check_snmp

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Maxwellb99
Posts: 97
Joined: Tue Jan 26, 2016 5:29 pm

check_snmp

Post by Maxwellb99 »

Hello,

With respect to the "check_snmp" plugin -- from the help page "the -t (timeout flag) does the optional ":<timeout state>" can be a state integer (0,1,2,3) or a state string" does this mean that we can set the return state (ok, warning, critical, unknown) in the case of a timeout?

Second, can you confirm that the check snmp plugin doesn't return anything from the gui when given the -t flag? I checked it from the command line & when i remove the -t flag it returns the expected result.
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: check_snmp

Post by jbrunkow »

-t, --timeout=INTEGER:<timeout state>
Seconds before connection times out (default: 10)
Optional ":<timeout state>" can be a state integer (0,1,2,3) or a state STRING
Nagios plugin docs
Yes, I believe the second argument for the -t flag determines what state will be returned, should the plugin timeout.

I should also mention that these values are read several times, and the final state is actually determined by a series of checks.
NOTE the final timeout value is calculated using this formula: timeout_interval * retries + 5
check_snmp man pages
Please see the documentation on state types if you are not familiar with this logic.
Nagios state types

I can confirm that the -t flag works when I change it in the GUI. I get the following output.

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H <IP address>  -o 'sysUpTime.0' -C '<community string>' -P 2c -t 1
SNMP OK - Timeticks: (2886921348) 334 days, 3:13:33.48 | DISMAN-EVENT-MIB::sysUpTimeInstance=2886921348
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked