This is a discussion on table can't be get and set, var_***Table functin is not invoked anyway within the SNMP Users forums, part of the Networking and Network Related category; --===============0868981567== Content-Type: multipart/Alternative; boundary="----=_Part_80698_4324422.1188454561445" ------=_Part_80698_4324422.1188454561445 Content-Type: text/plain; charset=gbk Content-Transfer-...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============0868981567==
Content-Type: multipart/Alternative; boundary="----=_Part_80698_4324422.1188454561445" ------=_Part_80698_4324422.1188454561445 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Hi, I have a question to ask you. In my mib2c-produced skeleton source files which are style of ucd-snmp, I can't get or set the node of Simple table. It always responds "1: node39param1.1 (nosuchobject) no such object". I find the table's get function "var_node39Table" 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 can I resolve it? My source code as follows: static long table_1 = 123;static long table_2 = 223; static long table_3 = 323; struct variable13 scomcenter_variables[] = { ...... #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) == MATCH_FAILED){ printf("header_simple_table failed\n"); return NULL; } printf("header_simple_table ok\n"); switch (vp->magic) { case NODE39INDEX: *write_method = write_node39index; return (u_char *) &table_1; case NODE39PARAM1: *write_method = write_node39param1; return (u_char *)table_2; case NODE39PARAM2: *write_method = write_node39param2; return (u_char *) &table_3; default: ERROR_MSG(""); } return NULL; } ------=_Part_80698_4324422.1188454561445 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable <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;line-height:15px; color:#000; text-decoration:no= ne" href=3D"http://event.mail.163.com/chanel/click.htm?from=3DNO_17&domain= =3D163" target=3D"_blank"><span style=3D"text-decoration:underline; color:b= lue">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 >></span> </a> ------=_Part_80698_4324422.1188454561445-- --===============0868981567== 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/ --===============0868981567== 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 --===============0868981567==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|