#!/bin/bash host="el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11 el12" per="1200" export DISPLAY=":0" ping -c 1 google.com -w 3 > /dev/null if [ $? != 0 ];then exit fi; for h in $host;do ping -c 1 $h -w 3 > /dev/null if [ $? != 0 ];then if [ ! -f /tmp/checker_${h}_send.lock ] || [ "`expr \`stat -c %Y /tmp/checker_${h}_send.lock \` + $per`" -lt "`date +%s`" ];then rm -f /tmp/checker_${h}_send.lock notify-send "Сервер ${h} не ответил на ping" -u low -t 10000 touch /tmp/checker_${h}_send.lock fi; fi; done