CPU usage on 2, 4 and 8 way Linux devices

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

Moderators: Developers, Moderators

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

CPU usage on 2, 4 and 8 way Linux devices

Post by fmangeant »

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 6394 times
cacti_graph_template_ucdnet_cpu_usage_4_way.xml
(22.56 KiB) Downloaded 6665 times
cacti_graph_template_ucdnet_cpu_usage_2_way.xml
(22.56 KiB) Downloaded 8506 times
CPU_x_ways.png
CPU_x_ways.png (22.59 KiB) Viewed 90081 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:

Post by alexb »

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: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

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

Post by janeller »

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

Post by kamina »

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: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

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

Post by kamina »

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

Post by mr_chip »

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: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

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...

Post by Viper »

Hello !
I see "Error: XML: Hash version does not exist." when importing the templates .
What the problem ?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

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

Post by Viper »

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: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

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

Post by Viper »

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

Post by xpbit »

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

Who is online

Users browsing this forum: No registered users and 1 guest