|
Linux. Computer network. Analyze ping ECHO statistics code: check if provider is stable. |
if provider is stable? Simple code will tell you.
File 1.log="/_scripts/_cron_init/_ping.log" /bin/date >> $log /bin/ping -c 3 -q www.typo3.as >> $log 2> /dev/null /bin/ping -c 3 -q www.example.lt >> $log 2> /dev/null /bin/ping -c 3 -q www.yahoo.com >> $log 2>/dev/null # 7.2 min per diena 0.5% laiko File 2. sleep 2 folder="/_scripts/_cron_init/" # grep -H "[a-zA-Z]" ${folder}_ping*.log | grep -v "rtt " | grep -E -B 8 -A 8 "(66%){1}|(100%){1}" > ${folder}ping_analyze.log grep -H "[a-zA-Z]" ${folder}_ping*.log | grep -v "rtt " | grep -E -B 8 -A 8 "(100%){1}" > ${folder}ping_analyze.log sleep 2 echo echo Ping Statistics # grep -H "[a-zA-Z]" ${folder}_ping*.log | grep -v "rtt " | grep -E "(66%){1}|(100%){1}" | wc -l
grep -H "[a-zA-Z]" ${folder}_ping*.log | grep -v "rtt " | grep -E "(100%){1}" | wc -l
|