Hi, (PLS instruct
me to become a member)
I downloaded and
installed the net-snmp-5.4.0.pre4-1.win32.exe on WinXP. I tried to call
snmptranslate from TCL and
use EXpect (5.21 for
Window) to get the output as follow:
========================================================
set outfile [open "translate.out" w+]
spawn snmptranslate -m ALL -Tp -OS
.iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0
while (1) {
expect {
eof {
break;
}
"*+*R--" {
puts $outfile "R: $expect_out(buffer)"
}
"*+*RW-" {
puts $outfile "RW: $expect_out(buffer)"
}
}
}
}
close $outfile
while (1) {
expect {
eof {
break;
}
"*+*R--" {
puts $outfile "R: $expect_out(buffer)"
}
"*+*RW-" {
puts $outfile "RW: $expect_out(buffer)"
}
}
}
}
close $outfile
=======================================================
every thing looks
fine! I got the tree view of the OID
But... when I turn
it into procedure as:
=================================================
proc
expect_translateCmd {oid} {
set outfile [open "translate-1.out" w+]
set outfile [open "translate-1.out" w+]
spawn snmptranslate
-m ALL -Tp
-OS $oid
while (1) {
expect {
eof {
break;
}
"*+*R--" {
puts $outfile "R: $expect_out(buffer)"
}
"*+*RW-" {
puts $outfile "RW: $expect_out(buffer)"
}
}
}
}
while (1) {
expect {
eof {
break;
}
"*+*R--" {
puts $outfile "R: $expect_out(buffer)"
}
"*+*RW-" {
puts $outfile "RW: $expect_out(buffer)"
}
}
}
}
close
$outfile
(Caller)
.....
set oid " .iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0"
expect_translateCmd
$oid
....
============================================
I never get the tree
view and always get the message:
"
No log handling enabled - turning on
stderr logging
.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0 : (0 )
"
The only difference is
instead of specifying the actual oid, $oid is use in spawn of the
procedure.
Thanks for the
reply!!
Jim
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
