Prihlásiť sa Odoslať Novinky :: FAQ :: Rozšírené vyhľadávanie :: Napísali o nás :: Ankety
Main Menu
· Home
· 
· FAQ
· 
· Diskusia
· 











Main Menu
· Domov

Moduly
· AvantGo
· Downloads
· FAQ
· News
· Recommend Us
· Reviews
· Search
· Sections
· Stats
· Topics
· Top List
· Web Links
· Forum

Jazyk
Výber jazykovej mutácie:



The time now is 15.10.2018 - 19:18


Overi pingom ci dana IPka zije

Post new topic Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
 
Author Message
amilo
Post subject: Overi pingom ci dana IPka zije  PostPosted: 14.12.2005 - 22:32 #26425
Basic


Joined: Okt 26, 2005
Posts: 56

...a ak zit prestane posle mail, to iste spravi ak ozije Smile

#!/bin/sh
# Change IP, HOST, MAIL and add to crontab every X minutes (eg. 5):
# */5 * * * * /path/to/script >/dev/null 2>&1

IP=""
HOST=""
MAIL=""

DATE=`date +'%k:%M:%S [%d-%b-%Y]'`
PING=`ping -c 2 $IP >/dev/null 2>&1`

if [ "$PING" ]; then
sleep 0
else
sleep 1
if ! "$PING" && ! ls ~/$HOST.log >/dev/null 2>&1; then
echo "$HOST ($IP) down at $DATE" | mail -s "$HOST down" $MAIL
touch ~/$HOST.log
fi
fi

if ls ~/$HOST.log >/dev/null 2>&1 && "$PING" ; then
echo "$HOST ($IP) up at $DATE" | mail -s "$HOST up" $MAIL
rm ~/$HOST.log >/dev/null 2>&1
fi

# powered by BoFH.sk developers
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
All times are GMT
Post new topic Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
 
Jump to:  

Powered by PNphpBB2 © 2003-2005 The PNphpBB Group
Credits

(C) SKFree 2002-2010: Powered by POSTNUKE. Môžete prebera? naše správy vo formáte XML(RSS)