ZORDER LABELBG + {node:this:inscaletag}

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
Atreides
Cacti User
Posts: 150
Joined: Mon May 31, 2010 9:26 am

ZORDER LABELBG + {node:this:inscaletag}

#1 Post by Atreides » Tue Nov 08, 2016 1:18 pm

Is it possible to have only one NODE for this kind of setup ?. I want to have a node wich graph an .PNG base of interface status(up or down), but also i want to have a LABELBGCOLOR. I tried to play with ZORDER, but didnt manage to(the BGCOLOR overwrites the PNG. I know I can make this happen with 2 NODES like below.

NODE P1
TEMPLATE PORTS
ICON images/ra_{node:this:inscaletag}.png
TARGET gauge:/var/www/html/cacti/rra/ro-ar01a-ra_int_status_3858.rrd:int_status:-
USESCALE ifstatus in
POSITION STATUS 0 23

NODE P1_B
POSITION STATUS 0 23
ZORDER 100
LABELFONT 102
LABELOUTLINECOLOR none
LABELBGCOLOR 255 178 102
ICON 93 24 box

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

Re: ZORDER LABELBG + {node:this:inscaletag}

#2 Post by Howie » Tue Nov 08, 2016 2:14 pm

That's an interesting question!

You could have a scale like this (for whatever the two values are):

Code: Select all

SCALE updown 0 1 255 178 102 down
SCALE updown 1 2 255 178 102 up
So the colour is set by the scale, but the colour is the same for both values...

A USESCALE will always override the manually set colour.

[woo! this is my 5000th post on the Cacti forums...]
Weathermap 0.98 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!)

Atreides
Cacti User
Posts: 150
Joined: Mon May 31, 2010 9:26 am

Re: ZORDER LABELBG + {node:this:inscaletag}

#3 Post by Atreides » Tue Nov 08, 2016 3:42 pm

What I want is to have a NODE ICON 110 24 box ( filled with a color) and on top of that...the ICON inscaletag wich is a PNG with an green OK for up and a red X for down :).

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

Re: ZORDER LABELBG + {node:this:inscaletag}

#4 Post by Howie » Tue Nov 08, 2016 4:21 pm

Oh, that's two icons, so you will need two nodes. Sorry!

How about making a 110x24 box in your paint software, and pasting on the icon? Two copies, one for up, one for down?

Like the attached?
Attachments
up.png
up.png (775 Bytes) Viewed 1582 times
down.png
down.png (693 Bytes) Viewed 1582 times
Weathermap 0.98 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!)

Atreides
Cacti User
Posts: 150
Joined: Mon May 31, 2010 9:26 am

Re: ZORDER LABELBG + {node:this:inscaletag}

#5 Post by Atreides » Tue Nov 08, 2016 4:31 pm

I can do that, will do that, was wondering if I can make it with one node. Maybe I'll get tired of that BG color, and want another :), I'll have to make another edit in paint software, upload the png again, etc.

PS : I thought of making one big box for all 32 ports, like 110 768(24*32) and BG color that, but it wont look like I want(each 110 24 box nicely separately from another, the up and down line from each port, will be missing).

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

Re: ZORDER LABELBG + {node:this:inscaletag}

#6 Post by Howie » Tue Nov 08, 2016 4:41 pm

Not with two icons, no.

For the box aicon in particular, it would be useful to be able to force the size of the label box, I guess, so you don't need to use an icon. Then there would be one icon and one label that you can colour as usual.
Weathermap 0.98 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
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: ZORDER LABELBG + {node:this:inscaletag}

#7 Post by Pucho » Tue Nov 08, 2016 4:44 pm

Atreides wrote:I can do that, will do that, was wondering if I can make it with one node. Maybe I'll get tired of that BG color, and want another :), I'll have to make another edit in paint software, upload the png again, etc.

PS : I thought of making one big box for all 32 ports, like 110 768(24*32) and BG color that, but it wont look like I want(each 110 24 box nicely separately from another, the up and down line from each port, will be missing).
I don't quite understand what's the final outcome you're aiming but wouldn't be better with relative positions and templates?
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

Atreides
Cacti User
Posts: 150
Joined: Mon May 31, 2010 9:26 am

Re: ZORDER LABELBG + {node:this:inscaletag}

#8 Post by Atreides » Tue Nov 08, 2016 4:55 pm

This is what I want to accomplish. Since there are 2 icons(ICON 93 24 box for the background color and the ICON added from inscaletag), I thought I can make it happen with just one NODE.
Maybe a future feature? to be able to put 2 icons on a node with different zorder ?.
Attachments
interface status.png
interface status.png (36.49 KiB) Viewed 1573 times

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: ZORDER LABELBG + {node:this:inscaletag}

#9 Post by Pucho » Tue Nov 08, 2016 5:03 pm

Yep, I'm with you. Would be useful for me too.

Don't know what's easiest, maybe just making USESCALE not overriding the colors and also grid maker feature for the web editor.
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

Atreides
Cacti User
Posts: 150
Joined: Mon May 31, 2010 9:26 am

Re: ZORDER LABELBG + {node:this:inscaletag}

#10 Post by Atreides » Tue Nov 08, 2016 5:08 pm

Howie, is there a way to ignore the warnings for negative values? I have a few and set nowarnclip 1 works only for positive values.

PUCHO : Managed to get the result with 2 nodes using same POSITION.

NODE P2
TEMPLATE PORTS
ICON images/ra_{node:this:inscaletag}.png
TARGET gauge:/var/www/html/cacti/rra/ro-ar01a-ra_int_status_3859.rrd:int_status:-
USESCALE ifstatus in
POSITION P1 0 23

NODE P2_B
TEMPLATE PORT_B
POSITION P1 0 23

Second NODE is just for filling the background with that yellow'ish color.

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

Re: ZORDER LABELBG + {node:this:inscaletag}

#11 Post by Howie » Wed Nov 09, 2016 5:38 am

For the warnings, there are two ways:

1) If the warning has WMWARNxx in it, you can add "SET nowarn_WMWARNxx 1" to the map config file (or in the Cacti UI for a group of maps/globally if you like)

2) Using an absolute scale should also stop any complaints about clipping or negative values.
Weathermap 0.98 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
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: ZORDER LABELBG + {node:this:inscaletag}

#12 Post by Howie » Wed Nov 09, 2016 5:48 am

Having USESCALE not update the BGCOLOR... this is a little bit unusual, because in theory that's all that USESCALE does :-) I definitely can see the point though. I'm just trying to think of the best way to configure it that isn't confusing to someone who doesn't care about it.

USESCALE somescale in nocolor

USESCALE somescale in keyonly

NODE sdfsdf
SET ignore_scalecolor 1

something else?

A grid wizard in the editor is something I've been thinking about for a while. I usually write a little perl script or use excel to generate the config, but I can see that not everyone could, and this would be quicker.
Weathermap 0.98 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!)

Post Reply