Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

processing of the multi varbinds in one snmpset command

70 views
Skip to first unread message

EYRE Bernadette

unread,
Mar 19, 2009, 4:36:48 PM3/19/09
to
This is a multi-part message in MIME format.

--===============1135095994117475074==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C9A8D1.EDB91D73"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C9A8D1.EDB91D73
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hello All,

if the snmpset command line has multiple varbinds (variables) to modify =
for the same table
and the same row (index), how can one ensures that all vars are =
processed in one request
struct?

Here is simple case of what I do and have:
I use snmpset command to set a variable but I also have to pass =
RowStatus value on the same line
with same request.=20

here is an example of the snmpset command:
snmpset -v 2c -c private localhost myvariable.1 s "hello" myRowStatus.1 =
i 2

this command is passed to the sub-agent in two netsnmp_request_info =
structs.
The 1st has the two varbinds the last request has only the last varbind.

In my sub-agent registered handler I have the following code:

int aSubagent_OID_handler( netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{

int ret =3D SNMP_ERR_NOERROR;
netsnmp_request_info *request;
netsnmp_variable_list *vars;

for (request =3D requests; request; request =3D request->next)
{
vars =3D request->requestvb;
for (var =3D vars; var; var =3D var->next_variable)=20
{
/* check the mode and process */

}
}

}

The spliting of the varbinds in the above fashion
confuses the sub-agent code since it is already processed the 1st =
request
with both varbinds and then it has
to process the last request, only the last one is incomplete and it is a =
subset of the first.

Is there any way that one can flag the varbind (perhaps in =
netsnmp_variable_list struct )
as processed, once it has been dealt with?


I'm using 5.4.2 release on linux.

Alternatively, and more robustly, is there any way or option to instruct =
snmpset/netsnmp master agent to intelligently
group the varbinds that belong to the same table same index=20
in one netsnmp_request_info struct? =20

I am doing something wrong here or looking at things in wrong way?

your replies and feedback are always appreciated

Bernadette

------_=_NextPart_001_01C9A8D1.EDB91D73
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7651.59">
<TITLE>processing of the multi varbinds in one snmpset command</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=3D2>Hello All,<BR>
<BR>
if the snmpset command line has multiple varbinds (variables) to modify =
for the same table<BR>
and the same row (index), how can one ensures that all vars are =
processed in one request<BR>
struct?<BR>
<BR>
Here is simple case of what I do and have:<BR>
I use snmpset command to set a variable but I also have to pass =
RowStatus value on the same line<BR>
with same request.<BR>
<BR>
here is an example of the snmpset command:<BR>
snmpset -v 2c -c private localhost myvariable.1 s &quot;hello&quot; =
myRowStatus.1 i 2<BR>
<BR>
this command is passed to the sub-agent in two netsnmp_request_info =
structs.<BR>
The 1st has the two varbinds the last request has only the last =
varbind.<BR>
<BR>
In my sub-agent registered handler I have the following code:<BR>
<BR>
int aSubagent_OID_handler( netsnmp_mib_handler *handler,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; netsnmp_handler_registration *reginfo,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; netsnmp_agent_request_info *reqinfo,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; netsnmp_request_info *requests)<BR>
{<BR>
<BR>
&nbsp;&nbsp; int ret =3D SNMP_ERR_NOERROR;<BR>
&nbsp;&nbsp; netsnmp_request_info *request;<BR>
&nbsp;&nbsp; netsnmp_variable_list *vars;<BR>
<BR>
&nbsp; for (request =3D requests; request; request =3D =
request-&gt;next)<BR>
&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vars =3D request-&gt;requestvb;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var =3D vars; var; var =3D =
var-&gt;next_variable)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* check the mode =
and process */<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp; }<BR>
<BR>
}<BR>
<BR>
The spliting of the varbinds in the above fashion<BR>
confuses the sub-agent code since it is already processed the 1st =
request<BR>
with both varbinds and then it has<BR>
to process the last request, only the last one is incomplete and it is a =
subset of the first.<BR>
<BR>
Is there any way that one can flag the varbind (perhaps in =
netsnmp_variable_list struct )<BR>
as processed, once it has been dealt with?<BR>
<BR>
<BR>
I'm using 5.4.2 release on linux.<BR>
<BR>
Alternatively, and more robustly, is there any way or option to instruct =
snmpset/netsnmp master agent to intelligently<BR>
group the varbinds that belong to the same table same index<BR>
in one netsnmp_request_info struct?&nbsp;&nbsp;<BR>
<BR>
I am doing something wrong here or looking at things in wrong way?<BR>
<BR>
your replies and feedback are always appreciated<BR>
<BR>
Bernadette</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C9A8D1.EDB91D73--


