Here's one way to do it with an iCall:
-
Create scripts for each up/down command (ex. /var/temp/interface_1_1_down.conf):
sys icall script interface_1_1_down {
app-service none
definition {
exec tmsh modify net interface 1.1 disabled
}
description none
events none
}
sys icall handler triggered interface_1_1_down {
script interface_1_1_down
subscriptions {
interface_1_1_down {
event-name interface_1_1_down
}
}
}
-
Merge these scripts into the config:
tmsh load sys config merge file /var/temp/interface_1_1_down.conf
-
Modify /config/user_alert.conf:
alert interface_1_1_down "text in log that reports interface 1.1 down" {
exec command="tmsh generate sys icall event interface_1_1_down"
}
You'd create one for each event and corresponding command. You'll also need to figure out exactly what the log statement will look like when the interface is disabled, as this is what triggers the user_alert.conf config.