[Xymon] PATCH - do_ifstat.c

John Horne john.horne at plymouth.ac.uk
Tue Jul 31 12:49:16 CEST 2012


Hello,

I noticed that one of our clients was not showing a trends 'Network
Traffic' graph produced from the client 'ifconfig' data. The client is
running Fedora 17, and it seems that the xymond/rrd/do_ifstat.c code
detects the interface but not the receive/transmit data.

The ifconfig output from Fedora 17 looks like:

========================================
em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu
1500                       
        inet 141.163.6.4  netmask 255.255.0.0  broadcast 141.163.255.255
        inet6 fe80::219:d1ff:fe80:83ed  prefixlen 64  scopeid 0x20<link>
        ether 00:19:d1:80:83:ed  txqueuelen 1000  (Ethernet)
        RX packets 20450819  bytes 11344298271 (10.5 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17144411  bytes 19407350261 (18.0 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xe0400000-e0420000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 1542160  bytes 419850208 (400.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1542160  bytes 419850208 (400.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast
192.168.122.255
        ether 52:54:00:2b:92:84  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
========================================

Attached is a patch which detects the RX and TX 'bytes' values. It also
strips the trailing colon character from the interface name if it is
present. This then allows the 'lo:' interface to be detected as the
loopback interface (and so ignored).

The patch has been tested with Xymon 4.3.7 and seems to work fine. I
have checked the 4.3.9 code, and although the code has changed a little,
it has not changed in this area of the code.





John.

-- 
John Horne                   Tel: +44 (0)1752 587287
Plymouth University, UK      Fax: +44 (0)1752 587001
-------------- next part --------------
A non-text attachment was scrubbed...
Name: do_ifstat.c.patch
Type: text/x-patch
Size: 1389 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120731/2dcd8ce8/attachment.bin>


More information about the Xymon mailing list