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]: <B>Spam</B><br>
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]: <B>Spam</B><br>
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]: <B>Spam</B><br>
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]: <B>Spam</B><br>
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: [email protected]
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: [email protected]
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]: <B>Spam</B><br>
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]: <B>Virus</B><br>
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]: <B>Subj</B><br>
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]: <B>Head</B><br>
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. <http://www.msnmobilefix.com/Default.aspx>