Users Guide
Following example shows the event triggering the script after the cpu-usage reaches 30%:
DellEMC(conf)#script trigger-event event1 cpu-usage 30
Following example shows how you can dene the event to trigger a script when a SYSLOG event with the OSTATE_UP pattern occurs:
DellEMC(conf)#script trigger-event Port_State_Event log-event tag tag-regex "OSTATE.*up"
Following example shows how you can dene the event to trigger a script even if any one of the pattern is matched:
DellEMC(conf)#script trigger-event Server_Reporter_Event log-event tag tag-or-ex "Major
alarm" "Minor alarm"
• Schedule a script to run based on dened events.
Schedule a script to provide mapping between the scripts and trigger-events.
CONFIGURATION mode
script event—handler event-name
Following snippet triggers the script at 22:22 and then triggers every monday midnight and stops at 02:02-11/10/14:
DellEMC(conf)#script trigger-event Event2 time-event start at 22:22 stop at 02:02-11/10/14
weekday mon
DellEMC(conf)#script event-handler handler1
DellEMC(conf-screvt-handler)#execute Report_server.tcl args 4
DellEMC(conf-screvt-handler)#triggered-by Event2
DellEMC(conf-screvt-handler)#no disable
Following snippet triggers the script once the cpu-usage reaches 30%:
DellEMC(conf)#script trigger-event event1 cpu-usage 30
DellEMC(conf)#script event-handler handler1
DellEMC(conf-screvt-handler)#execute Report_server.tcl args 4
DellEMC(conf-screvt-handler)#triggered-by event1
DellEMC(conf-screvt-handler)#no disable
Following snippet triggers a script of the system throws the SYSLOG like Oct 29 05:28:16: %RPM0-P:CP %IFMGR-5-
OSTATE_UP: Changed interface state to up: Ma 0/0:
DellEMC(conf)#script trigger-event Port_State_Event log-event tag tag-regex "OSTATE.*up"
DellEMC(conf)#script event-handler handler1
DellEMC(conf)#execute Report_server.tcl args 4
DellEMC(conf)#triggered-by Port_State_Event
DellEMC(conf)#no disable
Following snippet triggers a script even if any one of the pattern matches:
DellEMC(conf)#script trigger-event Server_Reporter_Event log-event tag tag-or-ex "Major
alarm" "Minor alarm"
DellEMC(conf)#script event-handler handler1
DellEMC(conf-screvt-handler)#execute Report_server.tcl args 4
DellEMC(conf-screvt-handler)#triggered-by Server_Reporter_Event
DellEMC(conf-screvt-handler)#no disable
Managing Executed Scripts
Use any of the following commands to manage or control the scripts; for example, stop, kill, resume, unscheduled, and clear.
Protect system resources by scheduling scripts to run when resources are within the threshold parameters you congured. System
resources include the switch CPU, memory, and le system. For example:
DellEMC#show script process detail
JobID Script Type Script Status Username Script Name Args
000 TRIGGER Running admin admin.pl
001 REPEAT Running user1 sample.zsh hello
002 CONF WATCH Watch Blocked user2 args.pl
Smart Scripting
85