[mrtg] ...Here is how I: 1) Graph Number of Devices on Layer 2 network, 2) Graph Spanning Tree Protocol Topology changes

Barron Hulver barron at po.cwru.edu
Tue Jan 25 14:05:40 MET 2000


> Hello all,
>
> To schedule network maintenance easier and more userfriendly I decided to
> collect some data on the hosts connected to my (switched) network.
> My idea is very simple and I guess the idea is not mine either.
> I would like to have graphial statistics via MRTG collected from our
> Catalyst 5000's (and a 6000) on the number of
> connected/notconnected pors. Is there an easy and simple way to
> make it?
> I found one similar solution on MRTG's website but that is based on a UNIX
> server and its finger so that is no good for me.
>
> Anyone "wearing the same pair of shoes"? - as we say in Hungarian.
>
> Thx,
> Levente


Below is a slight variation of what I think you are asking for.  I don't
think this is exactly what you are asking for but it may trigger some ideas.

Here is a little background information on our network, CWRUnet.  CWRUnet
has always been a layer-2-only network (no routers, only bridges).  We see
about 13,000 different mac address in a 30-day period.  We see about 6,500
mac addresses active at the same time in the middle of the afternoon based
on the bridge table sizes.  We use MRTG to monitor bridge table sizes and
Spanning Tree Topology changes as well as many other variables in our
network.

Barron


Barron Hulver                   216-368-2982
CWRUnet Services
Case Western Reserve University
Cleveland, Ohio  44106-7072
barron at po.cwru.edu



Graphing Number of Devices on Layer 2 network
=============================================
This graphs the number of entries in the bridge table.  Use a shell script
so we can do things based on threshholds (bridge table empty, etc.)

Shell script to get Bridge Table count
--------------------------------------
cat  btcount.sh
#!/bin/bash
#
#  btcount.sh
#  bridge table count
#

#set -x
LANEDIR=/.....
SNMPDIR=/usr/local/libexec
#SNMPDIR=/..............
SNMPDIR=/usr/local/bin

ip=$1
ip="......."
comm=<community name>
gDot1dTpLearnedEntryDiscards=".1.3.6.1.2.1.17.4.1"
gDot1dTpAgingTime=".1.3.6.1.2.1.17.4.2"
gDot1dTpFdbPort=".1.3.6.1.2.1.17.4.3.1.2"

gSystemDescrOid=".1.3.6.1.2.1.1.1.0"
gSystemUptimeOid=".1.3.6.1.2.1.1.3.0"
#set gDot1dTpFdbPort .1.3.6.1.2.1.17.4.3.1.2

#set gPhubSysOid .1.3.6.1.4.1.390.1.1
#set gPhubSysOid .1.3.6.1.4.1.326.2.6.1.1

# System MIB variables
#set gSystemDescrOid       .1.3.6.1.2.1.1.1.0
#set gSystemObjectID       .1.3.6.1.2.1.1.2.0
#set gSystemUpTimeOid      .1.3.6.1.2.1.1.3.0
#set gSystemContactOid     .1.3.6.1.2.1.1.4.0
#set gSystemNameOid        .1.3.6.1.2.1.1.5.0
#set gSystemLocationOid    .1.3.6.1.2.1.1.6.0

#set glesConfIndex           .1.3.6.1.4.1.326.2.4.2.1.1.1.1
#set glesConfOperStatus      .1.3.6.1.4.1.326.2.4.2.1.1.1.4
#set glesConfElanName        .1.3.6.1.4.1.326.2.4.2.1.1.1.5
#set glesLnniConfAtmAddress  .1.3.6.1.4.1.326.2.4.2.1.2.1.1

#set glesLeqConfLesId   .1.3.6.1.4.1.326.2.4.2.1.3.1
#set glesLeqTableReload .1.3.6.1.4.1.326.2.4.2.1.3.2
#set glesLeqStatLesId   .1.3.6.1.4.1.326.2.4.2.1.3.3
#set glesLeqIndex       .1.3.6.1.4.1.326.2.4.2.1.3.5.1.1
#set glesLeqNsap        .1.3.6.1.4.1.326.2.4.2.1.3.5.1.2



