I am trying to figure out how to configure nagios and I am having some problems with the check_snmp plugins. When I setup the service in the switch.cfg I have this code
define service{
use generic-service ; Inherit values from a template
host_name
service_description Uptime
check_command check_snmp!-C <community name> -o sysUpTime.0
}
Yet when the script executes on the web interface I get this error
Status Information: SNMP problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] xx.xx.xx.xx:161 sysUpTime.0$
So I looked at the commands.cfg and this is the config I have for check_snmp. Yes I know it is the template but I am now learning my way arounf nagios
‘check_snmp’ command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
When I run the command from my desktop where the code resides it works
ravir.desktop% ./check_snmp -t 1 -r 5 -m ALL -v 1 -C -H xx.xx.xx.xx -o sysUpTime.0
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c xx.xx.xx.xx:161 sysUpTime.0
RFC1213-MIB::sysUpTime.0 = Timeticks: (698815868) 80 days, 21:09:18.68
But when I replace the -o string to exactly what the web interface shows as an error…IE
ravir.desktop% ./check_snmp -t 1 -r 5 -m ALL -v 1 -C -H xx.xx.xx.xx -o sysUpTime.0$
/usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c xx.xx.xx.xx:161 sysUpTime.0$
SNMP problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] xx.xx.xx.xx:161 sysUpTime.0$
So my question is, how do I prevent the script from adding a $ to the end of sysUpTime.O when I do not specify the $ in the service definition. Any help would be greatly appreciated