Re: Agent Implimentation
Joao Miguel Ferreira <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2007-04-04 at 09:34 -0700, Reza Salehi wrote: > Thank you so much Joao for your response. You answer exactly what I > need to know. I think I am going to try Agentx first. I am using C not > perl. I am wonder why the last approach you mentioned is not good? Well, I guess writting and reading from file would be slower than socket based communication. If your implementation must retrieve much information from your application this would become more time consuming than the socket based approach. If you only have some OIDs then it would not be a problem... you must analyse it and decide. > In the first approach when agent fetch data from application.Dose it > do that upon receiving a SNMPGET or periodically using a timer? > you can do it the way you want. If you wish to retrieve the data when the agent receives the request you can do it. No problem. But if you think that a periodic approach wouldn't have negative impact on the quality of information the agent would send to the NMSs then you can also use the snmp_alarm_register() function. Example bellow: - snmp_alarm_register(5,SA_REPEAT,do_something,NULL); With this command, inside your mib code, you ask the agent to periodically (5 seconds in this case) execute the callback function do_something().... inside this function you can put anything you'dd like.. It's up to you to decide... cheers jmf > Regards, > Reza > > Joao Miguel Ferreira <[email protected]> wrote: > On Tue, 2007-04-03 at 12:16 -0700, Reza Salehi wrote: > > Hi, > > > > I have a question about implementing a MIB in agent > side .Right now > > for adding and implementing each MIB I need to compile the > agent and > > add my code to that. Is there anyway that I can run my code > separately > > and just refresh some variables (MIBS object) on agent. > > Is there any sample code for that? > > I've had that situation before. > > Your application runs appart from the agent and you need the > agent to > fetch OIDs that reside primarilly on your application. Is this > right ? > > What I did was design my application to listen on a UNIX > socket for > requests from the agent. Then, in the agent code I simply > create a > socket, connect it to the server an retrieve the information. > This is a > synchronous approach as the agent will always get the > information when > it needs it. > > Similar to this, you have the AgentX approach, fully suported > by > net-snmp in which you would not have to code the agent. Your > application > would need to act as an agentX though (there is an API for > that). Check > the documentation. There is Perl if you like it (I do :-)) > > Another option is your application would write the information > to a > common file on disk and then program the agent to read from > that file > (this is not a good approach for big mibs or for many OIDs) > > Well, I hope I helped. > > Cheers > joao > jmf > > > > > > > Appreciate your help, > > Reza > > > > > > > > > ______________________________________________________________________ > > Need Mail bonding? > > Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers > users. > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the > chance to share your > > opinions on IT & business topics through brief surveys-and > earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > 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 > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance > to share your > opinions on IT & business topics through brief surveys-and > earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > 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 > > > > > > ______________________________________________________________________ > 8:00? 8:25? 8:40? Find a flick in no time > with theYahoo! Search movie showtime shortcut. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ 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