Bug 491336 - mrtg fails to graph 64 bit counters
Summary: mrtg fails to graph 64 bit counters
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mrtg
Version: 5.3
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Vitezslav Crhonek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-20 14:06 UTC by Jani Ollikainen
Modified: 2013-03-12 12:17 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-12 12:17:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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/


Note You need to log in before you can comment on or make changes to this bug.