SNMP on redhat

hello

I installed SNMP on my RedHat server and want to get the traffic counter on eth0
on my ifconfig I see:
eth0 Link encap:Ethernet HWaddr 00:XX:XX:XX:4E:9C
inet addr:X.X.X.34 (...)

eth0:1 Link encap:Ethernet HWaddr 00:XX:XX:XX:4E:9C
inet addr:X.X.X.35

eth0:2 Link encap:Ethernet HWaddr 00:XX:XX:XX:4E:9C
inet addr:X.X.X.36

etc...

I'm using:
/usr/bin/snmpget -v 1 -c public -Oqv localhost IF-MIB::ifInOctets.1

the problem is that, although ifInOctets and ifOutOctets doesn't return the same result, they have the same "difference"

for example:
# /usr/bin/snmpget -v 1 -c public -Oqv localhost IF-MIB::ifInOctets.1;/usr/bin/snmpget -v 1 -c public -Oqv localhost IF-MIB::ifOutOctets.1;sleep 10;/usr/bin/snmpget -v 1 -c public -Oqv localhost IF-MIB::ifInOctets.1;/usr/bin/snmpget -v 1 -c public -Oqv localhost IF-MIB::ifOutOctets.1;
1482781297
1482781463
1482781629
1482781795
1482781629 - 1482781297 = 1482781795 - 1482781463 = 332

any hints on how to read the In and Out counters for eth0?

thanks

OBS: I didn't made any config on snmpd.conf... just configured the community to get access

 

 

 

 

Top