Getting working under osx

I often work and tweak things to get them going on OSX (not server) and then forget how I did it. Then I’ll end up wiping the machine and have to everything over and spending a ton of time on it. I should have documented getting nagios going properly and ndoutils and nagvis, but i didn’t.

But here is what I did to get the plugin working on OSX. At least part of it any way I crashed and lost some of the notes. check_ndo does exactly what its it checks to make sure that ndoutils is writing to the mysql database as expected and if not alerts you.

One weird thing that it took me lots of poking around with was why the plugin wouldn’t work from the command line. The first problem was that it was using the default perl install and not the perl install from Macports. Also it was looking in the default for linux location for the file not the default for OSX nagios via macports.

Here is how I did it.
First edit the file. $sudo vi /opt/local/libexec/nagios/
change the use lib line to:
use lib “/opt/local/libexec/nagios”;

Next to make things easier i create a command in the commands.cfg
$sudo vi /opt/local/etc/nagios/objects/commands.cfg
I add the following:
# check_ndo
define command{
command_name check_ndo
command_line /opt/local/bin/perl /opt/local/libexec/nagios/ -H $HOSTNAME$ -P 3306 -d $ARG1$ -u $ARG2$ -p $ARG3$ -i $ARG4$ -t 300

Next I added it to my localhost config, but it can be added anywhere:
$sudo vi /opt/local/etc/nagios/objects/localhost.cfg
# Service to check that ndoutils is working
define service{
use generic-service
host_name localhost
service_description NDOUTILS
check_command check_ndo!dbname!dbuser!dbpassword!default!300

Hopefully this will help me remember this in the future and anyone else who tries it.

%d bloggers like this: