problems getting mail usage statistics

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
omz13
Posts: 8
Joined: Thu May 12, 2005 5:03 pm
Location: Luxembourg
Contact:

problems getting mail usage statistics

Post by omz13 »

Hi,

I'm trying to get cacti to graph how much aduse my email server is getting.

I've written a simple awk script to process my mail log and generate some stats.

Code: Select all

# awk -f courier_stats.awk /var/log/mail/current
normal:5 list:15 maybespam:0 droppedspam:6 relay:0 unknownuser:1 invaliddom:0 cmderr:0
But, when I get cacti to execute this command (as part of Data Input Method), the poller just says the result from CMD is invalid

Code: Select all

01/19/2006 12:50:01 AM - CMDPHP: Poller[0] Host[3] DS[32] CMD: awk -f /var/www/intranet/root/cacti/scripts/courier_stats.awk /var/log/mail/current, output: U  
01/19/2006 12:50:01 AM - CMDPHP: Poller[0] Host[3] DS[32] WARNING: Result from CMD not valid. Partial Result:  
Any idea what I'm doing wrong (and why doesn't the log show more information, even though I set it to DEBUG mode)?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Maybe the user account running the cacti cron job doesn't have the proper rights to the files?
omz13
Posts: 8
Joined: Thu May 12, 2005 5:03 pm
Location: Luxembourg
Contact:

Post by omz13 »

BSOD2600 wrote:Maybe the user account running the cacti cron job doesn't have the proper rights to the files?
Ah. mea culpa. I'd switched from sysklogd to metalog, and when it created /var/log/mail it didn't give anybody (apart from root) rx access.

Right, after chmod on that dir, the poller is happy... but I've screwed up somewhere else as the graph isn' t being generated. I get

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Courier Mail Stats" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
DEF:a="/var/www/intranet/root/cacti/rra/courier_stats.rrd":normal:LAST \
DEF:b="/var/www/intranet/root/cacti/rra/courier_stats.rrd":list:LAST \
DEF:c="/var/www/intranet/root/cacti/rra/courier_stats.rrd":droppedspam:LAST \
AREA:a#00FF00:"Normal"  \
LINE1:b#FF897C:"List"  \
LINE1:c#B1441E:"SPAM" 
RRDTool Says:

ERROR: the RRD does not contain an RRA matching the chosen CF
Help!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Hmm, try the suggestion in this post: http://forums.cacti.net/about3686.html

You using cacti 0.8.6h + patches?
omz13
Posts: 8
Joined: Thu May 12, 2005 5:03 pm
Location: Luxembourg
Contact:

Post by omz13 »

BSOD2600 wrote:Hmm, try the suggestion in this post: http://forums.cacti.net/about3686.html
Many thanks. That fixed it.

Now I can sit back and watch cacti graph how much spam vs. real email I get. :D
BSOD2600 wrote:You using cacti 0.8.6h + patches?
Yep.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests