- Cisco Employee,
Hall of Fame,
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 220.127.116.11.18.104.22.168.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.