SNMP Trap

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
huaming
Posts: 26
Joined: Thu Jan 16, 2020 3:49 am

SNMP Trap

Post by huaming »

Hi Support.

I am using the latest version of NagiosXI. However, I found the SNMP trap not works out here. I followed the wizard to build a SNMP trap monitoring service. modified the snmptt per supporting manual tells. in the console. I only can see this trap is awaiting a trap. but i've already input "snmptrap -v 2c -c public 127.0.0.1 '' linkDown ifDescr s eth0 ifAdminStatus i 2 ifOperStatus i 2". I can't see this log shown on /var/log/snmptt.log. but i cannot see same in nagios.log. Attachment is my configuration. Anything i need to pay attention to.

Thanks
You do not have the required permissions to view the files attached to this post.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: SNMP Trap

Post by pbroste »

Hello @huaming

Thanks for reaching out and would like to take a look at your Nagios XI System Profile so we can see what is going on.

To send us your system profile.
  • Login to the Nagios XI GUI using a web browser.
  • Click the "Admin" > "System Profile" Menu
  • Click the "Download Profile" button
  • Save the profile.zip file send via Private Message
Or

Code: Select all

rm -rf /usr/local/nagiosxi/var/components/profile.zip
/usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT

Then send the resulting /usr/local/nagiosxi/var/components/profile.zip​ file via Private Message.

Thanks,
Perry
huaming
Posts: 26
Joined: Thu Jan 16, 2020 3:49 am

Re: SNMP Trap

Post by huaming »

Thanks, profile sent
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: SNMP Trap

Post by pbroste »

Hello @huaming

Thanks for sending over the System Profile, want to get more details on the snmp.

Please run this command as root and send me the resulting /tmp/SNMPFILES.tar.gz file:

Code: Select all

GZIP=-9 tar czvf /tmp/SNMPFILES.tar.gz /etc/snmp /usr/share/snmp/mibs
Also, make sure that you see the following:

Code: Select all

grep "alarm\|FIFO" /usr/local/bin/snmptraphandling.py
Results:
signal.alarm(15)
if os.path.exists('/usr/local/nagios/var/rw/nagios.cmd') and stat.S_ISFIFO(os.stat('/usr/local/nagios/var/rw/nagios.cmd').st_mode):
Thanks,
Perry
huaming
Posts: 26
Joined: Thu Jan 16, 2020 3:49 am

Re: SNMP Trap

Post by huaming »

Thanks, pm sent.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: SNMP Trap

Post by pbroste »

Hello @huaming

Thanks for sending over the info, we see "SNMP TRAP SENDER NOT CONFIGURED!" messages and want to find out if there are any "Unconfigured Objects" listed in the web console:
  • Admin => Unconfigured Objects
Want to find out if any of these are related as we see unlinked module errors:

(CISCO-NAC-TC-MIB) At line 41 /usr/share/snmp/mibs/CISCO-AUTH-FRAMEWORK-MIB.my
(CISCO-PRIVATE-VLAN-MIB) At line 30 /usr/share/snmp/mibs/CISCO-ERR-DISABLE-MIB.my
(CISCO-PRIVATE-VLAN-MIB) At line 39 /usr/share/snmp/mibs/CISCO-AUTH-FRAMEWORK-MIB.my
(CISCO-SMI) At line 22 /usr/share/snmp/mibs/CISCO-C2900-MIB.my
(CISCO-SMI) At line 27 /usr/share/snmp/mibs/CISCO-CLUSTER-MIB.my
(CISCO-SMI) At line 32 /usr/share/snmp/mibs/CISCO-ERR-DISABLE-MIB.my
(CISCO-SMI) At line 35 /usr/share/snmp/mibs/CISCO-CONFIG-COPY-MIB.my
(CISCO-SMI) At line 43 /usr/share/snmp/mibs/CISCO-AUTH-FRAMEWORK-MIB.my
(CISCO-SMI) At line 70 /usr/share/snmp/mibs/CISCO-CONFIG-MAN-MIB.my
(CISCO-ST-TC) At line 40 /usr/share/snmp/mibs/CISCO-CONFIG-COPY-MIB.my
(CISCO-TC) At line 28 /usr/share/snmp/mibs/CISCO-ERR-DISABLE-MIB.my
(CISCO-TC) At line 68 /usr/share/snmp/mibs/CISCO-CONFIG-MAN-MIB.my
Thanks,
Perry
huaming
Posts: 26
Joined: Thu Jan 16, 2020 3:49 am

Re: SNMP Trap

Post by huaming »

Thanks, I've checked, there is no Unconfigured Objects" listed.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: SNMP Trap

Post by pbroste »

Hello @huaming

Thanks for following up, in looking over the 'snmptt.conf' we see that most of the EXEC lines were updated with the '/usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" ....etc'.... Tossing out the gist of the process is this:
Trap Sender > snmptrapd on XI server (traphandle default /usr/sbin/snmptthandler) > SNMPTT match in snmptt.conf or snmptt.conf.nxti (included in snmptt.ini), EXEC line throws it into Nagios Core (EXEC /usr/local/bin/snmptraphandling.py) > Nagios Core looks for host/service, if can't find it puts in Admin > Unconfigured Objects
Do you see any details in the 'snmpttunknown.log' and 'snmpttsystem.log?:
/var/log/snmptt/snmpttsystem.log
This records what happens when the service starts. Information like version, config files used, UID.
/var/log/snmptt/snmptt.log
Traps that have been received AND detected as a trap to perform an action with.
/var/log/snmptt/snmpttunknown.log
Traps that have been received AND ignored.
Want to edit this file to enable debugging mode:
/etc/snmp/snmptt.ini
Define the following settings:

DEBUGGING = 2
DEBUGGING_FILE = /var/log/snmptt/snmptt.debug
Save the file and restart the snmptt service.

Now you can observe snmptt behaviour by watching the debug log:

tail -f /var/log/snmptt/snmptt.debug
Execute a simple test 'snmptrap' via command and let's find out what things look like and let us know.

Thanks,
Perry
Locked