A simple Perl script that generates status summary of NetApp Filers using SNMP in a web page.

Why:

Via the NetApp Tech site, I ended up finding a Perl script ‘ToasterView‘. Being responsible for 4 NetApp storages, I was interested in the program. Currently I am using MRTG to monitor diskspace en snapmirrors. It is great but I was missing a nice overview of the filers. So, the perl script looked the way to solve this need.

I checked out the script and came across a series of issues:

  • Only runs on Unix machines
    At least I do not know if snmpget & snmptable exsist on Windows.
  • The HTML code lacks a lot of closing tag’s and has others issues which can be problematic for some webbrowsers.
  • Reading df…KBytes etc might give you wrong information. The correct sizing of volumes must be calculated from dfHigh….KBytes and dfLow…KBytes.
  • the ‘look’ of the page is hardcoded in the Perl script. No use of CSS. This makes it hard to integrate the pages in exsisting pages or to give to the company-style look

The improvements:

  • using the Perl module, this script should run on Unix, Windows and MacIntosh.
    Note: I only tested it on Windows.
  • add CSS styles and a CSS file -> now it is easy to changes fonts, colors, etc
  • added closing tags as needed and corrected tag options where required.
    Add extra HTML info above <HTML> and in the <HEAD> section to make things better and more standard as well a to allow autorefreshing the page
  • to save screen ‘real-estate’, I removed pictures from the top.
  • coded to read dfHigh… and dfLow…KBytes and to calculate from these values the exacte sizes.
  • removed totals. When using aggregates, the totals are incorrect. NetApp shows aggregates as volumes and there is no way to make a distinction
    (in SNMP info) between the real volumes and the aggregates (the layer above).
  • added thresholds and added logic to change colors when sizes are above thresholds (warning = yellow and danger=red)
  • added logic to change color to RED when something fails/failed.
    Can be changed via CSS file
  • added logic to make gauge more colorfull
  • added reading of CFG file to make configs and code independant.
  • added logic to handle more than 1 filer from a config file

All has been tested using ActivePerl 5.8.7 and the module Net::SNMP 5.2.

Requirements:
Perl 5 and Perl module Net-SNMP 5.2 or better

Version history:

  • Version : 5.2 = added several fill-ups if some elements were not discoverd
  • Version : 5.1 = no longer reading filer info from .cfg but from Filers.txt
  • Version : 5.0 = add snapshot, snapmirror and snapvault info
  • Version : 4.5 = capture snapshot space when they are reprensetend as .. instead of .snapshot
  • Version : 4.4 = replace http://filer with https://filer
  • Version : 4.3 = correct precent calc when dfUsed = 0
  • Version : 4.2 = adjusted calc warn & danger
  • Version : 4.1 = changed to meet new battery info
  • Version : 4.0 = added vFiler information and changed the way to calc warnings & danger
  • Version : 3.1 = corrected problem in passing CSS file
  • Version : 3.0 = corrected some things and some HTML errors
  • Version : 2.9 = added logic to correct incorrect kbytes
  • Version : 2.8 = added domain
  • Version : 2.7 = commented out Start en ending logging
  • Version : 2.6 = Added config params to allow to control output
    This will make script also runable under a webserver and
    allow to create HTML on the fly
  • Version : 2.5 = corrected error $diskReconstructingParityCount in HTML code
    correct timestamp
    made ‘last updated info’ universal readable = no ambigious date
  • Version : 2.4 = added code to overcome size problem when
    dfPerCentKBytesCapacity > 100
    added link to FilerView on Filer (http://filer/na_admin)
    added extra CSS stuff
  • Version : 2.3 = corrected a HTML error
    moved table options to CSS file (as much as possible)
    cellspacing and cellpadding had to stay to keep layout OK
  • Version : 2.2 = changed name from FilerStatus to FilerStatus
    NetApp has already FilerView name
    Corrected a HTML error
  • Version : 2.1 = redirected logging to STDOUT
  • Version : 2.0 = redirected debug output to STDERR
    added logic to read filer list from config file
    changed command line arguments to get config filename from it
    and no longer filer and optional community
    html output is send to a file and no longer to STDOUT
  • Version : 1.3 = made config external
  • Version : 1.2 = corrected gauge_width_RED calculation
  • Version : 1.1 = changed gmtime() to localtime()
  • Version : 1.0 = initial release

Known issues:

  • The script is not idiot proof. Putting treshold > 100 or inverse will create problems. However I assume you are intelligent enough when using the script
    😉