Hi,
I'm trying to create a script that will perform an action when a port is configured with specific VLANs. I need to know which interface was configured in order to be able to take action. Problem is only the 2nd line shows up in the $_cli_msg.
event manager applet testapp1
description "when port configured for vlans 825 command issued to enable poe"
event tag 1 cli pattern "interface GigabitEthernet" sync no occur 1 skip no
event tag 2 cli pattern "switchport access vlan 825" sync no occur 1 skip no
trigger
correlate even 1 or event 2
exit
action 1.0 set intf ""
action 1.2 set interf ""
action 2.0 regexp "GigabitEthernet[0-9/]+" $_cli_msg intf
action 2.2 if $_regexp_result ne 1
action 2.4 set interf $intf
action 2.5 syslog msg "in the if section, $intf, $interf"
action 2.6 end
action 4.0 syslog msg "Message: $_cli_msg, INTERFACE $intf"
The script runs twice, once per line so I dont get the interface the 2nd time it runs. How can I do this differently to make it work?
Thanks,
Spiro