More Nagios Plugins on OSX

More about my nagios tweaking on OSX.

Adding check_dig (checks the DNS Server)
First there is no command defintion for this already setup. You’ll need to edit: /opt/local/etc/nagios/objects/commands.cfg
and add the following:
# ‘check_dig’ command definition
define command{
command_name check_dig
command_line $USER1$/check_dig $ARG1$

in your router,localhost, or where ever this services is add:
define service{
use generic-service
host_name linksys-wrt54g
service_description DNS
check_command check_dig!-H $HOSTADDRESS$ -l -A “+tcp”

Next up is check_dhcp
Nothing much here expect on my OSX it doesn’t get a mac so you’ll have to include that in your command: for example mine looks like:
check_dhcp!–mac=00:14:51:62:57:b3 -s $HOSTADDRESS$
(note I made that mac up, not sure exactly if thats a good idea or bad idea)

Next up is check_disk
while check_local_disk is already setup to monitor your disk, I wanted to added my 2 Firewire drives, myservices definition looks like this for the first one.

define service{
use local-service
host_name localhost
service_description FireWire1
check_command check_local_disk!10%!5%!/Volumes/Firewire1

Next up check_ftp
Nothing special here, works out of the box.

Next up check_http
Works out of the box

next up check_ifoperstatus and check_ifstatus
works out of the box

next up check_ide_smart
Was not compiled and installed from Macports on my system.
After doing some research the files need to compile this are linux only and after some searching there is no osx version of it.

next up check_mysql
This was not compiled and installed from Macports on my system for some reason, I think i didn’t have mysql installed at the time. Not sure if it would have worked then. Any way what I ended up having todo was downloading the source file of nagios-plugins. And running the configure like so:
./configure –with-mysql=/opt/local/lib/mysql5

then I was able to copy the check_mysql and check_mysql_query to /opt/local/libexec/nagios

And they worked fine.

Works out of the box, here is an example of the file locations on my mac:
./check_nagios -e 5 -F /opt/local/var/nagios/status.dat -C /opt/local/bin/nagios

Thats about it for all the stuff that I have and the standard plugins.

%d bloggers like this: