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

TCL script: suppress PfR syslog messages

pmcconne
Level 1
Level 1

I am trying to create a TCL script to suppress PfR learning syslog messages:

          %OER_BR-5-NOTICE: Prefix Learning STARTED

          %OER_BR-5-NOTICE: Prefix Learning STOPPED

I only wish to suppress these messages. 

All other syslog messages are needed. 

I have started with the following:

puts [open "flash:test" w] {

     if { [ regexp { "Prefix Learning STOPPED" } $::orig_msg ] } {

       return ""

         }  else {

            return  "$::orig_msg"

      }

}

I am seeing the errors:

     Error packaging args for ESM.
     Error packaging args for ESM.

Also, although I am only scripting with the "STOPPED" messages to begin, I am not seeing the "STARTED" messages either.

I have done some bash scripting but am new to scripting TCL.

Paul

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

When you "more" this file on flash, what are the contents?  I did notice one error.  Your script should be:

if { [regexp {Prefix Learning STOPPED} $::orig_msg] } {

    return ""

}

return $::orig_msg

The script you have listed:

if { [regexp {Prefix Learning STOPPED} $::orig_msg] } {

    return ""

}

return $::orig_msg

... is filtering both the "%OER_BR-5-NOTICE: Prefix Learning STOPPED" and the "%OER_BR-5-NOTICE: Prefix Learning STARTED" messages.  However, I am not understanding why it is filtering the "%OER_BR-5-NOTICE: Prefix Learning STARTED" messages.  My worry is the script may also be filter other unknown needed to be seen messages.  In the end, I do want to filter both, but need to key in on each message individually in th script.  Is there a way to do that and verify each is filtered individually?  Also, I am getting ESM errors on the non-filtered console during filtering:

Error packaging args for ESM.

Error packaging args for ESM.

Are you familar with these errors or seen these types of messages before?

Thank you for you assist,

Paul

Post your config and IOS version from this device.

test123-br# do sh ver | inc .bin


System image file is "flash:c2951-universalk9-mz.SPA.152-4.M4.bin" 

-


test123-br# do sh run

service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname test123-br
!
boot-start-marker
boot system flash:c2951-universalk9-mz.SPA.152-4.M4.bin
boot-end-marker 
!
logging buffered filtered
!
no aaa new-model
!
username -------- password ---------
!
!
ip cef
!
!
key chain --------
key ----
  key-string --------
!
pfr border
logging
local GigabitEthernet0/0
master ---.---.---.--- key-chain --------
active-probe address source interface Tunnel1
!
!
redundancy
!
interface Tunnel1
ip address ---.---.---.--- 255.255.255.0
no ip redirects
ip mtu 1470
ip flow ingress
ip nhrp authentication --------
ip nhrp map multicast dynamic
ip nhrp map multicast 172.16.0.2
ip nhrp map ---.---.---.--- 172.16.0.2
ip nhrp network-id ------
load-interval 30
tunnel source 172.16.0.1
tunnel mode gre multipoint
tunnel key ---------
!
!
interface GigabitEthernet0/0
description PSUEDO LAN
ip address 192.168.1.4 255.255.255.248

!
interface GigabitEthernet0/1
description PSEUDO WAN
ip address 172.16.0.1 255.255.255.0
!
router eigrp 1
network 172.16.0.0
network 192.168.1.0
!
no ip http server
no ip http secure-server
!
ip sla auto discovery
logging filter flash:test101.tcl
!
line con 0
exec-timeout 60 0
login local
!
line aux 0
transport none
!
line 2
no activation-character
no exec
transport preferred none
transport none
stopbits 1
line vty 0 4
exec-timeout 60 0
login local
transport input ssh
!
end
!

test123-br# do show log


    Console logging: level debugging, 600 messages logged, xml disabled,
                     filtering disabled
    Monitor logging: level debugging, 30 messages logged, xml disabled,
                     filtering disabled
    Buffer logging:  level debugging, 30 messages logged, xml disabled,
                    filtering enabled (30 messages logged)
    Exception Logging: size (8192 bytes)
    Count and timestamp logging messages: disabled
    Persistent logging: disabled

Filter modules:
    flash:test101.tcl 

This looks like a regression of CSCsq49519.  There is no workaround, and this seems to specifically affect this OER messages.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: