Page 1 of 1

how to create a command that submits a passive service check

Posted: Tue Nov 27, 2012 2:11 pm
by david_sloboda
Nagios XI 2011 r3.3

I am looking for information on how to set up an existing test to return its result as a passive check.

I have this URL
http://nagios.sourceforge.net/docs/3_0/ ... hecks.html

I have a test check_naf.py to measure disk usage and inode usage for Network Appliance (NetApp) filer exported volumes.

Frequently enough that test takes longer than 60 seconds to complete.
The service_check_timeout directive of 60 seconds then kills the test and raises a Critical event.

In the short term I would like to convert that test into a passive check.

I believe what I need to do is write a script that puts
[<timestamp>] PROCESS_SERVICE_CHECK_RESULT;<host_name>;<svc_description>;<return_code>;<plugin_output>
to the Nagios external command file.
Then, call that script via cron every INTERVAL.
INTERVAL would be something more than 60 seconds. Maybe 300 seconds.

The NetApps which time out are overloaded with traffic intermittently.
My long term goal is to have that test complete in less than 60 seconds by
tuning the NetApps. The NetApp tuning is managed by a separate team at my employer.

Any advice, suggestions or pointers would be appreciated.
Thank you,
David Sloboda

Re: how to create a command that submits a passive service c

Posted: Tue Nov 27, 2012 2:47 pm
by scottwilkerson
You can do this via NRDP, NRDS, or NSCA

NRDP
http://exchange.nagios.org/directory/Ad ... nt/details
Get the token from Admin -> Inbound Transfer

NRDS
http://library.nagios.com/library/produ ... s-tutorial

Re: how to create a command that submits a passive service c

Posted: Fri Nov 30, 2012 2:43 pm
by david_sloboda
Thanks for the references.

Between the references you provided and the online docs, I have a fix in place.
The NRDP example looks like the best to me.
I may implement that if/when I have to move these checks to a second host.
However, at present I am running from the Nagios server all of the below :
(1) the services are configured to have active checks disabled and passive checks enabled.
(2) From cron, I have a script that runs every INTERVAL (varies per NetApp volume; not all have to be tested at the same frequency.)
(3) the script runs the check_naf.py command and writes to the external command file
(4) the external command file updates Nagios.

So far, works great.

The only thing I still have to clean up is what Nagios XI displays as the "Status Information"
Step (3) writes all status information to the external command file as one line using plugin_output.
I need to re-read
http://nagios.sourceforge.net/docs/3_0/ ... hecks.html
http://nagios.sourceforge.net/docs/3_0/pluginapi.html
then tune the plugin output to make use of
$SERVICEOUTPUT$
$SERVICEPERFDATA$
$LONGSERVICEOUTPUT$

David Sloboda