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

This is a discussion on RE: table can't be get and set, var_***Table functin is not invok within the SNMP Users forums, part of the Networking and Network Related category; This message is in MIME format. Since your mail reader does not understand this format, some or all of this ...


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-30-2007
Adam Bell
 
Posts: n/a
Default RE: table can't be get and set, var_***Table functin is not invok

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--===============1732512727==
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C7EB04.ACCC1BB8"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C7EB04.ACCC1BB8
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

Looks=20like=20you=20may=20be=20indexing=20it=20wr ong.
=20
to=20access=20an=20item
=20
table.entry.index=20=20the=20index=20can=20be=20th e=20column=20number=20or=
=20whatever=20the=20index
is=20defines=20as=20for=20that=20table.
So=20it=20may=20be
SNMPv2-SMI::enterprises.19176.1.1.20.9.1.1.2.1.1.x=20to=2 0get=20it=20to=20=
work.
=20
Adam

=20=20_____=20=20

From:=20net-snmp-users-bounces@lists.sourceforge.net
[mailto:net-snmp-users-bounces@lists.sourceforge.net]=20On=20Behalf=20Of=20=
ye_cl
Sent:=20Thursday,=20August=2030,=202007=202:16=20A M
To:=20net-snmp-users
Subject:=20table=20can't=20be=20get=20and=20set,=2 0var_***Table=20functin=20=
is=20not=20invoked
anyway


Hi,

I=20have=20a=20question=20to=20ask=20you.
In=20my=20mib2c-produced=20skeleton=20source=20files=20which=20are =20style=
=20of=20ucd-snmp,=20I
can't=20get=20or=20set=20the=20node=20of=20Simple= 20table.=20It=20always=20=
responds=20"1:
node39param1.1=20(nosuchobject)=20no=20such=20obje ct".=20I=20find=20the=20=
table's=20get
function=20"var_node39Table"=20is=20not=20invoked= 20anyway
=20
When=20I=20run=20"snmptable=20-v2c=20-c=20public=20200.162.162.190=20.1.3.=
6.1.4.1.19176.1.1.
20.9.1.1.2.1",=20the=20agent=20always=20responds=2 0"Was=20that=20a=20table=
?
SNMPv2-SMI::enterprises.19176.1.1.20.9.1.1.2.1".
=20
How=20can=20I=20resolve=20it?

My=20source=20code=20as=20follows:
=20
static=20long=20table_1=20=3D=20123;
static=20long=20table_2=20=3D=20223;
static=20long=20table_3=20=3D=20323;
struct=20variable13=20scomcenter_variables[]=20=3D=20{
.......
#define=20NODE39INDEX=20=2011
=20=20=20=20{NODE39INDEX,=20ASN_INTEGER,=20RWRITE, =20var_node39Table,=207,=
=20=20=20{1,=201,=2020,=209,
1,=201,=201}},
#define=20NODE39PARAM1=20=2012
=20=20=20=20{NODE39PARAM1,=20ASN_INTEGER,=20RWRITE ,=20var_node39Table,=207=
,=20=20{1,=201,=2020,=209,
1,=201,=202}},
#define=20NODE39PARAM2=20=2013
=20=20=20=20{NODE39PARAM2,=20ASN_INTEGER,=20RWRITE ,=20var_node39Table,=207=
,=20=20{1,=201,=2020,=209,
1,=201,=203}},
};

unsigned=20char=20=20*
var_node39Table(struct=20variable=20*vp,
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20oi d=20*=20name,
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20si ze_t=20*length,
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20in t=20exact,=20size_t=20*v=
ar_len,=20WriteMethod=20**=20write_method)
{
=20=20=20=20static=20long=20=20=20=20=20long_ret;
=20=20=20=20static=20u_long=20=20=20ulong_ret;
=20=20=20=20static=20unsigned=20char=20string[SPRINT_MAX_LEN];
=20=20=20=20static=20oid=20=20=20=20=20=20objid[MAX_OID_LEN];
=20=20=20=20static=20struct=20counter64=20c64;
=20
=20=20=20=20printf("var_node39Table\n");

=20=20=20=20if=20(header_simple_table
=20=20=20=20=20=20=20=20(vp,=20name,=20length,=20e xact,=20var_len,=20write=
_method,=20TABLE_SIZE)
=20=20=20=20=20=20=20=20=3D=3D=20MATCH_FAILED){
=20=20=20=20=20=20=20=20printf("header_simple_tabl e=20failed\n");
=20=20=20=20=20=20=20=20return=20NULL;
=20=20=20=20=20}
=20=20=20printf("header_simple_table=20ok\n");
=20=20=20=20=20
=20=20=20=20switch=20(vp->magic)=20{
=20=20=20=20case=20NODE39INDEX:
=20=20=20=20=20=20=20=20*write_method=20=3D=20writ e_node39index;
=20=20=20=20=20=20=20=20return=20(u_char=20*)=20&t able_1;
=20=20=20=20case=20NODE39PARAM1:
=20=20=20=20=20=20=20=20*write_method=20=3D=20writ e_node39param1;
=20=20=20=20=20=20=20=20return=20(u_char=20*)table _2;
=20=20=20=20case=20NODE39PARAM2:
=20=20=20=20=20=20=20=20*write_method=20=3D=20writ e_node39param2;
=20=20=20=20=20=20=20=20return=20(u_char=20*)=20&t able_3;
=20=20=20=20default:
=20=20=20=20=20=20=20=20ERROR_MSG("");
=20=20=20=20}
=20=20=20=20return=20NULL;
}

