[AGENT++] Fwd: snmp->get / retransmits / rtt

Jochen Katz katz at agentpp.com
Fri Apr 14 19:13:02 CEST 2017


Hello,

you can only do this with a patched  Snmp::snmp_engine() function:
- Only generate and set a new request id (commands around MyMakeReqId())
if pdu.get_request_id() returns zero.
- As first command inside the maxloops for loop:
  if (maxloops > 0) pdu.set_request_id(0);

Regards,
  Jochen

Am 13.04.2017 um 09:26 schrieb Florian Lohoff:
> On Thu, Jan 05, 2017 at 09:02:19PM +0100, Jochen Katz wrote:
>> Hi,
>>
>>> i am using the snmp->get method of requesting some OIDs synchronously
>>> in a nagios/icinga check. I'd like to log retransmits/timeouts but
>>> by looking through the API Documentation i see no way to retrieve 
>>> the number of retransmits issued. Am i overlooking something?
>>
>> no, this information is not provided. As a simple workaround you could
>> set retransmit count to zero, so you will always get a timeout if a
>> packet is dropped.
>>
>>> PS: The list explicitly forbids gpg/pgp signatures - is that intentional?
>>
>> Maybe Frank can answer this after his vacation.
> 
> Okay - i again worked on this issue to get exponential timeouts - So i
> set retransmit count to 0 and calculated the timeout myself:
> 
> Basically my request method looks like this - The problem i am now facing is
> that snmp->get always sets a new request_id - so every retry get a new
> request_id which is not what i want - I want to let my devices to use
> their retransmit cache ... Is there a way around this?
> 
> 	for(int retry=0;retry<maxretries;retry++) {
> 		// timeout = deftimeout*2^retry
> 		int     timeout=defaulttimeout*(1<<retry);
> 		target.set_retry(0);
> 		target.set_timeout(timeout);
> 
> 		status=snmp->get(*pdu, target);
> 
> 		if (status == SNMP_CLASS_SUCCESS)
> 			break;
> 	}
> 
> Flo
> 



More information about the AGENTPP mailing list