|
|
| Author |
Message |
steff1977
Joined: 13 Oct 2005 Posts: 13
|
Posted: Tue May 15, 2007 3:43 am Post subject: Change color on ping? |
|
|
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
| Description: |
|
| Filesize: |
23.37 KB |
| Viewed: |
1906 Time(s) |

|
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Tue May 15, 2007 4:00 am Post subject: Re: Change color on ping? |
|
|
| 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: |
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!
|
|
| Back to top |
|
 |
steff1977
Joined: 13 Oct 2005 Posts: 13
|
Posted: Tue May 15, 2007 4:39 am Post subject: |
|
|
Ok it got something.
But it looks like it just returns 0? but the graph looks fine
Here is what i have done
| Quote: | 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
| Description: |
|
| Filesize: |
22.19 KB |
| Viewed: |
1890 Time(s) |

|
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Tue May 15, 2007 4:55 am Post subject: |
|
|
| 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
| Quote: | 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: |
TARGET yourrrdfile.rrd:dsname:-
|
(you don't need the 'out' value, so just let that be 0).
|
|
| Back to top |
|
 |
steff1977
Joined: 13 Oct 2005 Posts: 13
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Tue May 15, 2007 5:06 am Post subject: |
|
|
| steff1977 wrote: |
Should i have 2 TARGET linies? or like this
| Quote: |
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.
|
|
| Back to top |
|
 |
steff1977
Joined: 13 Oct 2005 Posts: 13
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Tue May 15, 2007 5:33 am Post subject: |
|
|
| 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.
|
|
| Back to top |
|
 |
steff1977
Joined: 13 Oct 2005 Posts: 13
|
Posted: Tue May 15, 2007 5:57 am Post subject: |
|
|
that gauge did the trick.. but :|
the number is 75,2 and so is that graph, but it is still green?
| Quote: | 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.
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Tue May 15, 2007 6:16 am Post subject: |
|
|
| steff1977 wrote: | that gauge did the trick.. but :|
the number is 75,2 and so is that graph, but it is still green?
| Quote: | 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 sorry about that
|
|
| Back to top |
|
 |
steff1977
Joined: 13 Oct 2005 Posts: 13
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Tue May 15, 2007 6:48 am Post subject: |
|
|
| 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?
| Quote: | | 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:
| Quote: | | 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
|
|
| Back to top |
|
 |
|