FREEBSD CPU Graphs are wrong

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

Moderators: Developers, Moderators

appodictic
Posts: 44
Joined: Thu Jul 10, 2008 4:46 pm

FREEBSD CPU Graphs are wrong

Post by appodictic »

We have several FREEBSD machines from 6.1,6.2,7.0 etc. None of them seem to have accurate CPU reporting. I am wondering if this is an issue with Kernel Counters, NetSNMP FreeBSD, or cacti issue.

If i look at the top ouptut I see a system that never gets above 20% CPU


last pid: 51704; load averages: 0.28, 0.28, 0.31 up 127+18:21:54 16:45:59
142 processes: 1 running, 140 sleeping, 1 zombie
CPU states: 14.6% user, 0.0% nice, 3.1% system, 0.8% interrupt, 81.5% idle
Mem: 584M Active, 918M Inact, 191M Wired, 115M Cache, 213M Buf, 14M Free
Swap: 1536M Total, 8K Used, 1536M Free

Yet my graphs are constantly showing 40+ percent

I also moved to the advanced templates with IO-WAIT and those numbers make even less sense to me.

Does anyone know how to make sense of freebsd top,ps, and cacti CPU graphs?

Notice how the CPU on web1 totals to 325%?
Attachments
web2_cpu.png
web2_cpu.png (62.51 KiB) Viewed 20501 times
web1_cpu.png
web1_cpu.png (39.99 KiB) Viewed 20501 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well, until we see the templates, the oid's and so on, we can only guess. My guess is that the first graph is not percentage, but rather time-tics, or maybe a 4 core box.

The sccond graph, well, I don't have a clue. It might be right.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
appodictic
Posts: 44
Joined: Thu Jul 10, 2008 4:46 pm

Post by appodictic »

Ok i will produce more statistics. Still though for my linux machines these graphs are right on. It is hard for me to fathom that no one has wondered why the CPU graphs for Free BSD do not match top output whatsoever.
appodictic
Posts: 44
Joined: Thu Jul 10, 2008 4:46 pm

Post by appodictic »

The template is 'ucd/net - CPU Usage' so the IODs being polled are the standard UCDavis ones. I am using cacti-0.8.7b.

Here is some processor info on a Free BSD7 x86_64 machine
We are using a stock FreeBSD kernel
kern.threads.virtual_cpu: 2
kern.smp.cpus: 2

As you can see my iostat and CPU graphs are not even close. I can find no specific graph templates for FreeBSD. No one on the cacti forums talking about this issue. I am sure people are using cacti to monitor FreeBSD devices. I am noticing this issue across all of our FreeBSD machines 6.1 6.2 7 i386 and x86_64.

But I think this issue would be effecting anyone trying to graph the CPU of a Free BSD system.

Any thoughts?
Attachments
As you can see the data does not jive at all.
As you can see the data does not jive at all.
web1_io.png (238.6 KiB) Viewed 20455 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Seeing your net-snmp walk of the CPU timetics and percentages along side of the top output would be more beneficial.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
appodictic
Posts: 44
Joined: Thu Jul 10, 2008 4:46 pm

Post by appodictic »

These values look ok:
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 15
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 80
Maybe some calculation involving the raw values is throwing the graph off.
Attachments
snmp_stat.txt
SNMPWalk
(27.12 KiB) Downloaded 1469 times
iostat.txt
iostat
(1.18 KiB) Downloaded 1276 times
real time of same inverval
real time of same inverval
web_again.png (19.06 KiB) Viewed 20382 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

If you are not interestested in I/O wait, you might want to consider these instead for your "new" template.

UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 15
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 80

My guess is that the script is using the time-tics, which are problematic to convert to anything like a percentage without a script or script server script.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
appodictic
Posts: 44
Joined: Thu Jul 10, 2008 4:46 pm

Post by appodictic »

