CPU usage on 2, 4 and 8 way Linux devices

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

CPU usage on 2, 4 and 8 way Linux devices

#1 Post by fmangeant » Mon Aug 14, 2006 7:41 am

Hi all

here are some data & graph templates for multiple CPU Linux devices.
Indeed, Net-SNMP under Linux returns counters whose values range from 0 to (100 x number of logical CPU).

More and more systems use dual core, hyper threading, etc. so the default template which ship with Cacti doesn't work.

To know how many logical CPU are seen by Linux, run this command :

Code: Select all

$ grep -c ^processor /proc/cpuinfo
2
The graph templates do not use the "Auto Scale" functionnality, they are fixed between 0 and 100 percent.

These templates require Cacti 0.8.6h
Attachments
cacti_graph_template_ucdnet_cpu_usage_8_way.xml
(22.56 KiB) Downloaded 6234 times
cacti_graph_template_ucdnet_cpu_usage_4_way.xml
(22.56 KiB) Downloaded 6549 times
cacti_graph_template_ucdnet_cpu_usage_2_way.xml
(22.56 KiB) Downloaded 8329 times
CPU_x_ways.png
CPU_x_ways.png (22.59 KiB) Viewed 87357 times
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

alexb
Posts: 3
Joined: Tue Nov 29, 2005 12:34 pm
Contact:

#2 Post by alexb » Fri Aug 25, 2006 5:37 pm

Good stuff...
I think you need to remove maximum value of 100 from data templates for ucd/net - CPU Usage, it can go beyond 100 on SMP systems.

AlexB

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#3 Post by fmangeant » Wed Aug 30, 2006 4:52 am

Hi
alexb wrote:I think you need to remove maximum value of 100 from data templates for ucd/net - CPU Usage, it can go beyond 100 on SMP systems.
that's why I made these templates :)

They use CDEF to divide each counter by the number of processors.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

janeller
Posts: 1
Joined: Fri Sep 01, 2006 2:27 pm

#4 Post by janeller » Fri Sep 01, 2006 2:32 pm

great job, thank you very much!
before installing your template the processor load from the dualcore cpu has been showed like the scales from top in ssh multiplicated with 2... :-?

kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

#5 Post by kamina » Fri Sep 08, 2006 8:32 am

I added io-wait to these graphs, but they seem disproportionate. Should I also be using the division for them? They seem to correlate with top better when I leave them without division.

edit:

I think I'm mistaken, it does need to be divided :)

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#6 Post by fmangeant » Fri Sep 08, 2006 10:15 am

I think so.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

#7 Post by kamina » Fri Sep 08, 2006 10:59 am

I finally managed to get io-wait which was consistant enough to judge from the averige, it definatly does need to be divided.

mr_chip
Posts: 3
Joined: Mon Sep 18, 2006 3:35 pm

#8 Post by mr_chip » Mon Sep 18, 2006 3:38 pm

Crap. I applied these templates and now every single graph in my cacti installation is blank.

My RRD's are still updating, the cacti log has nothing since I've done the change, and I'm stumped. Any ideas?

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#9 Post by fmangeant » Tue Sep 19, 2006 10:56 am

Hi

did you have any error (like "dependancy not met") when importing the templates ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

Viper
Posts: 3
Joined: Wed Oct 11, 2006 8:51 am

Error...

#10 Post by Viper » Wed Oct 11, 2006 8:54 am

Hello !
I see "Error: XML: Hash version does not exist." when importing the templates .
What the problem ?

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#11 Post by fmangeant » Wed Oct 11, 2006 9:13 am

Hi

these templates were exported from Cacti 0.8.6h, so you need at least this version to import them.

What version are you running ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

Viper
Posts: 3
Joined: Wed Oct 11, 2006 8:51 am

#12 Post by Viper » Wed Oct 11, 2006 9:22 am

fmangeant wrote:Hi

these templates were exported from Cacti 0.8.6h, so you need at least this version to import them.

What version are you running ?
Thaks ! i use Cacti Version 0.8.6c.

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#13 Post by fmangeant » Wed Oct 11, 2006 9:30 am

If you have a large Cacti installation, 0.8.6i (released yesterday) is for you :D
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

Viper
Posts: 3
Joined: Wed Oct 11, 2006 8:51 am

#14 Post by Viper » Thu Oct 12, 2006 12:25 am

fmangeant wrote:If you have a large Cacti installation, 0.8.6i (released yesterday) is for you :D
A lot of thanks )

xpbit
Posts: 20
Joined: Fri Sep 29, 2006 3:34 pm

#15 Post by xpbit » Thu Oct 19, 2006 3:49 pm

im not getting any data for the 4 way graph. no errors in the poller either. any ideas? it doesnt say nan just 0.00

Post Reply