Specifies a Python file that runs when a trigger condition occurs.
Event-handler configuration mode
You can assign only one action to a given event-handler profile.
You can also specify the Python file as part of the event-handler command.
To change the file assigned to a profile, you do not need to enter the no form of this command. You only need to enter action python-script file-name, specifying the new file name.
Running this command copies the Python script file from the flash:// directory to the database. After specifying a file for all relevant event-handler profiles, you can delete it from the flash:// directory.
If the event-handler for which you are modifying this command is active on the device, the changes take effect with no need to de-activate and re-activate the event-handler.
If an event-handler profile is not activated, the no form of this command deletes its action.
The following example specifies Python files for two event-handler profiles.
device# configure terminal device(config)# event-handler eventHandler1 device(config-event-handler-eventHandler1)# action python-script example.py device(config-event-handler-eventHandler1)# event-handler eventHandler2 device(config-event-handler-eventHandler2)# action python-script example2.py