--===============1135095994117475074==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--===============1135095994117475074==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snm...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

--===============1135095994117475074==--

Dave Shield

unread,
Mar 20, 2009, 6:45:45 AM3/20/09
to
2009/3/19 EYRE Bernadette <Bernade...@alcatel-lucent.com>:
> if the snmpset command line has multiple varbinds (variables) to modify for
> the same table
> and the same row (index), how can one ensures that all vars are processed in
> one request struct?

That's the reason that SET requests are processed in multiple passes.
Have a look at the file AGENT.txt, for a description of one possible
approach.

It might also be worth searching the mailing list archives - I'm pretty sure
that I've explained this sort of thing before.
(a quick search throws up a thread on the -users list from 10th Feb,
entitled"Parsing Get/Set Requests in Table_Handler". That looks relevant)


Dave

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com

Bell, Adam

unread,
Mar 20, 2009, 7:33:03 AM3/20/09
to
This is a multi-part message in MIME format.

--===============1033519352097169968==


Content-class: urn:content-classes:message
Content-Type: multipart/alternative;

boundary="----_=_NextPart_001_01C9A94F.4E203F60"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C9A94F.4E203F60


Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I actually submitted code for multi-varbind processing using the table =
iterator approach last year too.

Adam


-----Original Message-----
From: Dave Shield [mailto:D.T.S...@liverpool.ac.uk]
Sent: Fri 3/20/2009 6:44 AM
To: EYRE Bernadette
Cc: net-snm...@lists.sourceforge.net
Subject: Re: processing of the multi varbinds in one snmpset command
=20
2009/3/19 EYRE Bernadette <Bernade...@alcatel-lucent.com>:
> if the snmpset command line has multiple varbinds (variables) to =
modify for
> the same table

> and the same row (index), how can one ensures that all vars are =


processed in
> one request struct?

That's the reason that SET requests are processed in multiple passes.
Have a look at the file AGENT.txt, for a description of one possible
approach.

It might also be worth searching the mailing list archives - I'm pretty =


sure
that I've explained this sort of thing before.
(a quick search throws up a thread on the -users list from 10th Feb,

entitled"Parsing Get/Set Requests in Table_Handler". That looks =
relevant)


Dave

-------------------------------------------------------------------------=


-----
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and

easily build your RIAs with Flex Builder, the Eclipse(TM)based =


development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Net-snmp-coders mailing list
Net-snm...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


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.

=0D
------_=_NextPart_001_01C9A94F.4E203F60


Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =

6.5.7653.38">
<TITLE>RE: processing of the multi varbinds in one snmpset =


command</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=3D2>I actually submitted code for multi-varbind processing =
using the table iterator approach last year too.<BR>
<BR>
Adam<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Dave Shield [<A =
HREF=3D"mailto:D.T.S...@liverpool.ac.uk">mailto:D.T.S...@liverpool.ac=
.uk</A>]<BR>
Sent: Fri 3/20/2009 6:44 AM<BR>
To: EYRE Bernadette<BR>
Cc: net-snm...@lists.sourceforge.net<BR>
Subject: Re: processing of the multi varbinds in one snmpset command<BR>
<BR>
2009/3/19 EYRE Bernadette =
&lt;Bernade...@alcatel-lucent.com&gt;:<BR>
&gt; if the snmpset command line has multiple varbinds (variables) to =
modify for<BR>
&gt; the same table<BR>
&gt; and the same row (index), how can one ensures that all vars are =
processed in<BR>
&gt; one request struct?<BR>
<BR>
That's the reason that SET requests are processed in multiple =
passes.<BR>
Have a look at the file AGENT.txt, for a description of one possible<BR>
approach.<BR>
<BR>
It might also be worth searching the mailing list archives - I'm pretty =
sure<BR>
that I've explained this sort of thing before.<BR>
&nbsp;&nbsp; (a quick search throws up a thread on the -users list from =
10th Feb,<BR>
entitled&quot;Parsing Get/Set Requests in Table_Handler&quot;.&nbsp; =
That looks relevant)<BR>
<BR>
<BR>
Dave<BR>
<BR>
-------------------------------------------------------------------------=
-----<BR>
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) =
are<BR>
powering Web 2.0 with engaging, cross-platform capabilities. Quickly =
and<BR>
easily build your RIAs with Flex Builder, the Eclipse(TM)based =
development<BR>
software that enables intelligent coding and step-through debugging.<BR>
Download the free 60 day trial. <A =
HREF=3D"http://p.sf.net/sfu/www-adobe-com">http://p.sf.net/sfu/www-adobe-=
com</A><BR>
_______________________________________________<BR>
Net-snmp-coders mailing list<BR>
Net-snm...@lists.sourceforge.net<BR>
<A =
HREF=3D"https://lists.sourceforge.net/lists/listinfo/net-snmp-coders">htt=
ps://lists.sourceforge.net/lists/listinfo/net-snmp-coders</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
<pre>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.

