[SNMP4J] How to completely exit from agent?

Frank Fock fock at agentpp.com
Thu Mar 1 23:09:40 CET 2012


Hi Jesse,

Probably you have also to call AgentXSubAgent.setPingDelay(0);
to cancel the ping timer that runs in the background by default
every 30 seconds.

Best regards,
Frank

Am 22.02.2012 12:01, schrieb Jesse Woo:
> Hi Frank,
>
> Now we want to use the subagent org.snmp4j.agent.agentx.subagent.AgentXSubagent.java, and the same problem happens again and this time calling WorkerPool.stop() can't solve it.
>
> For example, I tried
>
> subagent.close(session, AgentXProtocol.REASON_SHUTDOWN);
> subagent.getWorkerPool().stop();
>
> or
>
> workerPool = ThreadPool.create("AgentXSubAgent", 3);
> subagent.setThreadPool(workerPool);
> ...
>
> subagent.close(session, AgentXProtocol.REASON_SHUTDOWN);
> workerPool.stop();
>
> Could you advise please?
>
> Thanks,
> Jesse
>
>
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On Behalf Of Frank Fock
> Sent: 17 January 2012 00:37
> To: snmp4j at agentpp.org
> Subject: Re: [SNMP4J] How to completely exit from agent?
>
> Hi Jesse,
>
> After calling AgentConfigManager.shutdown() you should also call WorkerPool.stop() on the WorkerPool you provided in the constructor of the AgentConfigManager.
> This, of course, only applies to thread pools that are under your control and stoppable.
>
> Best regards,
> Frank
>
> Am 16.01.2012 15:27, schrieb Jesse Woo:
>> Hi Guys,
>>
>> I have created a SNMP Agent based on org.snmp4j.agent.example. SampleAgent.java.
>>
>> This agent is running as part of my system, and I want to completely exit the agent before I can shut the whole system down.
>>
>> I tried shutdown() method from AgentConfigManager.java, and it did close the session but seems it left the thread in memory.
>>
>> How can I exit the agent completely?
>>
>> Much appreciated for your help.
>>
>> Regards,
>> Jesse
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
> --
> ---
> AGENT++
> Maximilian-Kolbe-Str. 10
> 73257 Koengen, Germany
> https://agentpp.com
> Phone: +49 7024 8688230
> Fax:   +49 7024 8688231
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list