This is a discussion on Re:RE: table can't be get and set, var_***Table functin is not within the SNMP Users forums, part of the Networking and Network Related category; --===============0807814652== Content-Type: multipart/Alternative; boundary="----=_Part_25993_19338061.1188541837207" ------=_Part_25993_19338061.1188541837207 Content-Type: text/plain; charset=gbk Content-Transfer-...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============0807814652==
Content-Type: multipart/Alternative; boundary="----=_Part_25993_19338061.1188541837207" ------=_Part_25993_19338061.1188541837207 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: quoted-printable hi,Adam Bell, My columnar node39param1's oid is 1.3.6.1.4.1.19176.1.1.20.9= ..1.1.2.In command "snmptable -v2c -c public 200.162.162.190 .1.3.6.1.4.1.19= 176.1.1.20.9.1.1.2.1", the last ".1" is the index of row. When I use GUI to= ol "MG-SOFT MIB Browser"to select Instance for getting, the tool prompt "0 = indexes found.".node39index is the index of the table.Is there any fault in= my MIB module? How can I implememnt it? -- 1.3.6.1.4.1.19176.1.1.20.9.1 node39Table OBJECT-TYPE SYNTAX SEQUENCE OF Node39Entry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Description." ::=3D { tabletst 1 } -- 1.3.6.1.4.1.19176.1.1.20.9.1.1 node39Entry OBJECT-TYPE SYNTAX Node39Entry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Description." INDEX { node39index } ::=3D { node39Table 1 } -- 1.3.6.1.4.1.19176.1.1.20.9.1.1.1 node39index OBJECT-TYPE SYNTAX INTEGER (1..1000) MAX-ACCESS read-write STATUS current DESCRIPTION "Description." ::=3D { node39Entry 1 } -- 1.3.6.1.4.1.19176.1.1.20.9.1.1.2 node39param1 OBJECT-TYPE SYNTAX INTEGER (0..1000) MAX-ACCESS read-write STATUS current DESCRIPTION "Description." ::=3D { node39Entry 2 } =20 =D4=DA2007-08-30=A3=AC"Adam Bell" <abell@safenet-inc.com> =D0=B4=B5=C0=A3= =BA Looks like you may be indexing it wrong. to access an item table.entry.inde= x the index can be the column number or whatever the index is defines as f= or that table.So it may beSNMPv2-SMI::enterprises.19176.1.1.20.9.1.1.2.1.1.= x to get it to work. Adam From:net-snmp-users-bounces@lists.sourceforge.net [mailto:net-snmp-users-bo= unces@lists.sourceforge.net]On Behalf Ofye_cl Sent: Thursday, August 30, 2007 2:16 AM To: net-snmp-users Subject: table can't be get and set, var_***Table functin is not invoked an= yway Hi, I have a question to ask you. In my mib2c-produced skeleton source files which are style of ucd-snmp, I c= an't get or set the node of Simple table. It always responds "1: node39para= m1.1 (nosuchobject) no such object". I find the table's get function "var_n= ode39Table" is not invoked anyway When I run "snmptable -v2c -c public 200.= 162.162.190 .1.3.6.1.4.1.19176.1.1.20.9.1.1.2.1", the agent always responds= "Was that a table? SNMPv2-SMI::enterprises.19176.1.1.20.9.1.1.2.1". How ca= n I resolve it? My source code as follows: static long table_1 =3D 123;static long table_2 = =3D 223; static long table_3 =3D 323; struct variable13 scomcenter_variables[] =3D { ....... #define NODE39INDEX 11 {NODE39INDEX, ASN_INTEGER, RWRITE, var_node39Table, 7, {1, 1, 20, 9, = 1, 1, 1}}, #define NODE39PARAM1 12 {NODE39PARAM1, ASN_INTEGER, RWRITE, var_node39Table, 7, {1, 1, 20, 9, = 1, 1, 2}}, #define NODE39PARAM2 13 {NODE39PARAM2, ASN_INTEGER, RWRITE, var_node39Table, 7, {1, 1, 20, 9, = 1, 1, 3}}, }; unsigned char * var_node39Table(struct variable *vp, oid * name, size_t *length, int exact, size_t *var_len, WriteMethod ** write_method) { static long long_ret; static u_long ulong_ret; static unsigned char string[SPRINT_MAX_LEN]; static oid objid[MAX_OID_LEN]; static struct counter64 c64; printf("var_node39Table\n"); if (header_simple_table (vp, name, length, exact, var_len, write_method, TABLE_SIZE) =3D=3D MATCH_FAILED){ printf("header_simple_table failed\n"); return NULL; } printf("header_simple_table ok\n"); =20 switch (vp->magic) { case NODE39INDEX: *write_method =3D write_node39index; return (u_char *) &table_1; case NODE39PARAM1: *write_method =3D write_node39param1; return (u_char *)table_2; case NODE39PARAM2: *write_method =3D write_node39param2; return (u_char *) &table_3; default: ERROR_MSG(""); } return NULL; } =20 2007 =C4=EA =D7=EE =CA=DC =C6=DA =B4=FD =B4=F3 =D0=CD =CD=F8 =D3=CE =A1=B6= =B4=F3 =BB=B0 =CE=F7 =D3=CE 3=A1=B7=D5=F0 =BA=B3 =B9=AB =B2=E2=A3=A1 =B5=E3= =B4=CB =C7=C0 =CF=C8 =C3=E2 =B7=D1 =CC=E5 =D1=E9 >> The information contained in this electronic mail transmission may be privi= leged and confidential, and therefore, protected from disclosure. If you ha= ve received this communication in error, please notify us immediately by re= plying to this message and deleting it from your computer without copying o= r disclosing it. ------=_Part_25993_19338061.1188541837207 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable <DIV> </DIV> <DIV>hi,Adam Bell,</DIV> <DIV> </DIV> <DIV>My columnar node39param1's oid is 1.3.6.1.4.1.19176.1.1.20.9.1.1.= 2.</DIV> <DIV>In command "snmptable -v2c -c public 200.162.162.190 .1.3.6.1.4.1.1917= 6.1.1.20.9.1.1.2.1", the last ".1" is the index of row. When I use GUI= tool "MG-SOFT MIB Browser"to select Instance for getting, the tool pr= ompt "0 indexes found.".</DIV> <DIV>node39index is the index of the table.</DIV> <DIV>Is there any fault in my MIB module? How can I implememnt it= ?</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>-- 1.3.6.1.4.1.19176.1.1.20.9.1<BR>node39Table OBJECT-TYPE<BR> SY= NTAX SEQUENCE OF Node39Entry<BR> MAX-ACCESS not-accessible<BR> ST= ATUS current<BR> DESCRIPTION<BR> "Descr iption."<BR> ::= =3D { tabletst 1 }<BR></DIV> <DIV>-- 1.3.6.1.4.1.19176.1.1.20.9.1.1<BR>node39Entry OBJECT-TYPE<BR> = SYNTAX Node39Entry<BR> MAX-ACCESS not-accessible<BR> STATUS curre= nt<BR> DESCRIPTION<BR> "Descriptio n."<BR> INDEX { node= 39index }<BR> ::=3D { node39Table 1 }<BR></DIV> <DIV>-- 1.3.6.1.4.1.19176.1.1.20.9.1.1.1<BR>node39index OBJECT-TYPE<BR>&nbs= p;SYNTAX INTEGER (1..1000)<BR> MAX-ACCESS read-write<BR> STATUS c= urrent<BR> DESCRIPTION<BR> "Descri ption."<BR> ::=3D { = node39Entry 1 }<BR></DIV> <DIV>-- 1.3.6.1.4.1.19176.1.1.20.9.1.1.2<BR>node39param1 OBJECT-TYPE<BR>&nb= sp;SYNTAX INTEGER (0..1000)<BR> MAX-ACCESS read-write<BR> STATUS = current<BR> DESCRIPTION<BR> "Descr iption."<BR> ::=3D {= node39Entry 2 }<BR></DIV> <DIV> </DIV> <DIV> </DIV> <DIV ></DIV><BR>=D4=DA2007-08-30=A3=AC"Adam Bell" <abell@safenet-inc.com= > =D0=B4=B5=C0=A3=BA<BR> <BLOCKQUOTE id=3DisReplyContent style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0px= 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <DIV dir=3Dltr align=3Dleft><SPAN class=3D319135112-30082007><FONT face=3DA= rial color=3D#0000ff size=3D2>Looks like you may be indexing it wrong.</FON= T></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D319135112-30082007><FONT face=3DA= rial color=3D#0000ff size=3D2></FONT></SPAN> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D319135112-30082007><FONT face=3DA= rial color=3D#0000ff size=3D2>to access an item</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D319135112-30082007><FONT face=3DA= rial color=3D#0000ff size=3D2></FONT></SPAN> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D319135112-30082007><FONT face=3DA= rial color=3D#0000ff size=3D2>table.entry.index the index can be the = column number or whatever the index is defines as for that table.</FONT></S= PAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D319135112-30082007><FONT face=3DA= rial color=3D#0000ff size=3D2>So it may be</FONT></SPAN></DIV> <DIV>SNMPv2-SMI::enterprises.19176.1.1.20.9.1.1.2.1.1.x t o get it= to work.</DIV> <DIV> </DIV> <DIV><FONT face=3DArial color=3D#0000ff size=3D2>Adam</FONT><BR></DIV> <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> <A href=3D"mailto:net-snmp-users-= bounces@lists.sourceforge.net">net-s...ourceforge.net= </A> [mailto:<A href=3D"mailto:net-snmp-users-bounces@lists.sourceforge.net= ">net-snmp-users-bounces@lists.sourceforge.net</A>] <B>On Behalf Of </B>ye_= cl<BR><B>Sent:</B> Thursday, August 30, 2007 2:16 AM<BR><B>To:</B> net-snmp= -users<BR><B>Subject:</B> table can't be get and set, var_***Table functin = is not invoked anyway<BR></FONT><BR></DIV> <DIV></DIV> <DIV>Hi,</DIV> <DIV><BR>I have a question to ask you.<BR>In my mib2c-produced skeleton sou= rce files which are style of ucd-snmp, I can't get or set the node of Simpl= e table. It always responds "1: node39param1.1 (nosuchobject) no such objec= t". I find the table's get function "var_node39Table" is not invoked anyway= </DIV> <DIV> </DIV> <DIV>When I run "snmptable -v2c -c public 200.162.162.190 .1.3.6.1.4.1.1917= 6.1.1.20.9.1.1.2.1", the agent always responds "Was that a table? SNMPv2-SM= I::enterprises.19176.1.1.20.9.1.1.2.1".</DIV> <DIV> </DIV> <DIV>How can I resolve it?</DIV> <DIV><BR>My source code as follows:</DIV> <DIV> </DIV> <DIV>static long table_1 =3D 123;</DIV> <DIV>static long table_2 =3D 223;<BR>static long table_3 =3D 323;<BR>struct= variable13 scomcenter_variables[] =3D {<BR>......<BR>#define NODE39INDEX&n= bsp; 11<BR> {NODE39INDEX, ASN_INTEGER, RWRITE, var_n= ode39Table, 7, {1, 1, 20, 9, 1, 1, 1}},<BR>#define NODE39PARAM1= 12<BR> {NODE39PARAM1, ASN_INTEGER, RWRITE, va= r_node39Table, 7, {1, 1, 20, 9, 1, 1, 2}},<BR>#define NODE39PARAM2&nb= sp; 13<BR> {NODE39PARAM2, ASN_INTEGER, RWRITE, var_n= ode39Table, 7, {1, 1, 20, 9, 1, 1, 3}},<BR>};<BR></DIV> <DIV>unsigned char *<BR>var_node39Table(struct variable *vp,<BR> = ; & nbsp; &n= bsp; oid * name,<BR>   ; &= nbsp; size_t *length,<BR> &n= bsp; &nbs p;  = ; int exact, size_t *var_len, WriteMethod ** write_method)<BR>{<BR> &n= bsp; static long long_ret;<BR> &nb= sp; static u_long ulong_ret;<BR> static unsig= ned char string[SPRINT_MAX_LEN];<BR> static oid &nbs= p; objid[MAX_OID_LEN];<BR> static struc= t counter64 c64;</DIV> <DIV> </DIV> <DIV> printf("var_node39Table\n");</DIV> <DIV><BR> if (header_simple_table<BR> &n= bsp; (vp, name, length, exact, var_len, write_method, TAB= LE_SIZE)<BR> &n bsp; =3D=3D MATCH_FAILED)= {<BR> printf("header_simple_table= failed\n");<BR>   ; return NULL;<BR>= }<BR> printf("header_simple_table ok\n= ");<BR> <BR> &nb sp; switch (vp->= magic) {<BR> case NODE39INDEX:<BR>  = ; *write_method =3D write_node39index;<BR> &nb= sp; return (u_char *) &table_1;<BR> = case NODE39PARAM1:<BR> &nb sp; *wr= ite_method =3D write_node39param1;<BR> &nb sp; &= nbsp; return (u_char *)table_2;<BR> case NODE39PARAM2:<BR= > *write_method =3D write_node39p= aram2;<BR> &nbs p; return (u_char *) &= ;table_3;<BR> default:<BR> &= nbsp; ERROR_MSG("");<BR> }<BR> re= turn NULL;<BR>}<BR></DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV><BR><!-- footer --><BR> <HR> <A style=3D"FONT-SIZE: 14px; COLOR: #000; LINE-HEIGHT: 15px; TEXT-DECORATIO= N: none" href=3D"http://event.mail.163.com/chanel/click.htm?from=3DNO_17&am= p;domain=3D163" target=3D_blank><SPAN style=3D"COLOR: blue; TEXT-DECORATION= : underline">2007 =C4=EA =D7=EE =CA=DC =C6=DA =B4=FD =B4=F3 =D0=CD =CD=F8 = =D3=CE =A1=B6=B4=F3 =BB=B0 =CE=F7 =D3=CE 3=A1=B7=D5=F0 =BA=B3 =B9=AB =B2=E2= =A3=A1 =B5=E3 =B4=CB =C7=C0 =CF=C8 =C3=E2 =B7=D1 =CC=E5 =D1=E9 >></SP= AN> </A><BR>The information contained in this electronic mail transmission = may be privileged and confidential, and therefore, protected from disclosur= e. If you have received this communication in error, please notify us immed= iately by replying to this message and deleting it from your computer witho= ut copying or disclosing it.<BR></BLOCKQUOTE> ------=_Part_25993_19338061.1188541837207-- --===============0807814652== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --===============0807814652== 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 --===============0807814652==-- |