Thank you for helping me look at this. Just making sure, You do realize that the script I am using is the default CPU script/template that comes with cacti. This means everyone using this template to graph a Free-BSD system is getting the wrong data.

I am not saying its a cacti problem, FREE-BSD 'isms' like this come up often. I am using the NFSSTAT templates and I had to patch nfsstat to deal with a signed unsigned counter problem.
netdevel
Posts: 6
Joined: Mon Jul 30, 2007 11:00 am

Post by netdevel »

appodictic wrote:Thank you for helping me look at this. Just making sure, You do realize that the script I am using is the default CPU script/template that comes with cacti. This means everyone using this template to graph a Free-BSD system is getting the wrong data.

I am not saying its a cacti problem, FREE-BSD 'isms' like this come up often. I am using the NFSSTAT templates and I had to patch nfsstat to deal with a signed unsigned counter problem.
did you solved it?
I'm getting the same problem (freebsd 7.1). My graph shows 125% of cpu usage when the cpu usage is from 95 and 100 %, I don't know where to look to solve this problem :(
appodictic
Posts: 44
Joined: Thu Jul 10, 2008 4:46 pm

Post by appodictic »

Unfortunately, it looks like we are going to have to generate our own CPU graphs. Some of the values are correct. Some of them are wrong. (e.g. negative counters etc). I will whip something up in the next couple of days.

I would post a message to the 'Free-BSD users' mailing list, but I think I have been banned because of heated debates about things like this :)
mscandian
Posts: 12
Joined: Tue Mar 03, 2009 2:18 pm

Post by mscandian »

Hi.

I'm getting the same situation. My CPU Usage on FreeBSD 8 (and snmp 5.5) is wrong. The 'top -P' is showing:

CPU 0: 0.8% user, 0.0% nice, 6.0% system, 3.0% interrupt, 90.2% idle
CPU 1: 1.5% user, 0.0% nice, 30.5% system, 0.8% interrupt, 67.3% idle
CPU 2: 0.8% user, 0.0% nice, 0.8% system, 21.4% interrupt, 77.1% idle
CPU 3: 1.1% user, 0.0% nice, 9.0% system, 5.3% interrupt, 84.6% idle

and my graph on cacti is showing System with 98... 99...

What do u did to fix this problem?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

net-snmp CPU usage is quite tricky.
First, please know that there are several OIDs related to CPU usage. Not all of them are supported on all systems. For example, there are CPU GAUGEs and at a different OID there are CPU COUNTERs. So it depends on what you are currently monitoring.
I advertise 2nd link of my sig to see what's really going on behind the scene
R.
mscandian
Posts: 12
Joined: Tue Mar 03, 2009 2:18 pm

Post by mscandian »

Hi Gandalf.

Thanks for your reply.

In my case, I'm using COUNTER in "Data Source Type" in all templates (ucd/net - CPU Usage - Nice, ucd/net - CPU Usage - System, ucd/net - CPU Usage - User and ucd/net - CPU Usage - Idle).

But the values in 'top' show a low use of cpu with 80%, 90% idle, while cacti shows a high use with 'System'.

Regs
mscandian
Posts: 12
Joined: Tue Mar 03, 2009 2:18 pm

Post by mscandian »

I'm trying now using GAUGE but with this, the result is 0 (zero) in all (System, User, Nice and Idle).

GAUGE and OID:

Results with snmpget manually:

lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.50.0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 889498
lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.51.0
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 426
lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.52.0
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 20639268
lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.53.0
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 146133442
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

mscandian wrote:I'm trying now using GAUGE but with this, the result is 0 (zero) in all (System, User, Nice and Idle).

GAUGE and OID:

Results with snmpget manually:

lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.50.0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 889498
lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.51.0
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 426
lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.52.0
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 20639268
lab# snmpget -v 2c -c comu 201.x.y.z 1.3.6.1.4.1.2021.11.53.0
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 146133442
That are COUNTER OIDs, not GAUGEs
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest