pnp4nagios, check_snmp, and the `-m' flag
Thomas Guyot-Sionnest
dermoth at aei.ca
Tue Nov 17 00:15:37 CET 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 16/11/09 03:17 PM, David Krider wrote:
> I have a system all setup and running with Nagios and PNP4Nagios. Some
> of the SNMP checks are not making graphs for me. My general habit has
> been to "anchor" the SNMP check with the `-m' flag on the check_snmp
> command.
>
> My command:
>
> define command {
> command_name check_snmp
> command_line $USER1$/check_snmp -H $HOSTADDRESS$ -m $ARG1$ -o $ARG2$
> }
>
> My service:
>
> define service {
> hostgroup_name power_meters
> service_description Demand KiloWatts
> use snmp-service
> check_command check_snmp!
> EATON-PWR-MTR-MIB!.1.3.6.1.4.1.534.8.3.1.5.1.1.4.1
> servicegroups power_meter_checks
> }
>
> My result:
>
> temporary configs # /usr/lib/nagios/plugins/check_snmp -H 10.1.25.11 -m
> EATON-PWR-MTR-MIB -o .1.3.6.1.4.1.534.8.3.1.5.1.1.4.1
> SNMP OK - 19 kilo-watts |
>
> Notice that there's no perfdata. If I leave out the `-m', I get it:
>
> temporary configs # /usr/lib/nagios/plugins/check_snmp -H 10.1.25.11
> -o .1.3.6.1.4.1.534.8.3.1.5.1.1.4.1
> SNMP OK - 19 | iso.3.6.1.4.1.534.8.3.1.5.1.1.4.1=19
>
> It would be nice to keep the units on these calls, just for the sake of
> it, but this is what's keeping the performance data from being reported
> in these instances. Just thought I'd post this to the list for future
> reference. If past experience is any indication of future trending, I'll
> find this through Google in about 3 years when I can't figure out why I
> can't get performance data in Nagios again. ;-)
The problem is that check_snmp parses the output from snmpget and it
appears that when you load the MIB it detects the result as a string (if
you post the full debug output (-vvv switch) I will be able to confirm).
The best fix would be to use the SNMP C library instead or running
snmpget (which would be more reliable too). This is a major rewrite and
we don't have time for that right now.
- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFLAd0Z6dZ+Kt5BchYRAr7SAJ40KLEe3jp6GG8S/Vfkc3w15s0oEACfaFBi
GVmi/p+ge4iZcg8+CHbDXj8=
=531R
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list