1

I have configured MRTG for bandwidth monitoring, and seems to work, now, how can i configure MRTG to monitoring IP aliases? I mean with ifconfig:

eth0

eth0:1

eth0:2

eth0:1 and eth0:2 are aliases

For the real phisic interface /etc/mrtg.cfg is as follow:

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

For IP aliases do I just need to configure as follows

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>

Thanx in advance

Michael Graff
  • 6,588
  • 1
  • 23
  • 36
xer
  • 23
  • 1
  • 6

1 Answers1

0

I don't believe you can do what you are trying to do, at least how you're wanting to do it.

I don't believe Linux performs per-address packet accounting, only per-interface. Since eth0:X are really all the same interface, just different addresses on it, they will all be accounted for in the eth0 statistics.

What you could do is look into how the firewall stuff works. Chances are there is a way to count packets/bytes there, and you could set up rules to count each alias. You could then query those counters and generate your graphs. However, I doubt MRTG will do that out of the box for you.

Check out https://lists.oetiker.ch/pipermail/mrtg/2003-May/024190.html which seems to be on topic.

Michael Graff
  • 6,588
  • 1
  • 23
  • 36
  • Hello Michael, fist of all i want thank you, 'cause your answer is pretty useful. I'm coming from FreeBSD and Linux is just a new system for me, but the script that you have signaled is simple to understand. So, what i was looking for is a monitoring system without mysql and also snmpd, with iptables i can do what i need. I'm just tuning my system and i can say that's working very well. Also, with this idea, i can monitor IP aliases nor IP and ports for every service. Great! – xer Nov 26 '09 at 08:52