I was recently tasked with finding a way to monitor the number of
modems in use on a USR Total Control Modem Rack. I had been using tkined
under Linux and to a limited extent BSDI. I decided to try modifying the
MIB Walk to walk just a specific tree anfd came up with this:
--- Cut --- Paste --- Cut --- Paste --- Cut --- Paste --- Cut --- Paste ---
#! /usr/local/bin/scotty -inf
##
## Very Simple USR Modem browser for tkined.
##
## Copyright (c) 1996
##
## James E. Wells
## Bellvue Washington, USA
## Northwest Link
##
## This code has been modified from it's original form
## which was created by Juergen Schoenwael.
##
## Permission to use, copy, modify, and distribute this
## software and its documentation for any purpose and without
## fee is hereby granted, provided that this copyright
## notice appears in all copies. The University of Braunschweig
## makes no representations about the suitability of this
## software for any purpose. It is provided "as is" without
## express or implied warranty.
##
LoadDefaults snmp
SnmpInit USR-Browser
##
## Dump a complete hierarchy. The user may choose the hierarchy
## before we start our action. We store the last selected hierarchy
## in a static variable called dump_mib_tree_path.
##
proc "Walk MIB Tree" {list} {
static dump_mib_tree_path
set dump_mib_tree_path "mdmCsStatus"
ForeachIpNode id ip host $list {
write "MIB Tree Walk for $host \[$ip\] "
writeln "starting at $dump_mib_tree_path:"
set s [SnmpOpen $id $ip]
SNMP_Walk $s $dump_mib_tree_path
$s destroy
writeln
}
}
--- Cut --- Paste --- Cut --- Paste --- Cut --- Paste --- Cut --- Paste ---
Great. This works beautifully under tkined, however a few days ago I was
further tasked with figuring out how to make this output available from a
command prompt and keep a running log. Well all hell broke loose. It
seems that when I try to run this from the command prompt it can't load
the SNMP tools that it needs and exits with the following message:
--- Cut --- Paste --- Cut --- Paste --- Cut --- Paste --- Cut --- Paste ---
invalid command name "LoadDefaults"
while executing
"LoadDefaults snmp"
(file "USR_browser.tcl" line 20)
invoked from within
"source USR_browser.tcl"
--- Cut --- Paste --- Cut --- Paste --- Cut --- Paste --- Cut --- Paste ---
I did some more research and found that the SNMP tools are in multiple
tcl files under the tkined apps directory. They are all .tcl files and I
foolishly thought that I could just load them all by hand and make it
work, unfortunately it failed miserably. My question then is this:
How would I make this little toy run from a command prompt?
James E. Wells
PS. Before anyone tells me to upgrade to scotty-2.1.1, I am trying to do
so, but am having a real ugly time getting it to compile and link
properly under BSDI. Linux was a synch. ;)