@cryptotaxi247 / netdata-1 / commits / fb8e9111e

adjust fping settings to minimum supported

Costa Tsaousis (ktsaou) committed Nov 1, 2016 at 00:41 UTC fb8e9111e17df9f6588e9d9c58d47d87e38fa70b
2 files changed +15 -6
conf.d/fping.conf
+8 -5
@@ -41,8 +41,11 @@ hosts=""
41 ping_every="$((update_every * 1000 / 5))"
42
43 # other fping options
44 -# -R = send packets with random data
45 -# -i 1 = send one packet every 1 ms (i.e how fast to switch hosts)
46 -# -r 0 = never retry packets
47 -
48 -other_opts="-R -i 1 -r 0"
44 +# -R = send packets with random data
45 +# -i 10 = send one packet every 10 ms (i.e how fast to switch hosts)
46 +# non-root users (like netdata) need >= 10
47 +# this limits the total number of packets fping can send
48 +# per second to 100, for all hosts, combined
49 +# -r 0 = never retry packets
50 +
51 +other_opts="-R -i 10 -r 0"
plugins.d/fping.plugin
+7 -1
@@ -92,7 +92,7 @@ hosts=""
92 ping_every="$((update_every * 1000 / 5))"
93
94 # other fping options
95 -other_opts="-R -i 1 -r 0"
95 +other_opts="-R -i 10 -r 0"
96
97 # -----------------------------------------------------------------------------
98 # load the configuration file
@@ -114,6 +114,12 @@ then
114 fatal "command '${fping}' is not executable - cannot proceed."
115 fi
116
117 +if [ ${ping_every} -lt 20 ]
118 + then
119 + warning "ping every was set to ${ping_every} but 20 is the minimum for non-root users. Setting it to 20 ms."
120 + ping_every=20
121 +fi
122 +
123 # the fping options we will use
124 options=( -N -l -Q ${update_every} -p ${ping_every} ${other_opts} ${hosts} )
125