Re: Is it safe to invoke an SNMP Get within a sub-agent?

Wes Hardaker <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization Sparta
Message-ID <[email protected]>
>>>>> On Wed, 26 Apr 2006 15:27:17 +0300, "Makavy, Erez (Erez)" <[email protected]> said:

Erez> My solution - is it safe?
Erez> ---------------------------------
Erez> Within the access_method of my (agentx) sub-agent, within the mode
Erez> MODE_GET, I basically invoke these net-snmp API function:
Erez> [in this order]
Erez> -    snmp_sess_init(&session);
Erez> -    ss = snmp_open(&session);
Erez> -    pdu = snmp_pdu_create(i_queryType);
Erez> -    snmp_synch_response(ss, pdu, &response);
Erez> -    snmp_free_pdu(response);
Erez> -    snmp_close(ss);
 
Erez> It seems to work, but I'm not sure it safe, with all the global
Erez> variables net-snmp is using to manage sessions, parse PDUs, and
Erez> much more I don't know of...
 
Erez> Is it safe?

I'm certainly not going to promise it's safe, but in theory it might
be.

However, you should be using a asynchronous request instead of a
synchronous one...  See the ucd-snmp/proxy.c file for an example of
how a asynchronous request is used to send a request, return control
to the master agent, receive the response and finish up the handling
of the original request.

Right now, if you use snmp_synch_response you'll potentially end up
dropping other important packets...
-- 
Wes Hardaker
Sparta, Inc.


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.