set request received more than once.

2010-02-24 Thread Tanisha Kashyap
Hi,

I am using a NMS which sends a Set request to the snmp agent. On receiving a 
SET request, certain function is invoked.

However at times, the set request seems to be received more than once which 
causes the function to be invoked again and again which is not desirable.

Any pointers as to whether the retries need to be limited at the NMS end or the 
agent's end? Do I need to change something in the config file (snmpd.conf) to 
correct this?

Thanks.


"DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in error, 
please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus."
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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/listinfo/net-snmp-users


Re: set request received more than once.

2010-02-24 Thread Dave Shield
On 24 February 2010 10:16, Tanisha Kashyap  wrote:
> I am using a NMS which sends a Set request to the snmp agent. On receiving a
> SET request, certain function is invoked.
>
> However at times, the set request seems to be received more than once which
> causes the function to be invoked again and again which is not desirable.

Are you sure that the agent is receiving multiple copies of the same request?
Remember that the Net-SNMP agent uses a multi-pass SET processing model,
which means that the same handler routines will be called several times for
a single SET request.   The last section of the file AGENT.txt describes this
behaviour in more detail.   (Don't be misled by the fact that this describes the
old v4-style API - the basic model is the same for the v5 handlers as well).



> Any pointers as to whether the retries need to be limited at the NMS end or
> the agent’s end? Do I need to change something in the config file
> (snmpd.conf) to correct this?

If the SET request *is* actually received more than once, then this is
something that will have to be tackled at the NMS end.

Dave

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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/listinfo/net-snmp-users


RE: set request received more than once.

2010-02-24 Thread Tanisha Kashyap
I have defined the following cases in my code for the SET REQUEST:

MODE_SET_RESERVE1
MODE_SET_RESERVE2
MODE_SET_FREE -> does nothing
MODE_SET_ACTION
MODE_SET_COMMIT -> does nothing
MODE_SET_UNDO -> does nothing

The function that is invoked multiple times is defined under the 
MODE_SET_ACTION case.

Since I have defined all the cases for the Set request so the function under 
MODE_SET_ACTION case shouldn't be invoked more than once.

Is my thought correct?

-Original Message-
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf 
Of Dave Shield
Sent: Wednesday, February 24, 2010 4:21 PM
To: Tanisha Kashyap
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: set request received more than once.

On 24 February 2010 10:16, Tanisha Kashyap  wrote:
> I am using a NMS which sends a Set request to the snmp agent. On receiving a
> SET request, certain function is invoked.
>
> However at times, the set request seems to be received more than once which
> causes the function to be invoked again and again which is not desirable.

Are you sure that the agent is receiving multiple copies of the same request?
Remember that the Net-SNMP agent uses a multi-pass SET processing model,
which means that the same handler routines will be called several times for
a single SET request.   The last section of the file AGENT.txt describes this
behaviour in more detail.   (Don't be misled by the fact that this describes the
old v4-style API - the basic model is the same for the v5 handlers as well).



> Any pointers as to whether the retries need to be limited at the NMS end or
> the agent's end? Do I need to change something in the config file
> (snmpd.conf) to correct this?

If the SET request *is* actually received more than once, then this is
something that will have to be tackled at the NMS end.

Dave

"DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in error, 
please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus."

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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/listinfo/net-snmp-users


Re: set request received more than once.

2010-02-24 Thread Dave Shield
On 24 February 2010 11:09, Tanisha Kashyap  wrote:
> I have defined the following cases in my code for the SET REQUEST:
>
> MODE_SET_RESERVE1
> MODE_SET_RESERVE2
> MODE_SET_FREE -> does nothing
> MODE_SET_ACTION
> MODE_SET_COMMIT -> does nothing
> MODE_SET_UNDO -> does nothing
>
> The function that is invoked multiple times is defined under the 
> MODE_SET_ACTION case.
>
> Since I have defined all the cases for the Set request so the function under 
> MODE_SET_ACTION
> case shouldn't be invoked more than once.
>
> Is my thought correct?

That sounds right, yes.
If your routine is *only* being called multiple times for the ACTION pass,
and not for the earlier ones, then that sounds like an issue with the
agent processing.
   (Since a re-sent SET request would start again with RESERVE1)

That sounds a very odd situation, though - since I'd expect to have heard
of such problems before now.   What version of the agent are you using?
Does this happen for all SET requests, or just particular OIDs?

Dave

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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/listinfo/net-snmp-users


Re: set request received more than once.

