How to Configure the EEM Python Policy For the Python script to work, you must enable the Guest Shell. For more information, see the Guest Shell chapter. Registering a Python Policy SUMMARY STEPS 1. enable 2. configure terminal 3. event manager directory user policy path 4. event manager policy policy-filename 5. exit 6. show event manager policy registered 7. show event manager history events DETAILED STEPS Procedure Shells and Scripting How to Configure the EEM Python Policy Command or Action Purpose Step 1 enable Example: Device> enable Enables privileged EXEC mode. • Enter your password if prompted. Step 2 configure terminal Example:
Device# configure terminal Enters global configuration mode. Step 3 event manager directory user policy path Example: Device(config)# event manager directory user policy flash:/user library _ Specifies a directory to use for storing user library files or user-defined EEM policies. Note You must have a policy in the specified path. For example, in this step, the eem script.py policy is available in the _ flash:/user library folder or path. _ Step 4 event manager policy policy-filename Example: Device(config)# event manager policy eem script.py _ Registers a policy with EEM. • The policy is parsed based on the file extension.
If the file extension is .py, the policy is registered as Python policy. • EEM schedules and runs policies on the basis of an event specification that is contained within the policy itself. When the event manager policy command is Programmability Configuration Guide, Cisco IOS XE 17.16.x 146