On 22 Apr 2009 at 9:41, Dave Shield wrote:
> > Anyway, I wonder how these two applications can live together
> > sharing most of the variables.
> Which variables are you talking about?
>   The variables used by whatever it is on this device that
> you are trying to manage?
>   Or the variables used by the SNMP agent to hold this
> information internally?

The device connected to the RS232 port of the Linux box has many 
manageable variables (ON/OFF, power consumption and so on).
I want to retrieve these information for SNMP and HTTP.


> >       Ok, no problem to run two applications on the
> > same linux box, but how they can share the variables?
> The HTTP server can't see the SNMP agent internal variables.
> Those are private to the agent.

Yes, I know. But I also know there are many mechanism of sharing 
areas of memory in Linux...


> > Now I'm facing two possibilities.
> >
> > Write an application that retrieve data from the field (by RS232)
> > and maintains the variables in a shared memory area that can be
> > accessed by Net-SNMP agent and by web server. In this case I need to
> > rewrite the "cache_handler" mechanism.
> >
> > Use the cache_handler helper to retrieve and maintain updated the
> > field variables inside the SNMP agent and use SNMP GET/SET on
> > loopback (127.0.0.1) to create a communication between web server
> > and agent. In this case I reuse the "cache_handler" mechanism, but
> > I'm worried about the latency of the web server (that needs to
> > request data from SNMP agent, a complex task).
> >
> > What do you think about that? There could be a simpler and more
> > effective solution to my problem?
> 
> I'd suggest that you use a third approach - to embed equivalent data
> retrieval routines within the HTTP interface, to talk directly to the
> device itself.

Oh yes, I could use this third approach, but in that case I need to 
write the "retrieval routines" two times: in HTTP and in Net-SNMP 
agent.


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to