Re: [tkined] Which data types can be monitored?

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Mon, 29 Jun 1998 20:38:39 +0200

>>>>> Colin Smith writes:

Colin> I would like to monitor some variables on our DG/UX hosts. The
Colin> DG AViiON machines snmpd implements the HP-UNIX MIB and I can
Colin> stripchart some of the variables ie:

[snip]

Colin> Which is great, however there are a whole load of variables
Colin> which "SNMP-Monitor -> Monitor Variable" will not allow me to
Colin> monitor. An example is:

[snip]

Colin> returns the message: "computerSystemFreeSwap is either not
Colin> available or of wrong type."

Colin> I've tried it on a a whole bunch of other variables and it
Colin> looks as if only INTEGER types will work.

The code is indeed broken. (I am always wondering how long it takes
until someone reports bugs like this one.) Below is a patch which
should fix the problem.
Juergen

*** tkined/apps/snmp_monitor.tcl.orig Fri Sep 13 11:05:13 1996
--- tkined/apps/snmp_monitor.tcl Mon Jun 29 20:35:06 1998
***************
*** 115,120 ****
--- 115,121 ----
switch -glob $syntax {
Gauge -
INTEGER -
+ Unsigned32 -
Integer32 {
set val $value
}
***************
*** 204,210 ****
proc MonitorVariable {list varname} {
ForeachIpNode id ip host $list {
set s [SnmpOpen $id $ip]
! set syntaxList "Gauge Counter Counter32 Counter64 INTEGER"
set vars ""

set err [catch {$s get $varname} vbl]
--- 205,214 ----
proc MonitorVariable {list varname} {
ForeachIpNode id ip host $list {
set s [SnmpOpen $id $ip]
! set syntaxList {
! Gauge Gauge32 Counter Counter32 Counter64
! Unsigned32 INTEGER Integer32
! }
set vars ""

set err [catch {$s get $varname} vbl]
***************
*** 214,219 ****
--- 218,226 ----
set syntax [lindex [lindex $vbl 0] 1]
if {[lsearch $syntaxList $syntax] >= 0} {
lappend vars [lindex [lindex $vbl 0] 0]
+ } else {
+ set name [mib name [lindex [lindex $vbl 0] 0]]
+ writeln "$host: $name of base type $syntax ignored"
}
}
} msg]} {
***************
*** 225,233 ****
set syntax [lindex [lindex $vbl 0] 1]
if {[lsearch $syntaxList $syntax] >= 0} {
lappend vars [lindex [lindex $vbl 0] 0]
}
}
!
if {$vars == ""} {
ined acknowledge \
"$varname is either not available or of wrong type."
--- 232,243 ----
set syntax [lindex [lindex $vbl 0] 1]
if {[lsearch $syntaxList $syntax] >= 0} {
lappend vars [lindex [lindex $vbl 0] 0]
+ } else {
+ set name [mib name [lindex [lindex $vbl 0] 0]]
+ writeln "$host: $name of base type $syntax ignored"
}
}
!
if {$vars == ""} {
ined acknowledge \
"$varname is either not available or of wrong type."

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