Need help with WeatherMap Legend

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
ikorzha758
Cacti User
Posts: 164
Joined: Thu Jan 21, 2010 8:41 pm

Need help with WeatherMap Legend

Post by ikorzha758 »

Guys I looked pretty much everywhere I can't figure out how to can I change the legend to look like the attached image.
If anybody can post a code that can create this particular legend bar I would greatly appreciate it. In addition I would like to know how do I control width and hight of the legend.

Thank you in advance for any response.

FYI here is my MAP :wink:
Attachments
I would like my map to use this legend.  Looking for someone to past source code.
I would like my map to use this legend. Looking for someone to past source code.
legend.gif (5.37 KiB) Viewed 11643 times
Here is my 2nd map. Not bad so far If I can fix the legend
Here is my 2nd map. Not bad so far If I can fix the legend
Mymap.gif (66.48 KiB) Viewed 11643 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

If you have the scale already defined that way, then

KEYSTYLE vertical

does what you want.
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!)
ikorzha758
Cacti User
Posts: 164
Joined: Thu Jan 21, 2010 8:41 pm

Howie, I'm sorry that I didn't make myself clear

Post by ikorzha758 »

When it comes to vertical or horizontal I have figured that part as per documentation.
What I look for the legend code that would blend seamlessly from light blue to dark red as per attached previously picture as well as how to control the height and width of the legend.
If you can post a sample code of what the legend would look like I would greatly appreciate it

The scale and legend I use now is very ugly. See attached graph is this reply and my source code:
KEYPOS DEFAULT 816 624 Traffic Load
KEYSTYLE DEFAULT horizontal
KEYTEXTCOLOR 0 0 0
KEYOUTLINECOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0

SCALE 0 0.01 204 255 255
SCALE 0.01 0.5 153 255 204
SCALE 0.5 1 51 104 255
SCALE 1 2 51 102 255
SCALE 2 5 92 255 92
SCALE 5 8 31 255 31
SCALE 8 15 0 184 0
SCALE 15 30 0 102 0
SCALE 30 35 0 102 51
SCALE 35 60 255 255 0
SCALE 60 75 255 166 77
SCALE 75 90 204 102 51
SCALE 90 100 255 0 0
Attachments
legend2.gif
legend2.gif (2.59 KiB) Viewed 11629 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

If you put two colour definitions on a scale line, then weathermap blends between those two colours over the dpread between the values:

e.g.

SCALE 0 100 255 0 0 0 255 0

blends between red and green as the percentage goes from 0 to 100.

So if you make sure that the second colour in one band matches the first colour in the next band, you get a smooth rainbow.
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!)
ikorzha758
Cacti User
Posts: 164
Joined: Thu Jan 21, 2010 8:41 pm

Thank you based on your reply I have figured it out.

Post by ikorzha758 »

I have now only 1 more question.
How do I control the height and width of the legend as well as font size/fonts on the legend tag.
Thank you very much in advance for your reply.
Attachments
My legend doesn't fit into the graph.How do I control the height and width of the legend as well as font size/fonts on the legend tag
My legend doesn't fit into the graph.How do I control the height and width of the legend as well as font size/fonts on the legend tag
Mymap.gif (65.43 KiB) Viewed 11611 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

KEYFONT controls the font
It also controls the height (it's 4 lines of text tall, I think)

KEYSTYLE horizontal 600

makes the horizontal scale 600 pixels wide

All of that is in the manual under KEYSTYLE, I think.
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!)
tcprado
Posts: 23
Joined: Fri Apr 12, 2013 7:25 am

Re: Need help with WeatherMap Legend

Post by tcprado »

SET key_hidepercent_DEFAULT 1
SET key_hidezero_DEFAULT 1
SCALE DEFAULT 0 0 192 192 192
SCALE DEFAULT 0 1M 255 255 255 0 255 0 0-1M
SCALE DEFAULT 1M 10M 0 255 0 200 255 0 1M-10M
SCALE DEFAULT 10M 25M 200 255 0 255 255 0 10M-25M
SCALE DEFAULT 25M 40M 255 255 0 255 200 0 25M-40M
SCALE DEFAULT 40M 55M 255 200 0 255 150 0 40M-55M
SCALE DEFAULT 55M 70M 255 150 0 255 75 0 55M-70M
SCALE DEFAULT 70M 85M 255 75 0 200 0 150 70M-85M
SCALE DEFAULT 85M 95M 200 0 150 125 0 125 85M-95M
SCALE DEFAULT 95M 100M 125 0 125 125 0 125 95M-100M

displays the following:
Capturar.PNG
Capturar.PNG (3.36 KiB) Viewed 8439 times
How can I change the text from 10000000-25000000 to 10M-25M ?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Need help with WeatherMap Legend

Post by Howie »

Hmm. I'm not sure if you can. It's also a bug that the box isn't big enough to contain the text... :oops:

Absolute scales need some love.
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!)
tcprado
Posts: 23
Joined: Fri Apr 12, 2013 7:25 am

Re: Need help with WeatherMap Legend

Post by tcprado »

Howie wrote:Hmm. I'm not sure if you can. It's also a bug that the box isn't big enough to contain the text... :oops:

Absolute scales need some love.
check my other post here
http://forums.cacti.net/viewtopic.php?f=16&t=54429
Is there a way to make it horizonta?
jimcjulsonjr
Posts: 48
Joined: Fri Dec 07, 2012 11:11 am

Re: Need help with WeatherMap Legend

Post by jimcjulsonjr »

hmm...oddly, copying and pasting that configuration didn't work for me. The legend changed fine, but then all my lines failed to actually show the colors. I'm not sure if it's my values or not. I'm dealing with links that are 100Gbps (Yes, Gigabits Per Second). I adjusted mine to look like this:

0 - 1000M
1001M 9999M
10000M 19999M
20000M 29999M
etc..


Any thoughts? Is that the right method above to represent the speeds I need?
-------------------------------------

VERSION: Cacti 0.8.8b
POLLER: Spine
DATA SOURCES: 100,000K and Growing (Multiple Servers)
PLUGINS: AUTOM8, THOLD, DISCOVER, WEATHERMAP, BOOST, CLOG, NECTAR, MACTRACK, FLOWVIEW, SPIKEKILL, INTROPAGE, MONITOR
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Need help with WeatherMap Legend

Post by Howie »

This is now the third different question tacked onto the same topic, but if you mean the absolute scale one, directly above...

You are leaving gaps in your scale (e.g. 1000.5Mbit/sec) but otherwise, yes it is. Are you actually setting absolute mode in the USESCALE command for each link (or the DEFAULT link)? By default it'll use percentages and these are all very high percentages :-)

My suggestions:

1) Don't bother with 1999 etc. Just use 1000-2000, 2000-3000. For the very edge case that it's *exactly* 2000Mbit/sec, you might get the wrong colour, but does that *really* matter?

2) For typical use (looking for link saturation), using percentages and setting BANDWIDTH will save you messing with different scales for different link capacities, etc. Again, the idea is usually to indicate where the load is, not to actually measure it by which colour is used. Maybe your application is different.

If you have got absolute scales turned on, then it's worth checking your actual data source (e.g. rrd files) to see if they are capturing data accurately. Running weathermap with DEBUG logging turned on in Cacti will give you a lot of information about what's going on internally in the cacti.log
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!)
jimcjulsonjr
Posts: 48
Joined: Fri Dec 07, 2012 11:11 am

Re: Need help with WeatherMap Legend

Post by jimcjulsonjr »

Howie, thanks so much for the fast response. And also, forgive me for not posting a new one in a different thread. I appreciate you taking the time in spite of the fact I should have or could have posted elsewhere!

That said, if my links are set to show Percentages, will that cause the disconnect? Do I simply need to adjust the links to show absolute values rather than the percentage?

To answer your question from your first point, *no* it doesn't matter that much. It's purely about link saturation for us for this particular map.

