snmpwalk as external command or customize "Status information"

Marc Powell marc at ena.com
Fri May 30 21:16:02 CEST 2008


On May 30, 2008, at 1:45 PM, Sergio Belkin wrote:

> Hi,
>
> I am using check_snmp plugin and is quite useful, but in some cases
> I'd like that  "Status Information" in "Status Detail For This Host"
> to print only the value, not something as "/usr/bin/snmpget -t 1 -r 5
> -m RAPID-CITY -v 2c -c 'my community' 10.1.0.4:161
> 1.3.6.1.4.1.2272.1.3.1.0"

Don't specify the verbose (-v) argument to check_snmp. If, after you  
do that, the output is still not clear enough, you might want to add a  
-l argument and -u argument. (check_snmp --help)

> Because of this I thought to use snmpwalk as external command, so I
> add an entry in commands.cfg as follows:
>
> define command{
>        command_name    snmpwalk
>        command_line    $USER5$/snmppwalk -v2c -c "mi community"
> $HOSTADDRESS$ -Oqv  $ARGS1$
>        }
>
> But is not working it outputs:
> "(Return code of 127 is out of bounds - plugin may be missing)"
>
> What's wrong with this? A suitable solution could be customize the

1) You can't use arbitrary system commands as nagios plugins. Nagios  
expects plugins to output results in a particular way and quit with  
specific exit codes corresponding to status. See the Developer  
Guidelines at http://nagiosplug.sf.net if you're interested in  
learning more.
2) Return code of 127 is a system level exit code. It means that the  
file/program doesn't exist. Regardless of whether snmppwalk would work  
as a nagios plugin, the program isn't where you've said it is (<value  
of $USER5$>/snmppwalk). You probably meant $USER5$/snmpwalk.

--
Marc


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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