SNMP ifHCOutOctets values on CentOS 5.2 too high. Why?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
mazaj
Posts: 13
Joined: Wed Mar 23, 2005 6:01 am

SNMP ifHCOutOctets values on CentOS 5.2 too high. Why?

Post by mazaj »

Hello everybody.

I have faced one problem, that all my graphs for Gigabit ethernets are too high. I am using

CentOS release 5.2 (Final)
net-snmp-5.3.1-24.el5_2.1

I was thinking that there is problem in my configuration in Cacti, but it is ok. I have checkted the interface with this simple script

Code: Select all

while /bin/true  ; do 
    value_old=0;
    value_new=$(snmpwalk -v 2c  -On -c password hostname  ifHCOutOctets.2); 
    value_new=${value_new/*Counter64\:}; 
    speed=$[$[$value_new - $value_old]*8/60] ; 
    printf "ifHCOutOctets.2=%17d   Speed= %12d \n" ${value_new} ${speed} bits/s  ; 
    value_old=$value_new ; 
    sleep 60 ; 
done
and what I actually see

Code: Select all

ifHCOutOctets.2=  257462239898183   Speed=            0 bits/s
ifHCOutOctets.2=  257467129408007   Speed=    651934643 bits/s
ifHCOutOctets.2=  257471718397976   Speed=    611865329 bits/s
ifHCOutOctets.2=  257476627832547   Speed=    654591276 bits/s
ifHCOutOctets.2=  257482512614974   Speed=    784637656 bits/s
ifHCOutOctets.2=  257488025894772   Speed=    735103973 bits/s

is that speed on interface ~8-10 times more then iptraf utility shows (Cacti shows exectly as above)

Code: Select all

 IPTraf
l Iface ============ Total ========= IP ===== NonIP ==== BadIP ===== Activity
x lo                    2           2            0          0         0.00 kbits/sec
x eth0             129110      129110            0          0     87361.20 kbits/sec
Did anybody faced such problem? Is there any other source of inbound/outbound packets (excluding iptables)?

Thank you.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Hmmm, that reminds me of the factor between bits/sec and bytes/sec. Please check the units
Reinhard
mazaj
Posts: 13
Joined: Wed Mar 23, 2005 6:01 am

Post by mazaj »

gandalf wrote:Hmmm, that reminds me of the factor between bits/sec and bytes/sec. Please check the units
Reinhard
I have identical setup on many servers, and only this gives me such things. All other are Counter32 and the are working properly.

The MIB should be fHCOutOctets which is actually bytes. Correct? So I should multiply by 8, to have bits, and divide by 60, to have per second. The Cacti behaves completly the same.

I will write tomorrow a script which takes bytes transferred from ifconfig utility, to compare results. We will see ...
mazaj
Posts: 13
Joined: Wed Mar 23, 2005 6:01 am

Post by mazaj »

Unfortunately the same thing is happening if I gather info from /proc/net/dev :(

I just don't understand why...
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests