Difference between revisions of "Interface alias statistics"
CollinGreer (Talk | contribs) |
m (Reverted edits by CollinGreer (talk) to last revision by Rstory) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 18: | Line 18: | ||
ifIndex, since we don't want to conflict with the kernel's ifIndex values. The best solution | ifIndex, since we don't want to conflict with the kernel's ifIndex values. The best solution | ||
is probably a new Net-SNMP mib table which ''extends'' the ifTable. | is probably a new Net-SNMP mib table which ''extends'' the ifTable. | ||
− | + | ||
If you would like to tackle this problem and contribute code to manage iptable entries | If you would like to tackle this problem and contribute code to manage iptable entries | ||
automatically, please submit your code to our [http://net-snmp.org/patches/ patches tracker]. | automatically, please submit your code to our [http://net-snmp.org/patches/ patches tracker]. | ||
− |
Latest revision as of 13:27, 12 February 2013
Interface aliases and ifTable statistics
Note: this is a Linux specific page.
Occasionally people will ask us why interface aliases (e.g. eth1:2) do not show up in the ifTable. Invariably, these people want to track bandwidth for these aliases.
Unfortunately, the Linux kernel does not track statistics for aliases, so we don't have an easy way to get the data.
One way to work around this problem is to use iptables to gather statistics. Robert Graf created a script called ipt2mrtg which creates iptables rules for just this purpose. If you really need statistics for aliases, this script plus the extend directive is a quick way to solver your problem.
There is a C API for manipulating iptables rules, so in theory snmp could create these rules at startup and integrate the statistics into the ifTable. The trouble is what to use as the ifIndex, since we don't want to conflict with the kernel's ifIndex values. The best solution is probably a new Net-SNMP mib table which extends the ifTable.
If you would like to tackle this problem and contribute code to manage iptable entries automatically, please submit your code to our patches tracker.