I am trying to track Switch Power supplys using Nagios SNMP interface. But the problem I came across is that the switch used the same trap ID to report Power supply failure and power supply recovery, just varying the description. Is there any way I could associate this to different states? Below there's the corresponding part from snmpttunknown.log:
Thu Jul 14 17:55:18 2016: Unknown trap (.1.3.6.1.4.1.9.9.13.3.0.5) received from 172.27.22.1 at:
Value 0: 172.27.22.1
Value 1: 172.27.22.1
Value 2: 242:10:19:10.77
Value 3: .1.3.6.1.4.1.9.9.13.3.0.5
Value 4: 172.27.22.1
Value 5: public
Value 6: .1.3.6.1.4.1.9.9.13.3
Value 7:
Value 8:
Value 9:
Value 10:
Ent Value 0: .1.3.6.1.4.1.9.9.13.1.5.1.2.2058=Sw2, PS1 Faulty, RPS NotExist
Ent Value 1: .1.3.6.1.4.1.9.9.13.1.5.1.3.2058=6
Thu Jul 14 17:55:21 2016: Unknown trap (.1.3.6.1.4.1.9.9.13.3.0.5) received from 172.27.22.1 at:
Value 0: 172.27.22.1
Value 1: 172.27.22.1
Value 2: 242:10:19:13.79
Value 3: .1.3.6.1.4.1.9.9.13.3.0.5
Value 4: 172.27.22.1
Value 5: public
Value 6: .1.3.6.1.4.1.9.9.13.3
Value 7:
Value 8:
Value 9:
Value 10:
Ent Value 0: .1.3.6.1.4.1.9.9.13.1.5.1.2.2058=Sw2, PS1 Normal, RPS NotExist
Ent Value 1: .1.3.6.1.4.1.9.9.13.1.5.1.3.2058=1
EVENT ciscoEnvMonRedundantSupplyNotification .1.3.6.1.4.1.9.9.13.3.0.5 "Status Events" Normal
FORMAT A ciscoEnvMonRedundantSupplyNotification is sent if $*
MATCH $2: (Normal)
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A ciscoEnvMonRedundantSupplyNotification is sent if $*"
SDESC
A ciscoEnvMonRedundantSupplyNotification is sent if
the redundant power supply (where extant) fails.
Since such a notification is usually generated before
the shutdown state is reached, it can convey more
data and has a better chance of being sent
than does the ciscoEnvMonShutdownNotification.
This notification is deprecated in favour of
ciscoEnvMonSuppStatusChangeNotif.
Variables:
1: ciscoEnvMonSupplyStatusDescr
2: ciscoEnvMonSupplyState
EDESC
EVENT ciscoEnvMonRedundantSupplyNotification .1.3.6.1.4.1.9.9.13.3.0.5 "Status Events" Critical
FORMAT A ciscoEnvMonRedundantSupplyNotification is sent if $*
MATCH $2: (Faulty)
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A ciscoEnvMonRedundantSupplyNotification is sent if $*"
SDESC
A ciscoEnvMonRedundantSupplyNotification is sent if
the redundant power supply (where extant) fails.
Since such a notification is usually generated before
the shutdown state is reached, it can convey more
data and has a better chance of being sent
than does the ciscoEnvMonShutdownNotification.
This notification is deprecated in favour of
ciscoEnvMonSuppStatusChangeNotif.
Variables:
1: ciscoEnvMonSupplyStatusDescr
2: ciscoEnvMonSupplyState
EDESC
Put those in your /etc/snmp/snmptt.conf and restart the snmptt service:
I added the line you suggested to the config file and restarted the service, however for some strange reason the trap is still being logged at snmpttunknown.log
#
#
#
# Traps para detectar falha na fonte secundaria de switch
EVENT ciscoEnvMonRedundantSupplyNotification .1.3.6.1.4.1.9.9.13.3.0.5 "Status Events" Normal
FORMAT A ciscoEnvMonRedundantSupplyNotification is sent if $*
MATCH $2: (Normal)
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A ciscoEnvMonRedundantSupplyNotification is sent if $*"
SDESC
A ciscoEnvMonRedundantSupplyNotification is sent if
the redundant power supply (where extant) fails.
Since such a notification is usually generated before
the shutdown state is reached, it can convey more
data and has a better chance of being sent
than does the ciscoEnvMonShutdownNotification.
This notification is deprecated in favour of
ciscoEnvMonSuppStatusChangeNotif.
Variables:
1: ciscoEnvMonSupplyStatusDescr
2: ciscoEnvMonSupplyState
EDESC
#
#
#
EVENT ciscoEnvMonRedundantSupplyNotification .1.3.6.1.4.1.9.9.13.3.0.5 "Status Events" Critical
FORMAT A ciscoEnvMonRedundantSupplyNotification is sent if $*
MATCH $2: (Faulty)
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A ciscoEnvMonRedundantSupplyNotification is sent if $*"
SDESC
A ciscoEnvMonRedundantSupplyNotification is sent if
the redundant power supply (where extant) fails.
Since such a notification is usually generated before
the shutdown state is reached, it can convey more
data and has a better chance of being sent
than does the ciscoEnvMonShutdownNotification.
This notification is deprecated in favour of
ciscoEnvMonSuppStatusChangeNotif.
Variables:
1: ciscoEnvMonSupplyStatusDescr
2: ciscoEnvMonSupplyState
EDESC
Fri Jul 15 16:23:21 2016: Unknown trap (.1.3.6.1.4.1.9.9.13.3.0.5) received from 172.27.22.1 at:
Value 0: 172.27.22.1
Value 1: 172.27.22.1
Value 2: 243:8:47:13.38
Value 3: .1.3.6.1.4.1.9.9.13.3.0.5
Value 4: 172.27.22.1
Value 5: public
Value 6: .1.3.6.1.4.1.9.9.13.3
Value 7:
Value 8:
Value 9:
Value 10:
Ent Value 0: .1.3.6.1.4.1.9.9.13.1.5.1.2.1061=Sw1, PS1 Faulty, RPS NotExist
Ent Value 1: .1.3.6.1.4.1.9.9.13.1.5.1.3.1061=6
Fri Jul 15 16:23:23 2016: Unknown trap (.1.3.6.1.4.1.9.9.13.3.0.5) received from 172.27.22.1 at:
Value 0: 172.27.22.1
Value 1: 172.27.22.1
Value 2: 243:8:47:15.39
Value 3: .1.3.6.1.4.1.9.9.13.3.0.5
Value 4: 172.27.22.1
Value 5: public
Value 6: .1.3.6.1.4.1.9.9.13.3
Value 7:
Value 8:
Value 9:
Value 10:
Ent Value 0: .1.3.6.1.4.1.9.9.13.1.5.1.2.1061=Sw1, PS1 Normal, RPS NotExist
Ent Value 1: .1.3.6.1.4.1.9.9.13.1.5.1.3.1061=1