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; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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> </DIV> <DIV></DIV> <DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT = size=3D2>Hi,<SPAN=20 class=3D778375600-02112006><FONT color=3D#0000ff> = (PLS instruct=20 me to become a = member) </FONT></SPAN></FONT></FONT></SPAN></DIV> <DIV><FONT face=3DArial size=3D2><SPAN=20 class=3D157104022-31102006></SPAN></FONT> </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 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> </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> =20 set outfile [open "translate.out" w+]</SPAN></FONT></DIV> <DIV><FONT face=3DArial size=3D2><SPAN = class=3D157104022-31102006> =20 spawn snmptranslate -m ALL -Tp -OS=20 ..iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0<BR> &nbs= p; =20 while (1) {<BR> &nb sp; expect=20 {<BR> &nb sp; &n= bsp; =20 eof=20 {<BR> &nb sp; &n= bsp; &nbs p; =20 break;<BR> &nbs p; &nb= sp;   ; =20 }<BR> &nb sp; &n= bsp; =20 "*+*R--"=20 {<BR> &nb sp; &n= bsp; &nbs p; =20 puts $outfile "R:=20 $expect_out(buffer)"<BR> &n bsp; &= nbsp; &nb sp; &n= bsp;=20 }<BR> &nb sp; &n= bsp; =20 "*+*RW-"=20 {<BR> &nb sp; &n= bsp; &nbs p; =20 puts $outfile "RW:=20 $expect_out(buffer)"<BR> &n bsp; &= nbsp; &nb sp; =20 }<BR> &nb sp; &n= bsp; =20 }<BR> }<BR>}<BR> 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> </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> </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> </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> 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 $oid <BR>&nbs p; = while=20 (1) {<BR> &nb sp; expect=20 {<BR> &nb sp; &n= bsp; =20 eof=20 {<BR> &nb sp; &n= bsp; &nbs p; =20 break;<BR> &nbs p; &nb= sp;   ; =20 }<BR> &nb sp; &n= bsp; =20 "*+*R--"=20 {<BR> &nb sp; &n= bsp; &nbs p; =20 puts $outfile "R:=20 $expect_out(buffer)"<BR> &n bsp; &= nbsp; &nb sp; &n= bsp;=20 }<BR> &nb sp; &n= bsp; =20 "*+*RW-"=20 {<BR> &nb sp; &n= bsp; &nbs p; =20 puts $outfile "RW:=20 $expect_out(buffer)"<BR> &n bsp; &= nbsp; &nb sp; =20 }<BR> &nb sp; &n= bsp; =20 }<BR> }<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> </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> </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> <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> </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> </DIV> <DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT = size=3D2><SPAN=20 class=3D778375600-02112006><FONT=20 color=3D#0000ff> "</FONT></SPAN></FONT></FONT></SPAN></DIV> <DIV><SPAN class=3D157104022-31102006><FONT face=3DArial><FONT = size=3D2><SPAN=20 class=3D778375600-02112006> </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 : (0 = )<SPAN=20 class=3D778375600-02112006><FONT=20 color=3D#0000ff> </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> </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> 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> </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> </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>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==-- |