I try to catch a bad config command on nexus5k.
I tried an eem applet.
event manager test description "catch bad trunk config line" event cli match "switchport trunk allowed vlan [0-9].*" action 1 cli local sen * hey please use the add parameter
It seems to me the match statement does not work on config commands.
I tried some variants, but config commands are not catched for event triggering.
event cli match "*switchport*" # no success
event cli match "show version" # success
Any suggestions ?
Solved! Go to Solution.
Hi, following match Statement works:
event cli match "conf t ; interface * ; switchport *"
Seems that the whole cli context has to be in the match Statement.
Config commands should be matched, but I do not have a N5K with which to test. I do not see anything wrong with your initial regex. You might try matching on "switchport" without any metacharacters (*switchport* is an invalid regex) to see if any config command matches.
If it's not working I recommend you open a TAC case as this sounds like a bug.
Hi, following match Statement works:
event cli match "conf t ; interface * ; switchport *"
Seems that the whole cli context has to be in the match Statement.