Bug 491336

Summary: mrtg fails to graph 64 bit counters
Product: Red Hat Enterprise Linux 5 Reporter: Jani Ollikainen <bestis+rh>
Component: mrtgAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED WONTFIX QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-12 12:17:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jani Ollikainen 2009-03-20 14:06:12 UTC
Description of problem:
MRTG determines 0 bytes of traffic when the counter is over 32bit value.
When the traffic counter is under 32bit value it will graph it correctly.

The key is here that the values must be over 32bit range, if they are
not, it will work. So when reproducing it, check that your interface
counters are big enough or debug with own script.

Version-Release number of selected component (if applicable):
mrtg-2.14.5-2

How reproducible:

/etc/mrtg/mrtg.conf:
#traffic
Options[eth0]: growright
Target[eth0]: `/usr/local/bin/mrtg-script-eth0`
MaxBytes[eth0]: 2621440
Title[eth0]: Traffic Analysis
PageTop[eth0]: <H1>Traffic stats</H1>

/usr/local/bin/mrtg-script-eth0:
#!/bin/sh

cat /proc/net/dev | grep eth0 | sed s/eth0://g | tr -s " " | awk '{print $1;}'
cat /proc/net/dev | grep eth0 | sed s/eth0://g | tr -s " " | awk '{print $9;}'
uptime|sed -e 's/.*up \(.*\),.*[0-9]* user.*/\1/'
hostname


Steps to Reproduce:
1. Configure
2. Wait
3. Watch the result
  
Actual results:
0 bytes of traffic if the counter value is over 32bit

Expected results:
Normal traffic graph

Additional info:

Workaround to this problem is to modulo the values to under 32bit:

/usr/local/bin/mrtg-script-eth0:
#!/bin/sh

echo $[`cat /proc/net/dev | grep eth0 | sed s/eth0://g | tr -s " " | awk '{print $1;}'` % 2147483648 ]
echo $[`cat /proc/net/dev | grep eth0 | sed s/eth0://g | tr -s " " | awk '{print $9;}'` % 2147483648 ]
uptime|sed -e 's/.*up \(.*\),.*[0-9]* user.*/\1/'
hostname

.. But it would be nice that this wouldn't be needed, took some time
to debug this and confirm it.

Comment 1 Vitezslav Crhonek 2013-03-12 12:17:20 UTC
RHEL-5 is entering Production 2 Phase (see [1]), only critical and important security issues are going to be adressed => closing this bug WONTFIX.

[1] https://access.redhat.com/support/policy/updates/errata/