[mrtg] Problems querying log file for IN and OUT numbers
Troy Wical
troy at wical.com
Sun Jun 28 14:24:24 CEST 2009
I am trying to graph the amount of emails that are/aren't being
greylisted. I have found several scripts that query the log file for
a certain string, and they work well. I thought I could just copy the
script and call a different parameter from a different log file, but I
seem to be missing something. Regardless of the values I am
successfully getting when I run the script manually, the value are not
plotting. The graph is all zeros. The mrtg log is empty as well.
Anyone here have an idea?
Scripts I am running:
/etc/mrtg/scripts/greylist.pl
#!/bin/sh
grep "action=greylist" /var/log/mail.info | /usr/bin/wc -l | /usr/bin/
awk '{print $1}'
grep "action=pass" /var/log/mail.info | /usr/bin/wc -l | /usr/bin/awk
'{print $1}'
uptime | awk '{ print $3, $4, $5, $6, $7, $8, $9, $10, $11, $12 }'
The output I get when I run the script manually:
host:/etc/mrtg/scripts$ ./greylist.pl
5580
625
8 days, 15:44, 1 user, load average: 0.02, 0.05, 0.00
the mrtg entry:
#############
#greylisting#
#############
Target[localhost.greylist]: `/etc/mrtg/scripts/greylist.pl`
Title[localhost.greylist]: Greylisting
PageTop[localhost.greylist]: <H1>Greylisted vs Accepted</H1>
MaxBytes[localhost.greylist]: 9
AbsMax[localhost.greylist]: 100
YLegend[localhost.greylist]: count
ShortLegend[localhost.greylist]: count
Options[localhost.greylist]: growright,nopercent,gauge
Legend1[localhost.greylist]: Count
Legend2[localhost.greylist]: Count
LegendI[localhost.greylist]: Greylisted
LegendO[localhost.greylist]: Accepted
Colours[localhost.greylist]:
DKBLUE#61A0DF,DKBLUE#0000DD,RED#FF0000,RED#FF0000
PNGtitle[localhost.greylist]: emails greylisted vs accepted
TimeStrPos[localhost.greylist]: RU
MacBytes and AbsMax are the only parameters I have not adjusted (I
also copied the mrtg entry that went with the script I copied.) If
those need to be changed, I am not sure what they should be changed to.
Thanks in advance,
Troy
More information about the mrtg
mailing list