It seems that calling init_agent() for the second time can not
reestablish the session with the master.
init_agent() calls subagent_init(),
and in subagent_init() there is this restriction:
static int init = 0;
if (++init != 1)
return 0;
So that the second time subagent_init() is called nothing is done.
I guess a solution might be:
1) simply remove the restriction in subagent_init() and leave it to the
responsibility of the sub-agent developer.
2) make that static vairblae in subagent_init() a global one (or in the
Data Store),
and in agentx_close_session() set it to Zero.
3) add parameter (bool shutdown)to subagent_init() which when it is TRUE
it will set the static init variable to Zero.
Then in agentx_close_session() call subagent_init with
shutdown==TRUE.
I tried removing the restriction (on calling subagent_init twice),
and still my agent could not reestablish connection with the master
agent.
Instead of seeing the usual:
agentx/subagent: initializing....
agentx/subagent: subagent_init sess 09149cf0
agentx/subagent: initializing.... DONE
I saw:
agentx/subagent: initializing....
agentx/subagent: initializing.... DONE
I guess there are some more things that have to be done to support
re-registration.
Any ideas?
I'll keep on trying.
this is very important, since we don't like our sub-agent crashing
whenever a query takes too long (usually because of temporary resource
issues).
Thanks,
Erez.
________________________________
From: Makavy, Erez (Erez)
Sent: Wednesday, June 06, 2007 7:21 PM
To: '[email protected]'
Subject: subagent crash on timeout with SIGPIPE
Hi,
The problem:
-------------------
My subagents crash if they don't return an answer (to SNMPGET) after
less then 8 seconds.
It seems that the master agent closes the agentx connection, and the
sub-agent gets BROKEN PIPE signal.
Solution:
------------
I thought that my sub-agents could catch the SIGPIPE signal,
and they re-establish the connection with the master agent.
The question:
--------------------
1) Do I have to run init_agent(_name) again in the subagent?
2) Do I have to run init_snmp(_name) again in the subagent?
3) I guess that the master agent deletes all of the sub-agents
registration info,
So the sub-agent must register again all it's MIBs, right?
4) I guess that after all that I just have to go back to
a loop on agent_check_and_process(), right?
5) Is there a different solution to this issue?
Thanks,
Erez.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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