Monitoring FreeBSD


:x

:x

1. The FreeBSD Agent

Check_MK comes with a dedicated agent for FreeBSD: check_mk_agent.freebsd. Just as for the other Unices, the agent is implemented as a shell script. Currently there is no port available for the agent, but a manual installation is easy. You find the agent on your Nagios server in the same directory as the other agents:

  • /omd/sites/mysite/share/check_mk/agents for OMD users
  • /usr/share/check_mk/agents in manual installations with default paths

Before installing the agent you should install a few dependencies. If those are missing, the agent will not output all data. Install the following ports:

  • sysutils/muse
  • sysutils/ipmitool
  • devel/libstatgrab

Then we'll enable the internet daemon inetd in /etc/rc.conf:

/etc/rc.conf
inetd_enable=yes
inetd_flags=-wW

Now we install the agent in /usr/local/bin/check_mk_agent. In the following example we assume that you are using OMD and the site-user mysite has a password:

root@linux# cd /usr/local/bin
root@linux# scp mysite@nagios:share/check_mk/agents/check_mk_agent.freebsd .
root@linux# mv check_mk_agent.freebsd check_mk_agent

Create an entry for the agent port in /etc/services:

/etc/services
check_mk        6556/tcp   #check_mk agent

An entry in /etc/inetd.conf will make the agent available via TCP at port 6556:

/etc/inetd.conf
check_mk  stream  tcp nowait  root  /usr/local/bin/check_mk_agent check_mk_agent

And we set up minimum security in /etc/hosts.allow so that only the IP address of your monitoring server (let's assume 192.168.56.3) has access:

/etc/hosts.allow
# Allow nagios server to access us
check_mk_agent : 192.168.56.3 : allow
check_mk_agent : ALL : deny

At last, we restart inetd to read in the new config and bring it up:

root@linux# /etc/rc.d/inetd start

If access doesn't work right away you can test the tcp wrapper settings using tcpdchk. Alternatively you can of course also use key-based ssh or any other more secure means of transportation.

1.1. Testing the agent

If everything works then you should be able to fetch the agent data from your monitoring server via telnet:

root@linux# telnet bsdhost 6556
<<<check_mk>>>
Version: 1.1.13i1
AgentOS: freebsd
...