PING : avoid percent & use absolute

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
netconnected
Posts: 9
Joined: Wed Apr 21, 2010 6:49 am
Location: Paris

PING : avoid percent & use absolute

Post by netconnected »

Hello,
I look for the good practice for change color of one Node with ping graph.

I simulate a high-latency and I have one graph with bad ping (over than 100ms!) and, I have configure the Node test1 with this graph.
I add "USESCALE xxxx absolute" (or "MAXVALUE 900") in his configuration but :
he stay green (like between 0 to 20ms in my SCALE).

Other details :
- If I put "USESCALE absolute", I have in log : "Attempted to use non-existent scale"
- If I put (in cli or by Editor) "USESCALE xxxx absolute" or
"USESCALE xxxx in absolute", I have in :
* file (CLI) : USESCALE xxxx absolute
* Editor : USESCALE xxxx in


Despite my search in documentation, forums and do many try : I need help...
_______________
My configuration :

KEYSTYLE DEFAULT tags
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 DEFAULT 0 0 255 255 255
SCALE DEFAULT 0 20 51 255 51 0 - 20 ms
SCALE DEFAULT 20 80 255 222 34 50 - 80 ms
SCALE DEFAULT 80 300 255 128 0 80 - 300 ms
SCALE DEFAULT 300 999 255 0 0 900 ms

KEYPOS PING 32 950 Ping (ms)
KEYSTYLE PING tags
SCALE PING 0 0 255 255 255
SCALE PING 0 20 51 255 51 0 - 20 ms
SCALE PING 20 80 255 222 34 50 - 80 ms
SCALE PING 80 300 255 128 0 80 - 300 ms
SCALE PING 300 999 255 0 0 900 ms


# End of global section


# TEMPLATE-only NODEs:
NODE DEFAULT
MAXVALUE 100


# TEMPLATE-only LINKs:
LINK DEFAULT
BWLABEL none
BANDWIDTH 100M


# regular NODEs:
NODE node03387
LABEL Test1
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=1099
OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=1099
TARGET gauge:/var/www/cacti/rra/linux_machine_test_denis_ping_1107.rrd:ping:-
POSITION 787 244
netconnected
Posts: 9
Joined: Wed Apr 21, 2010 6:49 am
Location: Paris

Re: PING : avoid percent & use absolute

Post by netconnected »

I forgot details : my machine is Debian 6 with Cacti 0.8.8a and Weathermap 0.97a
I would appreciate help. Thank
netconnected
Posts: 9
Joined: Wed Apr 21, 2010 6:49 am
Location: Paris

Re: PING : avoid percent & use absolute

Post by netconnected »

Hello, finally I answered my post. I adopted a solution after re tested the MAXVALUE parameter.


My map is intended only to ping, I modified MAXVALUE, in NODE DEFAULT, with 200. The calculation become on 200 and not percent.
This allows for what we wanted :
between O and 20 ms, the nodes become green
between 20 and 200 ms, the nodes become yellow and beyond red (like timeout) .

For those who are interested, the configuration :

SCALE DEFAULT 0 0 255 0 0 - TimeOut -
SCALE DEFAULT 51 255 0 10 51 0 - 20 ms
SCALE DEFAULT 10 99 255 210 34 20 - 200 ms
SCALE DEFAULT 99 200 255 0 0 200 et plus


# TEMPLATE-only NODEs:
NODE DEFAULT
MAXVALUE 200


# TEMPLATE-only LINKs:
LINK DEFAULT
BWLABEL none
BANDWIDTH 0.2K

# Here, all links also follow the color of the nodes. This requires changing the scale BANDWIDTH for match kbit ans 200 ms.


NODE node04387
TARGET gauge:/var/www/cacti/rra/linux_machine_test_ping_1107.rrd:ping:-

LINK node08246-node05226
TARGET gauge:/var/www/cacti/rra/linux_machine_test_ping_1107.rrd:ping:ping


# For links, the DS name (here : ping) should be noted twice, for both directions of the link (usually for in and out flow).

# That's all folks!
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PING : avoid percent & use absolute

Post by Howie »

netconnected wrote:My map is intended only to ping, I modified MAXVALUE, in NODE DEFAULT, with 200. The calculation become on 200 and not percent.
This is not true. If you change MAXVALUE then you are changing the maximum used to calculate percentage values. So 50ms is now 25% (50/200 x 100). If you want to use an absolute scale, use this:

USESCALE DEFAULT in absolute

