How to Monitor All of Your Access Switch Uplinks At a Glance

CLICK HERE FOR MORE DETAILS on how to utilize Ciscocmd and Syslog to monitor you entire network at a glance and keep your finger on the pulse of your global […]

CLICK HERE FOR MORE DETAILS on how to utilize Ciscocmd and Syslog to monitor you entire network at a glance and keep your finger on the pulse of your global communications infrastructure.

SUBSCRIBE HERE for to receive useful updates and tips for Network Administration and Automation.

In this article I will discuss creating a quick snapshot of the health of your entire network access layer uplink infrastructure. Most Enterprise networks follow a simple three layer infrastructure model which is: access, distribution, and core. Each successive layer consolidates more networks, switches, and routers.

In large enterprises, the access layer can often contain hundreds of switches and uplinks to the distribution layer. It is often difficult to monitor several hundred interfaces everyday using SNMP, because snmp pollers are unable to keep up polling a large amount of interfaces. Also, matters become complicated, if you attempt to set up simple a view of all of our uplinks on one page. Graphing engines may have trouble, graphing several hundred graphs in a short time. Another drawback is that SNMP systems have to be maintained and can degrade overtime. Once degraded, time, resources, and expertise have to be engaged to fix the issues with the monitoring platform.

One solution, is to take a quick snap shot of all of your uplink interfaces, and format the output of the snapshot so that you can scroll down hundreds and possibly thousands of interfaces to check their physical layer status in a minute or two. If you are really handy, you can even script alerts when errors are detected.

This article will build on the foundation of an earlier article on entworkadmin called Cisco Command – The Ultimate Little Tool. We discuss an incredibly powerful utility called ciscocmd written by Alain Degreffe (eczema@ecze.com).

Please refer to this article as primer and background information for this article:

Cisco Command (ciscocmd) – The Ultimate Little Tool

In that article, I essentially discuss the basic structure of what you need to display the layer 2 uplink status. In this article, I will provide the specific script with the specific commands needed. I will also discuss how to activate the script.

This scripts reads a file that contains two variables per line. The first element of the line is assigned as the host variable and the second line is assigned as the cmdfile variable. Please refer to the Cisco Command article for more information on the specifics of the options being called for the ciscocmd utility here. Every line of an input file causes the script to telnet to a host and run a set of commands that are specified in a command file.

Input File:
—————————————————
switch1 uplink-group1.txt
switch2 uplink-group1.txt
switch3 uplink-group2.txt
switch4 uplink-group2.txt
—————————————————

Switch1, Switch2, Switch3, and Switch4 are hostnames that resolve to IP addresses. While uplink-group1.txt and uplink2.txt are actually files containing a set of commands that are detailed in the full eBook.

As I’ve said a few times before in this article. You really must read the article titled “Cisco Command – The Ulimate Little Tool”. This will make this article very easy to understand. There are a few style elements of the script such as removing the actual command being issued from the output and naming the file with the date. Also you may notice I “echo” a date into the file before inputing switch uplink data. This is a good way to create the file with a redirect. Then if you notice the while loop contains an “appended” redirect (>>). This is so that new entries do not overwrite old entries. Finally, the output is mailed to an administrator for review.

I run this script as a cronjob and have it sent every morning around 7am. In future articles, I will discuss how to wrap these scripts up so that they are more cron friendly.

When you run the script the call will look something like this.

./accessreport.scr < inputfile.txt

The directory in which you run the command above will contain the following:

  • The ciscocmd script that you downloaded from the instructions shown at the following link
  • The access uplink report script. In this case we named it accessreport.scr.
  • An input file that contains a number of lines with two elements per line: host and command file.
  • Command files. In the case of this article we had two: uplink-group1.txt and uplink-group2.txt. However you can have as many as you require.
  • You also need to be able to run the “mail” or “mailx” unix program. My ebook on another topic describes how to test that. Please subscribe to the mailing list to receive the ebook.

If all goes well, you will receive a file that looks something like this:

——————————————————————–
Sun Mar 20 06:30:01 PDT 2011
Processing… switch1

Gi1/1                 0                0          0            0
Gi1/1                 0         0          0            0
Gi1/1                 0         0          0            0
Gi1/1                 0         0          0            0
Gi1/2                 0                0          0            0
Gi1/2                 0         0          0            0
Gi1/2                 0         0          0            0
Gi1/2                 0         0          0            0
switch1>
switch1>
Processing… switch2

Gi6/1               0          0          0          0         0           0
Gi6/1              0         0         0          0         0         0         0
Gi6/1                0           0            0            0          0
Gi6/2               0          0          0          0         0           0
Gi6/2              0         0         0          0         0         0         0
Gi6/2                0           0            0            0          0
switch2>
switch2>
——————————————————————–

You can very quickly scroll down a huge number of interfaces, once you realize all you are looking for is any number other than zero!

CLICK HERE FOR MORE DETAILS on how to utilize Ciscocmd and Syslog to monitor you entire network at a glance and keep your finger on the pulse of your global communications infrastructure.

SUBSCRIBE HERE for to receive useful updates and tips for Network Administration and Automation.

If you have any feedback or good ideas for future articles, please email me at info@enetworkadmin.net.

About berkel8