Re: simple, but over-reboot network interfaces monitoring tool



In article <m2zlyontkx.fsf@xxxxxxxxx>, Pawel <paulino90@xxxxxxxxx> wrote:
Gordon Henderson <gordon+usenet@xxxxxxxxxx> writes:

Yes.

The cfgmaker program will create a configuration to let you graph bytes
in/out of Interfaces, but for packets, you need something like:

Target[net_eth0_pkt]:
1.3.6.1.2.1.2.2.1.11.1&1.3.6.1.2.1.2.2.1.17.1:public@localhost:
MaxBytes[net_eth0_pkt]: 100000000
Options[net_eth0_pkt]: noinfo
#WithPeak[net_eth0_pkt]: dwmy
ShortLegend[net_eth0_pkt]: pkt/sec
Legend1[net_eth0_pkt]: Packets In
Legend2[net_eth0_pkt]: Packets Out
YLegend[net_eth0_pkt]: Packets/Sec
Title[net_eth0_pkt]: eth0 (Packets/Sec)
PageTop[net_eth0_pkt]: <H1>eth0 (Packets/Sec)</H1>


The last digit (1) in the 2 strings of numbers above (either side of
the &) refers to the interface number - it'll be the same as for the
bytes entry.

Gordon,
my mrtg.cnf now looks like following:
EnableIPv6: no
WorkDir: /home/mrtg/httpd

Target[localhost_2]:
1.3.6.1.2.1.2.2.1.11.2&1.3.6.1.2.1.2.2.1.17.2:Gdansk@localhost:
MaxBytes[localhost_2]: 100000000
Options[localhost_2]: noinfo
#WithPeak[localhost_2]: dwmy
ShortLegend[localhost_2]: pkt/sec
Legend1[localhost_2]: Packets In
Legend2[localhost_2]: Packets Out
YLegend[localhost_2]: Packets/Sec
Title[localhost_2]: eth0 (Packets/Sec)
PageTop[localhost_2]: <H1>eth0 (Packets/Sec)</H1>

..but I do not see any total bytes in/out counters. only bytes/sec, packets/sec.
Ahother thing I wonder what if I reboot machine. Will total bytes in/out
counters be properly updated (that is, added to those before reboot)?

MRTG won't give you total counts for intefaces, only counts over a
period of time. If it was giving total counts, the graphs would get
biger and bigger and bigger and ...

You can get the approximate data count by taking the averages on the
Interface over a period of time. This is reasobably accurate, so taking
the dailiy average speed (which MRTG gives you) and putting it through
some calculations you can get the daily traffic counts. The longer the
average period, the more accurate it is (eg. using the weekly count)

The interface counters are reset on a reboot, so unless you are sampling
them very frequently and logging it to disk, you're going to lose that
information. MRTG just needs to know the difference between 2 samples to
work out the speed, so a reboot isn't going to affect it.

Also note that MRTG will fail on very busy Gb links as the (32-bit)
counters will wrap more than once in a 5-minute period.

It's not difficult to get the raw numbers yourself - you could sample
them once a minute and write to a file, but you need to cope with the
counters wrapping round when they go over the 32-bit mark, and a reboot,
but I don't know off-hand any tools that might do this for you.

You can get the counts simply by grepping the output of ifconfig, or
from /proc/net/dev

Gordon
.



Relevant Pages

  • Re: 2970 traffic stats and VLANs
    ... counters. ... MRTG assigns an "interface number" rather ... than using a raw OID. ...
    (comp.dcom.sys.cisco)
  • Re: Cisco 151e PIX & MRTG
    ... >> have MRTG and would like to get it running to monitor our PIX ... First enable SNMP, and set the host that is going to be allowed to do the ... There is a MIB download somewhere on the Cisco site for the OIDs, ... and dmz (interface 3). ...
    (comp.security.firewalls)
  • Re: The page cannot be displayed - message received after being idle
    ... > I have found the only way to solve the problem is to reboot the ... saved the same report created when the interface was working normally. ... E.g. netstat -an may be showing a connection which existed prior ... I just poked around in the Network Connections Control Panel ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • named & ntpd quirkyness
    ... I've a FreeBSD 5.4 system here that is running an ipfw firewall, ntpd, ... BIND, etc. and I'm having a strange little problem whenever I reboot my ... named doesn't seem to be able to bind to the tun0 interface properly, ...
    (freebsd-questions)
  • Re: MRTG IP Traffic for one IP address
    ... >:>the MRTG Linux version program with SNMP. ... >of the IP addresses on the interface. ... >IP to a loopback interface, have that loopback interface set to drop ... Define two loopback interfaces on the router using ...
    (comp.dcom.sys.cisco)