]> arthur.barton.de Git - netdata.git/commitdiff
changes after https://github.com/schweikert/fping/pull/105 being merged into fping...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 1 Nov 2016 21:29:27 +0000 (23:29 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 1 Nov 2016 21:29:27 +0000 (23:29 +0200)
conf.d/fping.conf
plugins.d/fping.plugin
web/dashboard_info.js
web/index.html

index 5b8bfd27140ecf702390b000cb51712692c18292..b2d4f3ac81af473771fcfd2bf5065383a7274ab6 100644 (file)
@@ -1,51 +1,44 @@
 # no need for shebang - this file is sourced from fping.plugin
 
-# fping.plugin requires a special version of fping.
-# Get it from https://github.com/ktsaou/fping
-# and build it, like this:
-
-cat >/dev/null <<EOF
-cd /usr/src && \
-git clone https://github.com/ktsaou/fping.git fping-netdata.git && \
-cd fping-netdata.git && \
-./autogen.sh && \
-./configure --prefix=/usr/local && \
-make && \
-cp src/fping /usr/local/bin/ && \
-chown root:root /usr/local/bin/fping && \
-chmod 4755 /usr/local/bin/fping && \
-echo "DONE"
-EOF
+# fping.plugin requires a recent version of fping.
+#
+# You can get it on your system, by running:
+#
+# /usr/libexec/netdata/plugins.d/fping.plugin install
 
 # -----------------------------------------------------------------------------
 # configuration options
 
-# The update frequency of the chart - the default is inherited from netdata
-
-#update_every=2
-
 # The fping binary to use. We need one that can output netdata friendly info
 # (supporting: -N). If you have multiple versions, put here the full filename
 # of the right one
 
 #fping="/usr/local/bin/fping"
 
+
 # a space separated list of hosts to fping
 # we suggest to put names here and the IPs of these names in /etc/hosts
 
 hosts=""
 
+
+# The update frequency of the chart - the default is inherited from netdata
+
+#update_every=2
+
+
 # The time in milliseconds (1 sec = 1000 ms) to ping the hosts
 # by default 5 pings per host per iteration
+# fping will now allow this to be below 20ms
+
+#ping_every="200"
 
-ping_every="$((update_every * 1000 / 5))"
 
-# other fping options
-# -R    = send packets with random data
-# -i 10 = send one packet every 10 ms (i.e how fast to switch hosts)
-#         non-root users (like netdata) need >= 10
-#         this limits the total number of packets fping can send
-#         per second to 100, for all hosts, combined
-# -r 0  = never retry packets
+# other fping options - defaults:
+# -R      = send packets with random data
+# -b 56   = the number of bytes per packet
+# -i 1    = 1ms when sending packets to others hosts (switching hosts)
+# -r 0    = never retry packets
+# -t 5000 = per packet timeout at 5000ms
 
-other_opts="-R -i 10 -r 0"
+#fping_opts="-R -b 56 -i 1 -r 0 -t 5000"
index 2b80ea807876dbc2f47f66edbd32895d102a3c4b..97bd9442979ac8607ab8ebf6a65f9f03a10b8591 100755 (executable)
@@ -5,26 +5,57 @@
 # (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
 # GPL v3+
 #
-# This plugin requires a special version of fping.
-# Get it from https://github.com/ktsaou/fping
-# and build it, like this:
-#
-# cd /usr/src
-# git clone https://github.com/ktsaou/fping.git fping-netdata.git
-# cd fping-netdata.git
-# ./autogen.sh
-# ./configure --prefix=/usr/local
-# make
-# cp src/fping /usr/local/bin/
-# chown root:root /usr/local/bin/fping
-# chmod 4755 /usr/local/bin/fping
-#
-# Then, create /etc/netdata/fping.conf
-# and set the configuration options given below
+# This plugin requires a latest version of fping.
+# You can compile it from source, by running me with option: install
 
 export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
 export LC_ALL=C
 
+if [ "${1}" = "install" ]
+    then
+    [ "${UID}" != 0 ] && echo >&2 "Please run me as root. This will install a single binary file: /usr/local/bin/fping." && exit 1
+
+    run() {
+        printf >&2 " > "
+        printf >&2 "%q " "${@}"
+        printf >&2 "\n"
+        "${@}" || exit 1
+    }
+
+    [ ! -d /usr/src ] && run mkdir -p /usr/src
+    [ ! -d /usr/local/bin ] && run mkdir -p /usr/local/bin
+
+    run cd /usr/src
+
+    if [ -d fping.git ]
+        then
+        run cd fping.git
+        run git pull
+    else
+        run git clone https://github.com/schweikert/fping.git fping.git
+        run cd fping.git
+    fi
+
+    run ./autogen.sh
+    run ./configure --prefix=/usr/local
+    run make clean
+    run make
+    if [ -f /usr/local/bin/fping ]
+        then
+        run mv -f /usr/local/bin/fping /usr/local/bin/fping.old
+    fi
+    run mv src/fping /usr/local/bin/fping
+    run chown root:root /usr/local/bin/fping
+    run chmod 4755 /usr/local/bin/fping
+    echo >&2
+    echo >&2 "All done, you have a compatible fping now at /usr/local/bin/fping."
+    echo >&2
+    echo >&2 "If you have another fping installed, please set:"
+    echo >&2 "  fping=\"/usr/local/bin/fping\""
+    echo >&2 "at /etc/netdata/fping.conf"
+    exit 0
+fi
+
 # -----------------------------------------------------------------------------
 
 PROGRAM_NAME="$(basename "${0}")"
@@ -91,8 +122,8 @@ hosts=""
 # to ping the hosts - by default 5 pings per host per iteration
 ping_every="$((update_every * 1000 / 5))"
 
-# other fping options
-other_opts="-R -i 10 -r 0"
+# fping options
+fping_opts="-R -b 56 -i 1 -r 0 -t 5000"
 
 # -----------------------------------------------------------------------------
 # load the configuration file
index a5cdf7b87092c8f8b0310cb89f1ef3eb5d1efa11..610a0957c502a2b0ccd3e62aaa4e064d1fc573fc 100644 (file)
@@ -745,8 +745,8 @@ netdataDashboard.context = {
     // ------------------------------------------------------------------------
     // fping
 
-    'fping.loss': {
-        colors: NETDATA.colors[1],
+    'fping.quality': {
+        colors: NETDATA.colors[5],
         height: 0.5
     },
 
index c81d0e256baae9a5797ec621b0aeced91f36973b..164733812eaacdb34488a84ef60fe40273baf9a5 100644 (file)
         });
 
         NETDATA.requiredJs.push({
-            url: NETDATA.serverDefault + 'dashboard_info.js?v20161030-4',
+            url: NETDATA.serverDefault + 'dashboard_info.js?v20161101-1',
             async: false,
             isAlreadyLoaded: function() { return false; }
         });