Different CPU's Utilization in a single web page

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

mtb
Posts: 15
Joined: Tue Mar 27, 2007 4:47 am

Different CPU's Utilization in a single web page

Post by mtb »

hello all

can any one tell me that the cpu utilization of different machine can be displayed in a single web pag. because i want to monitor the cpu utilization of different machine at the same time.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Different CPU's Utilization in a single web page

Post by Howie »

mtb wrote:hello all

can any one tell me that the cpu utilization of different machine can be displayed in a single web pag. because i want to monitor the cpu utilization of different machine at the same time.
With weathermap 0.91, you would do something like:

Code: Select all

NODE myserver1
   POSITION 100 300
   TARGET gauge:/path/to/rrdfile/myserver1_cpu.rrd:1min:-
   LABEL {node:this:name} {node:this:bandwidth_in}
and repeat for each machine. You will need to know what the DS name is in your CPU rrd files (check the Data Sources section in Cacti for that).

That will leave you with node labels that look like "myserver1 4.5"
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

Hello there. I've never been one to piggy back on someone else's thread, but I was wondering if you'd gotten this workin since I am trying to accomplish pretty much the same thing and am so far having no luck. Here is my config:
WIDTH 800
HEIGHT 600
# BACKGROUND /var/www/html/plugins/weathermap/images/background_800x600.png
HTMLSTYLE overlib
HTMLOUTPUTFILE cpuusage.html
IMAGEOUTPUTFILE cpuusage.png
TITLE Server CPU Usage
KEYPOS 10 420 CPU Usage
KEYTEXTCOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0

# End of global section

# DEFAULT definitions:

#LINK DEFAULT
#ARROWSTYLE classic
BANDWIDTH 100M

# End of DEFAULTS section

# Node definitions:

NODE metaframe1_cpu0
LABEL {node:this:name} {node:this:bandwidth_in}
OVERLIBGRAPH https://hostname.domainname.com/graph_i ... _width=300
ICON /var/www/html/plugins/weathermap/images/my_server.png
TARGET gauge: /var/www/html/rra/metaframe1_cpu_1330.rrd:1min:-
LABELOFFSET S
POSITION 100 300

NODE metaframe1_cpu1
LABEL {node:this:name} {node:this:bandwidth_in}
OVERLIBGRAPH https://hostname.domainname.com/graph_i ... _width=300
ICON /var/www/html/plugins/weathermap/images/my_server.png
TARGET gauge: /var/www/html/rra/metaframe1_cpu_1331.rrd:1min:-
LABELOFFSET S
POSITION 250 300

NODE exch2k3_cpu0
LABEL {node:this:name} {node:this:bandwidth_in}
OVERLIBGRAPH https://hostname.domainname.com/graph_i ... _width=300
ICON /var/www/html/plugins/weathermap/images/my_server.png
TARGET gauge: /var/www/html/rra/exch2k3_cpu_1055.rrd:1min:-
LABELOFFSET S
POSITION 400 300

NODE exch2k3_cpu1
LABEL {node:this:name} {node:this:bandwidth_in}
OVERLIBGRAPH https://hostname.domainname.com/graph_i ... _width=300
ICON /var/www/html/plugins/weathermap/images/my_server.png
TARGET gauge: /var/www/html/rra/exch2k3_cpu_1056.rrd:1min:-
LABELOFFSET S
POSITION 550 300

# End of NODE section

# Link definitions:

# End of LINK section

# That's All Folks!
If anyone could let me know what the heck I'm doing wrong, I would appreciate it.

Thanks
-Chris
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Diggit2001 wrote:Hello there. I've never been one to piggy back on someone else's thread, but I was wondering if you'd gotten this workin since I am trying to accomplish pretty much the same thing and am so far having no luck.

If anyone could let me know what the heck I'm doing wrong, I would appreciate it.

Thanks
-Chris
What are you seeing, or not seeing?

You have a space between gauge: and the rrd filename in your TARGETs, which means that all your values will probably be out by 8x. Other than that, it looks right to me.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

What are you seeing, or not seeing?

You have a space between gauge: and the rrd filename in your TARGETs, which means that all your values will probably be out by 8x. Other than that, it looks right to me.
Well, the maps get drawn but they don't reflect the current CPU usage. They all stay at 0, even though when I look at the actual graph, it's showing anywhere between 5 and 15 % usage. None of the servers on the map are doign anything. They're just gray.

Thanks
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

Here's the map.

Thanks again.
-Chris
Attachments
weathermap_8.png
weathermap_8.png (6.21 KiB) Viewed 7287 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

OK. So take a look in the cacti.log - I suspect you'll see something about DS names not being correct.