=0D
------_=_NextPart_001_01C9A94F.4E203F60--


--===============1033519352097169968==


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------


Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com

--===============1033519352097169968==


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________

--===============1033519352097169968==--

EYRE Bernadette

unread,
Mar 25, 2009, 9:58:36 PM3/25/09
to
This is a multi-part message in MIME format.

--===============8153382366565397807==


Content-class: urn:content-classes:message
Content-Type: multipart/alternative;

boundary="----_=_NextPart_001_01C9ADB3.09E8DBBA"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C9ADB3.09E8DBBA


Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


As always your feedback and replies are appreciated.

I read AGENT.txt as well as the mail list thread you mentioned
Both materials helped enforce what I was already thinking ( or fearing )

My question was not so much to do with multi-pass nature of the set =
operation
and the need to structure the design to process it in multi pass,
but rather to do with what was the best way to service the set operation =
in each
pass, request-by-request struct or var-by-var struct. It was this last
choice that was confusing but after reading the document and the thread =
and with few
subtle hints here and there I realized that I have to make the choice =
how to process
the operation.

this email is sent as a courtesy and in the interest of=20
being of some value to others like me and no reply is expected.

Bernadette Eyre

-----Original Message-----
From: dave....@googlemail.com on behalf of Dave Shield
Sent: Fri 3/20/2009 5:44 AM
To: EYRE Bernadette
Cc: net-snm...@lists.sourceforge.net
Subject: Re: processing of the multi varbinds in one snmpset command
=20
2009/3/19 EYRE Bernadette <Bernade...@alcatel-lucent.com>:
> if the snmpset command line has multiple varbinds (variables) to =
modify for
> the same table
> and the same row (index), how can one ensures that all vars are =
processed in
> one request struct?

That's the reason that SET requests are processed in multiple passes.
Have a look at the file AGENT.txt, for a description of one possible
approach.

It might also be worth searching the mailing list archives - I'm pretty =
sure
that I've explained this sort of thing before.
(a quick search throws up a thread on the -users list from 10th Feb,
entitled"Parsing Get/Set Requests in Table_Handler". That looks =
relevant)


Dave


------_=_NextPart_001_01C9ADB3.09E8DBBA


Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =

6.5.7651.59">


<TITLE>RE: processing of the multi varbinds in one snmpset =
command</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<BR>

<P><FONT SIZE=3D2>As always your feedback and replies are =
appreciated.<BR>
<BR>
I read AGENT.txt as well as the mail list thread you mentioned<BR>
Both materials helped enforce what I was already thinking ( or fearing =
)<BR>
<BR>
My question was not so much to do with multi-pass nature of the set =
operation<BR>
and the need to structure the design to process it in multi pass,<BR>
but rather to do with what was the best way to service the set operation =
in each<BR>
pass, request-by-request struct or var-by-var struct. It was this =
last<BR>
choice that was confusing but after reading the document and the thread =
and with few<BR>
subtle hints here and there I realized that I have to make the choice =
how to process<BR>
the operation.<BR>
<BR>
this email is sent as a courtesy&nbsp; and in the interest of<BR>
being of some value to others like me and no reply is expected.<BR>
<BR>
Bernadette Eyre<BR>
<BR>
-----Original Message-----<BR>
From: dave....@googlemail.com on behalf of Dave Shield<BR>
Sent: Fri 3/20/2009 5:44 AM<BR>

</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C9ADB3.09E8DBBA--


--===============8153382366565397807==


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============8153382366565397807==


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snm...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

--===============8153382366565397807==--

0 new messages