SNMP 'regex' question
Posted: Mon Mar 25, 2013 5:01 pm
Hi,
I am trying to use Nagios to monitor our port up/down status on a switch. I have Nagios correctly working with SNMP, however I am getting odd results when I am trying to test UP/DOWN functionality.
I am checking port 1 (up) and port 8 (down). It should throw a value of 1 if the port is up, and a value of 6 if it is down. I would like it to say that it is down if it throws 6, but it looks like -r does nothing. Here is an example:
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.8 -r 1
SNMP OK - 6 | IF-MIB::ifOperStatus.8=6
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.1 -r 1
SNMP OK - 1 | IF-MIB::ifOperStatus.1=1
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.8 -r 6
SNMP OK - 6 | IF-MIB::ifOperStatus.8=6
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.1 -r 6
SNMP OK - 1 | IF-MIB::ifOperStatus.1=1
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.1 -r dsadsadasdsa
SNMP OK - 1 | IF-MIB::ifOperStatus.1=1
I threw in the last one to show that it doesn't seem to be taking my REGEX values at all. On the Nagios GUI it shows the following:
Port 1 Link Status
OK 03-25-2013 17:52:48 0d 0h 43m 6s 1/3 SNMP OK - 1
Port 8 Link Status
OK 03-25-2013 17:46:45 0d 0h 39m 9s 1/3 SNMP OK - 6
However, I would like it to show DOWN for the value of 6.
I tried a few different things but I am stumped. Am I misunderstanding how -r is supposed to work?
Thank you for taking the time to read this.
I am trying to use Nagios to monitor our port up/down status on a switch. I have Nagios correctly working with SNMP, however I am getting odd results when I am trying to test UP/DOWN functionality.
I am checking port 1 (up) and port 8 (down). It should throw a value of 1 if the port is up, and a value of 6 if it is down. I would like it to say that it is down if it throws 6, but it looks like -r does nothing. Here is an example:
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.8 -r 1
SNMP OK - 6 | IF-MIB::ifOperStatus.8=6
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.1 -r 1
SNMP OK - 1 | IF-MIB::ifOperStatus.1=1
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.8 -r 6
SNMP OK - 6 | IF-MIB::ifOperStatus.8=6
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.1 -r 6
SNMP OK - 1 | IF-MIB::ifOperStatus.1=1
[root@vmnagios libexec]# ./check_snmp -H x.x.x.x -P 2c -C pass -o ifOperStatus.1 -r dsadsadasdsa
SNMP OK - 1 | IF-MIB::ifOperStatus.1=1
I threw in the last one to show that it doesn't seem to be taking my REGEX values at all. On the Nagios GUI it shows the following:
Port 1 Link Status
OK 03-25-2013 17:52:48 0d 0h 43m 6s 1/3 SNMP OK - 1
Port 8 Link Status
OK 03-25-2013 17:46:45 0d 0h 39m 9s 1/3 SNMP OK - 6
However, I would like it to show DOWN for the value of 6.
I tried a few different things but I am stumped. Am I misunderstanding how -r is supposed to work?
Thank you for taking the time to read this.