[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-users
Subject:    Delayed Instance - snmpget does not get it?
From:       Dave C <dave.zap () gmail ! com>
Date:       2018-03-27 23:41:40
Message-ID: CAKVp00Wr6YXfL_4RZgSS6dNscKPUtVGyvM7bdH-MR8vyGPAbLw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I have an AgentX sub agent and needed to add a delayed response to a GET
request whilst I perform some background processing. This is all 5.7.3.

Following this example.
http://www.net-snmp.org/dev/agent/delayed__instance_8c-example.html

In my normal GET handler I am setting
requests->delegated = 1;

Then setting up the delay (snmp_alarm_register) passing it the delegated
cashe.

Finally returning SNMP_ERR_NOERROR; back to snmpd

On the remote side I am calling snmpget to fetch the OID in question. I can
see from a pcap that my agent responds ( I presume with some kind of
deferral notification) But snmpget immediately sends the same GET request.
So my handler is getting hammered even though I told it to delegate?

I'm getting about 16 such duplicate GET's before the timer I setup runs out
(2 seconds). It seems I've created something of an infinite loop here, but
I'm not able to distinguish 'duplicate' packets from the real ones in my
handler?

Any ideas on where to look?

Thanks

Dave

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div>I have an AgentX sub agent and needed to add a delayed \
response to a GET request whilst I perform some background processing. This is all \
5.7.3.</div><div><br></div><div>Following this example.  </div><div><a \
href="http://www.net-snmp.org/dev/agent/delayed__instance_8c-example.html">http://www. \
net-snmp.org/dev/agent/delayed__instance_8c-example.html</a></div><div><br></div><div>In \
my normal GET handler I am setting  </div><div>requests-&gt;delegated = \
1;</div><div><br></div><div>Then setting up the delay (snmp_alarm_register) passing \
it the delegated cashe.</div><div><br></div><div>Finally returning SNMP_ERR_NOERROR; \
back to snmpd</div><div><br></div><div>On the remote side I am calling snmpget to \
fetch the OID in question. I can see from a pcap that my agent responds ( I presume \
with some kind of deferral notification) But snmpget immediately sends the same GET \
request. So my handler is getting hammered even though I told it to \
delegate?</div><div><br></div><div>I&#39;m getting about 16 such duplicate GET&#39;s \
before the timer I setup runs out (2 seconds). It seems I&#39;ve created something of \
an infinite loop here, but I&#39;m not able to distinguish &#39;duplicate&#39; \
packets from the real ones in my handler?</div><div><br></div><div>Any ideas on where \
to look?</div><div><br></div><div>Thanks</div><div><br></div><div>Dave</div></div></div><div><br></div></div>




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic