[Nagiosplug-help] running check_snmp from CLI works but nagios web shows return code of 127 out of bounds

Gothard, Morgan Morgan.Gothard at SUG.com
Tue Mar 15 18:26:15 CET 2011


Generally, if you are receiving the "out of bounds" message the path to your plugin is bad, in this case $USER1$/check_snmp.  Try using the absolute path of /usr/local/nagios/libexec/check_snmp and run again.  If it works, you haven't defined USER1 properly in your resource.cfg file.


-----Original Message-----
From: Shekhar Basnet [mailto:shekhar at mercantile.com.np] 
Sent: Monday, March 14, 2011 6:01 AM
To: nagiosplug-help at lists.sourceforge.net
Subject: [Nagiosplug-help] running check_snmp from CLI works but nagios web shows return code of 127 out of bounds

Hi all,

I am trying to monitor Cisco router 5 minutes CPU usage via check_snmp plugin.

I have this in commands.cfg

# 'check_snmp_cpu' command definition
define command{
        command_name    check_snmp_cpu
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -o 1.3.6.1.4.1.9.2.1.58.0 -w 80 -c 90 -l CPU -u% -d iso.3.6.1.4.1.9.2.1.58.0 -C $ARG1$

running as user nagios

%id
uid=181(nagios) gid=181(nagios) groups=181(nagios)
%
%/usr/local/nagios/libexec/check_snmp -H my-router -o 1.3.6.1.4.1.9.2.1.58.0 -w 80 -c 90 -l CPU -u% -d iso.3.6.1.4.1.9.2.1.58.0 -C community
CPU OK - 30 % | =30 
%
%

running without the other flags

%/usr/local/nagios/libexec/check_snmp -H my-router -o 1.3.6.1.4.1.9.2.1.58.0 -w 80 -c 90 -C community
SNMP OK - 30 | iso.3.6.1.4.1.9.2.1.58.0=30 
%

running with the -v flag

%/usr/local/nagios/libexec/check_snmp -H my-router -o 1.3.6.1.4.1.9.2.1.58.0 -w 80 -c 90 -C community -v
/usr/local/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] my-router:161 1.3.6.1.4.1.9.2.1.58.0
iso.3.6.1.4.1.9.2.1.58.0 = INTEGER: 30
SNMP OK - 30 | iso.3.6.1.4.1.9.2.1.58.0=30 
%


But in the nagios web site the status is always CRITICAL and the STATUS INFORMATION is always (Return code of 127 is out of bounds - plugin may be missing). What does this mean? In the hosts.cfg file i have this:-

define service{
        use                     generic-service
        host_name               my-router
        service_description     CPU 5min
        check_period            24x7
        max_check_attempts      4
        normal_check_interval   5
        retry_check_interval    1
        contact_groups          nagadmin
        servicegroups           CPU-USAGE
        notification_interval   60
        check_command           check_snmp_cpu!community

i can't figure out what is wrong. Net-SNMP is installed. I am using FreeBSD. can somebody pls help?

%uname -imprsv
FreeBSD 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007     root at dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386 i386 GENERIC
%

NAGIOS version 3.2.1

Tia

Sb




Private and confidential as detailed here: http://www.sug.com/disclaimers/default.htm#Mail . If you cannot access the link, please e-mail sender.




More information about the Help mailing list