Change color on ping?

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
steff1977
Posts: 13
Joined: Thu Oct 13, 2005 7:34 am

Change color on ping?

Post by steff1977 »

Hey

I cant quite figure out if this is dureable in 0.9.

i want to have a node or link that changes color if the ping gets to high.

there is a lot of new parameters with TARGET is just can figure them out

can i make something like this

NODE testping
LABEL ping to server12
TARGET rrd:/var/www/html/rra/ping.rra
USESCALE ping

Best Regards Steff
Attachments
untitled.jpg
untitled.jpg (23.37 KiB) Viewed 6709 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Change color on ping?

Post by Howie »

steff1977 wrote: NODE testping
LABEL ping to server12
TARGET rrd:/var/www/html/rra/ping.rra
USESCALE ping
As long as you define the new scale called 'ping', then yes, that's right :-)

Code: Select all

SCALE ping  0 20   0 255 0
SCALE ping 20 100  255 0 0
One warning: even though it doesn't look like it, the SCALE lines are STILL PERCENTAGES. It just happens that for NODEs the default MAXVALUE is 100, so as long as your values are below 100, then everything works as expected.

If you have a global WAN, you might see ping times over 100ms even on idle links, so you will need to do a little math. I do this for our temperature map. The SCALE lines are set so that 50% is the perfect green, and MAXVALUE is set to twice the ideal value. Since the temperature will never actually double (unless the building is burning down), then we never go over 100%. If you set the scale and maxvalue right, then usually if it goes over 100%, it's probably a bad thing anyway, so 90-100 can be red, and if it clips to 100, then it's still OK being red. I hope that makes sense!
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!)
steff1977
Posts: 13
Joined: Thu Oct 13, 2005 7:34 am

Post by steff1977 »

Ok it got something.

But it looks like it just returns 0? but the graph looks fine

Here is what i have done
SCALE ping 0 20 0 255 0
SCALE ping 20 100 255 0 0

NODE Ciklum
LABEL Ciklum
POSITION 586 540
TARGET rrd:/var/www/html/rra/ciklum_net_ping_292.rrd
USESCALE ping

LINK Ciklum-Ping
INFOURL /graph.php?rra_id=all&local_graph_id=282
OVERLIBGRAPH /graph_image.php?local_graph_id=282&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
NODES Ciklum Ping
TARGET rrd:/var/www/html/rra/ciklum_net_ping_292.rrd
USESCALE ping
Any idea why it just returns 0

Regards
Steff
Attachments
ping0.jpg
ping0.jpg (22.19 KiB) Viewed 6693 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

steff1977 wrote:Ok it got something.

But it looks like it just returns 0? but the graph looks fine

Here is what i have done
SCALE ping 0 20 0 255 0
SCALE ping 20 100 255 0 0

NODE Ciklum
LABEL Ciklum
POSITION 586 540
TARGET rrd:/var/www/html/rra/ciklum_net_ping_292.rrd
USESCALE ping

LINK Ciklum-Ping
INFOURL /graph.php?rra_id=all&local_graph_id=282
OVERLIBGRAPH /graph_image.php?local_graph_id=282&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
NODES Ciklum Ping
TARGET rrd:/var/www/html/rra/ciklum_net_ping_292.rrd
USESCALE ping
Any idea why it just returns 0
Oh. One other thing :-)

In the TARGET lines, you will need to specify the RRD DS name, which probably isn't the default (traffic_in/traffic_out). You can see this by looking in Data Templates, at the Data Source Item name for this template. Once you know it, you add it to the TARGET line like this:

Code: Select all

TARGET yourrrdfile.rrd:dsname:-
(you don't need the 'out' value, so just let that be 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!)
steff1977
Posts: 13
Joined: Thu Oct 13, 2005 7:34 am

Post by steff1977 »

Thanks for the quick responce :D
but you lost me a bit there :)


TARGET yourrrdfile.rrd:dsname:-
?
Should i have 2 TARGET linies? or like this
NODE Ciklum
LABEL Ciklum
POSITION 586 540
TARGET /var/www/html/rra/ciklum_net_ping_292.rrd:ping:-
USESCALE ping

SCALE ping 0 20 0 255 0
SCALE ping 20 100 255 0 0

NODE Ciklum
LABEL Ciklum
POSITION 586 540
TARGET rrd:/var/www/html/rra/ciklum_net_ping_292.rrd
USESCALE ping

LINK Ciklum-Ping
INFOURL /graph.php?rra_id=all&local_graph_id=282
OVERLIBGRAPH /graph_image.php?local_graph_id=282&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
NODES Ciklum Ping
TARGET rrd:/var/www/html/rra/ciklum_net_ping_292.rrd
USESCALE ping

