LABELFONTCOLOR to none

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
msantana
Posts: 27
Joined: Mon May 18, 2009 8:33 am

LABELFONTCOLOR to none

Post by msantana »

Hello. My respects to the developers of Cacti and Weathermap.

Perhaps my question has already been addressed on another forum. If so, I'd appreciate if someone can guide me where to find the thread.

I'm using Weathermap to illustrate the status of a switch as the following:

The problem I'd like to solve is the appearance of the value of the datasource when values are 0 and 2; as they shown in the picture. The node configuration I'm using is the following:
Switch_Port_Status.png
Switch_Port_Status.png (19.95 KiB) Viewed 2098 times
NODE ge-0-0-0
LABEL {node:this:bandwidth_in:%d}
LABELFONT 1
LABELFONTCOLOR 0 255 0
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=12051
OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=12051
ICON images/square_button.jpg
TARGET gauge:/var/www/cacti-0.8.8g/rra/file.rrd:snmp_oid:-
USESCALE portupdown in percent
POSITION ge-0-0 -207 7

The scale has the following configuration:

SCALE portupdown 1 1 0 255 0 Up
SCALE portupdown 2 2 255 0 0 Down
SCALE portupdown 0 0 255 255 255 Disabled

The only way I've acheived to mask the values is when the port is up, the labelfontcolor forces the color match the status; therefore it disappears. I was wondering how can I achieve the same when the values are 0 or 2 (down or disabled).

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

Re: LABELFONTCOLOR to none

Post by Howie »

It's not completely clear - you just want there to be no label at any time?

Change the LABEL :-)

Code: Select all

NODE ge-0-0-0
   LABEL
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!)
msantana
Posts: 27
Joined: Mon May 18, 2009 8:33 am

Re: LABELFONTCOLOR to none

Post by msantana »

Hello Howie, first thank you replying so quickly I apologize for not responding promptly.

To answer your question, yes... In this case I do not want the label appear at any time.

To elaborate on what I'm doing. Each port on the switch is a node on the picture with a box icon that I made. The datasource that it targets brings the traditional IF-MIB::ifOperStatus value to either one (1) if the port is up or two (2) if the port is down.

Now, there's an issue (for this application) with the font color. The default is black, so in order to mask the color I defined as green so in normal operations the value disappears. The issue occurs when the port is down, since the font color is green, the value appears.

So, going back to technical terms, I'd assume one way is to have a no color feature on the labelfontcolor command; unless there's another way to do this.

I hope I've explained myself clearly.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: LABELFONTCOLOR to none

Post by Howie »

So once again - why not just change the label to be blank? If there's no text, it doesn't matter what colour it is.

There is no practical reason to have a labelfontcolor of 'none' that I can think of, when you can just have no label instead.
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!)
msantana
Posts: 27
Joined: Mon May 18, 2009 8:33 am

Re: LABELFONTCOLOR to none

Post by msantana »

I gave your question some thought, and found the solution. For some reason leaving it blank disables the coloring feature and all I get is the plain icon. Apparently, when it comes it the node configuration, it needs invoke some sort of value.

However, I've managed to achieve what I was pursuing with the following command:

LABEL {node:this: : }

Now the values do not appear in any case. Here's the result.
Switch_Port_Status.png
Switch_Port_Status.png (18.7 KiB) Viewed 1816 times
Thank you Howie!
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: LABELFONTCOLOR to none

Post by Howie »

Ooooh, those boxes are the label box, not an icon...

Yes, the label box will disappear when there is no label.

"USEICONSCALE portupdown in percent" and "ICON 5 5 box" is probably a more predictable way to get the same result (with a blank LABEL). But I guess it's working, so doesn't need fixing :-)
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!)
msantana
Posts: 27
Joined: Mon May 18, 2009 8:33 am

Re: LABELFONTCOLOR to none

Post by msantana »

Certainly my lack of a clear explanation didn't help. I've attached a raw config along with icons I'm using for the configuration. I hope this is useful for someone.

Cheers...
switch_status.rar
(7.94 KiB) Downloaded 123 times
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests