[Nagiosplug-help] creating a plugin script

Robert Cole robert.cole at support4linux.com
Mon Jan 21 22:56:39 CET 2008


I'm trying to create my own set of scripts that monitor activity on a 
SQL server and here is what I have so far.

#!/bin/bash

result=$(mysql -u nagios -h pacman --password="xxxx" < test.sql | tail -n1)

if [ $result -eq 0 ]; then
                exit 2
        else
                exit 0
fi

I've run some tests and found that the proper value is being returned 
and with this and most of the scripts I'm creating a zero result would 
result in a critical alert a non-zero would be ok. There is no warning 
level for these things so I'm working with just exit codes 0 and 2 and 
it doesn't seem like the exit codes are getting returned or something 
because I get this on the nagios console:

NRPE: Unable to read output

I'm using nrpe and telling the nagios system to just launch the script 
with no params like this:

check_command                   check_nrpe_noargs!check_calls

Any ideas on how to correct this and what's happening?

Thanks,
Robert




More information about the Help mailing list