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 1.1.1.1.1.1.1.1 string $alarm
sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1 generic_trapnum 6 specific_trapnum 2 trap_oid 1.1.1.1.1.1.1.1.1.1.1.1.1 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“:

tcl-snmp-trap-01

tcl-snmp-trap-02

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

留言哦