[SOLVED] Change colour of links (not using bandwidth)

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
pbickerd
Posts: 3
Joined: Tue Dec 11, 2007 11:25 am

[SOLVED] Change colour of links (not using bandwidth)

Post by pbickerd »

Hi all,

I have a weathermap set up to monitor the number of active users on a number of sites that I look after.

On this particular map the links are not showing bandwidth but pulling information from an rrd that I set up. I want these links to change colour based on the ammount of sessions. I have set up a scale (and tried using the default but they just wont change colour. I am guessing this is because the code here that changes the colour of these lines is always looking for in:out?

To test this I currently have the node labels changing colour based on the criteria i want. Is there a way to get the links to do this instead?

I am on version 0.941.

I have attached a pic of the map as it is now.

Here is my config:

BACKGROUND images/bw_gradient_1024.png
HTMLSTYLE overlib


TITLE RGS Production - System Overview

KEYPOS DEFAULT 848 30 Num Active Sessions
KEYTEXTCOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 1 10 140 0 255
SCALE DEFAULT 10 25 32 32 255
SCALE DEFAULT 25 40 0 192 255
SCALE DEFAULT 40 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

SCALE sessions 0 10 140 0 255
SCALE sessions 10 25 32 32 255
SCALE sessions 25 40 0 192 255
SCALE sessions 40 55 0 240 0
SCALE sessions 55 70 240 240 0
SCALE sessions 70 85 255 192 0
SCALE sessions 85 100 255 0 0


# End of global section

# DEFAULT definitions:
NODE DEFAULT
LABELFONTCOLOR 245 245 245
MAXVALUE 100

LINK DEFAULT
BWLABEL bits
BANDWIDTH 500M


# End of DEFAULTS section

# Node definitions:
NODE RGS
LABEL RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=246
OVERLIBGRAPH http://xxxxxxx/cacti/graph_image.php?lo ... _width=300
ICON images/Host.png
LABELFONTCOLOR 0 0 0
POSITION 512 384

NODE rgs-total
LABEL {node:this:bandwidth_in:%d} Total
LABELFONT 32
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_rgstotalsessionssou_424.rrd:RGSTotalSessionsSou:-
USESCALE none in
LABELBGCOLOR none
LABELFONTCOLOR 0 0 0
LABELOUTLINECOLOR none
POSITION RGS -5 20

NODE PPY
LABEL PPY
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_ppysessions_444.rrd:PPYSessions:PPYSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 510 30

NODE VGFO
LABEL VGFO
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_vgfosessions_443.rrd:VGFOSessions:VGFOSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 400 40

NODE BAR
LABEL BAR
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_barsessions_448.rrd:BARSessions:BARSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 610 40

NODE GM
LABEL GM
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gmsessions_440.rrd:GMSessions:GMSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 703 50

NODE GX2
LABEL GX2
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gx2sessions_441.rrd:GX2Sessions:GX2Sessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 800 120

NODE ATC
LABEL ATC
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_atcsessions_439.rrd:ATCSessions:ATCSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 850 250

NODE GXA
LABEL GXA
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gxasessions_442.rrd:GXASessions:GXASessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 880 340

NODE GEUR
LABEL GEUR
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_geursessions_451.rrd:GEURSessions:GEURSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 900 450

NODE GCOR
LABEL GCOR
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gcorsessions_450.rrd:GCORSessions:GCORSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 880 550

NODE GBIN
LABEL GBIN
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gbinsessions_449.rrd:GBINSessions:GBINSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 850 650

NODE TFAA
LABEL TFAA
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_tfaasessions_499.rrd:TFAASessions:TFAASessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 700 700

NODE TFHP
LABEL TFHP
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_tfhpsessions_500.rrd:TFHPSessions:TFHPSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 500 680

NODE TFHS
LABEL TFHS
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_tfhssessions_501.rrd:TFHSSessions:TFHSSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 337 652

NODE TTV
LABEL TTV
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_ttvsessions_447.rrd:TTVSessions:TTVSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 190 565

NODE RHRT
LABEL RHRT
ICON images/Host.png
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_rhrtsessions_446.rrd:RHRTSessions:RHRTSessions
USESCALE sessions in
LABELFONTCOLOR 255 255 250
POSITION 149 431


# End of NODE section

# Link definitions:
LINK VGFO-RGS
INFOURL http://xxx/cacti/graph.php?rra_id=all&l ... aph_id=249
OVERLIBGRAPH http://xxxxxxx/cacti/graph_image.php?lo ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_vgfosessions_443.rrd:VGFOSessions:VGFOSessions
NODES VGFO RGS

LINK PPY-RGS
INFOURL http://xxxxxx/cacti/graph.php?rra_id=al ... aph_id=250
OVERLIBGRAPH http://xxxxx/cacti/graph_image.php?loca ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_ppysessions_444.rrd:PPYSessions:PPYSessions
NODES PPY RGS

LINK BAR-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=253
OVERLIBGRAPH http://xxxx/cacti/graph_image.php?local ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_barsessions_448.rrd:BARSessions:BARSessions
NODES BAR RGS

LINK GM-RGS
INFOURL http://xxxxx/cacti/graph.php?rra_id=all ... aph_id=248
OVERLIBGRAPH http://xxxxx/cacti/graph_image.php?loca ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gmsessions_440.rrd:GMSessions:GMSessions
NODES GM RGS

LINK GX2-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=248
OVERLIBGRAPH http://xxxxx/cacti/graph_image.php?loca ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gx2sessions_441.rrd:GX2Sessions:GX2Sessions
NODES GX2 RGS

LINK ATC-RGS
INFOURL http://xxxxx/cacti/graph.php?rra_id=all ... aph_id=248
OVERLIBGRAPH http://xxxxx/cacti/graph_image.php?loca ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_atcsessions_439.rrd:ATCSessions:ATCSessions
NODES ATC RGS

LINK GXA-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=248
OVERLIBGRAPH http://xxxxx/cacti/graph_image.php?loca ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gxasessions_442.rrd:GXASessions:GXASessions
NODES GXA RGS

LINK GEUR-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=254
OVERLIBGRAPH http://xxxxx/cacti/graph_image.php?loca ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_geursessions_451.rrd:GEURSessions:GEURSessions
NODES GEUR RGS

LINK GCOR-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=254
OVERLIBGRAPH http://xxxxx/cacti/graph_image.php?loca ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gcorsessions_450.rrd:GCORSessions:GCORSessions
NODES GCOR RGS

LINK GBIN-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=254
OVERLIBGRAPH http://xxxx/cacti/graph_image.php?local ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_gbinsessions_449.rrd:GBINSessions:GBINSessions
NODES GBIN RGS

LINK TFAA-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=294
OVERLIBGRAPH http://xxxx/cacti/graph_image.php?local ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_tfaasessions_499.rrd:TFAASessions:TFAASessions
NODES TFAA RGS

LINK TFHP-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=294
OVERLIBGRAPH http://xxxx/cacti/graph_image.php?local ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_tfhpsessions_500.rrd:TFHPSessions:TFHPSessions
NODES TFHP RGS

LINK TFHS-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=294
OVERLIBGRAPH http://xxxx/cacti/graph_image.php?local ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_tfhssessions_501.rrd:TFHSSessions:TFHSSessions
NODES TFHS RGS

LINK TTV-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=252
OVERLIBGRAPH http://xxxx/cacti/graph_image.php?local ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_ttvsessions_447.rrd:TTVSessions:TTVSessions
NODES TTV RGS

LINK RHRT-RGS
INFOURL http://xxxx/cacti/graph.php?rra_id=all& ... aph_id=252
OVERLIBGRAPH http://xxxx/cacti/graph_image.php?local ... _width=300
TARGET gauge:/opt/cacti-0.8.7/rra/rgs_monitor_rhrtsessions_446.rrd:RHRTSessions:RHRTSessions
NODES RHRT RGS


# End of LINK section

# That's All Folks!
Attachments
This is the current map.
This is the current map.
weathermap_7.png (230.81 KiB) Viewed 2510 times
Last edited by pbickerd on Mon Jan 07, 2008 6:27 am, edited 1 time in total.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I think that's working as you want, except:

* you have set the default link bandwidth to 500M. So any session counts will be turned into percentages of 500M. 4/500M is a very small number.

* you are using the default SCALE which has no colour defined for values between 0% and 1%, which is why you get white for this (very nearly) 0% value.

So what you should probably do is set the BANDWIDTH to be the maximum number of sessions on your device, and add a USESCALE sessions to use your nice 0-100 scale.

I can see that it's a little weird to think about. It makes it more logical if you use MAXVALUE instead of BANDWIDTH. It does exactly the same thing, but it makes more sense to think about it.
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!)
pbickerd
Posts: 3
Joined: Tue Dec 11, 2007 11:25 am

