ASR9k EEM+TCL General custom SNMP Trap

If customer want to focus a alarm on their NMS by SNMP Trap, they can config “snmp-server traps syslog”. But if customer no filter feature on NMS, they couldn’t find special alarm in all syslog, now we can use EEM + TCL to match customer requirement.

Follow TCL Script:

::cisco::eem::event_register_syslog pattern $_error_log occurs $_number period $_times maxrun 300
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

set alarm "***OOB_ERROR Happened!***"

sys_reqinfo_snmp_trapvar var temp oid string $alarm
sys_reqinfo_snmp_trap enterprise_oid generic_trapnum 6 specific_trapnum 2 trap_oid trap_var temp

After copy above script to disk0, then config follow command.
Follow variable mean that the alarm “Configuration committed” happened 3 times each 60s.
Customer can custom those variable by them.
Attention: if you change any variable or script, you need re-config “event manager policy snmp_trap.tcl username cisco”.

event manager environment _times 60
event manager environment _number 3
event manager environment _error_log Configuration committed
event manager directory user policy disk0:
event manager policy snmp_trap.tcl username cisco persist-time 3600

Refer to SNMP Traps receiver on MAC OS, I use “MIB Browser“:



你可以留言,或者trackback 从你的网站