I went ahead and created a test scenario. I set up SNMP Traps on a fresh install of XI using the following documentation:
https://assets.nagios.com/downloads/nag ... ios_XI.pdf
Then I added an additional MIB in /usr/share/snmp/mibs/UCD-TRAP-TEST-MIB.txt:
Code: Select all
demoTrap2 TRAP-TYPE
ENTERPRISE demotraps
VARIABLES { sysLocation }
DESCRIPTION "Another example"
::= 18
I re-added my mib, and then opened /etc/snmp/snmptt.conf:
Code: Select all
EVENT demoTrap .1.3.6.1.4.1.2021.13.990.0.17 "Status Events" Normal
EVENT demoTrap2 .1.3.6.1.4.1.2021.13.990.0.18 "Status Events" Warning
I restarted snmptt service. Then, from within Nagios, I used the SNMP Trap Wizard to create a service on my localhost host. I ensured that this service had stalking enabled on the OK state. The series of commands I use throughout my testing are as follows:
Code: Select all
snmptrap -v 1 -c public 127.0.0.1 UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" SNMPv2-MIB::sysLocation.0 s "OK Status #1"
snmptrap -v 1 -c public 127.0.0.1 UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" SNMPv2-MIB::sysLocation.0 s "OK Status #2"
snmptrap -v 1 -c public 127.0.0.1 UCD-TRAP-TEST-MIB::demotraps "" 6 18 "" SNMPv2-MIB::sysLocation.0 s "Warning Status #1"
snmptrap -v 1 -c public 127.0.0.1 UCD-TRAP-TEST-MIB::demotraps "" 6 18 "" SNMPv2-MIB::sysLocation.0 s "Warning Status #2"
In the Event Log Report, here is an attached screenshot of the relevant output:
stalking_ok.PNG
Then, I enabled stalking on Warning (and kept the OK state stalking enabled as well), and re-issued the same commands. Here is the attached screenshot of the relevant output:
stalking_ok_and_warning.PNG
Finally, I disabled all state stalking for this service, and re-issued the same commands. Here is the attached screenshot of the relevant output:
no_stalking.PNG
The behavior is as described in the documentation that you linked:
https://assets.nagios.com/downloads/nag ... lking.html
With state stalking enabled, Nagios would have examined the output from each service check to see if it differed from the output of the previous check. If the output differed and the state of the service didn't change between the two checks, the result of the newer service check would get logged.
As you can see from the attached screenshots, when stalking was enabled for ok, multiple states [where the output differed]
WERE logged, unlike when stalking was not enabled.
If volatility is enabled, and stalking is disabled, the State History report should show multiple non-OK states in a row, whether the output is different or not. If you need to see multiple occuring OK states with differing output, please use the Event Log report.
Hope this helps clear it up.