Showing posts with label CLI. Show all posts
Showing posts with label CLI. Show all posts

Tuesday, March 31, 2015

A simple EEM in my home environment

My broadband link is not as stable as what I expect, and it goes up / down from time to time.  When it goes up and down, the public interfaces of IP address might change.  I have a few settings in my lab depends on that IP address, although DDNS is a way to go, I haven't found a new provide after my DynDNS free membership expired.  So in the meantime I have written a simple EEM to send me the IP address of all my interfaces via email.

! Define the email environmental parameters such as from, to address and email server address
event manager environment _email_from alice@aaa.com
event manager environment _email_to bob@bbb.com
event manager environment _email_server smtp.ccc.com

! Since I want to run show command, panda is a local username with privilege level 15 so that I can run this command in enable mode
event manager session cli username "panda"

! I want to run this EEM every 00:00 midnight
event manager applet check-interface-ip
event timer cron cron-entry "0 0 * * *"
action 1.1 cli command "show ip int brief"
action 1.2 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "[EEM] HOME-RT01 gi0/0 up" body "$_cli_result"


Thursday, November 20, 2014

ISR - High CPU with the process SNMP Engine

I have a Cisco 1841 router running in my lab, running code 15.0(1)M, experienced high CPU (9x% in most of the time) after I started to manage and monitor it via Prime Infrastructure 2.1.

When I do a "show process cpu | inc SNMP", it shows the SNMP engine is consuming 90 something percent CPU:


 309  2437791424     2302245     105531 92.36% 76.00% 74.82%   0 SNMP ENGINE    

And when I do a "show snmp stat oid", the mostly queried OID is ipNetToMediaEntry

time-stamp  #of times requested  OID
22:52:04 HKT Nov 20 2014 5261 ipNetToMediaEntry.1
22:52:04 HKT Nov 20 2014 5261 ipNetToMediaEntry.2
22:52:03 HKT Nov 20 2014 5261 ipNetToMediaEntry.4
22:52:03 HKT Nov 20 2014 5260 ipNetToMediaEntry.3
22:50:43 HKT Nov 20 2014 4100 sysUpTime
22:50:22 HKT Nov 20 2014 2 ciscoEnvMonMIBNotificationEnables.4
22:50:22 HKT Nov 20 2014 1 ciscoEnvMonMIBNotificationEnables.3
22:50:22 HKT Nov 20 2014 1 ciscoEnvMonMIBNotificationEnables.3
22:50:22 HKT Nov 20 2014 2 ciscoEnvMonMIBNotificationEnables.2

As a workaround, I have created a view to exclude ipNetToMediaEntry with the following commands:

DW-DESK-RT01(config)#snmp-server view cutdown iso included
DW-DESK-RT01(config)#snmp-server view cutdown ipNetToMediaEntry excluded
DW-DESK-RT01(config)#snmp-server community dshome view cutdown RW

And now it looks much better:
DW-DESK-RT01(config)#do sh proc cpu | inc SNMP
 156           0           6          0  0.00%  0.00%  0.00%   0 SNMP Timers      
 263           0           3          0  0.00%  0.00%  0.00%   0 EEM ED SNMP      
 264           0           2          0  0.00%  0.00%  0.00%   0 EEM ED SNMP Noti 
 267           0           3          0  0.00%  0.00%  0.00%   0 EEM ED SNMP Obje 
 307  1366776000     2507583        545  0.00%  0.00%  0.00%   0 IP SNMP          
 309  2887259424     2304177     105638  0.00% 47.55% 68.40%   0 SNMP ENGINE      
 310        4000           2       2000  0.00%  0.00%  0.00%   0 IP SNMPV6        
 311           0           1          0  0.00%  0.00%  0.00%   0 SNMP ConfCopyPro 
 312           0           2          0  0.00%  0.00%  0.00%   0 SNMP Traps  

Probably I need to upgrade my IOS code for this legacy old box....