SNMP

retrieve_custom_snmp

Description:

A script to retrieve exit codes and status messages for Nagios plugin scripts run through SNMP.

Current Version

Last Release Date

June 23, 2009

Compatible With


Project Files
Project Notes
One of the things we've been looking into recently, is running the standard Nagios plugins through SNMP instead of through NRPE. Putting aside the discussion of the various merits and flaws such a solution has, let's say that it works nicely. How do you do this? In your snmpd.conf add a line like: exec .1.3.6.1.4.1.6886.4.1.1 check_load /usr/local/nagios/libexec/check_load exec .1.3.6.1.4.1.6886.4.1.2 check_mem /usr/local/nagios/libexec/check_mem ?w 85 ?c 95 exec .1.3.6.1.4.1.6886.4.1.3 check_swap /usr/local/nagios/libexec/check_swap -w 15% -c 5% What this does, is tell the SNMP daemon to run the check_load script when someone asks for object .1.3.6.1.4.1.6886.4.1.1 (or .2, or .3). The exit code for the script will be place in OID.100.0 and the first line of output will be placed in OID.101.1. This script retrieves those two values through SNMP and returns them to Nagios. Your checkcommands.cfg should contain something like: define command{ command_name retrieve_custom_snmp command_line $USER1$/retrieve_custom_snmp -H $HOSTADDRESS$ -o $ARG1$ } The "-o" parameter takes the OID you have selected for your custom check. Now... How do you select an OID? There's two ways: 1. The WRONG way = randomly selecting some OID. You might pick an OID which is needed for other monitoring purposes in your network. 2. The RIGHT way = requesting a private Enterprise ID for your company at IANA (http://www.iana.org/cgi-bin/enterprise.pl). You are free to build an SNMP tree beneath this EID. For example, the EID 6886 mentioned above is registered to KPN (my current client). The sub-tree .4.1 contains all OIDs referring to Nagios checks performed by my department. UPDATE (2006-10-02): Thanks to the kind folks on the Nagios Users ML I've found out that my original version of the script was totally bug-ridden. I've made a big bunch of adjustments and now the script should work properly. Thanks especially to Andreas Ericsson.
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
0 (0)
Favorites
0
Views
149,802