snmptrap v2 to v3

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

snmptrap v2 to v3

Post by elinagios »

Hello

im having issues sending snmptraps in v3.
I have a misc command (used as event handler). Current snmp v2 working one:
/usr/bin/snmptrap -v 2c -c communityname IP:167 '' 1.3.6.1.4.1.48522.7717 1.3.6.1.4.1.48522.7717.119.0 s "$NOTIFICATIONTYPE$" 1.3.6.1.4.1.48522.7717.50.0 s "$SERVICEDESC$" 1.3.6.1.4.1.48522.7717.1.0 s "$HOSTNAME$" 1.3.6.1.4.1.48522.7717.4.0 s "$HOSTADDRESS$" 1.3.6.1.4.1.48522.7717.52.0 s "$SERVICESTATE$" 1.3.6.1.4.1.48522.7717.130.0 s "$LONGDATETIME$" 1.3.6.1.4.1.48522.7717.78.0 s "$SERVICEOUTPUT$" 1.3.6.1.4.1.48522.7717.125.0 s "$NOTIFICATIONCOMMENT$"

Now i was asked to move it to v3 but it doesnt seem to be working

/usr/bin/snmptrap -v3 -e 0x090807060504030201 -u username -a SHA -A password -x AES -X password -l authPriv IP:167 '' 1.3.6.1.4.1.48522.7717 1.3.6.1.4.1.48522.7717.119.0 s "$NOTIFICATIONTYPE$" 1.3.6.1.4.1.48522.7717.50.0 s "$SERVICEDESC$" 1.3.6.1.4.1.48522.7717.1.0 s "$HOSTNAME$" 1.3.6.1.4.1.48522.7717.4.0 s "$HOSTADDRESS$" 1.3.6.1.4.1.48522.7717.52.0 s "$SERVICESTATE$" 1.3.6.1.4.1.48522.7717.130.0 s "$LONGDATETIME$" 1.3.6.1.4.1.48522.7717.78.0 s "$SERVICEOUTPUT$" 1.3.6.1.4.1.48522.7717.125.0 s "$NOTIFICATIONCOMMENT$"

The receiving end sees something coming but its unreadable. What type of AES is used? Do i need to do some more configuration in nagios serverside? Do i need to configure the user in /etc/snmp/snmptrapd.conf also or the receiving end needs to configure it?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: snmptrap v2 to v3

Post by pbroste »

Hello @elinagios

Thanks for reaching out, here is the configuration requirements:
To send a test trap with v3 enabled: [/list]

Please let us know how things look,
Perry
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

Re: snmptrap v2 to v3

Post by elinagios »

Hello

thank you for your answer. I have been looking at those articles but what i don't exactly understand is that are the changes in "/etc/snmp/snmptrapd.conf" needed in the sending, receiving or on both ends?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: snmptrap v2 to v3

Post by pbroste »

Hello @elinagios

The gist of the process:
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
Please let us know where things are getting hung-up,
Perry
Locked