Odd SCALE behaviour with label/RRD

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
davebyrne
Posts: 12
Joined: Tue Jun 13, 2017 3:23 pm

Odd SCALE behaviour with label/RRD

#1 Post by davebyrne » Tue May 01, 2018 6:11 am

Hi,

I'm running into a bit of an oddity here. I am building a summary of remote sites on a geographical map, but the traffic in/out nodes/labels I'm using don't seem to be behaving as I'd expect. They report the right data value from my RRD file, but they wont play ball with my scale.

The Scale "100M":

Code: Select all

KEYPOS 100M 1659 52 100MTraffic
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 100M 0    0    192 192 192
SCALE 100M 0    1    228 255 255
SCALE 100M 1    10   212 255 209
SCALE 100M 10   20   170 233 165
SCALE 100M 20   30   142 216 136
SCALE 100M 30   40   103 191  97
SCALE 100M 40   50    75 167  68
SCALE 100M 50   60    48 141  41
SCALE 100M 60   70   204 198  26
SCALE 100M 70   80   183 128   9
SCALE 100M 80   90   183  58   9
SCALE 100M 90   100  127  36   0
SET key_hidezero_100M 1
The bandwidth IN/OUT nodes:

Code: Select all

NODE STR-QUA-ROU1-BWOUT
        LABEL Out: {node:this:bandwidth_out:%k} / {node:this:max_bandwidth_out:%k}
        TARGET /var/www/cacti/rra/str-qua-rou1_traffic_in_2276.rrd
        POSITION 1163 925
        MAXVALUE 100M
        USESCALE 100M in percent

NODE STR-QUA-ROU1-BWIN
        LABEL In: {node:this:bandwidth_in:%k} / {node:this:max_bandwidth_in:%k}
        TARGET /var/www/cacti/rra/str-qua-rou1_traffic_in_2276.rrd
        POSITION 1163 946
        MAXVALUE 100M
        USESCALE 100M in percent
I've attached an image to this post of what it's outputting at the moment. FOr some reason, two things happen:
1. They are both the same colour, when according to the scale they should be different
2. That shade of blue isn't in my scale... Sometimes it turns a light blue aswell, like a cyan, that colour also isnt in my scale (my scale is a colour sweep from light green to dark red..)

Have I grossly misunderstood how scales work? Or am I just not defining something somewhere? The fact the two nodes behave the same is also alarming, I would have expected it to use the data value of that node/label for the scale value?
Attachments
ukmapsnip1.JPG
ukmapsnip1.JPG (35.61 KiB) Viewed 470 times

davebyrne
Posts: 12
Joined: Tue Jun 13, 2017 3:23 pm

Re: Odd SCALE behaviour with label/RRD

#2 Post by davebyrne » Tue May 01, 2018 6:23 am

UPDATE

I figured it was using the same colour for both nodes because the "TARGET" was set the same.. So I further defined traffic_in and traffic_out on the TARGET's like this:

Code: Select all

NODE STR-QUA-ROU1-BWOUT
        LABEL Out: {node:this:bandwidth_out:%k} / {node:this:max_bandwidth_out:%k}
        TARGET /var/www/cacti/rra/str-qua-rou1_traffic_in_2276.rrd:traffic_out:traffic_out
        POSITION 1163 925
        MAXVALUE 100M
        USESCALE 100M in percent

NODE STR-QUA-ROU1-BWIN
        LABEL In: {node:this:bandwidth_in:%k} / {node:this:max_bandwidth_in:%k}
        TARGET /var/www/cacti/rra/str-qua-rou1_traffic_in_2276.rrd:traffic_in:traffic_in
        POSITION 1163 946
        MAXVALUE 100M
        USESCALE 100M in percent
That resolved the issue of bothe nodes being the same colour. They are now different. BUT!! Both the colours that they are now are not in my scale, lol... It's using random colours for some reason and I can't figure out why. Pic attached of how it looks now.

Thanks, Dave.
Attachments
ukmapsnip2.JPG
ukmapsnip2.JPG (19.22 KiB) Viewed 468 times

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

Re: Odd SCALE behaviour with label/RRD

#3 Post by Howie » Tue May 01, 2018 7:54 am

Scale names must start with a letter. You should be seeing errors about unrecognized config in the logs.

Since the scale doesn't exist, it's still using the DEFAULT scale.

Looks like the naming thing isn't actually documented, although you are the first person to hit it (as far as I know) in a decade or more :-) I'll update the manual.
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!)

davebyrne
Posts: 12
Joined: Tue Jun 13, 2017 3:23 pm

Re: Odd SCALE behaviour with label/RRD

#4 Post by davebyrne » Tue May 01, 2018 8:20 am

Howie wrote:Scale names must start with a letter. You should be seeing errors about unrecognized config in the logs.

Since the scale doesn't exist, it's still using the DEFAULT scale.

Looks like the naming thing isn't actually documented, although you are the first person to hit it (as far as I know) in a decade or more :-) I'll update the manual.
Ah! Ok, that's great I wasn't going mad haha... Changed SCALE name to "T100M", and it's working now.

Code: Select all

SCALE T100M 0    0    192 192 192
SCALE T100M 0    1    228 255 255
SCALE T100M 1    10   212 255 209
SCALE T100M 10   20   170 233 165
SCALE T100M 20   30   142 216 136
SCALE T100M 30   40   103 191  97
SCALE T100M 40   50    75 167  68
SCALE T100M 50   60    48 141  41
SCALE T100M 60   70   204 198  26
SCALE T100M 70   80   183 128   9
SCALE T100M 80   90   183  58   9
SCALE T100M 90   100  127  36   0

NODE STR-QUA-ROU1-BWOUT
        LABEL Out: {node:this:bandwidth_out:%k} / {node:this:max_bandwidth_out:%k}
        TARGET /var/www/cacti/rra/str-qua-rou1_traffic_in_2276.rrd:traffic_out:traffic_out
        POSITION 1163 925
        MAXVALUE 100M
        USESCALE T100M in percent

NODE STR-QUA-ROU1-BWIN
        LABEL In: {node:this:bandwidth_in:%k} / {node:this:max_bandwidth_in:%k}
        TARGET /var/www/cacti/rra/str-qua-rou1_traffic_in_2276.rrd:traffic_in:traffic_in
        POSITION 1163 946
        MAXVALUE 100M
        USESCALE T100M in percent
Image attached of it working, just for sanity's sake and future reference.
Attachments
ukmapsnip3.JPG
ukmapsnip3.JPG (18.6 KiB) Viewed 465 times

Post Reply