snmp Trap import to Nagios XI missing EXEC line
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: snmp Trap import to Nagios XI missing EXEC line
Steve, could I request you create a new thread for your issue in particular please? We do this only so that when your issue, as the original poster, is completed we can lock the topic, otherwise it gets messy seeing who's resolved and who is not. Also if both of you could go to Admin -> System Profile -> Download Profile and PM that to one of us, that would be great. Please do not post them on the forum as they do contain some sensitive information.
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.
Re: snmp Trap import to Nagios XI missing EXEC line
To MrSteve and all other posters involved with this post,
This is not a bug. The EXEC line is added to the snmptt.ini file, the processed_mibs are for use with products such as NSTI that will actually require processing.
Verify:
To try and verify your system setting follow this documentation:
How to Intergrate SNMP Traps With Nagios XI
http://assets.nagios.com/downloads/nagi ... ios_XI.pdf
This will give you script to run that will setup snmptt so it will work with Nagios XI.
Hopefully this answers any questions, but please come back to this post and let us know how everything went.
/Luke
This is not a bug. The EXEC line is added to the snmptt.ini file, the processed_mibs are for use with products such as NSTI that will actually require processing.
Verify:
To try and verify your system setting follow this documentation:
How to Intergrate SNMP Traps With Nagios XI
http://assets.nagios.com/downloads/nagi ... ios_XI.pdf
This will give you script to run that will setup snmptt so it will work with Nagios XI.
Hopefully this answers any questions, but please come back to this post and let us know how everything went.
/Luke
/Luke
Re: snmp Trap import to Nagios XI missing EXEC line
I ran that script already. I can use addmib to process the MIB file and the EXEC line is added, the issue is with processing the MIB from the webUI, no EXEC line is added anywhere, not even in smnptt.ini. From that document:
Installing MIBs
You may need to configure snmptt on the Nagios XI server to use the MIBs your remote devices are using. This may mean having to
load extra MIBs into the /usr/share/snmp/mibs/ directory on the Nagios XI server.
You will then also have to run the following command to import each new MIB into the /usr/share/snmp/mibs/ directory.
Remember to replace <PathToNewMIB> with the path to the MIB file you want to import.
addmib <PathToNewMIB>
On Nagios XI 2012R2.8+ this can be done through the XI interface by browsing to the Admin → Manage MIBs page via the top
navigation bar, browsing to the MIB to be added and checking the 'Process Trap' checkbox, then click Upload MIB.
Installing MIBs
You may need to configure snmptt on the Nagios XI server to use the MIBs your remote devices are using. This may mean having to
load extra MIBs into the /usr/share/snmp/mibs/ directory on the Nagios XI server.
You will then also have to run the following command to import each new MIB into the /usr/share/snmp/mibs/ directory.
Remember to replace <PathToNewMIB> with the path to the MIB file you want to import.
addmib <PathToNewMIB>
On Nagios XI 2012R2.8+ this can be done through the XI interface by browsing to the Admin → Manage MIBs page via the top
navigation bar, browsing to the MIB to be added and checking the 'Process Trap' checkbox, then click Upload MIB.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: snmp Trap import to Nagios XI missing EXEC line
We are aware that this page is not working as intended presently, and are looking into a patch for it.
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.
Re: snmp Trap import to Nagios XI missing EXEC line
I tested this and printed out the exec lines by processing a MIB that is included by default in Nagios XI called NAGIOS-NOTIFY-MIB.
Here is the output of the exec section:
so the processed mib is being sent here:
/usr/share/snmp/mibs/processed_mibs/NAGIOS-NOTIFY-MIB.txt
Then the MIB user interface writes to snmptt.ini at the very bottom:
I also see a section added to the snmptt.conf file. If you don't have net-snmp-perl installed this will not write the files correctly.
Also if you run addmibfrom the the command line you should see this:
This will verify that you installed the NagiosXI-SNMPTrap-setup.sh without any failures.
Here is the output of the exec section:
Code: Select all
//executed command
/usr/bin/snmpttconvertmib --in='/usr/share/snmp/mibs/NAGIOS-NOTIFY-MIB.txt' --out='/usr/share/snmp/mibs/processed_mibs/NAGIOS-NOTIFY-MIB.txt'
//PHP exec() output
Array
(
[0] =>
[1] =>
[2] => ***** Processing MIB file *****
[3] =>
[4] => snmptranslate version: NET-SNMP version: 5.5
[5] => severity: Normal
[6] =>
[7] => File to load is: /usr/share/snmp/mibs/NAGIOS-NOTIFY-MIB.txt
[8] => File to APPEND TO: /usr/share/snmp/mibs/processed_mibs/NAGIOS-NOTIFY-MIB.txt
[9] =>
[10] => MIBS environment var: /usr/share/snmp/mibs/NAGIOS-NOTIFY-MIB.txt
[11] => mib name: NAGIOS-NOTIFY-MIB
[12] =>
[13] =>
[14] => Processing MIB: NAGIOS-NOTIFY-MIB
[15] => #
[16] => skipping a TRAP-TYPE / NOTIFICATION-TYPE line - probably an import line.
[17] => #
[18] => Line: 575
[19] => NOTIFICATION-TYPE: nHostEvent
[20] => Variables: nHostname nHostStateID nHostStateType nHostAttempt nHostDurationSec nHostGroupName nHostLastCheck nHostLastChange nHostOutput
[21] => Enterprise: nagiosNotify
[22] => Looking up via snmptranslate: NAGIOS-NOTIFY-MIB::nHostEvent
[23] => OID: .1.3.6.1.4.1.20006.1.5
[24] => #
[25] => Line: 586
[26] => NOTIFICATION-TYPE: nHostNotify
[27] => Variables: nHostNotifyType nHostNotifyNum nHostAckAuthor nHostAckComment nHostname nHostStateID nHostAttempt nHostGroupName nHostLastCheck nHostLastChange nHostOutput
[28] => Enterprise: nagiosNotify
[29] => Looking up via snmptranslate: NAGIOS-NOTIFY-MIB::nHostNotify
[30] => OID: .1.3.6.1.4.1.20006.1.6
[31] => #
[32] => Line: 597
[33] => NOTIFICATION-TYPE: nSvcEvent
[34] => Variables: nHostname nHostStateID nSvcDesc nSvcStateID nSvcAttempt nSvcDurationSec nSvcGroupName nSvcLastCheck nSvcLastChange nSvcOutput
[35] => Enterprise: nagiosNotify
[36] => Looking up via snmptranslate: NAGIOS-NOTIFY-MIB::nSvcEvent
[37] => OID: .1.3.6.1.4.1.20006.1.7
[38] => #
[39] => Line: 607
[40] => NOTIFICATION-TYPE: nSvcNotify
[41] => Variables: nSvcNotifyType nSvcNotifyNum nSvcAckAuthor nSvcAckComment nHostname nHostStateID nSvcDesc nSvcStateID nSvcAttempt nSvcGroupName nSvcLastCheck nSvcLastChange nSvcOutput
[42] => Enterprise: nagiosNotify
[43] => Looking up via snmptranslate: NAGIOS-NOTIFY-MIB::nSvcNotify
[44] => OID: .1.3.6.1.4.1.20006.1.8
[45] =>
[46] =>
[47] => Done
[48] =>
[49] => Total translations: 4
[50] => Successful translations: 4
[51] => Failed translations: 0
)
//return code
0
(0 is a successful process code)
/usr/share/snmp/mibs/processed_mibs/NAGIOS-NOTIFY-MIB.txt
Then the MIB user interface writes to snmptt.ini at the very bottom:
Code: Select all
[TrapFiles]
# A list of snmptt.conf files (this is NOT the snmptrapd.conf file). The COMPLETE path
# and filename. Ex: '/etc/snmp/snmptt.conf'
snmptt_conf_files = <<END
/usr/share/snmp/mibs/processed_mibs/NAGIOS-NOTIFY-MIB.txt
/etc/snmp/snmptt.conf
ENDAlso if you run addmibfrom the the command line you should see this:
Code: Select all
[root@XIdevel tmp]# addmib
Usage: /usr/local/bin/addmib <mibfile>
Configure snmptt.conf for a given MIB file/Luke
Re: snmp Trap import to Nagios XI missing EXEC line
OK, I am using the Dell iDRAC mib as the one you used threw an error for me when I tried to upload/process via the webUI.
Below is the result of uploading the file via the WebUI and checking "Process Trap", notice there is no EXEC line. In this case nothing is written to snmptt.conf.
/usr/share/snmp/mibs/processed_mibs/iDRAC-MIB.txt
Here are the relevant contents of snmptt.ini
If I instead process it with the addmib command I get the following in snmptt.conf (notice that the EXEC line is included):
From my perspective the first process should function just like the second process. Please let me know if I can provide any additional information.
Below is the result of uploading the file via the WebUI and checking "Process Trap", notice there is no EXEC line. In this case nothing is written to snmptt.conf.
/usr/share/snmp/mibs/processed_mibs/iDRAC-MIB.txt
Code: Select all
#
#
#
#
MIB: IDRAC-MIB (file:/usr/share/snmp/mibs/iDRAC-MIB.txt) converted on Tue Oct 28 16:55:04 2014 using snmpttconvertmib v1.3
#
#
#
EVENT alertAmperageProbeNormal .1.3.6.1.4.1.674.10892.5.3.2.1.0.2179 "Status Events" INFORMATIONAL
FORMAT System: Amperage Normal: $2
SDESC
Current sensor reading is within range.
Variables:
1: alertMessageID
2: alertMessage
3: alertCurrentStatus
4: alertSystemServiceTag
5: alertSystemFQDN
6: alertFQDD
EDESC
#
#
#
EVENT alertAmperageProbeWarning .1.3.6.1.4.1.674.10892.5.3.2.1.0.2178 "Status Events" MINOR
FORMAT System: Amperage Warning: $2
SDESC
Current sensor has detected a warning value.
Variables:
1: alertMessageID
2: alertMessage
3: alertCurrentStatus
4: alertSystemServiceTag
5: alertSystemFQDN
6: alertFQDD
EDESC
#
#
#
EVENT alertAmperageProbeFailure .1.3.6.1.4.1.674.10892.5.3.2.1.0.2177 "Status Events" CRITICAL
FORMAT System: Amperage Failure: $2
SDESC
Current sensor has detected a failure value.
Variables:
1: alertMessageID
2: alertMessage
3: alertCurrentStatus
4: alertSystemServiceTag
5: alertSystemFQDN
6: alertFQDD
EDESC
#
#
#
Code: Select all
[TrapFiles]
# A list of snmptt.conf files (this is NOT the snmptrapd.conf file). The COMPLETE path
# and filename. Ex: '/etc/snmp/snmptt.conf'
snmptt_conf_files = <<END
/usr/share/snmp/mibs/processed_mibs/iDRAC-MIB.txt
/usr/share/snmp/mibs/processed_mibs/Steelhead-MIB.txt
/usr/share/snmp/mibs/processed_mibs/XUPS-MIB.txt
/etc/snmp/snmptt.conf
END
Code: Select all
MIB: IDRAC-MIB (file:./iDRAC-MIB.txt) converted on Tue Oct 28 17:11:16 2014 using snmpttconvertmib v1.3
#
#
#
EVENT alertAmperageProbeNormal .1.3.6.1.4.1.674.10892.5.3.2.1.0.2179 "Status Events" INFORMATIONAL
FORMAT System: Amperage Normal: $2
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "System: Amperage Normal: $2"
SDESC
Current sensor reading is within range.
Variables:
1: alertMessageID
2: alertMessage
3: alertCurrentStatus
4: alertSystemServiceTag
5: alertSystemFQDN
6: alertFQDD
EDESC
#
#
#
EVENT alertAmperageProbeWarning .1.3.6.1.4.1.674.10892.5.3.2.1.0.2178 "Status Events" MINOR
FORMAT System: Amperage Warning: $2
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "System: Amperage Warning: $2"
SDESC
Current sensor has detected a warning value.
Variables:
1: alertMessageID
2: alertMessage
3: alertCurrentStatus
4: alertSystemServiceTag
5: alertSystemFQDN
6: alertFQDD
EDESC
#
#
#
EVENT alertAmperageProbeFailure .1.3.6.1.4.1.674.10892.5.3.2.1.0.2177 "Status Events" CRITICAL
FORMAT System: Amperage Failure: $2
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "System: Amperage Failure: $2"
SDESC
Current sensor has detected a failure value.
Variables:
1: alertMessageID
2: alertMessage
3: alertCurrentStatus
4: alertSystemServiceTag
5: alertSystemFQDN
6: alertFQDD
EDESC
#
#
#
Re: snmp Trap import to Nagios XI missing EXEC line
Good afternoon kbarina,
I'm going to go through all the code on this and will be adding some checks to make sure the exec lines are being written correctly.
Can you verify that the attached MIB is the exact same as the one you're using? I'll test with it from here on out.
/Luke
I'm going to go through all the code on this and will be adding some checks to make sure the exec lines are being written correctly.
Can you verify that the attached MIB is the exact same as the one you're using? I'll test with it from here on out.
/Luke
You do not have the required permissions to view the files attached to this post.
/Luke
Re: snmp Trap import to Nagios XI missing EXEC line
Luke,
I have attached the exact file I am using. Thanks for looking into this.
Kyle
I have attached the exact file I am using. Thanks for looking into this.
Kyle
You do not have the required permissions to view the files attached to this post.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: snmp Trap import to Nagios XI missing EXEC line
Thanks! Luke is working on some finishing touches, and we should be able to provide an update, with any luck, soon enough!
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.
Re: snmp Trap import to Nagios XI missing EXEC line
This update to the mibs.php page has made it into testing. Awaiting word and will post any updates to it.
If you want to use 'proccess mibs' with this page you will have to use the addmib() function that comes from running our setup SNMPTT script that I posted above. snmpttconvertmib is used as a back up if addmib is not available and is designed to add files to a new folder of processed mibs for program such as NSTI.
If snmpttconvertmib is used to process a MIB file then there will NOT be EXEC lines.
If you want to use 'proccess mibs' with this page you will have to use the addmib() function that comes from running our setup SNMPTT script that I posted above. snmpttconvertmib is used as a back up if addmib is not available and is designed to add files to a new folder of processed mibs for program such as NSTI.
If snmpttconvertmib is used to process a MIB file then there will NOT be EXEC lines.
/Luke