Kod benim değil zaten. http://www.enderunix.org/qsheff/index.php?sect=download&lang=en de en altta yer alan qsheff-mrtg ye ait olan kodlar bunlar. Yanlış hatırlamıyorsam barış bey tarafından yazılmışlar. Değiştirerek deneyeyim?
-----Original Message----- From: Mehmet CELIK [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 29, 2008 2:20 PM To: freebsd@lists.enderunix.org Subject: RE: [FreeBSD] qsheff ve mrtg Neden expr fonksiyonunu kullaniyorsunuz? "expr" fonksiyonu yuzunden script calismiyor ve hata donderiyor.. Acaba script'i asagidaki gibi degistirme imkaniniz varmidir ? ### Script baslangic #!/bin/sh spam=`cat /var/log/qsheff.log | grep HEAD | wc -l` if [ "X$spam" = "X" ]; then SPAM = 0 else SPAM = $spam fi cat /var/log/qsheff.log>> /var/log/qsheff.log-head.cumulative echo $SPAM ### Script bitis -- Mehmet CELIK ---------------------------------------- > From: [EMAIL PROTECTED] > To: freebsd@lists.enderunix.org > Date: Tue, 29 Jan 2008 13:52:51 +0200 > Subject: RE: [FreeBSD] qsheff ve mrtg > > Dediğiniz şekilde yapmaya çalıştım ancak syntax hatası alıyorum. Cfg yi de > aşağıda iletmeye çalıştım... > > # mrtg qsheff-mrtg.cfg > expr: syntax error > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-spam.sh': > Expected a Number for 'in' but got '' > > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-spam.sh': > Expected a Number for 'out' but got '' > > expr: syntax error > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-subj.sh': > Expected a Number for 'in' but got '' > > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-subj.sh': > Expected a Number for 'out' but got '' > > expr: syntax error > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-head.sh': > Expected a Number for 'in' but got '' > > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-head.sh': > Expected a Number for 'out' but got '' > > expr: syntax error > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-virus.sh': > Expected a Number for 'in' but got '' > > 2008-01-29 13:49:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-virus.sh': > Expected a Number for 'out' but got '' > > 2008-01-29 13:50:02: ERROR: Target[spam][_IN_] ' $target->[0]{$mode} ' did > not eval into defined data > 2008-01-29 13:50:02: ERROR: Target[spam][_OUT_] ' $target->[0]{$mode} ' did > not eval into defined data > 2008-01-29 13:50:02: ERROR: Target[subj][_IN_] ' $target->[1]{$mode} ' did > not eval into defined data > 2008-01-29 13:50:02: ERROR: Target[subj][_OUT_] ' $target->[1]{$mode} ' did > not eval into defined data > 2008-01-29 13:50:02: ERROR: Target[head][_IN_] ' $target->[2]{$mode} ' did > not eval into defined data > 2008-01-29 13:50:02: ERROR: Target[head][_OUT_] ' $target->[2]{$mode} ' did > not eval into defined data > 2008-01-29 13:50:02: ERROR: Target[virus][_IN_] ' $target->[3]{$mode} ' did > not eval into defined data > 2008-01-29 13:50:02: ERROR: Target[virus][_OUT_] ' $target->[3]{$mode} ' did > not eval into defined data > # > > # egrep spam qsheff-mrtg-* > qsheff-mrtg-head.sh:spam=`cat /var/log/qsheff.log | grep HEAD | wc -l` > spam=`expr $spam + 0` > qsheff-mrtg-head.sh:echo $spam > qsheff-mrtg-spam.sh:spam=`cat /var/log/qsheff.log | grep SPAM | wc -l` > spam=`expr $spam + 0` > qsheff-mrtg-spam.sh:cat /var/log/qsheff.log>> > /var/log/qsheff.log-spam.cumulative > qsheff-mrtg-spam.sh:echo $spam > qsheff-mrtg-subj.sh:spam=`cat /var/log/qsheff.log | grep SUBJ | wc -l` > spam=`expr $spam + 0` > qsheff-mrtg-subj.sh:echo $spam > qsheff-mrtg-virus.sh:spam=`cat /var/log/qsheff.log | grep VIRUS | wc -l` > spam=`expr $spam + 0` > qsheff-mrtg-virus.sh:echo $spam > # > > İyi çalışmalar... > -----Original Message----- > From: mehmet celik [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 29, 2008 1:17 PM > To: freebsd@lists.enderunix.org > Subject: RE: [FreeBSD] qsheff ve mrtg > > > > Selamlar, verdigi hatayi eger yanlis cevirmiyor isem; "beklenen bir deger > yok veya bulunamadi" gibi birsey.. Script'leriniz de hata ile alakali ufak > bir sorun var.. > >> echo $spam # As MRTG in >> >> echo >> > > Script ciktisi olarak bir tane '$spam' degiskeni ve arkasindan bos bir > sekilde '\n' (yani enter) basiliyor. MRTG son degiskeni kabul ettigi icin > (son girilen input'da NULL oldugu icin) bos bir degere cevap veremiyor. > "Target" hatalarini bu yuzden vermektedir.. Script'ten en son cikti olarak > "$spam" degiskenini verirseniz, sorun duzelecektir. Asagida dogru sekilde > yazmaya calistim.. > > ### Script baslangic > #!/bin/sh > > spam=`cat /var/log/qsheff.log | grep HEAD | wc -l` > spam=`expr $spam + 0` > > cat /var/log/qsheff.log>> /var/log/qsheff.log-head.cumulative > echo $spam > ### Script bitis > > "/usr/local/bin/rateup" hatasina gelince de, MRTG kendisi, html ve png > dosyalarini rotate ederken, surekli olarak varolan bir html veya png'yi > ".old" seklinde saklayip yeni geleni onun yerine koyarak rotate islemini > saglamaktadir. Daha onceden olusturulmus bir html veya png dosyasi > bulamadigindan dolayi ".old" olarak dosyayi tasiyamamaktadir. Birkac kere > MRTG calistirdiktan sonra, hatalar ortadan kalkacak ve normale donecektir. > Kisaca "rateup" uyarisini onemsemeyin. > > -- Mehmet CELIK > > ________________________________ >> From: [EMAIL PROTECTED] >> To: freebsd@lists.enderunix.org >> Date: Tue, 29 Jan 2008 11:20:20 +0200 >> Subject: RE: [FreeBSD] qsheff ve mrtg >> >> >> Dediğiniz gibi yapmaya çalıştım. Ancak eksiklerim var sanırım. Ve yine > sanırımki "Yukaridaki 4 integer (echo $subj) deger icin ayri ayri kod > calistirip bunlara ayri ayri "Target" belirtirseniz, sorununuz > duzelecektir.. " dan kastınızı tam anlayamamışım. İligli konflar aşağıda. > Hata yı da göndermeye çalıştım. Eksik nokta konusunda yardımcı olabilir > misiniz? >> >> Aldığım hata ( lar ): >> >> >> >> mrtg qsheff-mrtg.cfg >> >> 2008-01-29 11:08:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-spam.sh': >> >> Expected a Number for 'out' but got '' >> >> >> >> 2008-01-29 11:08:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-subj.sh': >> >> Expected a Number for 'out' but got '' >> >> >> >> 2008-01-29 11:08:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-head.sh': >> >> Expected a Number for 'out' but got '' >> >> >> >> 2008-01-29 11:08:06: WARNING: Problem with External get > '/usr/local/etc/qsheff-II/qsheff-mrtg-virus.sh': >> >> Expected a Number for 'out' but got '' >> >> >> >> 2008-01-29 11:08:24: ERROR: Target[spam][_OUT_] ' $target->[0]{$mode} ' > did not eval into defined data >> >> 2008-01-29 11:08:24, Rateup WARNING: /usr/local/bin/rateup Can't remove > spam.old updating log file >> >> 2008-01-29 11:08:24: ERROR: Target[subj][_OUT_] ' $target->[1]{$mode} ' > did not eval into defined data >> >> 2008-01-29 11:08:24, Rateup WARNING: /usr/local/bin/rateup Can't remove > subj.old updating log file >> >> 2008-01-29 11:08:24: ERROR: Target[head][_OUT_] ' $target->[2]{$mode} ' > did not eval into defined data >> >> 2008-01-29 11:08:24, Rateup WARNING: /usr/local/bin/rateup Can't remove > head.old updating log file >> >> 2008-01-29 11:08:24: ERROR: Target[virus][_OUT_] ' $target->[3]{$mode} ' > did not eval into defined data >> >> 2008-01-29 11:08:24, Rateup WARNING: /usr/local/bin/rateup Can't remove > virus.old updating log file >> >> >> >> # cat qsheff-mrtg-* >> >> #!/bin/sh >> >> # >> >> # Produces mrtg values >> >> # >> >> # -b$, Fri Dec 3 14:25:05 EET 2004 >> >> # >> >> >> >> spam=`cat /var/log/qsheff.log | grep HEAD | wc -l` >> >> spam=`expr $spam + 0` >> >> >> >> cat /var/log/qsheff.log>> /var/log/qsheff.log-head.cumulative >> >> #echo -n> /var/log/qsheff.log >> >> >> >> echo $spam # As MRTG in >> >> echo >> >> #!/bin/sh >> >> # >> >> # Produces mrtg values >> >> # >> >> # -b$, Fri Dec 3 14:25:05 EET 2004 >> >> # >> >> >> >> spam=`cat /var/log/qsheff.log | grep SPAM | wc -l` >> >> spam=`expr $spam + 0` >> >> >> >> cat /var/log/qsheff.log>> /var/log/qsheff.log-spam.cumulative >> >> #echo -n> /var/log/qsheff.log >> >> >> >> echo $spam # As MRTG in >> >> echo >> >> #!/bin/sh >> >> # >> >> # Produces mrtg values >> >> # >> >> # -b$, Fri Dec 3 14:25:05 EET 2004 >> >> # >> >> >> >> spam=`cat /var/log/qsheff.log | grep SUBJ | wc -l` >> >> spam=`expr $spam + 0` >> >> >> >> cat /var/log/qsheff.log>> /var/log/qsheff.log-subj.cumulative >> >> #echo -n> /var/log/qsheff.log >> >> >> >> echo $spam # As MRTG in >> >> echo >> >> #!/bin/sh >> >> # >> >> # Produces mrtg values >> >> # >> >> # -b$, Fri Dec 3 14:25:05 EET 2004 >> >> # >> >> >> >> spam=`cat /var/log/qsheff.log | grep VIRUS | wc -l` >> >> spam=`expr $spam + 0` >> >> >> >> cat /var/log/qsheff.log>> /var/log/qsheff.log-virus.cumulative >> >> echo -n> /var/log/qsheff.log >> >> >> >> echo $spam # As MRTG in >> >> echo >> >> # cat qsheff-mrtg.cfg >> >> WorkDir: /usr/local/www/apache22/data/qsheff-stats >> >> >> >> ############################################################# >> >> Title[spam]: Rejected Messages >> >> MaxBytes[spam]: 10000 >> >> AbsMax[spam]: 20000 >> >> Options[spam]: gauge >> >> Target[spam]: `/usr/local/etc/qsheff-II/qsheff-mrtg-spam.sh` >> >> PageTop[spam]: Spam >> >> ShortLegend[spam]: spam >> >> YLegend[spam]: spam/hour >> >> Legend1[spam]: Total Filtered Subject >> >> LegendI[spam]: Body Spam: >> >> LegendO[spam]: Subject Spam: >> >> WithPeak[spam]: ymwd >> >> XSize[spam]: 350 >> >> YSize[spam]: 150 >> >> ############################################################# >> >> Title[subj]: Rejected Messages >> >> MaxBytes[subj]: 10000 >> >> AbsMax[subj]: 20000 >> >> Options[subj]: gauge >> >> Target[subj]: `/usr/local/etc/qsheff-II/qsheff-mrtg-subj.sh` >> >> PageTop[subj]: Spam >> >> ShortLegend[subj]: subj >> >> YLegend[subj]: subj/hour >> >> Legend1[subj]: Total Filtered Subject >> >> LegendI[subj]: Body Spam: >> >> LegendO[subj]: Subject Spam: >> >> WithPeak[subj]: ymwd >> >> XSize[subj]: 350 >> >> YSize[subj]: 150 >> >> ############################################################# >> >> Title[head]: Rejected Messages >> >> MaxBytes[head]: 10000 >> >> AbsMax[head]: 20000 >> >> Options[head]: gauge >> >> Target[head]: `/usr/local/etc/qsheff-II/qsheff-mrtg-head.sh` >> >> PageTop[head]: Spam >> >> ShortLegend[head]: head >> >> YLegend[head]: head/hour >> >> Legend1[head]: Total Filtered Subject >> >> LegendI[head]: Body Spam: >> >> LegendO[head]: Subject Spam: >> >> WithPeak[head]: ymwd >> >> XSize[head]: 350 >> >> YSize[head]: 150 >> >> ############################################################# >> >> Title[virus]: Rejected Messages >> >> MaxBytes[virus]: 10000 >> >> AbsMax[virus]: 20000 >> >> Options[virus]: gauge >> >> Target[virus]: `/usr/local/etc/qsheff-II/qsheff-mrtg-virus.sh` >> >> PageTop[virus]: Spam >> >> ShortLegend[virus]: virus >> >> YLegend[virus]: virus/hour >> >> Legend1[virus]: Total Filtered Subject >> >> LegendI[virus]: Body Spam: >> >> LegendO[virus]: Subject Spam: >> >> WithPeak[virus]: ymwd >> >> XSize[virus]: 350 >> >> YSize[virus]: 150 >> >> >> >> From: mehmet celik [mailto:[EMAIL PROTECTED] >> Sent: Monday, January 28, 2008 7:12 PM >> To: freebsd@lists.enderunix.org >> Subject: RE: [FreeBSD] qsheff ve mrtg >> >> >> >> >> Merhaba Mesut Bey, MRTG uygulamasi "Target" bolumunde belirtilen > opsiyona bagli olarak aldigi integer bir deger uzerinden grafiklerini cizer. > Baslangic degeri "0"'dir ve surekli olarak artalan bir integer dizgisine > sahiptir. >> >> Simdi sizin probleminize gelirsek; >> >> Target[spam]: `/usr/local/etc/qsheff-II/qsheff-mrtg.sh` >> >> boyle bir kodun calistirilmasi durumunda MRTG'ye asagidaki > integer'lari input etmis oluyorsunuz. >> >> >> echo $subj # As MRTG in >> >> echo $head # As MRTG head >> >> echo $virus # As MRTG virus >> >> echo $spam # As MRTG out >> >> >> >> MRTG bu degerlerden hangisini kullanacagini belirleyemez !!! Bu yuzden > grafikler bos cikiyor. Yukaridaki 4 integer (echo $subj) deger icin ayri > ayri kod calistirip bunlara ayri ayri "Target" belirtirseniz, sorununuz > duzelecektir.. >> >> Target[spam]:`/usr/...../qsheff-mrtg-subj.sh` => Sadece "echo subj" >> Target[spam]:`/usr/...../qsheff-mrtg-head.sh` => Sadece "echo head" >> >> Bu sekilde 4 tane birbirinden bagimsiz script'in verdigi degerler, MRTG > icin input olarak kullanilacaktir.. >> >> >> >> -- >> Mehmet CELIK >> >> >> >> >> ________________________________ >> >> From: [EMAIL PROTECTED] >> To: freebsd@lists.enderunix.org >> Date: Mon, 28 Jan 2008 14:21:54 +0200 >> Subject: [FreeBSD] qsheff ve mrtg >> >> Qsheff uygulamasının mrtg çıktılarını gösterebilen bir qsheff-mrtg > uygulaması vardı. Ancak qsheff gelişirken bu uygulama zaman olmaması vs gibi > sebeplerden dolayı geliştirilememiş ve qsheff in en son versiyonuna > uyarlanamamıştı. Mrtg konusunda hiç bir bilgim malesef yok. Ancak bunu > uylamayı kullanabilmek adına bir kaç çabam oldu. Ve ilgili dosyaları aklımca > editledim. Ancak başarılı sonuçlar alamadım. İlgili dosyalar aşağıdaki > şekilde. Grafikler oluşuyor ancak bomboşlar. Hata nerede. Yardımcı olabilir > misiniz? Ayrıca her bir konu için html dosyası oluşuyor ancak index.html > yok. >> >> >> >> # pwd >> >> /usr/local/etc/qsheff-II >> >> >> >> # cat qsheff-mrtg.sh >> >> #!/bin/sh >> >> # >> >> # Produces mrtg values >> >> # >> >> # -b$, Fri Dec 3 14:25:05 EET 2004 >> >> # >> >> >> >> subj=`cat /var/log/qsheff.log | grep SUBJ | wc -l` >> >> head=`cat /var/log/qsheff.log | grep HEADER | wc -l` >> >> virus=`cat /var/log/qsheff.log | grep VIRUS | wc -l` >> >> spam=`cat /var/log/qsheff.log | grep SPAM | wc -l` >> >> subj=`expr $subj + 0` >> >> head=`expr $head + 0` >> >> virus=`expr $virus + 0` >> >> spam=`expr $spam + 0` >> >> >> >> cat /var/log/qsheff.log>> /var/log/qsheff.log.cumulative >> >> echo -n> /var/log/qsheff.log >> >> >> >> echo $subj # As MRTG in >> >> echo $head # As MRTG head >> >> echo $virus # As MRTG virus >> >> echo $spam # As MRTG out >> >> echo >> >> >> >> >> >> # cat qsheff-mrtg.cfg >> >> WorkDir: /usr/local/www/apache22/data/qsheff-stats >> >> >> >> ############################################################# >> >> Title[spam]: Rejected Messages >> >> MaxBytes[spam]: 10000 >> >> AbsMax[spam]: 20000 >> >> Options[spam]: gauge >> >> Target[spam]: `/usr/local/etc/qsheff-II/qsheff-mrtg.sh` >> >> PageTop[spam]: Spam >> >> ShortLegend[spam]: spam >> >> YLegend[spam]: spam/hour >> >> Legend1[spam]: Total Filtered Subject >> >> LegendI[spam]: Body Spam: >> >> LegendO[spam]: Subject Spam: >> >> WithPeak[spam]: ymwd >> >> XSize[spam]: 350 >> >> YSize[spam]: 150 >> >> ############################################################# >> >> Title[virus]: Rejected Messages >> >> MaxBytes[virus]: 10000 >> >> AbsMax[virus]: 20000 >> >> Options[virus]: gauge >> >> Target[virus]: `/usr/local/etc/qsheff-II/qsheff-mrtg.sh` >> >> PageTop[virus]: Virus >> >> ShortLegend[virus]: virus >> >> YLegend[virus]: virus/hour >> >> Legend1[virus]: Total Filtered Subject >> >> LegendI[virus]: Body Virus: >> >> LegendO[virus]: Subject Virus: >> >> WithPeak[virus]: ymwd >> >> XSize[virus]: 350 >> >> YSize[virus]: 150 >> >> ############################################################# >> >> Title[subj]: Rejected Messages >> >> MaxBytes[subj]: 10000 >> >> AbsMax[subj]: 20000 >> >> Options[subj]: gauge >> >> Target[subj]: `/usr/local/etc/qsheff-II/qsheff-mrtg.sh` >> >> PageTop[subj]: Subj >> >> ShortLegend[subj]: subj >> >> YLegend[subj]: subj/hour >> >> Legend1[subj]: Total Filtered Subject >> >> LegendI[subj]: Body Subj: >> >> LegendO[subj]: Subject Subj: >> >> WithPeak[subj]: ymwd >> >> XSize[subj]: 350 >> >> YSize[subj]: 150 >> >> ############################################################# >> >> Title[head]: Rejected Messages >> >> MaxBytes[head]: 10000 >> >> AbsMax[head]: 20000 >> >> Options[head]: gauge >> >> Target[head]: `/usr/local/etc/qsheff-II/qsheff-mrtg.sh` >> >> PageTop[head]: Head >> >> ShortLegend[head]: head >> >> YLegend[head]: head/hour >> >> Legend1[head]: Total Filtered Headect >> >> LegendI[head]: Body Head: >> >> LegendO[head]: Subject Head: >> >> WithPeak[head]: ymwd >> >> XSize[head]: 350 >> >> YSize[head]: 150 >> >> >> >> >> >> İyi çalışmalar... >> >> >> >> Mesut GÜLNAZ >> >> >> >> ________________________________ >> >> Need to know the score, the latest news, or you need your Hotmail®-get > your "fix". Check it out. > > _________________________________________________________________ > Climb to the top of the charts! Play the word scramble challenge with star > power. > http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan > > --------------------------------------------------------------------- > Listeye soru sormadan once lutfen http://ipucu.enderunix.org sitesine > bakiniz. > > Cikmak icin, e-mail: [EMAIL PROTECTED] > Liste arsivi: http://news.gmane.org/gmane.org.user-groups.bsd.turkey > FreeBSD 6 kitabi cikti! http://www.acikakademi.com/catalog/freebsd6 > > > > --------------------------------------------------------------------- > Listeye soru sormadan once lutfen http://ipucu.enderunix.org sitesine bakiniz. > > Cikmak icin, e-mail: [EMAIL PROTECTED] > Liste arsivi: http://news.gmane.org/gmane.org.user-groups.bsd.turkey > FreeBSD 6 kitabi cikti! http://www.acikakademi.com/catalog/freebsd6 > > _________________________________________________________________ Shed those extra pounds with MSN and The Biggest Loser! http://biggestloser.msn.com/ --------------------------------------------------------------------- Listeye soru sormadan once lutfen http://ipucu.enderunix.org sitesine bakiniz. Cikmak icin, e-mail: [EMAIL PROTECTED] Liste arsivi: http://news.gmane.org/gmane.org.user-groups.bsd.turkey FreeBSD 6 kitabi cikti! http://www.acikakademi.com/catalog/freebsd6 --------------------------------------------------------------------- Listeye soru sormadan once lutfen http://ipucu.enderunix.org sitesine bakiniz. Cikmak icin, e-mail: [EMAIL PROTECTED] Liste arsivi: http://news.gmane.org/gmane.org.user-groups.bsd.turkey FreeBSD 6 kitabi cikti! http://www.acikakademi.com/catalog/freebsd6