ESM tcl filter + ios_config, possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2020 11:14 AM - edited 03-05-2020 11:15 AM
Community,
Example of Syslog Message:
*Mar 5 15:06:57.694: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet1/0/9 (1), with 100_testValidate GigabitEthernet0/18 (255).
I want to take this syslog message and then send ios_config with parts of it to fix the issue.
My tcl script thus far:
if { [string length $::orig_msg] == 0} {
return ""
}
if { $::mnemonic == "NATIVE_VLAN_MISMATCH"} {
set args [split $::msg_args]
set vlan [lindex $args 4]
set interface [lindex $args 0]
ios_config "int $interface" "switchport mode trunk" "switchport trunk native vlan $vlan" "switchport none"
}
return $::orig_msg
logging filter bootflash:nativeVlanMismatch.tcl
logging buffered filtered warnings
Can anyone see where I may be going wrong here?
Is ios_config possible with a ESM filter?
I've been using:
as documentation.
As well as:
Thanks,
-@mforman2
- Labels:
-
Network Management
