NOTE: this tutorial is based on the code for the upcoming release 5.2 (currently in the main CVS line). If you generate code from a release prior to 5.2, your results may vary.
This tutorial documents the process of implementing the IF-MIB MIB module for Linux. We'll start with the ifTable, and then do the ifXTable.
The data for both of these tables comes from the kernel. This means that we have to explicity ask for the data, the data may not be in the format we would like it to be in, and all the data we want may not be available. It also means that we will not be notified when the data changes.
We cannot really do anything about the format of the data that we get from the kernel. The ifXTable presenta an additional twist, in that it contains 64 bit counters for statistics, and the statistics available for the Linux 2.4 kernels are only 32 bits. So we'll cache data and do periodic polls to maintaine these values.
As is often the case with external data, the interfaces data we get from the kernel is not sorted by the index specified by the MIB. The kernel reports data by interface names ('eth0', 'lo', etc), and the IF-MIB tables specifies an integer, ifIndex, as the table index.Next: ifTable | Up: MFD Tutorials | Skip to: ifXTable
Last modified: Thursday, 26-May-2011 23:21:32 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.