Recieving SNMP Traps

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ahoward12
Posts: 137
Joined: Thu Jan 05, 2017 10:24 am

Re: Recieving SNMP Traps

Post by ahoward12 »

Ok, I guess I used a bad example. I apologize for not noticing that you mentioned that in an earlier response. I hate to be a bother, but take a look at what I am doing below and let me know what I am missing please:

1) In the midst of all of those MIB's being uploaded, one was called LIEBERT_GP_AGENT.MIB. Previously when this uploaded the "Process Trap" was not ticked. I just re-uploaded this MIB and checked the "Process Trap" and I received the message:
MIB file successfully processed:
Total translations: 10
Successful translations: 10


2) Service snmptt restart

3) I then generated a trap, aptly called "Test Heatbeat Trap" that that appears per below in the snmptt.log file.

Code: Select all

[root@NAGIOS snmptt]# cat /var/log/snmptt/snmptt.log
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
Tue Oct 24 16:00:21 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Normal "Status Events" 10.10.99.245 - The agent card is alive. 4:1:48:05.60 0 1
I am not seeing anything in the event viewer, the service I have for the trap, or anything in unconfigured objects.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recieving SNMP Traps

Post by tgriep »

Check the following files

Code: Select all

/usr/share/snmp/mibs/processed_mibs/RFC1628_UPS_MIB.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_SYSTEM.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt
/etc/snmp/snmptt.conf
for that OID .1.3.6.1.4.1.476.1.42.2.3.0.0.7

If you find it, post it here.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ahoward12
Posts: 137
Joined: Thu Jan 05, 2017 10:24 am

Re: Recieving SNMP Traps

Post by ahoward12 »

Hey Tgriep, I grep'd it and I found it here: /usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt:EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Normal
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recieving SNMP Traps

Post by tgriep »

When the Process MIB box is checked, it should of added an EXEC line to the config files and it looks like that did not happen.

So, open up this file /usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt and under this section

Code: Select all

EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Normal
Add this line

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
It looks like the whole file is missing the EXEC line so you can add it under all of the EVENT lines.

Can you post this file so I can check and see what may have caused that line from not getting added to the files?

Code: Select all

/usr/local/bin/addmib
Thanks.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ahoward12
Posts: 137
Joined: Thu Jan 05, 2017 10:24 am

Re: Recieving SNMP Traps

Post by ahoward12 »

Sorry for the late response, I was out of the office for a couple days.

I added this for every event:
Add this line
CODE: SELECT ALL
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
Now this is my /usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt

Code: Select all

