[mrtg] IP Alias Statistics SOLVED

Allon Bendavid allon at imacination.com
Thu May 15 22:52:27 MEST 2003


Listees-

After many solid days of research and no answers to this, what would seem
simple, question of how to get MRTG to calculate metrics for virtual hosts,
I found the answer.

Remember the scenario:

We have one Ethernet interface and we have multiple IP addresses bound to it
with aliases.

The Linux kernel since 2.2 no longer tracks TX/RX metrics for aliases.

Here's what I did:

Using the built-in iptables:

iptables -A INPUT -d <ip_address>
iptables -A OUTPUT -s <ip_address>

For each IP alias.

This created a rule in iptables.  Since the rule basically doesn't do
anything, there is no impact, but by default iptables begins to count
packets that pass the rule.

Next I used a script called 'ipt2mrtg'
(http://www.bgplus.com/software/ipt2mrtg.html ) courtesy of George Zlatanov
to get the metrics into MRTG.

You need a copy of the script for each IP alias and you need to set within
the script which line to read from the iptables output.

Pretty simple?

-Allon




----------------------------------------------------------------------------
Allon Bendavid                                          Imacination Software
allon at imacination.com                            http://www.imacination.com/
818-706-8664
----------------------------------------------------------------------------
Visit Imacination and start selling on the Web today with Ch-Ching!
----------------------------------------------------------------------------

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list