/Steff
Attachments
ping1.jpg
ping1.jpg (145.61 KiB) Viewed 6685 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

steff1977 wrote: Should i have 2 TARGET linies? or like this
NODE Ciklum
LABEL Ciklum
POSITION 586 540
TARGET /var/www/html/rra/ciklum_net_ping_292.rrd:ping:-
USESCALE ping
Like that. As long as 'ping' is what the DS is called in your rrd files. There should only be one TARGET line in any node or link.
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!)
steff1977
Posts: 13
Joined: Thu Oct 13, 2005 7:34 am

Post by steff1977 »

almost there :)

i added a maxvalue of 500, what happens if it gets over 500? or timeout?
LINK Ciklum-Ping
MAXVALUE 500
INFOURL /graph.php?rra_id=all&local_graph_id=282
OVERLIBGRAPH /graph_image.php?local_graph_id=282&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
NODES Ciklum Ping
TARGET /var/www/html/rra/ciklum_net_ping_292.rrd:ping:-
USESCALE ping
but the data i multiplied by 8. how do i change that.

and is there a way to only have a one way arrow, i can "hide" the number useing BWLABELPOS but can i have only one arrow?

/Steff
Attachments
ping3.jpg
ping3.jpg (23.29 KiB) Viewed 6677 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

steff1977 wrote: i added a maxvalue of 500, what happens if it gets over 500? or timeout?
It will clip the percentage to 100, and use whatever colour your have for that. I don't know about your network, but once it gets to 500 in mine, then it doesn't matter too much if you can see how much more than that it really is. It's a bad thing anyway. :-)
steff1977 wrote: but the data i multiplied by 8. how do i change that.
Ooops. TARGET gauge:/var/www/html/rra/ciklum_net_ping_292.rrd:ping:-

Gauge stops the *8 part.
steff1977 wrote: and is there a way to only have a one way arrow, i can "hide" the number useing BWLABELPOS but can i have only one arrow?
No. That is something I want to add in a future version.
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!)
steff1977
Posts: 13
Joined: Thu Oct 13, 2005 7:34 am

Post by steff1977 »

that gauge did the trick.. but :|

the number is 75,2 and so is that graph, but it is still green?
SCALE ping 0 50 0 255 0
SCALE ping 50 150 240 240 0
SCALE ping 150 500 255 0 0

NODE Ciklum
LABEL Ciklum
POSITION 586 540
TARGET gauge:/var/www/html/rra/ciklum_net_ping_292.rrd:ping:-
MAXVALUE 500
USESCALE ping
Thanks for the great help so far.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

steff1977 wrote:that gauge did the trick.. but :|

the number is 75,2 and so is that graph, but it is still green?
SCALE ping 0 50 0 255 0
SCALE ping 50 150 240 240 0
SCALE ping 150 500 255 0 0
These are percentages. They should only ever go up to 100.

So if you have MAXVALUE 500, and the actual ping was 75 or so, then the percentage is (75/500) * 100 = 15%, which is in the first band of your scale.

This makes a lot more sense if you consider that it originally was meant for bandwidth on links :roll: sorry about that
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!)
steff1977
Posts: 13
Joined: Thu Oct 13, 2005 7:34 am

Post by steff1977 »

My bad. it works :)

it is no problem thats it is in %, when you just understand it, all it take is a little math :)

If i want the input and output to be the same, so the line between the 2 nodes is the same color, if i look at the docs it should be like this right?
TARGET gauge:/var/www/html/rra/ciklum_net_ping_292.rrd:ping gauge:/var/www/html/rra/ciklum_net_ping_292.rrd:ping:-
Other that that, i just works like a charm, time to make a map :)
Attachments
ping5.jpg
ping5.jpg (3.09 KiB) Viewed 6655 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

steff1977 wrote:My bad. it works :)

it is no problem thats it is in %, when you just understand it, all it take is a little math :)

If i want the input and output to be the same, so the line between the 2 nodes is the same color, if i look at the docs it should be like this right?
TARGET gauge:/var/www/html/rra/ciklum_net_ping_292.rrd:ping gauge:/var/www/html/rra/ciklum_net_ping_292.rrd:ping:-
Other that that, i just works like a charm, time to make a map :)
To do it so that both sides are the same colour:
TARGET gauge:/var/www/html/rra/ciklum_net_ping_292.rrd:ping:ping
should be enough. This makes both the values from the same DS.

We got there in the end :-)
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 0 guests