We have a bunch of ISR 2800s on 12.4(25b) that basically are in production until they die. There are no plans to invest money in SmartNET or purchase replacement fans.
We are getting a ton of fan service syslog messages and it is a nuisance with the tens of thousands of messages received daily. I see you can rate limit the number of syslog messages per second but need something more along the lines of allowing one syslog message of a particular type per day.
Are there any commands on the router or other external methods that would accomplish something like that?
Apr 17 14:52:09.292: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:52:09.292: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:52:09.292: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Apr 17 14:52:39.292: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:52:39.292: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:52:39.292: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Apr 17 14:53:09.293: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:53:09.293: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:53:09.293: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Apr 17 14:53:39.293: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:53:39.293: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:53:39.293: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Apr 17 14:54:09.293: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:54:09.293: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:54:09.293: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Apr 17 14:54:39.294: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:54:39.294: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:54:39.294: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Apr 17 14:55:09.294: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:55:09.294: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:55:09.294: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Apr 17 14:55:39.295: %ENVMON-4-FAN_LOW_RPM: Fan 1 service recommended
Apr 17 14:55:39.295: %ENVMON-4-FAN_LOW_RPM: Fan 2 service recommended
Apr 17 14:55:39.295: %ENVMON-4-FAN_LOW_RPM: Fan 3 service recommended
Best Answer
Summary
You should use Cisco's Embedded Syslog Manager. ESM can dynamically modify or throttle syslog messages when they are generated on the router.
ESM Demo
I built an example (see bottom of answer) of how to rate-limit configuration messages within a test time window; for the purposes of this demo, I substituted
[regexp {CONFIG} $::orig_msg]
instead of[regexp {FAN_LOW_RPM} $::orig_msg]
so I could illustrate rate-limiting messages like%SYS-5-CONFIG_I: Configured from console by vty0
.I edited the tcl script at the bottom of the answer with
[regexp {CONFIG} $::orig_msg]
, and tftp'd the script into flash...Then I configured my router with the name of the script, and the syslog server's address (172.16.1.5).
Now when you go into configuration mode on the router, the syslog messages are rate-limited.
How it works
The ESM script at the bottom of the answer rate-limits
FAN_LOW_RPM
messages. The example leverages the fact thatNVMON-4-FAN_LOW_RPM
messages are sent every 30 seconds. For simplicity, I use an absolute 30-second window between 23:59:30 and 23:59:59 to rate-limit the messages. This script assumes the syslogs are sent at a constant rate, and are not intermittent. In the attached script, I use timestamps inHHMMSS
(24-hour) format so they would map easily to integers.When a syslog message is ready to be sent, IOS stores it in
$::orig_msg
. I just built a quick series ofif .. else
clauses to detect whether the syslog message:FAN_LOW_RPM
)If the message contains
FAN_LOW_RPM
and is within the time window, the script sends the message. Other messages containingFAN_LOW_RPM
messages are not sent. All other syslogs are sent (because we only want to silence the noisy messages).FYI, for simplicity I intentionally avoided persisting timestamp values between the last
NVMON-4-FAN_LOW_RPM
syslog message seen, although someone could do that too.ESM syslog rate-limit script:
Save this file in flash as
flash:filterSyslog.tcl