[tkined] fix for tkined's snmp_monitor in 3.0.0-99-08-12

Greg A. Woods (tkined-fwd@mail.weird.com)
Fri, 13 Aug 1999 01:29:27 -0400 (EDT)

The following change (which restores the code to look much more like it
did in 2.1.10) is necessary to get the "SNMP-Monitor -> Interface Load"
feature to work in 3.0.0-99-08-12. Without this change the strip charts
appear to be created without any SNMP:Config attribute and then they
just die with "noResponse".

Index: tkined/apps/snmp_monitor.tcl
===================================================================
RCS file: /cvs/misc/scotty-3/tkined/apps/snmp_monitor.tcl,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 snmp_monitor.tcl
*** tkined/apps/snmp_monitor.tcl 1999/08/12 19:26:56 1.1.1.1
--- tkined/apps/snmp_monitor.tcl 1999/08/12 23:56:09
***************
*** 517,524 ****

set args $ip
set i 0
foreach if $iflist {
! lappend args [CreateChart $id [expr 30+$i] [expr 30+$i]]
lappend args $if
incr i
}
--- 517,527 ----

set args $ip
set i 0
+ set snmpconfig [ined attribute $id "SNMP:Config"]
foreach if $iflist {
! set nid [CreateChart $id [expr 30+$i] [expr 30+$i]]
! lappend args $nid
! ined -noupdate attribute $nid "SNMP:Config" $snmpconfig
lappend args $if
incr i
}

I was also thinking of the following change to the same file (though I
think additional changes are required to avoid divide-by-zero errors).
I'd rather have the srip chart running than entirely non-existant,
especially if it only takes a slight tweak to correct the ifSpeed
setting on the device....

***************
*** 503,512 ****
# continue
# }

! if {$speed == 0} {
! writeln "Interface $idx on $host \[$ip\] ignored (ifSpeed = $speed)"
! continue
! }

lappend iflist $idx
}
--- 503,512 ----
# continue
# }

! # if {$speed == 0} {
! # writeln "Interface $idx on $host \[$ip\] ignored (ifSpeed = $speed)"
! # continue
! # }

lappend iflist $idx
}

The snmp_monitor tool is a lot less robust than in 2.1.10 -- it
occasionally goes away completely (and reliably dies when trying to
access interface loads from UCD-SNMP on BSD, so I should be able to
debug this one), and occasionally it just silently stops running one or
more jobs.

-- 
							Greg A. Woods

+1 416 218-0098 VE3TCP <gwoods@acm.org> <robohack!woods> Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>

--
!! 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.