Page 1 of 1

Debugging Plugins

Posted: Thu Jun 03, 2010 10:21 am
by aaldrich
I just installed NagaiosXI and am attempting to migrate some plugins
from the Nagios Core server with some difficulty

Perhaps someone can help get me started

I have a plugin called check_disk_space which does an ssh into my linux, freebsd and solaris
hosts and does a df and warns of filesystems over 90% and critcal for over 95%

I have copied this plugin over to /usr/local/nagios/libexec on the NagiosXI system and added it as a service
with this check command, the same as on the old server
$USER1$/check_disk_space -w90 -c95 -H $HOSTADDRESS$

when I log into the server as nagios and run this command manually, I get the proper
output, but the service for the host is calling it a critical failure and displaying
output as (null)

How can I debug what is failing as far as NagiosXI is concerned

Not sure what other information you would need to help me find a way to debug this

Re: Debugging Plugins

Posted: Thu Jun 03, 2010 11:01 am
by mmestnik
NagiosXI uses Nagios Core to run all the check commands, so the debugging steps are identical to running Core. Typically there is something in your environment that does not mimic the conditions precisely.

I assume this worked on your other Nagios install? Ignoring this my first assumption would imply that running the command, particularly the ssh portions, through a pty is making it work. While running the same command w/o a pty would cause the output Nagios is seeing.

Internally we just developed a ssh-expect based plugin, I'll attach the code. You might alter this plugin to suit your needs and drop your existing plugin... As there is a chance you gave up on it long ago and are actually using something else on the other Nagios install. That is just one theory.