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 12.12.2018 - 15:01


Overi pingom ci ip zije? je tu niekde chyba?

Post new topic Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
 
Author Message
Wictorio
Post subject: Overi pingom ci ip zije? je tu niekde chyba?  PostPosted: 26.07.2007 - 09:18 #55292
Basic


Joined: Feb 27, 2006
Posts: 25
Location: SNP 410/7
...a ak zit prestane posle mail, to iste spravi ak ozije

#!/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
-----------------------------------------------

podarilo sa mi to dvakrat spustit v ostatnych pripadoch vypise hlasku:

line 16 : command not found
line 22 : command not found

dikes za kazdu radu...
 
 View user's profile Send private message Visit poster's website ICQ Number 
Reply with quote Back to top
iwik
Post subject: RE: Overi pingom ci ip zije? je tu niekde chyba?  PostPosted: 26.07.2007 - 15:05 #55303
Basic


Joined: Feb 05, 2003
Posts: 118
Location: Bratislava
asi nemas nainstalovany program mail...
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
slonik
Post subject: RE: Overi pingom ci ip zije? je tu niekde chyba?  PostPosted: 28.07.2007 - 12:04 #55366
Ucen


Joined: Okt 20, 2004
Posts: 561

na toto by som pouzival fping sa to tusim vola
je to rychlejsi ICMP echo req ako klasiciky ping ak je tych ipciek vela oplati sa doinstalovat

inak je lepsie nahodit nieco ako nagios netXMS a pod zabbyx
ak toho bude treba monitorovat viac
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
lol
Post subject: RE: Overi pingom ci ip zije? je tu niekde chyba?  PostPosted: 28.07.2007 - 12:07 #55369
Ucen


Joined: Jan 15, 2005
Posts: 768

Alebo calstats a mas k tomu aj pekny graficky vystup vo forme obrazka
 
 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)