Monitor Interface Utilization on NX-OS

Document

Apr 29, 2012 10:07 PM
Apr 29th, 2012

The SNMP event detector in NX-OS does not support a delta or incremental polling type so counter objects cannot be properly monitored.  This makes it difficult to monitor things such as interface utilization.  This solution repurposes the SNMP ED along with a Tcl script and a hidden VSH command to provide syslog alerting if any of a list of interfaces exceeds a configurable threshold.

First, configure an EEM applet using the SNMP ED.  This applet will monitor sysUpTime and fire whenever sysUpTime is greater than 0.  This will always be true.  The point of this applet is to run each time the polling interval pops and execute the Tcl script.

event manager applet ifTimer

event snmp oid 1.3.6.1.2.1.1.3.0 get-type exact entry-op gt entry-val 0 poll-interval 30

action 1.0 cli tclsh bootflash:if_util.tcl

In this example, the applet will run every 30 seconds and fire off the if_util.tcl script.  It is the job of this script to check the interface utilization.

The attached Tcl script will check two EEM environment variables.  The first provides a comma-separated list of interfaces to check.  The second specifies the threshold.

event manager environment if_util_intfs "e3/1,e3/2,e4/1"

event manager environment if_util_threshold "90"

In this example, the script will monitor the utilization of Ethernet3/1, Ethernet3/2, and Ethernet4/1 (using the "show interface" command).  If any of the iterfaces' utilization is over 90%, a syslog message will be generated for that interface.  That syslog will look like:

%USER-2-SYSTEM_MSG: systest from  0: Interface e3/1 exceeded 90% utilization threshold: Tx: 91%, Rx: 60% - vsh

This solution has been tested on a Nexus 7K running 6.0(3).  NX-OS 5.2 or higher should also work with this solution.

Average Rating: 4.5 (2 ratings)

Comments

Joseph Clarke Mon, 08/19/2013 - 07:17 (reply to carltonpatterson)

Calling a Tcl script from EEM or the scheduler is not officially supported on NX-OS yet.  Meaning if something goes wrong, there is no way to get support for it.  However, it does work given a new enough version of NX-OS.

Actions

Login or Register to take actions

This Document

Posted April 29, 2012 at 10:07 PM
Stats:
Comments:2 Avg. Rating:4.5
Views:2680 Contributors:2
Shares:0
Categories: EEM for NX-OS
+

Related Content

Documents Leaderboard