Dynamic Label color for nodes (based on CPU usage)
Moderators: Developers, Moderators
Dynamic Label color for nodes (based on CPU usage)
Hi all,
I'm trying to change the color of a node label based on CPU usage. Based on the manual, we have created the following code that does not work:
NODE PAPY
LABEL Home
ICON images/my_router.png
LABELOFFSET S
TARGET /var/www/html/rra/ce26212_5min_cpu_87.rrd:5min_cpu:-
POSITION 886 362
Could you help sorting out this please?
Ben
I'm trying to change the color of a node label based on CPU usage. Based on the manual, we have created the following code that does not work:
NODE PAPY
LABEL Home
ICON images/my_router.png
LABELOFFSET S
TARGET /var/www/html/rra/ce26212_5min_cpu_87.rrd:5min_cpu:-
POSITION 886 362
Could you help sorting out this please?
Ben
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Dynamic Label color for nodes (based on CPU usage)
Which version of weathermap are you using? For node targets to work, you need to use the (beta test) 0.9pre1 version.ben_2007 wrote:Hi all,
I'm trying to change the color of a node label based on CPU usage. Based on the manual, we have created the following code that does not work:
NODE PAPY
LABEL Home
ICON images/my_router.png
LABELOFFSET S
TARGET /var/www/html/rra/ce26212_5min_cpu_87.rrd:5min_cpu:-
POSITION 886 362
Could you help sorting out this please?
Ben
That's correct config though. Bear in mind that by default it will use the same scale as the bandwidth arrows, with a maximum value of 100. So your load average will need to be fairly high to get significant changes.
You probably want to set the MAXVALUE for your node to something more like 10 or 20, so that 100% is something you might see. If I saw a load of 100 on one of our servers, I would be listening for the fire system's gas-dump alarm
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!)
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!)
Hi Howie,
I'm using v0.9 version. I already changed MAXVALUE to adjust current polled value to around 50% of MAXVALUE.
I should get some color. I tried with other values of OID. It works with these values.
Therefore, it seems to be an incompatibility between this function and the CPU value.
Any idea/comment about this?
Thanks, Ben
I'm using v0.9 version. I already changed MAXVALUE to adjust current polled value to around 50% of MAXVALUE.
I should get some color. I tried with other values of OID. It works with these values.
Therefore, it seems to be an incompatibility between this function and the CPU value.
Any idea/comment about this?
Thanks, Ben
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
One other thing - tryben_2007 wrote:Hi Howie,
I'm using v0.9 version. I already changed MAXVALUE to adjust current polled value to around 50% of MAXVALUE.
I should get some color. I tried with other values of OID. It works with these values.
Therefore, it seems to be an incompatibility between this function and the CPU value.
Any idea/comment about this?
Thanks, Ben
Code: Select all
TARGET gauge:/var/www/html/rra/ce26212_5min_cpu_87.rrd:5min_cpu:-
It definitely works, because I use it myself to map temperatures and humidity around our data centre.
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!)
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!)
I used the proposed code and it works for me.
However, the Weathermap log has now the following line for each of the CPU entry I use to colour the label:
However, the Weathermap log has now the following line for each of the CPU entry I use to colour the label:
Have you already experienced the same kind of notice?Notice: Undefined index: - in /var/www/html/plugins/weathermap/lib/datasources/WeatherMapDataSource_rrd.php on line 172
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
No, but I can see why you would get it. It's nothing to worry about. I'll make changes to stop the warning.khooker wrote:I used the proposed code and it works for me.
However, the Weathermap log has now the following line for each of the CPU entry I use to colour the label:
Have you already experienced the same kind of notice?Notice: Undefined index: - in /var/www/html/plugins/weathermap/lib/datasources/WeatherMapDataSource_rrd.php on line 172
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!)
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!)
-
- Posts: 6
- Joined: Sat Mar 04, 2006 11:34 pm
- Location: México
Node Icon changing color
Hi Howie, I was wondering if there is a way to link the data read by some Target and to scale it to a color, and that the value in between that scale can Set a specific number or name, in order to change the ICON using the Special Tokens (another image with other color).
I don't know if you understand me, but the idea is for a Map that changes it's color according to any data fetch value.
I don't know if you understand me, but the idea is for a Map that changes it's color according to any data fetch value.
Last edited by oasturiano on Tue Apr 03, 2007 7:44 pm, edited 4 times in total.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Node Icon changing color
Well, neither the map BACKGROUND colour or image can use the special string tokens at the moment, so the short answer is no.oasturiano wrote:Hi Howie, I was wondering if there is a way to link the data read by some Target and to scale it to a color, and that the value in between that scale can Set a specific number or name, in order to change the ICON using the Special Tokens (another image with other color).
I don't know if you understand me, but the idea is for a Map that changes it's color according to any data fetch value.
You want the whole background of the map to change colour, so it's visible from the thumbnail view?
This is the sort of thing that the new weathermap post-processing plugins in 0.9 are intended for, although I haven't really worked out the details yet.
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!)
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!)
-
- Posts: 6
- Joined: Sat Mar 04, 2006 11:34 pm
- Location: México
Well, what I meant was, if there is a way to set a specific value in a variable if some data read by cacti falls into a range of values (like the scale).
With that number set in a variable (0,1,2,3...), to change an Icon in the map, using the syntax:
ICON images/image_name_{node:this:variable}.png
Or something like that... But I guess like you say, there is got to be a pre or post-processing
With that number set in a variable (0,1,2,3...), to change an Icon in the map, using the syntax:
ICON images/image_name_{node:this:variable}.png
Or something like that... But I guess like you say, there is got to be a pre or post-processing
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
How about if the matching scale line-number was stored away somewhere for each node/link? That way you could define a custom scale on a hidden-away node (position -100 0 or something), then read that line number back out to use somewhere. Just trying to think of a simple way to achieve this... simple for the code, I meanoasturiano wrote:Well, what I meant was, if there is a way to set a specific value in a variable if some data read by cacti falls into a range of values (like the scale).
With that number set in a variable (0,1,2,3...), to change an Icon in the map, using the syntax:
ICON images/image_name_{node:this:variable}.png
Or something like that... But I guess like you say, there is got to be a pre or post-processing
To do this for each node, you would need a hidden node for each one though So it still needs something that does the same comparisons as the scale/colour process, but without changing the colour...
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!)
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!)
Code: Select all
TARGET gauge:/var/www/html/rra/ce26212_5min_cpu_87.rrd:5min_cpu:-
I've tried implementing it but the labels are all grayed out...
Couldn't find anything on the weathermap site about this...
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
There's a page of the manual about targets.KBBAch wrote:Can anyone explain to me how this code actually works?Code: Select all
TARGET gauge:/var/www/html/rra/ce26212_5min_cpu_87.rrd:5min_cpu:-
I've tried implementing it but the labels are all grayed out...
Couldn't find anything on the weathermap site about this...
Anyway, this one looks at /var/www/html/rra/ce26212_5min_cpu_87.rrd
It doesn't multiply by 8 (gauge:) and it fetches a DS called 5min_cpu as the 'in' value and nothing at all as the 'out' value (-).
If you run DEBUG logging and look in the logs, you can see a lot of information about how the data is being collected.
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!)
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!)
Hiii thx for the fast reply...
Yeah, just found the documentation, so embarrasing..
Well.. I guess in my case it should look like this then
I'll try implementing it... [/code]
Yeah, just found the documentation, so embarrasing..
Well.. I guess in my case it should look like this then
Code: Select all
TARGET /var/www/cacti/rra/MT-RO-01_5min_cpu_22.rrd:5min_cpu:-
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
With the gauge: prefix. Otherwise it will multiply by 8 (the default is to treat the data as byte counters, and multiply by 8 to get bits).KBBAch wrote:Hiii thx for the fast reply...
Yeah, just found the documentation, so embarrasing..
Well.. I guess in my case it should look like this thenI'll try implementing it... [/code]Code: Select all
TARGET /var/www/cacti/rra/MT-RO-01_5min_cpu_22.rrd:5min_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!)
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!)
Who is online
Users browsing this forum: No registered users and 2 guests