Just waiting on a reinstall of my test system to fully verify, but I believe those are referenced as values within the traps, not different OIDS. I believe the OIDs are for differing types of events such as host results, service results, and notifications or events. I will post back once my system is finished.
Edit: Yep, states are reported as variables within the trap, not specifically one oid per state.
MIB: NAGIOS-NOTIFY-MIB (file:./NAGIOS-NOTIFY-MIB) converted on Tue Jun 24 11:14:45 2014 using snmpttconvertmib v1.3
#
#
#
EVENT nHostEvent .1.3.6.1.4.1.20006.1.5 "Status Events" Normal
FORMAT The SNMP trap that is generated as a result of an event with the host $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event with the host $*"
SDESC
The SNMP trap that is generated as a result of an event with the host
in Nagios.
Variables:
1: nHostname
2: nHostStateID
3: nHostStateType
4: nHostAttempt
5: nHostDurationSec
6: nHostGroupName
7: nHostLastCheck
8: nHostLastChange
9: nHostOutput
EDESC
#
#
#
EVENT nHostNotify .1.3.6.1.4.1.20006.1.6 "Status Events" Normal
FORMAT The SNMP trap that is generated as a result of an event requiring $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event requiring $*"
SDESC
The SNMP trap that is generated as a result of an event requiring
notification for a host in Nagios.
Variables:
1: nHostNotifyType
2: nHostNotifyNum
3: nHostAckAuthor
4: nHostAckComment
5: nHostname
6: nHostStateID
7: nHostStateType
8: nHostAttempt
9: nHostDurationSec
10: nHostGroupName
11: nHostLastCheck
12: nHostLastChange
13: nHostOutput
EDESC
#
#
#
EVENT nSvcEvent .1.3.6.1.4.1.20006.1.7 "Status Events" Normal
FORMAT The SNMP trap that is generated as a result of an event with the service $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event with the service $*"
SDESC
The SNMP trap that is generated as a result of an event with the service
in Nagios.
Variables:
1: nHostname
2: nHostStateID
3: nSvcDesc
4: nSvcStateID
5: nSvcAttempt
6: nSvcDurationSec
7: nSvcGroupName
8: nSvcLastCheck
9: nSvcLastChange
10: nSvcOutput
EDESC
#
#
#
EVENT nSvcNotify .1.3.6.1.4.1.20006.1.8 "Status Events" Normal
FORMAT The SNMP trap that is generated as a result of an event requiring $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event requiring $*"
SDESC
The SNMP trap that is generated as a result of an event requiring
notification for a service in Nagios.
Variables:
1: nSvcNotifyType
2: nSvcNotifyNum
3: nSvcAckAuthor
4: nSvcAckComment
5: nHostname
6: nHostStateID
7: nSvcDesc
8: nSvcStateID
9: nSvcAttempt
10: nSvcDurationSec
11: nSvcGroupName
12: nSvcLastCheck
13: nSvcLastChange
14: nSvcOutput
EDESC
.1.3.6.1.4.1.20006.1.5 - Variable 3
.1.3.6.1.4.1.20006.1.6 - Variable 7
.1.3.6.1.4.1.20006.1.7 - Variable 8 if anything, might be N/A
.1.3.6.1.4.1.20006.1.8 - Variable 12 if anything, might be N/A
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
When you say tested, what exactly did you change and do to test, and how is it now being reported in XI? Showing just the status only gives me a very small idea of what might actually be going on.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
sreinhardt wrote:When you say tested, what exactly did you change and do to test, and how is it now being reported in XI? Showing just the status only gives me a very small idea of what might actually be going on.
For the previous screenshot picture, I didn't change anything on the snmptt.conf. All are default after running addmib.
After that, I have tried to change the status of the OID. I mean by default .1.3.6.1.4.1.20006.1.7 status is Normal, and i changed to Warning. Then I created Warning situation on Nagios-Main. I received Warning SNMP traps and the OID is .1.3.6.1.4.1.20006.1.7. So far, the status show as "Warning". But when Nagios-Main service state change warning to normal, the status still showing as "Warning" on My Nagios server. When Nagios-Main send Critical Service SNMP Trap, status show as "Warning" in my Naigos Server. That is the problem i can't solved.
I'm pretty sure I understand what you meant by that, more of an issue with picturing what you are expecting vs what should be happening more than anything else. Let's do this:
Look in /etc/snmp/snmptt.ini, at the very bottom of that file will be a list of .conf files including snmptt.conf. Either zip\tar them all up and attach as one, or attach each one individually to your next post.
Then if you can send me the oids that you are sending when you expect a warning and a critical trap to come in, I will take a look and see what might be wrong with those definitions and hopefully how we can correct them.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
The reason this trap came in as normal, despite being generated from a warning service check, is that the exec line and event lines specify it should be that way. I would suggest we change it to a dynamic state by using one of the variables that the oid provides for us to use.
Right now you have in snmptt.xi.conf:
51) EVENT nSvcEvent .1.3.6.1.4.1.20006.1.7 "Status Events" Normal
53) EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The service $*"
53 should probably be changed to:
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$9" "$@" "$-*" "The service $*"
This will allow us to pull the variable 9 which should be the last state change. Now I can't be sure if this will work properly since, I don't fully know if that returns something like critical\warning\OK, but we can verify that by turning on debugging or giving it a try.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
sreinhardt wrote:53 should probably be changed to:
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$9" "$@" "$-*" "The service $*"
This will allow us to pull the variable 9 which should be the last state change. Now I can't be sure if this will work properly since, I don't fully know if that returns something like critical\warning\OK, but we can verify that by turning on debugging or giving it a try.
Hi sreinhardt,
I have tested as you guide. But after change "$s" to "$9", the SNMP Trap Status is not update/change anymore. https://db.tt/PIcdRk2y
As you can see in the screen, current user status of Nagios-Main is critical. But in the status information of SNMP Trap didn't update to current state. Actually I received service critical in the log file.
When I change back "$9" to "$s", the status information of SNMP Traps show as what we received.
OK, that clearly was not the correct variable to use. Let's enable debugging, make the service that is sending traps go OK then critical, so that we can see both traps, then we can change which variable you want to use.
restart snmptt - service snmptt restart
Make the service on your remote nagios system send an OK and a critical trap for the service we have been working with(user count).
Disable debugging, just revert the lines above, and send me the two debugging log files please.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.