SNMP OID information of Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

SNMP OID information of Nagios XI

Post by phyo »

Dear all,

When Nagios XI send SNMP traps to another Nagios XI, there will be 4 SNMP traps.

I want to know which OID is OK, Warning, Critical or unknown.

Here are 4 SNMP OID after compiling NAGIOS-NOTIFY-MIB

Code: Select all

.1.3.6.1.4.1.20006.1.5
.1.3.6.1.4.1.20006.1.6
.1.3.6.1.4.1.20006.1.7
.1.3.6.1.4.1.20006.1.8
Thanks.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMP OID information of Nagios XI

Post by sreinhardt »

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.

Code: Select all

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

Code: Select all

.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.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: SNMP OID information of Nagios XI

Post by phyo »

I have tested with two nagios xi server. One is main and send snmp trap to another nagios xi server.

I attached 3 pictures of service state, OK, Warning and Critical.

https://db.tt/jfmD6Z4D
This one is fine.

https://db.tt/HYMloVRl
As you can see, even though service is warning state. But Status show "OK". I want to show as "Warning"

https://db.tt/z8XS5hiu
As you can see, even though service is critical, status showing "OK". I want to show as "Critical".

When service is warning, I want to see Status also "Warning".
When service is critical, I want to see Status also "Critical".

Can I change?

thanks.
Last edited by phyo on Thu Jul 10, 2014 10:21 pm, edited 1 time in total.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMP OID information of Nagios XI

Post by sreinhardt »

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.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: SNMP OID information of Nagios XI

Post by phyo »

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.

Hope you will understand my explanation.

Thanks.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMP OID information of Nagios XI

Post by sreinhardt »

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.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: SNMP OID information of Nagios XI

Post by phyo »

You can download from the below link. There will be snmptt.ini, snmptt.conf, snmptt.xi.conf and snmptt.log in the zip file.

Code: Select all

https://db.tt/47niX5dr
You can see the OID of Critical and Warning in the snmptt.log file.


Thanks.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMP OID information of Nagios XI

Post by sreinhardt »

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.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: SNMP OID information of Nagios XI

Post by phyo »

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.

Thanks.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMP OID information of Nagios XI

Post by sreinhardt »

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.

enable debugging - Modify snmptt.ini to this:

Code: Select all

DEBUGGING = 2
#DEBUGGING_FILE =
 DEBUGGING_FILE = /var/log/snmptt/snmptt.debug
#DEBUGGING_FILE_HANDLER =
 DEBUGGING_FILE_HANDLER = /var/log/snmptt/snmptthandler.debug
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.
Locked