Check_SNMP not alerting when Down


I am attempting to write my own command to check memcached using SNMP. I can use SNMPWALK to view my process. I created a Service for it and set MY OID. Everything looks fine in Nagios. The problem is that it is always reporting up even when the Service is down. Nagios is always staying green.

I am not very familiar with snmpwalk so not sure what I am doing wrong.

Here is my Service in Nagios.

define service {
use my-service
hostgroup_name my-service-group
service_description memcached process
servicegroups memcached
check_command check_snmp!.!password!1!1!
notifications_enabled 1

Here is my snmpwalk on the machine.
[root@me]# snmpwalk -v 2c -c password host .
UCD-SNMP-MIB::prNames.2 = STRING: memcached

Am I missing something in my SNMPWALK?

When I back up on my snmpwalk I can see the memcached process stopped in the pr.errmessage,

UCD-SNMP-MIB::prNames.2 = STRING: memcached
UCD-SNMP-MIB::prErrMessage.2 = STRING: No memcached process running.

What am I missing in Nagios to Alert me when the Process goes down?



did you redefine check_snmp?
if yes how?

start by running check_snmp from command line, and get it to return what you need.


My SNMP is defined as follows.


I did the SNMP walk based on my check_snmp

snmpwalk -v 2c -c password host .
UCD-SNMP-MIB::prCount.2 = INTEGER: 1

If I shutdown memcached the value changes to 0
snmpwalk -v 2c -c password host .
UCD-SNMP-MIB::prCount.2 = INTEGER: 0

I can look at Nagios and see that is is down. However Nagios stays green and I never get alerted


what is the line defining check_snmpo in command.cfg

can you run check_snmp from command line and have ti return what you want?


I have it in my checkcomands.cfg

check_snmp’ command definition
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -C $ARG2$ -c $ARG3$ -w $ARG4$

Running it from command line I get this.

This is with memcached turned off

[root@mon01 libexec]# ./check_snmp -H host -o . -C password
SNMP OK - 0 | iso.

This is with memcached turned on
[root@mon01 libexec]# ./check_snmp -H host -o . -C password
SNMP OK - 1 | iso.

SNMP still says OK even though the Service is down

Once thing I am not sure if this
check_command check_snmp!.!password!1!1!

I am not sure if I have the arguments after the password correct.


add the -c and -w arguments from command line or it will never know when to say there is a critical situation.


I tried using the check_snmp with the -w and -c as 0 or 1. If I used a 1 as my Critical and Warning Argument I always would get it saying OK.

Here is it down
[root@mon01 libexec]# ./check_snmp -H host -o . -C password -w 1 -c 1
SNMP OK - 0 | iso.

Here it is UP
[root@mon01 libexec]# ./check_snmp -H 1host -o . -C password -w 1 -c 1
SNMP OK - 1 | iso.

if I used a 0 as my argument it would work but work backwards. It alerts me when the Value is 1 when value 1 indicates that the Service is UP.

Here the service is Down
[root@mon01 libexec]# ./check_snmp -H host -o . -C password -c 0
SNMP OK - 0 | iso.

here it is Up.
[root@mon01 libexec]# ./check_snmp -H host -o . -C password -c 0
SNMP CRITICAL - 1 | iso.

I think my SNMP uses the 1 as saying it is up but when I try check_snmp it thinks 1 is down. Is there a way to reverse this?