[tkined] What's a better way to do this with the Tnm extensions

Bill Harris (billh@airmail.net)
Fri, 18 Sep 1998 15:11:30 -0500

I need to gather the enterprise data from the UCD agent on some of my
servers. I'm uncertain the correct syntax of the snmp walk/get/cget in order
to pull this data into an array where I can work with it. The following code does
just what I need, but is obviously not very effecient having to shell out to snmpwalk.

Can someone send me a fragment that will accomplish the same goal?

set fileid [ open "|/usr/local/bin/snmpwalk $hostname $comm_name .1.3.6.1.4.1.2021" ]
while { [gets $fileid data ]>=0 } {
set xx [ split $data "=" ]
set idx [ string trim [ lindex $xx 0 ] ]
set snmpdata($idx) [ string trim [ lindex $xx 1 ] ]
# puts "$idx : $snmpdata($idx)"
}

Thanks

--
Bill Harris
Internet America (Systems)

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