Hello guys,
This is my trap description.
EVENT pduUnitActivePowerStateChange .1.3.6.1.4.1.38446.1.9.24 "Status Events" $+6
FORMAT PDU unit active power state changes. $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "" "PDU unit active power state changes to $+6"
REGEX (.iso:1)(Critical)
REGEX (.iso:2)(Warning)
REGEX (.iso:3)(Warning)
REGEX (.iso:4)(Critical)
REGEX (.iso:5)(Normal)
SDESC
PDU unit active power state changes.
Variables:
1: pduIndex
2: pduNamePlateName
3: pduNamePlateInetAddressType
4: pduNamePlateIPAddress
5: pduUnitStatusLoadState
6: pduUnitStatusActivePower
7: sysContact
8: sysName
9: sysLocation
EDESC
I would like to assign the status events by a variable. I tried to put $+6 with a regex but didn't work.
This is the line in the snmptt.log :
Tue Jan 31 11:18:04 2017 .iso .iso "Status Events" 10.96.148.240 - PDU unit active power state changes. 0
Thanks
Jim
Variable as Status Events in snmptt.conf
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Variable as Status Events in snmptt.conf
Just so we're all on the same page, have you been through https://support.nagios.com/kb/article.php?id=558 ?
If you are open to alternative methods, you should also look at https://assets.nagios.com/downloads/nag ... ios_XI.pdf (which is actually the first link in the KB, but I wanted to draw special attention to it as it is also a detailed document)
If you are open to alternative methods, you should also look at https://assets.nagios.com/downloads/nag ... ios_XI.pdf (which is actually the first link in the KB, but I wanted to draw special attention to it as it is also a detailed document)
Re: Variable as Status Events in snmptt.conf
Thank you for your help, so if I do like that in the EXEC line :
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$+6" "$@" "$-*" "Link down on interface
whatever the severity in the EVENT line, the EXEC line will send the variable state as the severity ?
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$+6" "$@" "$-*" "Link down on interface
whatever the severity in the EVENT line, the EXEC line will send the variable state as the severity ?
Re: Variable as Status Events in snmptt.conf
Yes, but I don't know what you're trying to do with $s+6 (or what it represents, I do see it in your event). This document might help outline things more - https://support.nagios.com/kb/article.php?id=77
Code: Select all
EVENT nSvcEvent .1.3.6.1.4.1.20006.1.7 "Status Events" Normal
<SEVERITY> = "$s"
"$s" = the SEVERITY defined in the EVENT line (in this case it is Normal)
Former Nagios Employee
Re: Variable as Status Events in snmptt.conf
Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up or has the issue otherwise been resolved?
Former Nagios employee