[SOLVED] FreeBSD, (IF/Traffic) - 64 bit counters broken.

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

Moderators: Moderators, Developers

Post Reply
Author
Message
ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

[SOLVED] FreeBSD, (IF/Traffic) - 64 bit counters broken.

#1 Post by ahyes » Tue Mar 04, 2008 8:35 pm

Hi All,

I've noticed the "interface" statistics for traffic reported in cacti, seem to be out by a factor of 10.

Please see the attached screenshot showing the em0 interface:

I was copying a large file (>10GB) across my LAN via FTP. The network is a 1000BaseT network. The speed reported by midnight commander during the transfer was 45MB/s (megabytes of data, not megabits), which is about right, due to limitations of disk speeds/PCI bus speeds etc.

How ever in cacti, the speeds are represented as 45Mbps. This is wrong. It should be 450Mbps. The chart template I chose should be expressing in megabits per second.

Whats up with that??
Attachments
cacti.jpg
cacti.jpg (444.25 KiB) Viewed 9154 times
Last edited by ahyes on Mon Mar 10, 2008 11:36 am, edited 2 times in total.

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Interface statistics (traffic), Scale representation pro

#2 Post by gandalf » Wed Mar 05, 2008 7:48 am

ahyes wrote:How ever in cacti, the speeds are represented as 45Mbps.
Where did you find this number on the graphs? Are you aware of Consoldiation (http://docs.cacti.net/node/278)?
Reinhard

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#3 Post by ahyes » Wed Mar 05, 2008 11:20 am

Where did you find this number on the graphs? Are you aware of Consoldiation (http://docs.cacti.net/node/278)?
Reinhard
Notice it says maximum 48M down at the bottom? I don't quite understand what you're getting at, I read the link you provided, but cant see how it ties into my issue. My issue is that the graph on the Y axis is counting in bits per second, and reaches around the 40/50 mark on the graph, now if this was indeed being expressed as the true bits per second, it should look different on the left hand side, 100, 200, 300, 400, 500 Mbps etc Not 10, 20, 30, 40, 50 Mbps. It appears the graph has the correct idea on what the utilization was, its just being expressed incorrectly.

I am no expert with cacti, so if I am missing the point, please explain it to me in noob terms if possible (be gentle) :)

It appears the utilization just needs to be multiplied by 10 and it should be correct.. Where can I adjust this though? The graph for em0 is basically saying that the max utilization was 48mbps, when it was really 480mbps.

The thing I find odd is, this issue is only with the high speed interface. The WAN interface graphs correctly, but never comes close to pushing the speeds that the LAN interface does, in this instance I was streaming a 128kbps audio stream, the graph at the top is pretty spot on. Could it be when the throughput reaches a certain number the math is wrong?

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Interface statistics (traffic), Scale representation pro

#4 Post by gandalf » Fri Mar 07, 2008 10:30 am

ahyes wrote:The network is a 1000BaseT network. The speed reported by midnight commander during the transfer was 45MB/s (megabytes of data, not megabits)
Now I suppose I get closer. 45MBytes/sec would result in 360 Mbps/sec. That results in a COUNTER overflow when graphing 32bit COUNTERs only and using standard 300 sec polling interval. The overflow occurs at roughly 114 Mbps. Use 64 bit COUNTERs instead hoping the device support both SNMP V2c and 64 bit COUNTERs
Reinhard

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#5 Post by ahyes » Sat Mar 08, 2008 11:50 pm

ahh that makes sense.

I tried 64 bit counters (against 2 BSD machines running snmp v5) with version 2 SNMP selected in cacti, but it seems 64 bit counters will not work. I get this in the logs:

03/09/2008 03:44:53 PM - SPINE: Poller[0] Host[2] DS[8] WARNING: Result from SNMP not valid. Partial Result: ...

Any ideas?
Thanks!

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#6 Post by gandalf » Sun Mar 09, 2008 7:07 am

Please snmpwalk using V2c manually against .1.3.6.1.2.1.31.1.1.1 and report results
Reinhard

taipan
Posts: 15
Joined: Tue Nov 14, 2006 6:20 am

#7 Post by taipan » Sun Mar 09, 2008 6:05 pm

Hello Gandalf,

I have same issues on FreeBSD servers:

For snmp version 2c:

[[email protected] /]# snmpwalk -v 2c -c xxxxxx xxxxxxxx .1.3.6.1.2.1.31.1.1.1
IF-MIB::ifXEntry = No Such Object available on this agent at this OID

Of course I have replaced comunity string and real hostname with xxxxxx.
Same query is working fine on Cisco devices.
TIA for your help.

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#8 Post by ahyes » Sun Mar 09, 2008 10:29 pm

[[email protected] ~]# snmpwalk -v 2c -c community nas.xor.net .1.3.6.1.2.1.31.1.1.1
IF-MIB::ifXEntry = No Such Object available on this agent at this OID

[[email protected] ~]# snmpwalk -v 2c -c community ns.xor.net .1.3.6.1.2.1.31.1.1.1
IF-MIB::ifXEntry = No Such Object available on this agent at this OID

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#9 Post by ahyes » Mon Mar 10, 2008 9:32 am

taipan wrote:Hello Gandalf,

I have same issues on FreeBSD servers:

For snmp version 2c:

[[email protected] /]# snmpwalk -v 2c -c xxxxxx xxxxxxxx .1.3.6.1.2.1.31.1.1.1
IF-MIB::ifXEntry = No Such Object available on this agent at this OID

Of course I have replaced comunity string and real hostname with xxxxxx.
Same query is working fine on Cisco devices.
TIA for your help.
It seems that the default version of snmp (5.3) doesnt support 64 bit counters under freebsd. Of course linux is supported in that version *rolls eyes*

But from the net-snmp site, in v5.4:


For FreeBSD:

- Experimental support for 64bit interface counters (ifXTable). Enable
via '--with-mib-modules=if-mib --enable-mfd-rewrites'.


I am trying a rebuild of snmp with:

./configure --enable-mfd-rewrites --with-mib-modules=if-mib --with-gnu-ld --with-libwrap --with-libs="-lkvm-ldevstat" --with-persistent-directory=/var/net-snmp

(the other configure flags I borrowed from the /usr/ports/net-mgmt/net-snmp makefile)

I'll report back and let you know how I go.

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#10 Post by ahyes » Mon Mar 10, 2008 9:43 am

<deleted>
Last edited by ahyes on Mon Mar 10, 2008 11:37 am, edited 1 time in total.

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#11 Post by ahyes » Mon Mar 10, 2008 10:12 am

Ok its started to work now.. Not sure what was up before....

[[email protected] /home/alex/serverbuild/net-snmp-5.4.1]# snmpwalk -v 2c -c community 127.0.0.1 .1.3.6.1.2.1.31.1.1 |grep Counter64
IF-MIB::ifHCInOctets.1 = Counter64: 860060822
IF-MIB::ifHCInOctets.2 = Counter64: 30870362
IF-MIB::ifHCInUcastPkts.1 = Counter64: 1230118
IF-MIB::ifHCInUcastPkts.2 = Counter64: 186729
IF-MIB::ifHCInMulticastPkts.1 = Counter64: 114
IF-MIB::ifHCInMulticastPkts.2 = Counter64: 0
IF-MIB::ifHCInBroadcastPkts.1 = Counter64: 0
IF-MIB::ifHCInBroadcastPkts.2 = Counter64: 0
IF-MIB::ifHCOutOctets.1 = Counter64: 650195215
IF-MIB::ifHCOutOctets.2 = Counter64: 30870362
IF-MIB::ifHCOutUcastPkts.1 = Counter64: 1135454
IF-MIB::ifHCOutUcastPkts.2 = Counter64: 186729
IF-MIB::ifHCOutMulticastPkts.1 = Counter64: 0
IF-MIB::ifHCOutMulticastPkts.2 = Counter64: 0
IF-MIB::ifHCOutBroadcastPkts.1 = Counter64: 0
IF-MIB::ifHCOutBroadcastPkts.2 = Counter64: 0

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#12 Post by ahyes » Mon Mar 10, 2008 11:39 am

All working.

I had to rebuild Spine, as it had a fit when I uninstalled the stock net-snmp package (it was looking for non existent libraries).

Any ideas why "|query_ifIP| " is missing from the graphs? I found this rather odd. I had to add it manually.
Attachments
graph_image.png
Traffic count is now displayed correctly. though the IP address of the IF no longer appears in the graph..
graph_image.png (25.32 KiB) Viewed 8884 times

ahyes
Posts: 12
Joined: Wed Apr 25, 2007 12:35 am

#13 Post by ahyes » Tue Mar 11, 2008 6:21 am

That was 2 hitches I had with Cacti and FreeBSD.

I was getting blank pages after an initial install of cacti on a new FreeBSD 7 machine. Test pages indicated my apache and php were fine, but the stock php package for FreeBSD has no support for MySQL! (I assumed it did have support). I had to rebuild it, as soon as I added mysql support, cacti began to work.

It also seems the default net-snmp package shipped with FreeBSD is also inadequate for 64 bit IF counters.

Hopefully my experiences will help anyone else struggling!

Thanks to all who responded.

Alex.

ben_c
Cacti User
Posts: 203
Joined: Mon May 14, 2007 8:12 pm
Location: Melbourne, Australia.

#14 Post by ben_c » Wed Mar 12, 2008 7:41 pm

ahyes wrote:It also seems the default net-snmp package shipped with FreeBSD is also inadequate for 64 bit IF counters.

Hopefully my experiences will help anyone else struggling!

Thanks to all who responded.

Alex.
Can you expand on this a bit? I cannot get ifAlias to display on any 64bit interface graph, even after reindexing hosts, I was assuming it's more of a bug within cacti. I'm running net-snmp 5.1.2 on Redhat AS4
Last edited by ben_c on Wed Jun 04, 2008 8:51 pm, edited 1 time in total.

User avatar
mokeybrains
Posts: 42
Joined: Mon Aug 22, 2005 9:39 pm
Location: San Francisco, CA
Contact:

HOW-TO make 64 bit counters work on FreeBSD

#15 Post by mokeybrains » Wed Jun 04, 2008 8:49 pm

Code: Select all

cd /usr/ports/net-mgmt/net-snmp && make -DWITH_MFD_REWRITES
make deinstall  (if you have the old one installed)
make install
/usr/local/etc/rc.d/snmpd restart
then, go to "Console->Device->Pick-your-box"
Set SNMP Version = 2

WHEEEEEE, now you have graphs over 114 Mbps for your em0.

Post Reply