check_ifstatus problems, fine on commandline


#1

Hi I was hoping someone could give me a hand.

I am currently setting up a new monitoring systems for my works network and am getting some strange problems with some of the service checks.

Using the check_ifstatus command the nagios we interface returns an error of:
"CRITICAL: No response from remote host ‘A.B.C.D’ for 1.3.6.1.2.1.2.2.1.8 with snmp version 2 "

Running the same command from the command line returns the expected results though:
“OK: host ‘HOSTNAME’, interfaces up: #, down: 0, dormant: 0, excluded: 0, unused: 0 |up=#,down=0,dormant=0,excluded=0,unused=0”

command being used is:
"/usr/lib/nagios/plugins/check_ifstatus -H HOSTNAME -C COMMUNITY -v2"

Any help would be greatly appreciated,
cheers in advance,
Andrew
Edited ]


#2

are you running the command from command Line as user nagios or root?

Luca


#3

luca is correct. The permissions on your files are not correct.
Plus, you shouldn’t use check_ifstatus since it takes longer that the check_snmp directly.
check_command check_snmp!public!.1.3.6.1.2.1.2.2.1.8.4!1!ifOperStatus!RFC1213-MIB

define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o $ARG2$ -r $ARG3$ -l $ARG4$ -m $ARG5$
}