Post by pbickerd »

Sorry I should have mentioned what i have already tried.

I did try setting:

BANDWIDTH 100M
USESCALE sessions

On the VGFO-RGS link but it still stayed white. I would have expected at least purple (which is 0 on the sessions scale).

But thinking about it. Would this mean 24M/100M or is it comming up with something like 24bits/100m? I think this is the problem..

If i expect the max number of sesions to be 100, what will the bandwidth need to be set to? Even if i set it to 1k will it stil be calculating 24/1000?

Now on the Node itself I have it using the scale and it does change colour.

Thanks for your reply.
pbickerd
Posts: 3
Joined: Tue Dec 11, 2007 11:25 am

Post by pbickerd »

Fixed it!!!

Thanks very much for your help. I was being a dumb ass!

I changed the settings in LINK DEFAULT as follows:

LINK DEFAULT
BWLABEL bits
BANDWIDTH 0.1K
USESCALE sessions

And now it works. It gives me a scale of 0-100 matching up with 0-100%.

Thankyou again! I am loving weathermap so far. Really nice tool!

Here is a pic of the working (but not finished) product!.
Attachments
weathermap_72.png
weathermap_72.png (231.43 KiB) Viewed 2481 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Yes, for a NODE, the default 'BANDWIDTH' is 100, so 1 'something'=> 1%, which is why that worked for you. For links, you can force that same situation with BANDWIDTH 100 as you have, but be aware that if you get 105 sessions, it will clip that down to 100% because internally weathermap still thinks of an absolute maximum.

So the right way really is to make your scale in terms of percentages, as it should be, and set BANDWIDTH to the actual maximum session count. If that is 100, then it all turns out nicely :-)
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 1 guest