Re: [tkined] Need Cisco Orientation for Scotty/SNMP

From: Doug Hughes (doug@eng.auburn.edu)
Date: Thu Oct 19 2000 - 22:54:15 MET DST


Here are the cisco mibs that I use:
Heck. Here's my .scottyrc. :)

global s
set s [snmp session]

proc cisco {} {
mib load cisco.mib
mib load int_1155.mib
mib load int_1213.mib
mib load int_1493.mib
mib load int_1643.mib
mib load int_1757.mib
mib load int_gen.mib
mib load int_s500.mib
mib load cisco-smi.mib
mib load cisco-vlan.mib
mib load cisco-stack.mib
mib load cisco-vtp.mib
mib load cisco-c2900.mib
}

proc walkit {handle mib args} {
        if {[llength $args] > 0} {
                set ofile [lindex $args 0]
        } else {
                set ofile stdout
        }
        $handle walk x $mib {
                set oid [lindex [lindex $x 0] 0]
                set name [mib name $oid]
                set parent [mib parent $name]
                set p2 [mib parent $parent]
                puts -nonewline $ofile "$p2.$parent.$name "
                puts $ofile " [lindex [lindex $x 0] 2]"
        }
}
                
proc vlanmap {} {
        global s
        $s walk x ifName {
                set oid [lindex [lindex $x 0] 0]
                set pname [lindex [lindex $x 0] 2]
                set osplit [split $oid .]
                set port [lindex $osplit [expr [llength $osplit] -1]]
# puts "$port"
                lappend ports [list $port $pname]
        }
# set index [lindex [lindex [$s get portIfIndex.$port] 0] 2]

        foreach port $ports {
                if {[catch {set vlan [$s get vmVlan.[lindex $port 0]]}]} {
                        set vlan [list "??" "??"]
                }
# if {! [catch {set vlan [$s get vmVlan.[lindex $port 0]]}]} {
                        puts [format "port %4.4s Name %-6.6s Vlan %-3.3s LastChange: %-16s link: %s" \
                                [lindex $port 0] [lindex $port 1] [lindex [lindex $vlan 0] 2]\
                                [lindex [lindex [$s get ifLastChange.[lindex $port 0]] 0] 2] \
                                [lindex [lindex [$s get ifOperStatus.[lindex $port 0]] 0] 2]]
# }
        }
}

proc add {a} {
        global s
        $s configure -address $a
}

____________________________________________________________________________
Doug Hughes formerly of Auburn University

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:55 MET