partial speed of interface

Timothy Newsham (newsham@aloha.net)
Fri, 13 Jan 1995 11:54:50 -1000 (HST)

Our site has partial T1's coming out of the router. The interface
speed still reports the full T1 speed. This is my hack to allow
realistic monitoring of the interface load. It allows you to
specify an interface speed override variable. Click on a node and
enter 'create attribute'. Make an attribute named "ifspeed" and
assign a string like:

"- - 256000 - - -"

to it. Each item in the string is an interface speed. A speed
of "-" or "" is ignored (the value the remote gave is used). A
numerical value overrides the value the remote gives. The example
above overrides the speed for interface number 3 to be 256000.

Tim N.

*** snmp_monitor.tcl Fri Jan 13 11:17:25 1995
--- snmp_monitor2.tcl Fri Jan 13 11:21:43 1995
***************
*** 323,340 ****
}

##
## Start a new interface load monitoring job for the device given by ip.
## The args list contains node ids with the interface index to display.
##

! proc start_ifload_monitor { ip args } {

global interval
global sv_snmp sv_idx sv_time sv_duplex
global sv_ifInOctets sv_ifOutOctets sv_ifSpeed sv_ifDescr

# Note, IANAifType (RFC 1573) has somewhat different encodings
# than RFC 1213. We use RFC 1213 style.

set full_duplex {
regular1822 hdh1822 ddn-x25 rfc877-x25 lapb sdlc ds1 e1
--- 323,343 ----
}

##
## Start a new interface load monitoring job for the device given by ip.
## The args list contains node ids with the interface index to display.
+ ## The ifspeed list contains a list of speeds or "-" or empty list
+ ## for default
##

! proc start_ifload_monitor { ifspeedlist ip args } {

global interval
global sv_snmp sv_idx sv_time sv_duplex
global sv_ifInOctets sv_ifOutOctets sv_ifSpeed sv_ifDescr

+
# Note, IANAifType (RFC 1573) has somewhat different encodings
# than RFC 1213. We use RFC 1213 style.

set full_duplex {
regular1822 hdh1822 ddn-x25 rfc877-x25 lapb sdlc ds1 e1
***************
*** 366,375 ****
--- 369,385 ----
set sv_ifDescr($id) [lindex [lindex $value 3] 2]
set sv_ifType($id) [lindex [lindex $value 4] 2]
set sv_time($id) [getclock]
set sv_snmp($id) $sh
set sv_idx($id) $idx
+
+ # Check Interface speed override
+ set ifspeed [lindex $ifspeedlist [expr $idx - 1]]
+ if { $ifspeed != "" && $ifspeed != "-" } {
+ set sv_ifSpeed($id) $ifspeed
+ }
+
if {[lsearch $full_duplex $sv_ifType($id)] < 0} {
set sv_duplex($id) 0
} else {
set sv_duplex($id) 1
}
***************
*** 425,436 ****
foreach if $iflist {
set nid [CreateChart $id [expr {30+$i}] [expr {30+$i}]]
append args " $nid $if"
incr i
}

! eval start_ifload_monitor $args

SnmpClose $sh
}
}

--- 435,449 ----
foreach if $iflist {
set nid [CreateChart $id [expr {30+$i}] [expr {30+$i}]]
append args " $nid $if"
incr i
}
+
+ # Get Interface Speeds
+ set ifspeed [ined attribute $id "ifspeed"]

! eval start_ifload_monitor { $ifspeed } $args

SnmpClose $sh
}
}