[Top] [All Lists]

Re: MIBs on Cisco Cat4003/4006

To: nv-l@lists.tivoli.com
Subject: Re: MIBs on Cisco Cat4003/4006
From: Jane Curry <jane.curry@skills-1st.co.uk>
Date: Sun, 09 Jul 2000 20:44:54 +0100
I have a generic script that tries to determine what devices are
attached to what hubs / switches.  It uses a standard MIB variable that
comes out of the bridge subtree of MIB-2 (as a switch is effectively a
multi-port bridge).  Here is the script if it is useful - no guarantees,
as ever!

Regards, Jane

# Modification date: 5/1/2000
# Uses NetView mibtable command to get mac addresses
#    associated with switches into
# NetView nvUtil command used to supply members of NetView collections
#   as the hub / switch names.  These collections are maintained
#   dynamically by NetView
# Munges information into format
#  MAC Address switch_name   port no
# Output sorted by switch name into
# and by MAC Address in /usr/OV/conf/skills/mac_to_switches.out
# Edit next line for name of NetView collection representing all
# You can define this with the "isBridge" attribute

# Check that the NetView nvcold is running

RUNNING=`/usr/OV/bin/ovstatus nvcold | grep RUNNING | awk '{print $2}'`
if [ $RUNNING != "RUNNING" ]
  echo "NetView Collection daemon, nvcold, not running - exiting"
  exit 0

cat /dev/null > /usr/OV/conf/skills/switch_macaddr.temp

for i in `/usr/OV/bin/nvUtil l $SWITCH_COL`
   echo "$i"
#  Get the MIB variables representing MAC address(es) seen by port(s)
#  This comes out of the Bridge subtree of MIB-2
   /usr/OV/bin/mibtable -table .  \
  -fields dot1dTpFdbAddress=1:48,dot1dTpFdbPort=2:11  \
  -node "$i"  \
  >> /usr/OV/conf/skills/switch_macaddr.temp

cat /dev/null > /usr/OV/conf/skills/switches_to_mac.out
cat /dev/null > /usr/OV/conf/skills/mac_to_switches.out
cat /usr/OV/conf/skills/switch_macaddr.temp | \
 awk '
        /User Specified MIB Table/      {switchname=$6}
        /^[0-9A-F][0-9A-F] /
 ' "$@"   \
   | sort -k7,7 -k8,8n \
   >> /usr/OV/conf/skills/switches_to_mac.out

sort -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 -k6,6
/usr/OV/conf/skills/switches_to_mac.out >

Tivoli Certified Enterprise Consultant & Instructor
Skills 1st Limited, 2 Cedar Chase, Taplow, Bucks, SL6 0EU, UK
Tel: +44 (0)1628 782565
Copyright (c) 2000 Jane Curry <jane.curry@skills-1st.co.uk>.  All rights

<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web