Re:RE: table can't be get and set, var_***Table functin is not

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-...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-31-2007
ye_cl
 
Posts: n/a
Default Re:RE: table can't be get and set, var_***Table functin is not

--===============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>&nbsp;</DIV>
<DIV>hi,Adam Bell,</DIV>
<DIV>&nbsp;</DIV>
<DIV>My columnar&nbsp;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",&nbsp;the last ".1" is the index of row. When I use GUI=
tool "MG-SOFT MIB Browser"to select Instance for getting,&nbsp;the tool pr=
ompt "0 indexes found.".</DIV>
<DIV>node39index is the index of the table.</DIV>
<DIV>Is&nbsp;there&nbsp;any fault in my MIB module? How can I implememnt it=
?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>-- 1.3.6.1.4.1.19176.1.1.20.9.1<BR>node39Table OBJECT-TYPE<BR>&nbsp;SY=
NTAX SEQUENCE OF Node39Entry<BR>&nbsp;MAX-ACCESS not-accessible<BR>&nbsp;ST=
ATUS current<BR>&nbsp;DESCRIPTION<BR>&nbsp;&nbsp;"Descr iption."<BR>&nbsp;::=
=3D { tabletst 1 }<BR></DIV>
<DIV>-- 1.3.6.1.4.1.19176.1.1.20.9.1.1<BR>node39Entry OBJECT-TYPE<BR>&nbsp;=
SYNTAX Node39Entry<BR>&nbsp;MAX-ACCESS not-accessible<BR>&nbsp;STATUS curre=
nt<BR>&nbsp;DESCRIPTION<BR>&nbsp;&nbsp;"Descriptio n."<BR>&nbsp;INDEX { node=
39index }<BR>&nbsp;::=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>&nbsp;MAX-ACCESS read-write<BR>&nbsp;STATUS c=
urrent<BR>&nbsp;DESCRIPTION<BR>&nbsp;&nbsp;"Descri ption."<BR>&nbsp;::=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>&nbsp;MAX-ACCESS read-write<BR>&nbsp;STATUS =
current<BR>&nbsp;DESCRIPTION<BR>&nbsp;&nbsp;"Descr iption."<BR>&nbsp;::=3D {=
node39Entry 2 }<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV ></DIV><BR>=D4=DA2007-08-30=A3=AC"Adam Bell" &lt;abell@safenet-inc.com=
&gt; =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>&nbsp;</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>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D319135112-30082007><FONT face=3DA=
rial color=3D#0000ff size=3D2>table.entry.index&nbsp; 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&nbsp;t o&nbsp;get it=
to work.</DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV>How can I resolve it?</DIV>
<DIV><BR>My source code as follows:</DIV>
<DIV>&nbsp;</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;&nbsp;11<BR>&nbsp;&nbsp;&nbsp; {NODE39INDEX, ASN_INTEGER, RWRITE, var_n=
ode39Table, 7,&nbsp;&nbsp; {1, 1, 20, 9, 1, 1, 1}},<BR>#define NODE39PARAM1=
&nbsp;&nbsp;12<BR>&nbsp;&nbsp;&nbsp; {NODE39PARAM1, ASN_INTEGER, RWRITE, va=
r_node39Table, 7,&nbsp; {1, 1, 20, 9, 1, 1, 2}},<BR>#define NODE39PARAM2&nb=
sp;&nbsp;13<BR>&nbsp;&nbsp;&nbsp; {NODE39PARAM2, ASN_INTEGER, RWRITE, var_n=
ode39Table, 7,&nbsp; {1, 1, 20, 9, 1, 1, 3}},<BR>};<BR></DIV>
<DIV>unsigned char&nbsp; *<BR>var_node39Table(struct variable *vp,<BR>&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; oid * name,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size_t *length,<BR>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp=
; int exact, size_t *var_len, WriteMethod ** write_method)<BR>{<BR>&nbsp;&n=
bsp;&nbsp; static long&nbsp;&nbsp;&nbsp;&nbsp; long_ret;<BR>&nbsp;&nbsp;&nb=
sp; static u_long&nbsp;&nbsp; ulong_ret;<BR>&nbsp;&nbsp;&nbsp; static unsig=
ned char string[SPRINT_MAX_LEN];<BR>&nbsp;&nbsp;&nbsp; static oid&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; objid[MAX_OID_LEN];<BR>&nbsp;&nbsp;&nbsp; static struc=
t counter64 c64;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; printf("var_node39Table\n");</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp; if (header_simple_table<BR>&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; (vp, name, length, exact, var_len, write_method, TAB=
LE_SIZE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp; =3D=3D MATCH_FAILED)=
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("header_simple_table=
failed\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; return NULL;<BR>=
&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; printf("header_simple_table ok\n=
");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nb sp;&nbsp; switch (vp-&gt;=
magic) {<BR>&nbsp;&nbsp;&nbsp; case NODE39INDEX:<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; *write_method =3D write_node39index;<BR>&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; return (u_char *) &amp;table_1;<BR>&nbsp;&nbsp;=
&nbsp; case NODE39PARAM1:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp; *wr=
ite_method =3D write_node39param1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&=
nbsp; return (u_char *)table_2;<BR>&nbsp;&nbsp;&nbsp; case NODE39PARAM2:<BR=
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *write_method =3D write_node39p=

aram2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p; return (u_char *) &amp=
;table_3;<BR>&nbsp;&nbsp;&nbsp; default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; ERROR_MSG("");<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; re=
turn NULL;<BR>}<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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 &gt;&gt;</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==--


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 05:08 AM.


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