[CentOS] MRTG Problem - no traffic recorded

Morten Nilsen

morten at runsafe.no
Fri Aug 8 06:15:04 UTC 2008


Hi all,

I've just recently replaced my old firewall with a new one, running 
CentOS 5..

Yesterday, I decided to get MRTG up and running again, so I entered 
sections like this into the mrtg.conf file:

Title[vlan10]: Bandwidth usage on tenchi.4th-age.com (Internet)
PageTop[vlan10]: <H1>Traffic stats on VLAN 10 (Internet)</H1>
Target[vlan10]: `ifconfig vlan10 |
    /usr/bin/awk '/bytes/{ gsub(/:/, " "); print $3 "\n" $8}'`
MaxBytes[vlan10]: 12500000
Options[vlan10]: noinfo, growright, bits
WithPeak[vlan10]: wmy

The Target is all on one line in the file.

This config worked fine on my old firewall, but on the new, I get this 
in the log files:

[root at tenchi mrtg]# head /var/lib/mrtg/vlan10.log
1218175802 -1 -1
1218175802 3 3 3 3
1218175501 3 3 3 3
1218175500 3 3 3 3

When testing, I ran the mrtg command, precisely as it is written in 
/etc/cron.d/mrtg, and that placed real values where now it says -1, but 
as soon as the cron job ran, the values became -1 again.

I hope someone can shed some light on this problem..

-- 
Cheers,
Morten



More information about the CentOS mailing list