RE: linkup linkdown monitoring impacts the performance
"Peder Chr. Norgaard" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 7 Mar 2006, vishakha s wrote: > Date: Tue, 7 Mar 2006 14:23:14 +0530 > From: vishakha s <[email protected]> > To: 'Peder Chr. Norgaard' <[email protected]> > Cc: "Net-Snmp-Users (E-mail)" <[email protected]> > Subject: RE: linkup linkdown monitoring impacts the performance > > Hi > I read this mail and tried to run with the notification.c you mentioned .It > is generating the trap .But how to use netlink for this .We have to write > some code for opening the socket and what you mean by subscribe to link > change messages.I am not much familiar with this topic .Can you please put > some more light on this exactly how to implement this netlink concept in > net-snmp. I can only repeat what I already wrote to Robert Story last week: Grab the "quagga" package from the net and study it: -------- The "quagga" package uses netlink much the way I suggest (actually I looked more in the "quagga" code than in the documentation when I wrote my own piece). Look in the file zebra/rt_netlink.c. The function netlink_link_change is the place where you recognize the ifUp/ifDown events - but of course you also need the surrounding infrastructure - the opening and configuration of the socket, the ordering of this specific brand of events, the adding of the FD for the socket to the central select loop etc etc. I did not find netlink easy to work with - the documentation is sloppy and complex, and the design is not impressive. It took me something like two full weeks, with a lot of cheating = looking in kernel source, to get the hang of it - but when you know how to work it, it works like a charm. And for performance it really beats using /proc for almost everything. -------- -- Peder Chr. Nørgaard Senior System Developer, M. Sc. Ericsson Denmark A/S, Telebit Division Skanderborgvej 232 tel: +45 30 91 84 31 DK-8260 Viby J, Denmark fax: +45 89 38 51 01 e-mail: [email protected] (old e-mail 2000-2003: [email protected]) (old e-mail 1992-2000: [email protected]) ---------------------------------------------------------------- This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.