From a5d785e341df59e67fbc4d883c9392b6417ef284 Mon Sep 17 00:00:00 2001 From: Sancho Lerena Date: Thu, 18 Sep 2014 18:30:42 +0200 Subject: [PATCH] New remote plugin to measure packet loss using a remote check. --- pandora_server/util/plugin/packet_loss.sh | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 pandora_server/util/plugin/packet_loss.sh diff --git a/pandora_server/util/plugin/packet_loss.sh b/pandora_server/util/plugin/packet_loss.sh new file mode 100755 index 0000000000..93ae663050 --- /dev/null +++ b/pandora_server/util/plugin/packet_loss.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# (c) 2014 Sancho Lerena +# (c) Artica Soluciones Tecnologicas + +# Packet loss ICMP measurement remote plugin + +# Remote plugin to measure remote packet loss using ping +# It requires root access, because use flood mode to send many pings. +# It's limited to 50 pings and 10 seconds, so it should not be nasty +# for your network :-) + +if [ $# -eq 0 ] || [ $# -eq 1 ] +then + echo "Syntax: " + exit -1 +fi + +TIMEOUT=$1 +DESTINATION=$2 + +echo `ping -W $1 -q -f -c 50 $2 | grep -o "[0-9\.]*. packet loss" | grep -o "[0-9.]*"` + +