And then the real value (50) will be used to look up in the scale instead of the percentage (25%).
netconnected wrote: SCALE DEFAULT 0 0 255 0 0 - TimeOut -
SCALE DEFAULT 51 255 0 10 51 0 - 20 ms
SCALE DEFAULT 10 99 255 210 34 20 - 200 ms
SCALE DEFAULT 99 200 255 0 0 200 et plus
This is probably not what you want either, even with absolute scales. Several of these bands overlap with each other:
[*] Exactly 0
[*] 10-99
[*] 99-200
[*] 51-255 (will only be hit for values > 200, because other smaller bands cover 51-200)
No colour at all for 0.000001-10 (grey)

Without absolute (like you have now), you'll get:
[*] Exactly 0
[*] 10%-100%
Still no colour for 0-10%

Personally, I'd use percentage scales, set the colours so that 50% is green, 75% is yellow and 100% is red, then set MAXVALUE for each node to double the expected value (so that it will be green at the expected value, and red at double or more). That way you can use one scale for high and low speed links.
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!)
netconnected
Posts: 9
Joined: Wed Apr 21, 2010 6:49 am
Location: Paris

Re: PING : avoid percent & use absolute

Post by netconnected »

I made mistake when I paste/modify here my legend :
It's on second line, "51 255 0 10" was wrong ... "0 10 51 255" is correct. Sorry
I wanted to wrote :

SCALE DEFAULT 0 0 255 0 0 - TimeOut -
SCALE DEFAULT 0 10 51 255 51 0 - 20 ms
SCALE DEFAULT 10 99 255 210 34 20 - 200 ms
SCALE DEFAULT 99 200 255 0 0 200 et plus

0 0 : red for timeout
0 10 : 0 to 20 ms (green)
10 99 : 20 to almost 200 ms (yellow)
99 200 : almost 200 ms and more (red). I do not know if the values ​​are really correct in this line, but all works fine in my map now after many tests ...

Thank for your reply and sugestions ; I will test.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PING : avoid percent & use absolute

Post by Howie »

If you want to test, you can use the static TARGET temporarily to get the value you want to test:

TARGET static:180:180
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!)
netconnected
Posts: 9
Joined: Wed Apr 21, 2010 6:49 am
Location: Paris

Re: PING : avoid percent & use absolute

Post by netconnected »

Thank for the tip 'target static', it's easier than using a ping delay*

Personally, I'd use percentage scales, set the colours so that 50% is green, 75% is yellow and 100% is red, then set MAXVALUE for each node to double the expected value...
I successfully tested the configuration below, but I appreciate if you confirm that is your preferred method :

SCALE DEFAULT 0 0 - TimeOut -
SCALE DEFAULT 0 50 51 255 51 green
SCALE DEFAULT 50 75 255 210 34 yellow
SCALE DEFAULT 75 100 255 0 0 red

### green between 0 and 25 ms :
NODE node78387
LABEL My_LAN
MAXVALUE 50

### green between 0 and 50 ms
NODE node88387
LABEL My_MAN

### green between 0 and 100 ms
NODE node98387
LABEL My_WAN
MAXVALUE 200

___________________________________________
Ping delay :
If anyone's interested by add delay of ping, for various test, on the machine that monitored, you can use this command :
tc qdisc [add or change] dev eth0 root handle 1:0 netem delay 100msec
To remove the delay:
tc qdisc del dev eth0 root
Another option for modify or, make treatment of trafic, is possible with the tc command.
KoZo
Posts: 2
Joined: Mon Dec 16, 2013 4:12 am

Re: PING : avoid percent & use absolute

Post by KoZo »

Hi guys,

This has been helpful as I did not know the absolute option. However, the legend still displays percentage. How can I make it use the values I definied in the SCALE ?

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

Re: PING : avoid percent & use absolute

Post by Howie »

Because the scale definition doesn't actually say if it's absolute or percent (it's only when you use it in a node or link that you specify), the legend drawing code needs some help.

From the KEYSTYLE section in the manual:
"You can hide the percentage signs in the key, by setting key_hidepercent_scalename to 1"

e.g. SET key_hidepercent_DEFAULT 1 in the top section of the map file.
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!)
KoZo
Posts: 2
Joined: Mon Dec 16, 2013 4:12 am

Re: PING : avoid percent & use absolute

Post by KoZo »

Hi Howie,

Thanks for your quick answer. I'll then use the "tags" style instead, so I can display the values I want.

Cheers,

K
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests