2009/4/22 Giuseppe Modugno <[email protected]>:
> I need to let the user to manage a device by SNMP and/or HTTP

> 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?


>       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.

But it doesn't need to - it can talk to the underlying subsystem
(in much the same way as the agent does),  and report or
manipulate whatever information that subsystem has.



> 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.

Dave

------------------------------------------------------------------------------
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