>       I need to get the Net-SNMP supported OID (like system group,
> interface group, snmpTargetMIB group etc) values in private MIB
> instrumentation (implemented using mib2c frame work in net-snmp-
> 5.2.1).
>       Is there a way to do so?        

One way would be to send a request to the agent at 127.0.0.1
(localhost).  Something like:

    struct snmp_session session;
    struct snmp_pdu *pdu;
    struct snmp_pdu *response;
    oid anOID[] = { YourOIDHere };
    size_t anOID_len = OID_LENGTH(anOID);
    struct variable_list *vars;
    int status;
            
    init_snmp("snmpapp");
    snmp_sess_init( &session );
    
    session.peername = "127.0.0.1";
    session.retries = 1;
    session.version = SNMP_VERSION_2c;
    session.community = "myComm";
    session.community_len = strlen(session.community);
    ss = snmp_open(&session);

    pdu = snmp_pdu_create(SNMP_MSG_GET);

    snmp_add_null_var(pdu, anOID, anOID_len);
    
    status = snmp_synch_response(ss, pdu, &response);
    ...

If there's a better way, I'd like to hear it.





-------------------------------------------------------
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-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to