The difference between your map, and the OP's is that yours is Windows servers and their's is Unix Load Average. Chances are you'll need to change the DS name (the '1min') to something else.

Here's an article I wrote a while ago about this type of problem, and how to sort it out.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

Ahh, excellent article. That really helps to make sense of whats going on here but I have thus far been unsuccessful with getting this to work. When I check out one of my data sources and turn on debug mode, like your article suggests, I get this:
/usr/bin/rrdtool create \
/var/www/html/rra/exch2k3_cpu_1055.rrd \
--step 300 \
DS:cpu:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \
So, I then change the Target line in my config to this:
TARGET gauge:/var/www/html/rra/exch2k3_cpu_1055.rrd:cpu
and I see this in my logs:
09/10/2007 10:01:58 AM - WEATHERMAP: Poller[0] ReadData: NODE exch2k3_cpu0, target: gauge:/var/www/html/rra/exch2k3_cpu_1055.rrd:cpu on config line 49 was not recognised as a valid TARGET
I'm sure I'm missing something still with the DS, but I haven't figured out what the heck it is. I do appreciate your continued assistance.

-Chris
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

OK, I think I've got it. I changed the TARGET line to this:
TARGET gauge:/var/www/html/rra/exch2k3_cpu_1055.rrd:cpu:cpu
This seems to have done the trick. Now I'm off to figure out if I can combine the totals of all 4 CPUS on the single server and average them out to a single output.

Thanks again for your help.
-Chris
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Yes. If you specify DS names, you must specify two (one for in and one for out). You can just use '-' to mean 'none' though. This is because the same code is used for links and nodes, and a link without in and out doesn't make much sense.

To sum all four into one, just list the 4 targets on one line:

Code: Select all

TARGET gauge:cpu1.rrd:cpu:- gauge:cpu2.rrd:cpu:- gauge:cpu3.rrd:cpu:- gauge:cpu4.rrd:cpu:-
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Diggit2001
Cacti User
Posts: 195
Joined: Tue May 03, 2005 4:29 pm
Location: MD, US

Post by Diggit2001 »

Thanks. yeah, I figured out how to sum them all up but what I really wanted was a way to show the average of all 4 processors together. I couldn't make it work right, so I moved on. I have the individual processors working, and thats what I was really after.

Thanks again.
-Chris
runlikeanantelope
Cacti User
Posts: 63
Joined: Thu Feb 15, 2007 12:08 pm

Post by runlikeanantelope »

I'm having a similar problem with 0.941 (but I'm not using Cacti - just stand-alone Weathermap with Cricket):

NODE Router6
LABEL {node:this:name} {node:this:ds1}
OVERLIBGRAPH https://server/statistics/cricket/mini- ... 200;rand=2
TARGET gauge:/data/cricket-data/routers/Router6.gw.psu.edu.rrd:ds0:ds1
POSITION 80 39


My label on the weathermap colors correctly based on the CPU utilization, but labels it "Router6 [Unknown]" so I know it is picking up the right DS (ds1), but not displaying it numerically correct??
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

runlikeanantelope wrote:I'm having a similar problem with 0.941 (but I'm not using Cacti - just stand-alone Weathermap with Cricket):

NODE Router6
LABEL {node:this:name} {node:this:ds1}
OVERLIBGRAPH https://server/statistics/cricket/mini- ... 200;rand=2
TARGET gauge:/data/cricket-data/routers/Router6.gw.psu.edu.rrd:ds0:ds1
POSITION 80 39


My label on the weathermap colors correctly based on the CPU utilization, but labels it "Router6 [Unknown]" so I know it is picking up the right DS (ds1), but not displaying it numerically correct??
That's because it's {node:this:bandwidth_in} - there's a partial list of these variable names in the advanced section of the manual.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
runlikeanantelope
Cacti User
Posts: 63
Joined: Thu Feb 15, 2007 12:08 pm

Post by runlikeanantelope »

OK - I've got it now. Thanks.

NODE Router6
LABEL {node:this:name} {node:this:bandwidth_in}%
OVERLIBGRAPH https://server/statistics/cricket/mini- ... 200;rand=2
TARGET gauge:/data/cricket-data/routers/computer2.gw.psu.edu.rrd:ds0:-
POSITION 399 212
runlikeanantelope
Cacti User
Posts: 63
Joined: Thu Feb 15, 2007 12:08 pm

Post by runlikeanantelope »

How can I round off the value from the DS so it only displays the whole number, not all the decimal places as in the picture below?
Attachments
percentage.JPG
percentage.JPG (104.19 KiB) Viewed 6163 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest