Hey,
What do I
need
----------------------
I want to invoke an
SNMP get ( send an SNMP request PDU to the master agent), within a sub-agent (on
the same system).
In particular within
a netsnmp_mib_handler - access_method.
Meaning that when
the sub-agent receive a request for some OID1, it may query the master agent for
some other OID2,
and using that
information decide what to return for OID1.
[Of course I have to
be carefull so that OID2 retrival is not dependent on OID1]
My solution - is it
safe?
---------------------------------
Within the
access_method of my (agentx) sub-agent, within the mode MODE_GET, I
basically invoke these net-snmp API function:
[in this order]
[in this order]
-
snmp_sess_init(&session);
- ss = snmp_open(&session);
- pdu =
snmp_pdu_create(i_queryType);
- snmp_synch_response(ss, pdu,
&response);
- snmp_free_pdu(response);
- snmp_close(ss);
It seems to
work,
but I'm not sure it
safe, with all the global variables net-snmp is using to manage
sessions,
parse PDUs, and much
more I don't know of...
Is it
safe?
Thanks,
Erez.
