Page 1 of 1

Manually add SNMPT trap for host

Posted: Thu Jan 11, 2018 3:15 pm
by osk.dthompson
How do we manually add SNMP traps to an existing server. I've tried using the SNMP Trap Wizard, but once it's done, all I end up with is a check that uses a host template called "xiwizard_snmptrap_service" and apparently the host template uses the command 'check_dummy' - I'm guessing 'check_dummy' is pretty much useless. Below is the command the template uses:

$USER1$/check_dummy $ARG1$ $ARG2$

- where
$ARG1$ = 0
$ARG2$ = "Trap host assumed to be UP"

Also, while going through the snmp trap wizard, on the 'Monitoring Settings' page, I see the message 'There are no monitoring options to configure with SNMP Traps. Click Next to continue.' So I continue which is when I end up with the 'check_dummy' command.

I've checked '/var/log/snmptt/snmptt.log' so I know I'm correctly translating the received SNMP traps, but it's not linking them to my monitored host. Below is a sample from 'snmptt.log' and 'snmptt.conf.'

-- Sample snmp message in snmptt.log:

Thu Jan 11 13:57:10 2018 .1.3.6.1.4.1.2312.13.1.1.0.1 Normal "Status Events" server1 - Defines an audit log event sent by ovirt-engine-notifier. 11933 USER_VDC_LOGIN 30 0 User admin@internal-authz logged in. 1 2018-01-11T13:56Z admin@internal-authz 5a2078e3-0346-0252-0258-0000000000b4

-- MIB from snmptt.conf

MIB: OVIRT-MIB (file:./OVIRT-MIB.txt) converted on Wed Jan 10 15:05:49 2018 using snmpttconvertmib v1.4beta2
#
#
#
EVENT ovirtEngineNotifierNotificationsAudit .1.3.6.1.4.1.2312.13.1.1.0.1 "Status Events" Normal
FORMAT Defines an audit log event sent by ovirt-engine-notifier. $*
# EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "Defines an audit log event sent by ovirt-engine-notifier. $*"
EXEC /usr/local/bin/snmptraphandling.py $r TRAP 1 "Defines an audit log event sent by ovirt-engine-notifier. $*"
SDESC
Defines an audit log event sent by ovirt-engine-notifier.
Variables:
1: ovirtEngineNotifierInstanceId
2: ovirtEngineNotifierName
3: ovirtEngineNotifierId
4: ovirtEngineNotifierSeverity
5: ovirtEngineNotifierMessage
6: ovirtEngineNotifierStatus
7: ovirtEngineNotifierDatetime
EDESC

Re: Manually add SNMPT trap for host

Posted: Thu Jan 11, 2018 4:52 pm
by npolovenko
Hello, @osk.dthompson. Have you checked out the "Unconfigured Objects" section in XI yet? It is located in the Admin menu/Monitoring config/Unconfigured Objects. If your XI is receiving traps but you can't see them in the web interface that would be the place to add new checks.

Re: Manually add SNMPT trap for host

Posted: Thu Jan 11, 2018 5:06 pm
by osk.dthompson
Hello,

I have checked 'Unconfigured Objects' but nothing shows up in there.

Re: Manually add SNMPT trap for host

Posted: Fri Jan 12, 2018 12:00 pm
by npolovenko
@osk.dthompson, Can you change the following line in your snmptt.conf file:

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py  "$r"  "SNMP Traps" "Defines an audit log event sent by ovirt-engine-notifier. $*"
SDESC
After that please run:

Code: Select all

service snmptt restart
Let it run for a 5-10 minutes and post the /var/log/snmptt/snmptt.log, /var/log/snmptt/snmpttunknown.log and /usr/local/nagios/var/nagios.log log files.

Re: Manually add SNMPT trap for host

Posted: Fri Jan 12, 2018 4:39 pm
by osk.dthompson
I did change the EXEC line as requested, then forced an event on the monitored host. Still not seeing any traps being associated to the host.

Just an FYI, the event I triggered was around 15:25.
I have attached the logs you requested.
Thank you,

Forgot to add the EXEC line:

EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "Defines an audit log event sent by ovirt-engine-notifier. $*"

Re: Manually add SNMPT trap for host

Posted: Mon Jan 15, 2018 12:22 pm
by tgriep
The EXEC line looks like it is missing some options that are needed to send the trap information to Nagios.
Try using the following example in your /etc/snmp/snmptt.conf file for that OID.

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Defines an audit log event sent by ovirt-engine-notifier. $*"
After the change is done, you will have to restart the Trap Translator daemon by running.

Code: Select all

service snmptt restart
Then, it you can generate a Trap from the device, it should either show up in the SNMP Traps service for that host or if it is a new Trap, it will be in the Admin > Unconfigured Objects menu so it can have it's final configuration setup.

You may want to look at the SNMP Trap Tutorial at the link below for how Nagios XI receives and processes Traps.
https://support.nagios.com/kb/article/n ... al-77.html