Re: Integrating net-SNMP agent into my application
"Nikos Balkanas" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <001a01c96daa$a4c6a700$02b2a8c0@tardis> |
In every system you need to have snmp support you need to have the master agent running. MIB files are just configuration files that the master agent reads. You do not plug them into any code and expect them to do anything. If you are lucky mib2c can generate an snmp API skeleton for you to make your snmp calls. You still need to develop your own application interface from scratch. All tutorials show how to modify the master agent to support your MIB variables. It is not recommended to code snmp in your application (although you could), since you would have to add support for the whole snmp tree (system, traps, etc.). You would need this since there can be only be one agent listening on UDP 169 (default snmp port). If you just modify the master agent, he will do all the other stuff for you. You will need to create a backdoor TCP protocol from your application to talk to your module. This can be anything you decide. BR, Nikos ----- Original Message ----- From: "Bart Cornelissen" <[email protected]> To: <[email protected]> Sent: Saturday, January 03, 2009 3:36 PM Subject: Re: Integrating net-SNMP agent into my application > Thanks for the reply. > > On Sat, Jan 3, 2009 at 12:09 PM, Nikos Balkanas <[email protected]> > wrote: >> >> I am doing the exact same thing, still not finished, but further along >> the way. >> The documentation is very clear on that. Please check the tutorials: >> >> 1) Subagent >> http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent >> 2) Shared object >> http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Dynamically_Loadable_Object >> 3) Chaging the master agent >> http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_MIB_Module > > If I understand it right, these tutorials describe how I can plug my > own MIB module, with knowledge of how to access my server > application's variables, into the agent. Since I don't want to (and I > guess I'm not supposed to either) incorporate my entire server into > this module, the MIB module will have to communicate with my server > application somehow. > >> All of these provide a custom handler placeholder that you can place your >> own code to interface with your application. Of course you will need to >> add >> support from your application to serve these requests and fire traps. > > Yes, but this is still unclear to me. Am I supposed to start the agent > and my server application as two separate processes, and make them > communicate with each other (through the MIB module)? Or can I just > plug the Net-SNMP agent into my server application, and have my MIB > module retrieve the needed information through simple function calls? > > -- Bart > > >> Start by writing your own MIB (definition) file describing your >> variables. >> Then try mib2c to see if it can generate the code for you from the MIB. I >> couldn't get it to work for me (Solaris 10.5), so I had to tough it out >> from >> scratch using the examples >> http://www.net-snmp.org/dev/agent/examples.html >> >> BR, >> Nikos >> >> ----- Original Message ----- From: "Bart Cornelissen" >> <[email protected]> >> To: <[email protected]> >> Sent: Saturday, January 03, 2009 12:43 PM >> Subject: Integrating net-SNMP agent into my application >> >> >>> Hi, >>> >>> We have written a server application that we would like to extend with >>> some monitoring support. The goal is to expose some variables that >>> describe the status of these servers, so their status can be easily >>> visualized with a remote application. >>> Is there a way to integrate the Net-SNMP agent module into our >>> application? The documentation only seems to mention how to extend the >>> agent application, but not the other way around. Reorganizing our >>> project so that the servers start up from within the Net-SNMP agents >>> seems a way too drastic change, since the monitoring should be an >>> optional feature anyway. >>> >>> Or am I looking at it the wrong way? I don't have any experience with >>> Net-SNMP, or SNMP even. >>> >>> Thanks, >>> Bart > > ------------------------------------------------------------------------------ > _______________________________________________ > 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 ------------------------------------------------------------------------------ _______________________________________________ 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