From: Ahmet Aksoy (ahmetax@axtelsoft.com)
Date: Thu 29 Jul 2004 - 13:36:51 EEST
Merhaba,
(Aslinda bu mesaji linux-baslangic listesine gondermistim ama,
asil yeri burasi olmali.)
/axtelsoft dizininde wm isimli bir scriptim var. Soyle:
#!/bin/bash
#
pingtest() {
ping=`ping -c3 $1 | tail -2`
loss=`echo $ping | cut -d"," -f3 | cut -d" " -f2`
delay=`echo $ping | cut -d"=" -f2 | cut -d"." -f1`
if [ "$loss" = "%100" ] ; then
echo $1 `date` : complete loss >> /axtelsoft/ax.hist
elif [ "$loss" = "" ] ; then
echo $1 `date` : no response >> /axtelsoft/ax.hist
else
#exit
echo $1 `date` : ok >> /axtelsoft/ax.hist
fi
}
pingtest www.axtelsoft.com
pingtest www.axomar.com
Bu scripti cronla 10 dakikada bir calistiriyorum:
Crontab komutu da su sekilde:
10,20,30,40,50 * * * * /axtelsoft/wm
Ping normal tepki verdiginde sorun yok. Ancak, adres devre disi ise bir hata
mesaji donuyor. Bu mesaj da mail ile root hesabina gonderiliyor.
Bunu, yani bu scriptin olusturdugu hatalarin root'a rapor edilmesini nasil
engelleyebilirim?
10,20,30,40,50 * * * * /axtelsoft/wm 2>/dev/null
ve
ping=`ping -c3 $1 | tail -2 2>/dev/null`
ile bir cozum elde edemedim.
-----------------------------
Ahmet Aksoy
www.axtelsoft.com
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.722 / Virus Database: 478 - Release Date: 18.07.2004