[Solved] Changing the default scale, legend problems

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

[Solved] Changing the default scale, legend problems

Post by malgoe »

Hi,

I've got some links on my weathermap with 0.1-0.5% load, but it is still important to see the traffic flow. Hence i tried changing the default scale so i will get different colors even at very low loads. That seems to work fine, but the legend looks really messy.

Here's my scale:

Code: Select all

SCALE DEFAULT 0    0    192 192 192  
SCALE DEFAULT 0.01    0.5    140 0 255  
SCALE DEFAULT 0.5   1    32  32 255  
SCALE DEFAULT 1   25     0 192 255  
SCALE DEFAULT 25   55     0 240   0  
SCALE DEFAULT 55   70   240 240   0  
SCALE DEFAULT 70   85   255 192   0  
SCALE DEFAULT 85   100  255   0   0 
The legend then displays:
0-1%
0.01-0.5%
0.5-1%
1-10%
1-25%
10-25%
25-40%
25-55%
40-55%

and the rest doesn't even fit into the legend. (I know I can change the legend size with KEYSTYLE, but that's not the primary issue here.)
It seems the legend gets both "my" default scale and the "old" default scale from somewhere?

I do have my scale (and legend settings) in a separate file that is then imported to several maps. I did notice the editor copies everything from the imported file to the map file, so when i make changes in the map i have to manually remove that, otherwise i will get duplicate settings. That doesn't seem to be the problem here though...
Last edited by malgoe on Thu Mar 22, 2012 5:10 am, edited 2 times in total.
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Changing the default scale, legend problems

Post by malgoe »

UPDATE:
I tried using a new scale instead of the DEFAULT scale and it worked fine. Unless I made a mistake somewhere (it's been known to happen, let's not rule it out! :P) could this be a bug?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Changing the default scale, legend problems

Post by Howie »

Yes - that's a bug. Usually you should be able to redefine the DEFAULT scale with no problem. I do it all the time. I'll check what's special about your situation.
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!)
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Changing the default scale, legend problems

Post by malgoe »

UPDATE: Nevermind this post, it seems to work now for some reason. Yay! :)


Hmm i seem to get another problem now.
I've defined color (let's say green) for 0.01-0.5 and one (pretend it's blue) for 0.5-1%
I have links with 0.6% load showing in green now, and links at 0.01% showing as white.
gros_manu
Posts: 5
Joined: Tue Mar 24, 2009 9:12 am
Location: Paris

Re: [Solved] Changing the default scale, legend problems

Post by gros_manu »

The style of legend, its position ... remainder set in the file weathermap.xml!
it here; is only to configure the colors and unit of measurement of the legend (the scales)

To set the legend:

the files in question:

legende.php
\modules\drawmap.php
\lib\configfile.php
\lib\rrd.php

The principle is as follows:
1 - commanter all lines or autoscale ago
2 - edit the file drawmap.php at line 115
as shown in commantaires File


# Default scale / /! \ \ FILE LEGEND!! the legend of the map weathermap!
# The Legend of the xml file n being taken into count, you must directly edit directly
# Default file that scale is as follows:
#
$ Scale = new stdClass; # do not touch! should appear only once
$ Scale-> entry [0] = new stdClass; # same
$ Scale-> entry [0] -> low = 1 # this is the% Min premere box simboliser not [0]
$ Scale-> entry [0] -> high = 2; #% max of the first box
$ Scale-> entry [0] -> r = 0 # the color red 0 (null) to 255 (bright red max)
$ Scale-> entry [0] -> g = 176; the green color of # 0 (null) to 255 (bright green max)
$ Scale-> entry [0] -> b = 0 # the color blue 0 (null) to 255 (blue farting max)
$ Scale-> entry [1] -> low = 2 # this is the second box simboliser by [1]
$ Scale-> entry [1] -> high = 4 # same as box 1 [0]
$ Scale-> entry [1] -> r = 0;
$ Scale-> entry [1] -> g = 208;
$ Scale-> entry [1] -> b = 0;
$ Scale-> entry [2] -> low = 4;
$ Scale-> entry [2] -> high = 6;
$ Scale-> entry [2] -> r = 0;
$ Scale-> entry [2] -> g = 255;
$ Scale-> entry [2] -> b = 0;
---- And so on as you like .....

3 - there is therefore nothing to put a legend in the file weathermap. Xml
4 - You now have a pretty legend
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: [Solved] Changing the default scale, legend problems

Post by Howie »

I think the previous reply is for some other weathermap - the Cacti plugin doesn't use any xml files.
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!)
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests