
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
09-02-2014 02:04 AM - edited 04-17-2020 05:22 PM
EEM Script to log committed configs to syslog
EEM Script to Capture Packet at SPP
EEM Script that saves some logs to a file every 30 mins
EEM script to manually flap the Error Disabled interface
EEM Script to reload the linecard
EEM Script to shut the interface
EEM script to collect logs from ASR9000 router
EEM script to monitor PowerModule of ASR9001 chassis
EEM script to capture logs when Double-bit ecc error is seen
EEM script to monitor multiple syslogs and reload RP/FC depending on syslog
Using Embedded-event-manager(EEM) in IOS-XR for the ASR9000 to Simulate ECMP "min links"

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi
As we discussing at meeting ,this is my plan for EEM .
purpose:
Between BFD flap (Will end in about 3 seconds), get following log 5times.
----
show interface <IF>
show controllers npu diag counters graphical instance all location all
show captured packets ingress location <LC>
show captured packets egress location <LC>
show controllers npu stats traps-all instance all location all
show spp node-counters location all
----
Config :
aaa authorization commands eem-method none
aaa authorization eventmanager default local
!
line template eem-template
authorization commands eem-method
!
event manager directory user policy disk0:
event manager policy <script name> username cisco persist-time 3600
script:
::cisco::eem::event_register_syslog occurs 1 pattern ".*bfd_agent.*BFD session to neighbor.*has gone down" maxrun_sec 30
#------------------------------------------------------------------
# EEM policy to monitor BFD
#
#
# Cisco Systems
#
#
# Copyright (c) 2010 by cisco Systems, Inc.
# All rights reserved.
#------------------------------------------------------------------
###
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
# 1. query the information of latest triggered eem event
array set arr_einfo [event_reqinfo]
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix err=%s\ns" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str]
error $result
}
set msg $arr_einfo(msg)
# 2. Execute the debug
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
# 2. <IF> need to be specified
if [catch {cli_exec $cli1(fd) "show interface <IF> | file harddisk:show interface <IF>"} result] {
error $result $errorInfo
}
# Execute the CMD
if [catch {cli_exec $cli1(fd) "show controllers npu diag counters graphical instance all location all | file harddisk:show controllers npu"} result] {
error $result $errorInfo
}
# <LC> need to be specified
if [catch {cli_exec $cli1(fd) "show captured packets ingress location <LC> | file harddisk:show captured packets ingress"} result] {
error $result $errorInfo
}
# <LC> need to be specified
if [catch {cli_exec $cli1(fd) "show captured packets egress location <LC> | file harddisk:show captured packets egress"} result] {
error $result $errorInfo
}
# Execute the CMD
if [catch {cli_exec $cli1(fd) "show controllers npu stats traps-all instance all location all | file harddisk:show controllers npu"} result] {
error $result $errorInfo
}
# Execute the CMD
if [catch {cli_exec $cli1(fd) "show spp node-counters location all | file harddisk:show spp"} result] {
error $result $errorInfo
}
# Execute the CMD
if [catch {cli_exec $cli1(fd) "show bfd session detail | file harddisk:show-bfd"} result] {
error $result $errorInfo
}
#Notify via a syslog message that we had this event.
action_syslog priority info msg "capture BFD info via EEM TCL!"
could you confirm.
Regards,
Kun Liu