Created
May 4, 2022 18:08
-
-
Save glallen01/a7cf299584475999aac8a2b3fa28a010 to your computer and use it in GitHub Desktop.
roll native vlan EEM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event manager applet DEFAULT_VLAN_2 | |
event syslog pattern "NATIVE_VLAN_MISMATCH:" period 180 | |
action 10 regexp "with\s([A-Za-z0-9-]*).*\s(.*E.*[0-9].*)\s\(([0-9]*)\)" "$_syslog_msg" _matchA _FarHost _FarInt _FarVlan | |
action 20 regexp "on\s(.*E.*[0-9].*)\s\(([0-9]*)\),\swith" "$_syslog_msg" _matchB _NearInt _NearVlan | |
action 30 syslog msg "Fixing Trunk on $_NearInt to match $_FarInt vlan $_FarVlan native vlan on $_FarHost" | |
action 40 cli command "enable" | |
action 50 cli command "conf t" | |
action 60 cli command "int $_NearInt" | |
action 80 if $_FarVlan eq "2" | |
action 82 cli command " description TRUNK: $_FarHost $_FarInt" | |
action 84 cli command " switchport trunk native vlan $_FarVlan" | |
action 86 end | |
action 90 cli command "end" | |
! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment