GigabitEthernet1/0/23 unassigned YES unset up up GigabitEthernet1/0/24 unassigned YES unset down down GigabitEthernet1/1/1 unassigned YES unset down down GigabitEthernet1/1/2 unassigned YES unset down down GigabitEthernet1/1/3 unassigned YES unset down down GigabitEthernet1/1/4 unassigned YES unset down down Te1/1/1 unassigned YES unset down down Te1/1/2 unassigned YES unset down down Te1/1/3 unassigned YES unset down down Te1/1/4 unassigned YES unset down down Loopback55 10.55.55.55 YES manual up up Device# Jun 7 12:51:20.549: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback55, changed state to up Jun 7 12:51:20.549: %LINK-3-UPDOWN:
Interface Loopback55, changed state to up The following is a sample script for printing messages to the syslog. This script must be stored in a file, copied to the file system on the device, and registered using the event manager policy file. ::cisco::eem::event_register_syslog tag "1" pattern COUNTER maxrun 200 import eem import time eem.action_syslog("SAMPLE SYSLOG MESSAGE","6","TEST") The following is sample script to print EEM environment variables. This script must be stored in a file, copied to the file system on the device, and registered using the event manager policy file.
::cisco::eem::event_register_syslog tag "1" pattern COUNTER maxrun 200 import eem import time c = eem.env_reqinfo() print "EEM Environment Variables" for k,v in c.iteritems(): print "KEY : " + k + str(" ---> ") + v print "Built in Variables" for i,j in a.iteritems() : print "KEY : " + i + str(" ---> ") + j Adding a Python Script in an EEM Applet SUMMARY STEPS 1. enable 2. configure terminal 3. event manager applet applet-name 4. event [ tag event-tag ] syslog pattern regular-expression 5. action label cli command cli-string Shells and Scripting Adding a Python Script in an EEM Applet Programmability Configuration Guide, Cisco IOS XE 17.16.x 149