=20
=20
=20


=20=20_____=20=20

=20<http://event.mail.163.com/chanel/click.htm?from=3DNO_17&domain=3D163>=20=
2007=20=C4=EA
=D7=EE=20=CA=DC=20=C6=DA=20=B4=FD=20=B4=F3=20=D0=C D=20=CD=F8=20=D3=CE=20=A1=
=B6=B4=F3=20=BB=B0=20=CE=F7=20=D3=CE=203=A1=B7=D5= F0=20=BA=B3=20=B9=AB=20=B2=
=E2=A3=A1=20=B5=E3=20=B4=CB=20=C7=C0=20=CF=C8=20=C 3=E2=20=B7=D1=20=CC=E5
=D1=E9=20>>=20

The=20information=20contained=20in=20this=20electr onic=20mail=20transmissi=
on=20may=20be=20privileged=20and=20confidential,=2 0and=20therefore,=20prot=
ected=20from=20disclosure.=20If=20you=20have=20rec eived=20this=20communica=
tion=20in=20error,=20please=20notify=20us=20immedi ately=20by=20replying=20=
to=20this=20message=20and=20deleting=20it=20from=2 0your=20computer=20witho=
ut=20copying=20or=20disclosing=20it.
------_=_NextPart_001_01C7EB04.ACCC1BB8
Content-Type: text/html;
charset="gb2312"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">


<META content="MSHTML 6.00.2900.3157" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=319135112-30082007><FONT face=Arial
color=#0000ff size=2>Looks like you may be indexing it
wrong.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=319135112-30082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=319135112-30082007><FONT face=Arial
color=#0000ff size=2>to access an item</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=319135112-30082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=319135112-30082007><FONT face=Arial
color=#0000ff size=2>table.entry.index&nbsp; the index can be the column number
or whatever the index is defines as for that table.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=319135112-30082007><FONT face=Arial
color=#0000ff size=2>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=Arial color=#0000ff size=2>Adam</FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
net-snmp-users-bounces@lists.sourceforge.net
[mailto:net-snmp-users-bounces@lists.sourceforge.net] <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 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</DIV>
<DIV>&nbsp;</DIV>
<DIV>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".</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 = 123;</DIV>
<DIV>static long table_2 = 223;<BR>static long table_3 = 323;<BR>struct
variable13 scomcenter_variables[] = {<BR>......<BR>#define
NODE39INDEX&nbsp;&nbsp;11<BR>&nbsp;&nbsp;&nbsp; {NODE39INDEX, ASN_INTEGER,
RWRITE, var_node39Table, 7,&nbsp;&nbsp; {1, 1, 20, 9, 1, 1, 1}},<BR>#define
NODE39PARAM1&nbsp;&nbsp;12<BR>&nbsp;&nbsp;&nbsp; {NODE39PARAM1, ASN_INTEGER,
RWRITE, var_node39Table, 7,&nbsp; {1, 1, 20, 9, 1, 1, 2}},<BR>#define
NODE39PARAM2&nbsp;&nbsp;13<BR>&nbsp;&nbsp;&nbsp; {NODE39PARAM2, ASN_INTEGER,
RWRITE, var_node39Table, 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;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;
int exact, size_t *var_len, WriteMethod **
write_method)<BR>{<BR>&nbsp;&nbsp;&nbsp; static long&nbsp;&nbsp;&nbsp;&nbsp;
long_ret;<BR>&nbsp;&nbsp;&nbsp; static u_long&nbsp;&nbsp;
ulong_ret;<BR>&nbsp;&nbsp;&nbsp; static unsigned char
string[SPRINT_MAX_LEN];<BR>&nbsp;&nbsp;&nbsp; static
oid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objid[MAX_OID_LEN];<BR>&nbsp;&nbsp;&nbsp;
static struct 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;&nbsp;&n bsp;&nbsp;&nbsp; (vp, name,
length, exact, var_len, write_method,
TABLE_SIZE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; ==
MATCH_FAILED){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&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 ;&nbsp;&nbsp; switch
(vp-&gt;magic) {<BR>&nbsp;&nbsp;&nbsp; case
NODE39INDEX:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp; *write_method =
write_node39index;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp; return (u_char
*) &amp;table_1;<BR>&nbsp;&nbsp;&nbsp; case
NODE39PARAM1:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp; *write_method =
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;&nb sp;&nbsp; *write_method =
write_node39param2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; return (u_char
*) &amp;table_3;<BR>&nbsp;&nbsp;&nbsp;
default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;
ERROR_MSG("");<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return
NULL;<BR>}<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV><BR><!-- footer --><BR>
<HR>
<A
style="FONT-SIZE: 14px; COLOR: #000; LINE-HEIGHT: 15px; TEXT-DECORATION: none"
href="http://event.mail.163.com/chanel/click.htm?from=NO_17&amp;domain=163"
target=_blank><SPAN style="COLOR: blue; TEXT-DECORATION: underline">2007 年 最 受 期
待 大 型 网 游 《大 话 西 游 3》震 撼 公 测! 点 此 抢 先 免 费 体 验 &gt;&gt;</SPAN> </A>
<BR>
The information contained in this electronic mail transmission may be privileged and confidential, and therefore, protected from disclosure. If you have received this communication in error, please notify us immediately by replying to this message and deleting it from your computer without copying or disclosing it.<BR>
</BODY></HTML>


------_=_NextPart_001_01C7EB04.ACCC1BB8--


--===============1732512727==
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/
--===============1732512727==
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

--===============1732512727==--

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 03:14 AM.


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