cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1330
Views
0
Helpful
0
Replies

ESM tcl filter + ios_config, possible?

@mforman2
Level 1
Level 1

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:

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/esm/configuration/xe-16-10/esm-xe-16-10-book/esm-syslog.html

as documentation.

As well as:

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/esm/configuration/12-4t/esm-12-4t-book/esm-syslog.html

 

Thanks,

-@mforman2

 

0 Replies 0