I need to check a MIB which returns a number from 0-6. A returned value of either 1 or 3 should show OK. Any other return value should result in a down.
I can do this with a RegEx = "1|3" however when it fails it only returns with critical alarm, and I need it to be only a warning alarm.
I have tried many options and can get most values to return as warning, but there is always at least one value that returns as critical
Any help would be appreciated.
check_snmp w/multiple valid return values with warning alert
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_snmp w/multiple valid return values with warning a
The best solution in these cases would be to write a custom plugin that can parse the output and then deliver the results you are looking for.
Here are the Nagios Plugin Development Guidelines
https://nagios-plugins.org/doc/guidelines.html
Here are the Nagios Plugin Development Guidelines
https://nagios-plugins.org/doc/guidelines.html
Re: check_snmp w/multiple valid return values with warning a
Unfortunately I can't glean enough information from the link provided to create a custom plugin to match my needs.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_snmp w/multiple valid return values with warning a
here is a different solution.
Create a new command that adds the negate command before the check_snmp command. The command would run something like this:
what this will do is change the the state of CRITICAL to WARNING
Create a new command that adds the negate command before the check_snmp command. The command would run something like this:
Code: Select all
/usr/local/nagios/libexec/negate -s -c WARNING /usr/local/nagios/libexec/check_snmp -H 192.168.5.15 -C public -o HOST-RESOURCES-MIB::hrSWRunPerfMem.2204 -r "1|3"Re: check_snmp w/multiple valid return values with warning a
Thank you. That does exactly what I need. 
Re: check_snmp w/multiple valid return values with warning a
Glad to hear!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.