Regarding number 2, I agree, but, I do want to tweak the percentages because the defaults are a BIG gap when you are talking about 100Gbps transit links. Seeing a jump from 1Gbps up to 2Gbps is significant, as is 5Gbps up to 10Gbps. So I'm hoping to to break them down quite a bit so that we have a visual cue that lets the "less informed" masses understand what's taking place. For us network guys, we get it regardless.

Last, I know the RRD's are capturing the data accurately for sure. Things are working great. I will move onto the Debugging to dig deeper. Again, I really appreciate your guidance and help, and I just have to once again thank you and compliment you for sticking with this project the way you have. You've achieved something quite great here, and you should be commended on your efforts.
-------------------------------------

VERSION: Cacti 0.8.8b
POLLER: Spine
DATA SOURCES: 100,000K and Growing (Multiple Servers)
PLUGINS: AUTOM8, THOLD, DISCOVER, WEATHERMAP, BOOST, CLOG, NECTAR, MACTRACK, FLOWVIEW, SPIKEKILL, INTROPAGE, MONITOR
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Need help with WeatherMap Legend

Post by Howie »

Agreed about the spacing - I just meant that if you make a new scale of percentages, then it will apply equally to 1G and 100G, and make one change to the "LINK DEFAULT" section to apply it to any link. With absolute scales, you need to manage it a bit more.

Also, you may not be aware that you can also have gradients in scales, so if you are looking for a gradual change, you don't necessarily need to have a zillion separate SCALE lines.

like this:

Code: Select all

# exactly 0 is usually bad
SCALE newdefault 0 0 255 0 0
# from black to blue for first 20%
SCALE newdefault 0 20  0 0 0   0 0 255
# from blue to green for 20-40%
SCALE newdefault 20 40  0 0 255   0 255 0
# from green to yellow for 40-60%
SCALE newdefault 40 60  0 255 0   255 255 0
# from yellow to red for 60-80%
SCALE newdefault 60 80  255 255 0   255 0 0
# red for 80%+
SCALE 80 100 255 0 0
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!)
jimcjulsonjr
Posts: 48
Joined: Fri Dec 07, 2012 11:11 am

Re: Need help with WeatherMap Legend

Post by jimcjulsonjr »

Howie wrote:Agreed about the spacing - I just meant that if you make a new scale of percentages, then it will apply equally to 1G and 100G, and make one change to the "LINK DEFAULT" section to apply it to any link. With absolute scales, you need to manage it a bit more.

Also, you may not be aware that you can also have gradients in scales, so if you are looking for a gradual change, you don't necessarily need to have a zillion separate SCALE lines.

like this:

Code: Select all

# exactly 0 is usually bad
SCALE newdefault 0 0 255 0 0
# from black to blue for first 20%
SCALE newdefault 0 20  0 0 0   0 0 255
# from blue to green for 20-40%
SCALE newdefault 20 40  0 0 255   0 255 0
# from green to yellow for 40-60%
SCALE newdefault 40 60  0 255 0   255 255 0
# from yellow to red for 60-80%
SCALE newdefault 60 80  255 255 0   255 0 0
# red for 80%+
SCALE 80 100 255 0 0
I actually ended up doing just that, but got a little more granular. For us, the difference in 1Gbps - 5Gbps is huge, and then as we saturate a 100Gbps link more, that's even more critical to know (visually) what it's doing. But yeah, thanks again for setting me straight on the path. Helped a lot! Got a beautiful, gradient horizontal graph now and about 8 x 100Gbps links all looking awesome in my Weathermap!
-------------------------------------

VERSION: Cacti 0.8.8b
POLLER: Spine
DATA SOURCES: 100,000K and Growing (Multiple Servers)
PLUGINS: AUTOM8, THOLD, DISCOVER, WEATHERMAP, BOOST, CLOG, NECTAR, MACTRACK, FLOWVIEW, SPIKEKILL, INTROPAGE, MONITOR
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest