why the snmptranslate (also snmpget,

This is a discussion on why the snmptranslate (also snmpget, within the SNMP Users forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --===============1957701946== Content-class: urn:content-classes:message Content-Type: multipart/alternative; ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-02-2006
Chin, Hua-Cheng
 
Posts: n/a
Default why the snmptranslate (also snmpget,

This is a multi-part message in MIME format.

--===============1957701946==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C6FE1A.AF8808C5"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C6FE1A.AF8808C5
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=20
Hi, (PLS instruct me to become a member)=20
=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)
......=20
set oid " .iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0"
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

..iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0 : (0 )=20
"
=20
The only difference is instead of specifying the actual oid, $oid is
use in spawn of the procedure.
=20
Thanks for the reply!!
=20
=20
Jim

------_=_NextPart_001_01C6FE1A.AF8808C5
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT>&nbsp;</DIV>
<DIV></DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2>Hi,<SPAN=20
class=3D778375600-02112006><FONT color=3D#0000ff>&nbsp;&nbsp; =
(PLS&nbsp;instruct=20
me&nbsp;to become a =
member)&nbsp;</FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN 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&nbsp;and</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>use =
EXpect (5.21 for=20
Window) to get the output as follow:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006>=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=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</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D157104022-31102006>&nbsp;&nbsp;&nbsp;=20
set outfile [open "translate.out" w+]</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D157104022-31102006>&nbsp;&nbsp;&nbsp;=20
spawn snmptranslate -m ALL -Tp -OS=20
..iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0<BR>&nbsp;&nbsp;&nbs=
p;&nbsp;=20
while (1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp; expect=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;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;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>}<BR>&nbsp;&nbsp; close=20
$outfile</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006>=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=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>every =
thing looks=20
fine! I got the tree view of the OID</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>But... =
when I turn=20
it into procedure as:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006>=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=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>proc=20
expect_translateCmd {oid} {<BR>&nbsp;set outfile [open "translate-1.out" =

w+]</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>spawn =
snmptranslate=20
-m ALL -Tp=20
-OS&nbsp;$oid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbs p;&nbsp;&nbsp;&nbsp; =
while=20
(1) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp; expect=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
eof=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
"*+*R--"=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;=20
puts $outfile "R:=20
$expect_out(buffer)"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
"*+*RW-"=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;=20
puts $outfile "RW:=20
$expect_out(buffer)"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>}</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>close=20
$outfile</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006>(Caller)</SPAN></FONT></DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2>.....<SPAN=20
class=3D778375600-02112006><FONT=20
color=3D#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2><SPAN=20
class=3D778375600-02112006><FONT color=3D#0000ff>set oid =
"</FONT>&nbsp;<SPAN=20
class=3D157104022-31102006><FONT face=3DArial><FONT=20
size=3D2>.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0"</FONT></FONT=
></SPAN></SPAN></FONT></FONT></SPAN></DIV>

<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D157104022-31102006>expect_translateCmd=20
$oid</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006>....</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006>=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=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>I =
never get the tree=20
view and always get the message:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2><SPAN=20
class=3D778375600-02112006><FONT=20
color=3D#0000ff>&nbsp;"</FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2><SPAN=20
class=3D778375600-02112006>&nbsp;</SPAN>No log handling enabled - =
turning on=20
stderr logging<BR></DIV></FONT></FONT></SPAN>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT=20
size=3D2>.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0 :&nbsp; (0 =
)<SPAN=20
class=3D778375600-02112006><FONT=20
color=3D#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2><SPAN=20
class=3D778375600-02112006>"</SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2><SPAN=20
class=3D778375600-02112006>&nbsp;</SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT =
size=3D2><SPAN=20
class=3D778375600-02112006><FONT color=3D#0000ff>&nbsp;The only =
difference is=20
instead of specifying the actual oid, $oid is use in spawn of the=20
procedure.</FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D157104022-31102006>Thanks =
for the=20
reply!!</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D157104022-31102006>Jim</DIV></SPAN></FONT></BODY></HTML>

------_=_NextPart_001_01C6FE1A.AF8808C5--


--===============1957701946==
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
--===============1957701946==
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

--===============1957701946==--

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:49 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0