#
#
#
#
MIB: LIEBERT-GP-AGENT-MIB (file:/usr/share/snmp/mibs/LIEBERT_GP_AGENT.MIB) converted on Tue Oct 17 11:27:45 2017 using snmpttconvertmib v1.4beta2
#
#
#
EVENT lgpAgentDeviceCommunicationLost .1.3.6.1.4.1.476.1.42.2.3.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessful .1.3.6.1.4.1.476.1.42.2.3.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorrupt .1.3.6.1.4.1.476.1.42.2.3.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeat .1.3.6.1.4.1.476.1.42.2.3.0.7 "Status Events" Critical
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailure .1.3.6.1.4.1.476.1.42.2.3.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
EVENT lgpAgentDeviceCommunicationLostLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessfulLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorruptLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailureLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
#
MIB: LIEBERT-GP-AGENT-MIB (file:/usr/share/snmp/mibs/LIEBERT_GP_AGENT.MIB) converted on Tue Oct 17 11:58:16 2017 using snmpttconvertmib v1.4beta2
#
#
#
EVENT lgpAgentDeviceCommunicationLost .1.3.6.1.4.1.476.1.42.2.3.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessful .1.3.6.1.4.1.476.1.42.2.3.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorrupt .1.3.6.1.4.1.476.1.42.2.3.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeat .1.3.6.1.4.1.476.1.42.2.3.0.7 "Status Events" 
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailure .1.3.6.1.4.1.476.1.42.2.3.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
EVENT lgpAgentDeviceCommunicationLostLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessfulLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorruptLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailureLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
#
MIB: LIEBERT-GP-AGENT-MIB (file:/usr/share/snmp/mibs/LIEBERT_GP_AGENT.MIB) converted on Tue Oct 17 18:23:12 2017 using snmpttconvertmib v1.4beta2
#
#
#
EVENT lgpAgentDeviceCommunicationLost .1.3.6.1.4.1.476.1.42.2.3.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessful .1.3.6.1.4.1.476.1.42.2.3.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorrupt .1.3.6.1.4.1.476.1.42.2.3.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeat .1.3.6.1.4.1.476.1.42.2.3.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailure .1.3.6.1.4.1.476.1.42.2.3.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
EVENT lgpAgentDeviceCommunicationLostLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessfulLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorruptLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailureLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
#
MIB: LIEBERT-GP-AGENT-MIB (file:/usr/share/snmp/mibs/LIEBERT_GP_AGENT.MIB) converted on Tue Oct 24 15:59:50 2017 using snmpttconvertmib v1.4beta2
#
#
#
EVENT lgpAgentDeviceCommunicationLost .1.3.6.1.4.1.476.1.42.2.3.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessful .1.3.6.1.4.1.476.1.42.2.3.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorrupt .1.3.6.1.4.1.476.1.42.2.3.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeat .1.3.6.1.4.1.476.1.42.2.3.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailure .1.3.6.1.4.1.476.1.42.2.3.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
EVENT lgpAgentDeviceCommunicationLostLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessfulLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorruptLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailureLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
#
MIB: LIEBERT-GP-AGENT-MIB (file:/usr/share/snmp/mibs/LIEBERT_GP_AGENT.MIB) converted on Tue Oct 24 16:14:40 2017 using snmpttconvertmib v1.4beta2
#
#
#
EVENT lgpAgentDeviceCommunicationLost .1.3.6.1.4.1.476.1.42.2.3.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessful .1.3.6.1.4.1.476.1.42.2.3.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorrupt .1.3.6.1.4.1.476.1.42.2.3.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeat .1.3.6.1.4.1.476.1.42.2.3.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailure .1.3.6.1.4.1.476.1.42.2.3.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
#
#
#
EVENT lgpAgentDeviceCommunicationLostLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.1 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent has lost communications with a managed device. $*
SDESC
The agent has lost communications with a managed device.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareUpdateSuccessfulLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.5 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has completed successfully. $*
SDESC
The firmware update to the agent card has completed successfully.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentFirmwareCorruptLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.6 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The firmware update to the agent card has failed and the firmware is $*
SDESC
The firmware update to the agent card has failed and the firmware is
now corrupt.
Variables:
  1: sysUpTime
EDESC
#
#
#
EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC
The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
#
#
#
EVENT lgpAgentDnsLookupFailureLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.8 "Status Events" Normal
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT A Domain Name System (DNS) lookup of a network name failed to $*
SDESC
A Domain Name System (DNS) lookup of a network name failed to
resolve.  This may result in one or more of the following:
1. failure to notify a target address of an important condition
2. failure allow access for monitoring purposes
This issue should be resolved as soon as possible with a
network or system administrator.
Variables:
  1: sysUpTime
  2: lgpNetworkName
EDESC
Here is a generated SNMP trap after those changes:

Code: Select all

2017-10-31 10:01:37	SERVICE ALERT: Core UPS Rack 3 .245;SNMP Traps;OK;HARD;1;10:19:49:08.53 0 1 / sysUpTime (TICKS):10:19:49:08.53 lgpConditionsPresent (GAUGE):0 lgpAgentConnectedDeviceCount (UNSIGNED32):1
We are very much heading in the right direction! My questions now are as follows, one will build off of the other:

It would appear that everything appears twice in my /usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt. Is this normal or can I just delete the first, or second half?

Also I have read the SNMP trap document several times but I am confused on where I state this trap received to be critical.

/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt
or
/usr/share/snmp/mibs/LIEBERT_GP_AGENT.MIB
or
/etc/snmp/snmptt.conf

I also attached the file you wanted..
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recieving SNMP Traps

Post by tgriep »

The duplicate entries in the /usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt file can be removed.
If they are the same, just remove one of them and restart the snmptt daemon.

After cleaning them up, to edit a trap for generating a critical or warning state, you would edit the rules in the following files for your OID.

Code: Select all

/usr/share/snmp/mibs/processed_mibs/RFC1628_UPS_MIB.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_SYSTEM.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt
/etc/snmp/snmptt.conf
Be sure to check out our Knowledgebase for helpful articles and solutions!
ahoward12
Posts: 137
Joined: Thu Jan 05, 2017 10:24 am

Re: Recieving SNMP Traps

Post by ahoward12 »

I deleted all of the duplicate entries from all of those files, just to clean up. I added the EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*" to all of the events for all of those MIB's as well because it was missing from them too.

Folllowing that I went in and just did a find and replace to make all of the SNMP Traps received to be critical.

You have solved nearly all of my issues. Any reason why that EXEC line is not being added to the processed MIB's?

Finally, here is how my alert comes in as this in the event log, very messy...

