On 26/10/06, Avnindra Singh <[EMAIL PROTECTED]> wrote: > I generated sub agent code for scalars in HOST-RESOURCES_MIB using: > env MIBS="+HOST-RESOURCES-MIB" mib2c -c mib2c.scalar.conf hrSystem
I presume you realise that the Net-SNMP agent already implements this particular group? (See agent/mibgroup/host/hr_system.c) > I want to initialize some value to, say, hrSystemDate, during subagent > initialization, before any GET/SET request comes. Can it be done? Yes. Put the necessary code in the init_hrSystem() routine. > Which data structure I can access calling > netsnmp_create_handler_registration in init_hrSystem to get to the > variable for hrSystemDate? That's totally up to you. The init_hrSystem() routine and the hrSystem_handler() code are held in the same file, so you can declare whatever data structures you feel that you need, such that both these routines can access them. Remember that the output of mib2c is simply a *template* for your MIB module implementation. As long as the basic structure of the code remains the same, you can tweak the details to your heart's content. Dave ------------------------------------------------------------------------- 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
