@cryptotaxi247 / netdata-1 / commits / e5565211f

changes after https://github.com/schweikert/fping/pull/105 being merged into fping repo

Costa Tsaousis (ktsaou) committed Nov 1, 2016 at 23:29 UTC e5565211f43643da7b705c02763e485ad1688f22
4 files changed +74 -50
conf.d/fping.conf
+22 -29
@@ -1,51 +1,44 @@
1 # no need for shebang - this file is sourced from fping.plugin
2
3 -# fping.plugin requires a special version of fping.
4 -# Get it from https://github.com/ktsaou/fping
5 -# and build it, like this:
6 -
7 -cat >/dev/null <<EOF
8 -cd /usr/src && \
9 -git clone https://github.com/ktsaou/fping.git fping-netdata.git && \
10 -cd fping-netdata.git && \
11 -./autogen.sh && \
12 -./configure --prefix=/usr/local && \
13 -make && \
14 -cp src/fping /usr/local/bin/ && \
15 -chown root:root /usr/local/bin/fping && \
16 -chmod 4755 /usr/local/bin/fping && \
17 -echo "DONE"
18 -EOF
3 +# fping.plugin requires a recent version of fping.
4 +#
5 +# You can get it on your system, by running:
6 +#
7 +# /usr/libexec/netdata/plugins.d/fping.plugin install
8
9 # -----------------------------------------------------------------------------
10 # configuration options
11
23 -# The update frequency of the chart - the default is inherited from netdata
24 -
25 -#update_every=2
26 -
12 # The fping binary to use. We need one that can output netdata friendly info
13 # (supporting: -N). If you have multiple versions, put here the full filename
14 # of the right one
15
16 #fping="/usr/local/bin/fping"
17
18 +
19 # a space separated list of hosts to fping
20 # we suggest to put names here and the IPs of these names in /etc/hosts
21
22 hosts=""
23
24 +
25 +# The update frequency of the chart - the default is inherited from netdata
26 +
27 +#update_every=2
28 +
29 +
30 # The time in milliseconds (1 sec = 1000 ms) to ping the hosts
31 # by default 5 pings per host per iteration
32 +# fping will now allow this to be below 20ms
33 +
34 +#ping_every="200"
35
41 -ping_every="$((update_every * 1000 / 5))"
36
43 -# other fping options
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
37 +# other fping options - defaults:
38 +# -R = send packets with random data
39 +# -b 56 = the number of bytes per packet
40 +# -i 1 = 1ms when sending packets to others hosts (switching hosts)
41 +# -r 0 = never retry packets
42 +# -t 5000 = per packet timeout at 5000ms
43
51 -other_opts="-R -i 10 -r 0"
44 +#fping_opts="-R -b 56 -i 1 -r 0 -t 5000"
plugins.d/fping.plugin
+49 -18
@@ -5,26 +5,57 @@
5 # (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
6 # GPL v3+
7 #
8 -# This plugin requires a special version of fping.
9 -# Get it from https://github.com/ktsaou/fping
10 -# and build it, like this:
11 -#
12 -# cd /usr/src
13 -# git clone https://github.com/ktsaou/fping.git fping-netdata.git
14 -# cd fping-netdata.git
15 -# ./autogen.sh
16 -# ./configure --prefix=/usr/local
17 -# make
18 -# cp src/fping /usr/local/bin/
19 -# chown root:root /usr/local/bin/fping
20 -# chmod 4755 /usr/local/bin/fping
21 -#
22 -# Then, create /etc/netdata/fping.conf
23 -# and set the configuration options given below
8 +# This plugin requires a latest version of fping.
9 +# You can compile it from source, by running me with option: install
10
11 export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
12 export LC_ALL=C
13
14 +if [ "${1}" = "install" ]
15 + then
16 + [ "${UID}" != 0 ] && echo >&2 "Please run me as root. This will install a single binary file: /usr/local/bin/fping." && exit 1
17 +
18 + run() {
19 + printf >&2 " > "
20 + printf >&2 "%q " "${@}"
21 + printf >&2 "\n"
22 + "${@}" || exit 1
23 + }
24 +
25 + [ ! -d /usr/src ] && run mkdir -p /usr/src
26 + [ ! -d /usr/local/bin ] && run mkdir -p /usr/local/bin
27 +
28 + run cd /usr/src
29 +
30 + if [ -d fping.git ]
31 + then
32 + run cd fping.git
33 + run git pull
34 + else
35 + run git clone https://github.com/schweikert/fping.git fping.git
36 + run cd fping.git
37 + fi
38 +
39 + run ./autogen.sh
40 + run ./configure --prefix=/usr/local
41 + run make clean
42 + run make
43 + if [ -f /usr/local/bin/fping ]
44 + then
45 + run mv -f /usr/local/bin/fping /usr/local/bin/fping.old
46 + fi
47 + run mv src/fping /usr/local/bin/fping
48 + run chown root:root /usr/local/bin/fping
49 + run chmod 4755 /usr/local/bin/fping
50 + echo >&2
51 + echo >&2 "All done, you have a compatible fping now at /usr/local/bin/fping."
52 + echo >&2
53 + echo >&2 "If you have another fping installed, please set:"
54 + echo >&2 " fping=\"/usr/local/bin/fping\""
55 + echo >&2 "at /etc/netdata/fping.conf"
56 + exit 0
57 +fi
58 +
59 # -----------------------------------------------------------------------------
60
61 PROGRAM_NAME="$(basename "${0}")"
@@ -91,8 +122,8 @@ hosts=""
122 # to ping the hosts - by default 5 pings per host per iteration
123 ping_every="$((update_every * 1000 / 5))"
124
94 -# other fping options
95 -other_opts="-R -i 10 -r 0"
125 +# fping options
126 +fping_opts="-R -b 56 -i 1 -r 0 -t 5000"
127
128 # -----------------------------------------------------------------------------
129 # load the configuration file
web/dashboard_info.js
+2 -2
@@ -745,8 +745,8 @@ netdataDashboard.context = {
745 // ------------------------------------------------------------------------
746 // fping
747
748 - 'fping.loss': {
749 - colors: NETDATA.colors[1],
748 + 'fping.quality': {
749 + colors: NETDATA.colors[5],
750 height: 0.5
751 },
752
web/index.html
+1 -1
@@ -2555,7 +2555,7 @@
2555 });
2556
2557 NETDATA.requiredJs.push({
2558 - url: NETDATA.serverDefault + 'dashboard_info.js?v20161030-4',
2558 + url: NETDATA.serverDefault + 'dashboard_info.js?v20161101-1',
2559 async: false,
2560 isAlreadyLoaded: function() { return false; }
2561 });