Hello!
I wrote a simple subagent for test purpose.
I set ping interval to different values 1 and 100. But the subagent waits
for master reconnection the same time. Why does ping interval not affect
changing that parameter?
The tests case:
1. run snmpd, snmptrapd.
2. set ping interval to 100, compile and run my own subagent
3. when first trap is sent I kill snmpd
Expectation: subagent should hang up for 100 sec.
But it waits for a few seconds! why?
int main()
{
netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE,
TRUE);
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
NETSNMP_DS_LIB_DONT_PERSIST_STATE, TRUE);
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 100);
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET,
"udp:localhost:705");
SOCK_STARTUP;//for win
init_agent("event_example");
init_snmp("event_example");
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 100);
send_trap(Object());// inside send_v2trap() is called
sleep(5);//kill master agent while this process sleeps
//I expected that my subagent waits for 100 sec then it completes the work
send_trap(Object());// inside send_v2trap() is called
snmp_shutdown("event_example");
SOCK_CLEANUP;//for win
return 0;
}
--
/BR, Alexander
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users