#$SNMPDIR/snmpwalk  $ip  $comm  $gDot1dTpFdbPort

COUNT=`$SNMPDIR/snmpwalk $ip $comm $gDot1dTpFdbPort | grep -i -c "."`
DESCRIP=`$SNMPDIR/snmpget  -q $ip $comm $gSystemDescrOid`
UPTIMET=`$SNMPDIR/snmpget -q $ip $comm $gSystemUptimeOid | cut -c 9-80`
UPTIME=`$SNMPDIR/snmpget -q $ip $comm $gSystemUptimeOid`
#UPTIME=`$SNMPDIR/snmpget -q $ip $comm $gSystemUptimeOid | awk '{print
$2$3$4}'`

DISCARDS=`$SNMPDIR/snmpget  -q $ip $comm $gDot1dTpLearnedEntryDiscards`
AGE=`$SNMPDIR/snmpget  -q $ip $comm $gDot1dTpAgingTime`
#let AGEMINS=$AGE / 60
AGEMINS=60

echo $COUNT
echo $COUNT
echo $UPTIMET
echo $DESCRIP " " $ip "with bridge aging time of " $AGE "seconds"

echo $COUNT      >$LANEDIR/btcount.dat
echo $COUNT     >>$LANEDIR/btcount.dat
echo $UPTIMET   >>$LANEDIR/btcount.dat
echo $DESCRIP " " $ip >>$LANEDIR/btcount.dat
echo $UPTIME    >>$LANEDIR/btcount.dat
echo $AGE       >>$LANEDIR/btcount.dat
echo $AGEMINS   >>$LANEDIR/btcount.dat
echo $DISCARDS  >>$LANEDIR/btcount.dat

exit

if [ $COUNT -eq 0 ]; then
    /usr/local/bin/expect -f $LANEDIR/phubgetmembrmib.exp  $ip
endif

#if [ $DISCARDS -gt 0 ]; then
#  mail -s "Bridge Table overflow $ip  $DISCARDS"  barron at po.cwru.edu



mrtg config file
----------------
Target[bt]: `btcount.sh`
Title[bt]: Total Active CWRUnet Devices (Bridge Table count from PowerHub A)
PageTop[bt]: <center><H1>Total Active CWRUnet Devices</H1></center>
        (Bridge table count from PowerHub A)
MaxBytes[bt]: 8000
AbsMax[bt]: 8000
Ylegend[bt]: Active Devices
RouterUptime[bt]:
Unscaled[bt]: dwmy
ShortLegend[bt]: Users
LegendI[bt]:
LegendO[bt]: Total
Legend2[bt]: <FONT Size=+2></FONT>Total count of all devices on
    <A HREF="......">CWRUnet</A>



Graphing Spanning Tree Protocol Changes
=============================
WorkDir: /usr/local/homes/mrtg/mrtgstp
Refresh: 600
Interval: 15

# Spanning Tree Protocol Changes
#
# The number of changes/second is typically < 1 (not an integer),
# Therefore calculate number of pages/hour to make an integer
#

MaxBytes[_]: 999999
Suppress[_]: y
YLegend[_]: Changes/15 mins
ShortLegend[_]: c/i
Legend1[_]:Changes per 15 mins
LegendI[_]:
LegendO[_]:&nbsp;Changes:
Options[_]: growright, nopercent
Colours[_]: GREEN#eefeee,BLUE#1000ff,DARK GREEN#000000,VIOLET#000000

Title[stproot]: Spanning Tree Protocol Changes
PageTop[stproot]: <h2>Spanning Tree Protocol Changes</h2>
   iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1).dot1dBridge(17).<br>
  dot1dStp(2).dot1dStpTopChanges(4)

Target[stproot]: 900 *
.1.3.6.1.2.1.17.2.4.0&.1.3.6.1.2.1.17.2.4.0:<comm>@<ip>
LegendI[stproot]:
LegendO[stproot]:&nbsp;Changes:
Legend2[stproot]:Changes per 15 mins

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list