New remote plugin to measure packet loss using a remote check.

This commit is contained in:
Sancho Lerena 2014-09-18 18:30:42 +02:00
parent 666097c434
commit a5d785e341
1 changed files with 24 additions and 0 deletions

View File

@ -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: <max_timeout_insecs> <target_ip>"
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.]*"`