2010-02-24 Thread Bart Van Assche
 On Wed, Feb 24, 2010 at 12:09 PM, Tanisha Kashyap <
tanisha.kash...@aricent.com> wrote:

> I have defined the following cases in my code for the SET REQUEST:
>
> MODE_SET_RESERVE1
> MODE_SET_RESERVE2
> MODE_SET_FREE -> does nothing
> MODE_SET_ACTION
> MODE_SET_COMMIT -> does nothing
> MODE_SET_UNDO -> does nothing
>
> The function that is invoked multiple times is defined under the
> MODE_SET_ACTION case.
>
> Since I have defined all the cases for the Set request so the function
> under MODE_SET_ACTION case shouldn't be invoked more than once.
>
> Is my thought correct?
>

I agree that MODE_SET_ACTION should be invoked only once for each SNMP set
request received from the SNMP management software. However, you should keep
in mind that SNMP requests are sent over UDP. If the reply gets lost or does
not arrive in time at the server running the management software, the set
request will be resent.

Bart.
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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/listinfo/net-snmp-users


RE: set request received more than once.

2010-02-24 Thread Tanisha Kashyap
There is only var in my MIB on which I can do a set.

The code under RESERVE1 and RESERVE2 is just validating the data received in 
the request for correct datatype and range.
The code under ACTION is the main code which is invoking a function.

So I believe that all the cases are executed again for the SET request.

-Original Message-
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf 
Of Dave Shield
Sent: Wednesday, February 24, 2010 4:49 PM
To: Tanisha Kashyap
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: set request received more than once.

On 24 February 2010 11:09, Tanisha Kashyap  wrote:
> I have defined the following cases in my code for the SET REQUEST:
>
> MODE_SET_RESERVE1
> MODE_SET_RESERVE2
> MODE_SET_FREE -> does nothing
> MODE_SET_ACTION
> MODE_SET_COMMIT -> does nothing
> MODE_SET_UNDO -> does nothing
>
> The function that is invoked multiple times is defined under the 
> MODE_SET_ACTION case.
>
> Since I have defined all the cases for the Set request so the function under 
> MODE_SET_ACTION
> case shouldn't be invoked more than once.
>
> Is my thought correct?

That sounds right, yes.
If your routine is *only* being called multiple times for the ACTION pass,
and not for the earlier ones, then that sounds like an issue with the
agent processing.
   (Since a re-sent SET request would start again with RESERVE1)

That sounds a very odd situation, though - since I'd expect to have heard
of such problems before now.   What version of the agent are you using?
Does this happen for all SET requests, or just particular OIDs?

Dave

"DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in error, 
please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus."

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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/listinfo/net-snmp-users


RE: set request received more than once.

2010-02-24 Thread Tanisha Kashyap
There are no debug logs catering to this scenario.

Il modify my code and try to reproduce the scenario.

Thanks for the help.

-Original Message-
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf 
Of Dave Shield
Sent: Wednesday, February 24, 2010 5:07 PM
To: Tanisha Kashyap
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: set request received more than once.

On 24 February 2010 11:32, Tanisha Kashyap  wrote:
> There is only var in my MIB on which I can do a set.

What about other MIBs?


> The code under RESERVE1 and RESERVE2 is just validating the data
> received in the request for correct datatype and range.
> The code under ACTION is the main code which is invoking a function.
>
> So I believe that all the cases are executed again for the SET request.

What debug output do you have in your module code?
What does this display when it processes such a repeated SET request?

Try running the agent using
snmpd -d -f -Le
(plus any other options you normally use)
and then issue the SET request.
This will show whether the agent is receiving a single request packet,
or multiple ones.

Dave

"DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in error, 
please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus."

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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/listinfo/net-snmp-users


Re: set request received more than once.

2010-02-24 Thread Dave Shield
On 24 February 2010 11:32, Tanisha Kashyap  wrote:
> There is only var in my MIB on which I can do a set.

What about other MIBs?


> The code under RESERVE1 and RESERVE2 is just validating the data
> received in the request for correct datatype and range.
> The code under ACTION is the main code which is invoking a function.
>
> So I believe that all the cases are executed again for the SET request.

What debug output do you have in your module code?
What does this display when it processes such a repeated SET request?

Try running the agent using
snmpd -d -f -Le
(plus any other options you normally use)
and then issue the SET request.
This will show whether the agent is receiving a single request packet,
or multiple ones.

Dave

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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/listinfo/net-snmp-users