Check_SNMP Interpreting Warnings and Criticals
Posted: Mon Mar 09, 2015 6:27 pm
Hey All,
So we fixed the issue from this post http://support.nagios.com/forum/viewtop ... =7&t=30535 and then when unknown timeouts occurred we fixed that by adding a -t to the command line and gave a 30 second timeout and Nagios saw the non responsive equipment as Critical (a forum suggestion). So what brought me back to this post is that for all of our buildings we utilize a gateway server for guest access so that when we have meetings, family, or visitors of any kind they can access the network temporarily. So I was running an SNMP check to make sure that the registration service (AAA) is enabled on the servers. The problem I hit is that the server responds to services as enabled or disabled (1 or 0). So when I run this code
Nagios returns and shows "SNMP OK - 1" which tells me that the service is on. So I added a -c 1 to the end of the code.
and then turned the service off and it appeared as "SNMP OK - 0" which tells me the service was off, but with the rules of Nagios programing applied (assuming I understand those correctly, I think I do but its iffy) Nagios saw the 0 status code and said OK because 0 typically means OK, 1 is usually a warning, and 2 is critical.
I re-read the forum post and I think I may be missing something basic, I am way over thinking everything. I added the "-r 1" regex to tell Nagios to look for a "1" and to output a warning if a 2 is found "-w 2" and to go critical if it finds a zero "-c 0" so the end result appeared this way.
but Nagios still comes back with "SNMP OK - 0". Can you point me in the direction of my misunderstanding/problem?
Thank you,
CountryLife08 (J)
So we fixed the issue from this post http://support.nagios.com/forum/viewtop ... =7&t=30535 and then when unknown timeouts occurred we fixed that by adding a -t to the command line and gave a 30 second timeout and Nagios saw the non responsive equipment as Critical (a forum suggestion). So what brought me back to this post is that for all of our buildings we utilize a gateway server for guest access so that when we have meetings, family, or visitors of any kind they can access the network temporarily. So I was running an SNMP check to make sure that the registration service (AAA) is enabled on the servers. The problem I hit is that the server responds to services as enabled or disabled (1 or 0). So when I run this code
Code: Select all
check_command check_snmp!-C MEMPHISpublic -o SERVER-MIB::aaaOn.0Code: Select all
check_command check_snmp!-C MEMPHISpublic -o SERVER-MIB::aaaOn.0 -c 1I re-read the forum post and I think I may be missing something basic, I am way over thinking everything. I added the "-r 1" regex to tell Nagios to look for a "1" and to output a warning if a 2 is found "-w 2" and to go critical if it finds a zero "-c 0" so the end result appeared this way.
Code: Select all
check_command check_snmp!-C MEMPHISpublic -o SERVER-MIB::aaaOn.0 -r 1 -w 2 -c 0Thank you,
CountryLife08 (J)