This is a discussion on issue on spawn snmptranslate from TCL - SNMP ; This is a multi-part message in MIME format. --===============1424622787== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6FD3F.3D5C76EF" This is a multi-part message in MIME format. ------_=_NextPart_001_01C6FD3F.3D5C76EF Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 I downloaded and installed the net-snmp-5.4.0.pre4-1.win32.exe on WinXP. I tried ...
This is a multi-part message in MIME format.
--===============1424622787==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C6FD3F.3D5C76EF"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C6FD3F.3D5C76EF
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
=20
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:
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
=20
every thing looks fine! I got the tree view of the OID
=20
But... when I turn it into procedure as:
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D
proc expect_translateCmd {oid} {
set outfile [open "translate-1.out" w+]
spawn snmptranslate -m ALL -Tp -OS $oid =20
while (1) {
expect {
eof {
break;
}
"*+*R--" {
puts $outfile "R: $expect_out(buffer)"
}
"*+*RW-" {
puts $outfile "RW: $expect_out(buffer)"
}
}
}
}
close $outfile
=20
(Caller)
......
expect_translateCmd $oid
.....
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D
=20
I never get the tree view and always get the message:
=20
No log handling enabled - turning on stderr logging
=20
What is the different between the two?
=20
Thanks for the reply!!
=20
=20
Jim
------_=_NextPart_001_01C6FD3F.3D5C76EF
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
charset=3Dus-ascii">
class=3D157104022-31102006>Hi,
class=3D157104022-31102006>
I =
downloaded and=20
installed the net-snmp-5.4.0.pre4-1.win32.exe on WinXP. I tried to call=20
snmptranslate from TCL and
use =
EXpect (5.21 for=20
Window) to get the output as follow:
class=3D157104022-31102006>
class=3D157104022-31102006>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
class=3D157104022-31102006> =20
set outfile [open "translate.out" w+]
class=3D157104022-31102006> =20
spawn snmptranslate -m ALL -Tp -OS=20
..iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0
&nbs=
p; =20
while (1) {
expect=20
{
&n=
bsp; =20
eof=20
{
&n=
bsp; =20
break;
&nb=
sp; =20
}
&n=
bsp; =20
"*+*R--"=20
{
&n=
bsp; =20
puts $outfile "R:=20
$expect_out(buffer)"
&=
nbsp; &n=
bsp;=20
}
&n=
bsp; =20
"*+*RW-"=20
{
&n=
bsp; =20
puts $outfile "RW:=20
$expect_out(buffer)"
&=
nbsp; =20
}
&n=
bsp; =20
}
}
}
close=20
$outfile
class=3D157104022-31102006>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
class=3D157104022-31102006>
every =
thing looks=20
fine! I got the tree view of the OID
class=3D157104022-31102006>
But... =
when I turn=20
it into procedure as:
class=3D157104022-31102006>
class=3D157104022-31102006>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
proc=20
expect_translateCmd {oid} {
set outfile [open "translate-1.out" =
w+]
spawn =
snmptranslate=20
-m ALL -Tp=20
-OS $oid
=
while=20
(1) {
expect=20
{
&n=
bsp; =20
eof=20
{
&n=
bsp; =20
break;
&nb=
sp; =20
}
&n=
bsp; =20
"*+*R--"=20
{
&n=
bsp; =20
puts $outfile "R:=20
$expect_out(buffer)"
&=
nbsp; &n=
bsp;=20
}
&n=
bsp; =20
"*+*RW-"=20
{
&n=
bsp; =20
puts $outfile "RW:=20
$expect_out(buffer)"
&=
nbsp; =20
}
&n=
bsp; =20
}
}
}
close=20
$outfile
class=3D157104022-31102006>
class=3D157104022-31102006>(Caller)
class=3D157104022-31102006>.....
class=3D157104022-31102006>expect_translateCmd=20
$oid
class=3D157104022-31102006>....
class=3D157104022-31102006>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
class=3D157104022-31102006>
I =
never get the tree=20
view and always get the message:
class=3D157104022-31102006>
No log =
handling=20
enabled - turning on stderr logging
class=3D157104022-31102006>
What =
is the=20
different between the two?
class=3D157104022-31102006>
Thanks =
for the=20
reply!!
class=3D157104022-31102006>
class=3D157104022-31102006>
class=3D157104022-31102006>Jim
------_=_NextPart_001_01C6FD3F.3D5C76EF--
--===============1424622787==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
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=...057&dat=121642
--===============1424622787==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
--===============1424622787==--