2017-10-31 11:40:13SERVICE ALERT: Core UPS Rack 3 .245;SNMP Traps;CRITICAL;HARD;1;10:21:27:43.89 0 1 / sysUpTime (TICKS):10:21:27:43.89 lgpConditionsPresent (GAUGE):0 lgpAgentConnectedDeviceCount (UNSIGNED32):1

However, inside my smptt.log I receive the following trap, which looks great!:

Tue Oct 31 11:43:38 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Critical "Status Events" 10.10.99.245 - The agent card is alive. 10:21:31:10.42 0 1

I am trying to to make the actual alert received look like the one that appears in the snmptt.log. To my understanding, I need to make some changes regarding this event in my snmptt.conf, however none of these traps are appearing in my snmptt.conf except for 4 of them. I attached another copy of my snmptt.conf.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recieving SNMP Traps

Post by tgriep »

The answer on why the EXEC lines did not show up in the config files is hard to answer. One of the steps you ran previously that had issues could of caused the addmib application to not add the EXEC lines.
If you want to change how the trap is displayed, you would have to edit the FORMAT line for that OID and update the Variable to pass on what you want to see.
The $* will pass on all of the variable bindings and you can change it to your liking. Thak a look at this link for details on the variables you can use in the Format line.
http://snmptt.sourceforge.net/docs/snmp ... ONF-FORMAT
Be sure to check out our Knowledgebase for helpful articles and solutions!
ahoward12
Posts: 137
Joined: Thu Jan 05, 2017 10:24 am

Re: Recieving SNMP Traps

Post by ahoward12 »

Ok, question, is any of this supposed to be in my snmptt.conf?

Everywhere I continue to read they keep referencing me making changes to my snmptt.conf file, while this OID doesn't appear anywhere but inside /usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt.

For instance, this is the OID I am "learning" with, located at the above referenced location:

Code: Select all

EVENT lgpAgentHeartbeatLegacy .1.3.6.1.4.1.476.1.42.2.3.0.0.7 "Status Events" Critical
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$*"
FORMAT The agent card is alive. $*
SDESC The agent card is alive.
Variables:
  1: sysUpTime
  2: lgpConditionsPresent
  3: lgpAgentConnectedDeviceCount
EDESC
I am generating the trap alert, and /var/log/snmp/snmptt.log receives this:

Tue Oct 31 16:37:24 2017 .1.3.6.1.4.1.476.1.42.2.3.0.0.7 Critical "Status Events" 10.10.99.245 - The agent card is alive. 11:2:24:56.27 0 1

Then Nagios event viewer gets this and I get a text message that means nothing to me:

Code: Select all

SERVICE NOTIFICATION: ahadm;Core UPS Rack 3 .245;SNMP Traps;CRITICAL;xi_service_notification_handler;11:2:24:56.27 0 1 / sysUpTime (TICKS):11:2:24:56.27 lgpConditionsPresent (GAUGE):0 lgpAgentConnectedDeviceCount (UNSIGNED32):1
Service Critical	2017-10-31 16:37:26	SERVICE ALERT: Core UPS Rack 3 .245;SNMP Traps;CRITICAL;HARD;1;11:2:24:56.27 0 1 / sysUpTime (TICKS):11:2:24:56.27 lgpConditionsPresent (GAUGE):0 lgpAgentConnectedDeviceCount (UNSIGNED32):1
So my first question still stands, should this OID be in my snmptt.conf and I be editing it there, or is editing the actual processed_mib the correct way to do this?
Why does Nagios not display in event viewer what it receives in snmptt.log? Is it not supposed to use the FORMAT line? If not, I know I have asked a lot, but would you be willing to help me edit this one and I will do any others myself?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recieving SNMP Traps

Post by tgriep »

To simplify things, you can put everything in to one file for ease of searching, editing, etc... you could take these config files

Code: Select all

/usr/share/snmp/mibs/processed_mibs/RFC1628_UPS_MIB.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_SYSTEM.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt
And put them at the bottom of this file.

Code: Select all

/etc/snmp/snmptt.conf
Make sure you remove the duplicated entries, etc...

Then edit this file

Code: Select all

/etc/snmp/snmptt.ini

Code: Select all

Remove these lines from the bottom
/usr/share/snmp/mibs/processed_mibs/RFC1628_UPS_MIB.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_SYSTEM.txt
/usr/share/snmp/mibs/processed_mibs/LIEBERT_GP_AGENT.txt
Save and restart the trap daemon by running

Code: Select all

service snmptt restart
That will consolidate everything in to one file.

Also, my bad, the EXEC line has to be under the FORMAT line that is why it is not looking the same from the log file to the entry in Nagios.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked