我已经为带宽监控配置了MRTG,现在我如何配置MRTG来监视IP别名呢?我的意思是使用ifconfig:
eth0
eth0:1
eth0:2eth0:1和eth0:2是别名
对于真实的phisic接口/etc/mrtg.cfg如下:
Target[localhost_eth0]: #eth0 public@localhost
SetEnv[localhost_eth0]: MRTG_INT_IP="xxx.xxx.xxx.xxx" MRTG_INT_DESCR="eth0"
MaxBytes[localhost_eth0]: 1250000
Title[localhost_eth0]: Traffic Analysis for eth0
PageTop[localhost_eth0]: Traffic Analysis for eth0对于IP别名,我是否只需要按以下方式进行配置
Target[localhost_eth0:1]: #eth0:1 public@localhost
SetEnv[localhost_eth0:1]: MRTG_INT_IP="xxx.xxx.xxx.xxx" MRTG_INT_DESCR="eth0:1"
MaxBytes[localhost_eth0:1]: 1250000
Title[localhost_eth0:1]: Traffic Analysis for eth0:1
PageTop[localhost_eth0:1]: <h1>Traffic Analysis for eth0:1</h1>事先鸣谢
发布于 2009-11-25 05:50:43
我不相信你能做你想做的事,至少你想怎么做。
我不相信Linux只对每个接口执行每个地址的数据包计费。因为eth0:X实际上都是相同的接口,只是上面的地址不同,所以它们都将在eth0统计数据中得到考虑。
你能做的就是研究防火墙是如何工作的。这里有一种计算数据包/字节的方法,您可以设置规则来计算每个别名。然后,您可以查询这些计数器并生成图形。然而,我怀疑MRTG是否会为您开箱即用。
请查看https://lists.oetiker.ch/pipermail/mrtg/2003-May/024190.html,它似乎是主题。
https://serverfault.com/questions/87699
复制相似问题