|
mrtgcontrol.sh
|
|
04-14-2010, 05:33 PM
Mesaj: #1
|
|||
|
|||
|
mrtgcontrol.sh
Bu script çalışmayan Mrtg grafiklerini bulup raporlamak üzere oluşturulmuştur.
#!/bin/bash #Variables path=/home/html mail=ozsarman@netone.com.tr #Statics file=/scripts/mrtgcontrol.txt #First Instruction echo > $file #Loop ls /home/html |while read line do fullpath="$path/$line/$line.html" control=`grep -w "0.0" $fullpath|wc -l` if [ $control -eq 0 ] then echo > /dev/null else echo >> $file echo "Lütfen $line grafigini kontrol ediniz" >> $file fi done #Report End toplam=`grep kontrol $file|wc -l` echo >> $file echo >> $file echo "Toplam problemli grafik sayisi = $toplam" >> $file echo >> $file echo >> $file #Send report mail -s "Mrtg Control Results" $mail < $file Özdemir Şarman aka (Charmant-zavanetratan) |
|||
|
04-14-2010, 05:34 PM
Mesaj: #2
|
|||
|
|||
|
RE: mrtgcontrol.sh
Bu versiyonda hatalı grafiklerin html linkleride eklenmiştir.
#!/usr/local/bin/bash #Variables path=/home/html/ mail=xyz@netone.com.tr weblink="http://grafik.xxx.com.tr/grafik" #Statics file=/scripts/mrtgcontrol.txt #First Instruction echo > $file #Loop ls /home/html/ |while read line do fullpath="$path/$line/$line.html" control=`grep -w "0.0" $fullpath|wc -l` if [ $control -eq 0 ] then echo > /dev/null else echo >> $file echo "Lütfen $weblink$line grafigini kontrol ediniz" >> $file fi done #Report End toplam=`grep kontrol $file|wc -l` echo >> $file echo >> $file echo "Toplam problemli grafik sayisi = $toplam" >> $file echo >> $file echo >> $file #Send report mail -s "Mrtg Control Results" $mail < $file Özdemir Şarman aka (Charmant-zavanetratan) |
|||
|
04-14-2010, 05:34 PM
Mesaj: #3
|
|||
|
|||
|
RE: mrtgcontrol.sh
Bu versiyonda yapilan kontrollere Mrtg grafiğinin zaman kontrolüde eklenmiştir.
#!/bin/bash #Variables path=/home/html/ mail=xxx@yyy weblink="http://aaa.bbb.ccc" #Statics file=/etc/mrtgcontrol.txt #Date era=`date -v1d|awk '{print $3,$2,$6}'` #First Instruction echo > $file #Loop ls /home/html |while read line do fullpath="$path/$line/$line.html" controla=`grep "$era" $fullpath|wc -l` controlb=`grep -w "0.0" $fullpath|wc -l` if [ $controla -gt 0 ] && [ $controlb -eq 0 ] then echo > /dev/null else echo >> $file echo "Lütfen $weblink$line grafigini kontrol ediniz" >> $file fi done #Report End toplam=`grep kontrol $file|wc -l` echo >> $file echo >> $file echo "Toplam problemli grafik sayisi = $toplam" >> $file echo >> $file echo >> $file #Send report mail -s "Mrtg Control Results" $mail < $file Özdemir Şarman aka (Charmant-zavanetratan) |
|||
|
04-14-2010, 05:34 PM
Mesaj: #4
|
|||
|
|||
|
RE: mrtgcontrol.sh
Scriptin karar mekanizmasi olan:
if [ $controla -gt 0 ] && [ $controlb -eq 0 ] if [ $controla -gt 0 ] then echo > /dev/null else echo >> $file echo "Lütfen $weblink$line grafigini kontrol ediniz" >> $file fi kismi asagidaki sekilde degistirilmelidir: #Karar Mekanizmasi if [ $controla -lt 1 ] then if [ $controlb -lt 1 ] then echo > /dev/null else echo >> $file echo "Lütfen $weblink$line grafigini kontrol ediniz" >> $file fi fi #Karar Mekanizmasi Bitis Özdemir Şarman aka (Charmant-zavanetratan) |
|||
'mrtgcontrol.sh' Konusunu PaylaÅŸ |
| Benzeyen Konular | |||||
| Konu: | Yazar | Cevaplar: | Gösterim: | Son Mesaj | |
| mrtgcontrol.sh En son full calisan Final Versiyon | ozsarman | 2 | 303 |
03-29-2010 05:53 PM Son Mesaj: ozsarman |
|

Arama
Üye Listesi
Takvim
Yardım














