Postfix monitoring with David Schweikert's Mailgraph?

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

Unless it actually logs a line into /var/log/maillog, then mailgraph won't pick it up. Are you sure there also isn't a line in maillog when it catches a virus?

If it really doesn't log to maillog, then you'd have to get the count some other way...
aboyz

yeah.

Post by aboyz »

yeah..

how do i go about doing that? which file do i change? will this work.. can edit clamd.conf to log the log file into /var/log/maillog?

I mean can both program log to the same files? or will it be a conflict??

do you know..
aboyz

hi

Post by aboyz »

hi,

Ok i got clanav to log ito /var/log/maillog

so am i all set or do i still need to change something?

This is what is in the clanav log. in maillog

SelfCheck: Database status OK.
stream: Worm.Mytob.BT FOUND
stream: Worm.Mytob.BT FOUND
stream: Worm.Mytob.T-2 FOUND
stream: Worm.Mytob.BR FOUND
stream: Worm.Bagle.Gen-zippwd FOUND
stream: Worm.SomeFool.P FOUND
stream: Worm.Mytob.BT FOUND
stream: Worm.Mytob.BT FOUND
stream: Worm.Mytob.BT FOUND
stream: Worm.Mytob.BR FOUND
stream: Worm.SomeFool.P FOUND
stream: Worm.Mytob.BR FOUND
stream: Worm.Mytob.T-2 FOUND
stream: Worm.SomeFool.Gen-1 FOUND
stream: Worm.Mytob.BR FOUND


So will it pick up virus now?
PChott
Posts: 1
Joined: Thu Jun 16, 2005 3:11 am

New boy between cacti

Post by PChott »

Hi, guys

I'm new with using Cacti and also snmpd. Im try to use this help for postfix statistic, but i don't have much luck.

My OS is debian. I downloaded "Mailgraph.zip" and use that INSTALL help, to install it.

AND, i'm not geting any results. on graph. But i can see an empty graph. Can anyone tell me what i did wrong?
lucky
Cacti User
Posts: 62
Joined: Mon Sep 30, 2002 3:23 am
Location: Germany

Post by lucky »

hi!

can somebody help me with monitoring postfix on my gentoo box.

a little step by step documentation?

cacti 0.8.6e

thanks
diego
Posts: 1
Joined: Fri Aug 05, 2005 3:18 am

Post by diego »

I had to patch the JJP script to get it work on my fedora 2 system.

mailgraph.pl
--------------

line 293 #use RRDs;

why:: remove dependency on perl RRD lib...

line 690 #return 1 if $m == $this_minute;
line 691 #return 0 if $m < $this_minute;

why:: if you don't, the stats will not update after it gets zeroed...

Comment the 3 lines out...the line number might be slightly off due to my other customization...
deuce868
Posts: 6
Joined: Mon Sep 12, 2005 8:45 am

Post by deuce868 »

Ok, I've been trying to get this to work as it looks great. I am getting nan for all my graphs and when I try to manually run postfixstats.sh I get the following:

'ostfixstats.sh: line 2: syntax error near unexpected token `
'ostfixstats.sh: line 2: `for i in sent received rejected bounced spam virus;

Now I've tried this loop without the ; which then gets me an unexpected end of file error. I've checked for any line breaks or speaces and nadda. I took out all of the spaces/tabs and no luck.

Any idea what's up with this?


EDIT:
ok, I had a bunch of bad end of line characters that weren't visible in vi I had to clean out.

The script runs now.
deuce868
Posts: 6
Joined: Mon Sep 12, 2005 8:45 am

Post by deuce868 »

Ok, I am missing something simple. I have everything going all the way to postfixcheck.pl giving out the response:
sent
received
rejected
bounced
spam
virus
sent:143 received:228 rejected:217 bounced:70 spam:42 virus:0

I am getting the graph, but all results are nan. I am thinking it's some permission problem, but I can't seem to find out which files it is. I tried changing the resultant /var/tmp/mail* files to be owned by www-data with no luck.

Any ideas what I need to check? All the scripts seem to be working, but I'm not getting the data in the graphs.

Thanks for the help.
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

The output of that script should *only* be:

Code: Select all

sent:143 received:228 rejected:217 bounced:70 spam:42 virus:0 
Anything before or after that line will throw off the parsing on the cacti side of things.

And was that a typo, or did you rewrite that as a perl script? It was originally a bash shell script.
deuce868
Posts: 6
Joined: Mon Sep 12, 2005 8:45 am

Post by deuce868 »

jpingle wrote:The output of that script should *only* be:

Code: Select all

sent:143 received:228 rejected:217 bounced:70 spam:42 virus:0 
Anything before or after that line will throw off the parsing on the cacti side of things.

And was that a typo, or did you rewrite that as a perl script? It was originally a bash shell script.
Ok, it was my mistake. When I was having problems with the script I had added a echo $i line. I took that out.

The I was running the perl scipt which is the one in the cacti/scipts directory. It was calling the postfixstats.sh

Is there some clearing out I need to do because I am still getting nan.
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

Ah, ok. Well after you get a successful run of that script output, it will take a couple runs of the poller to pick up data. If you can run the perl script and it gets the output fine, then it should work inside of cacti. The biggest hurdle is getting that script output back to the cacti input script.

You might try deleting the graph and recreating it, but it may just take some time.
deuce868
Posts: 6
Joined: Mon Sep 12, 2005 8:45 am

Post by deuce868 »

Ok, I had the cacti script in the wrong place. In my debian install it needed to go under /use/share/cacti/site/scripts/

Oops. Well I think it's starting to work now. very very sweet.

thanks!
kanada
Cacti User
Posts: 137
Joined: Sun Aug 28, 2005 12:51 pm

Problem.

Post by kanada »

Its possible to do this module remote graphing from other machine ?
stickboy2642
Posts: 2
Joined: Wed Nov 30, 2005 12:04 pm

Post by stickboy2642 »

Hello all. Thank you creating the templates and such to get this working in cacti. I am using this to monitor my postfix machines, and it is working great. I also wanted to make a contribution to the work going on in this thread.

I made some modifications to the mailgraph files to make them more cacti friendly. I rewrote the postfixcheck.pl script so that it pulls host and snmp information from cacti rather than having to edit postfixcheck.pl by hand. This makes it easier to monitor multiple hosts using a single script. The script also accepts the snmp version and handles the data gathering process appropriately. I made a change to the graph template to reflect the change in the script.

I also added a walkthrough to get this running in Gentoo linux and RHEL 3. I included the original documentation from jpingle as well.

Please note that this is the first time I have worked with Perl, so if things in the script look a little sloppy, I apologize. I have been running this on my cacti box and it seems to work great, but if anybody notices anything or has any feedback, please let me know. The template was exported using version 0.8.6g.

There is also a nice walkthrough in this post on the Gentoo Forums for those of you who want to get this working under Gentoo.

http://forums.gentoo.org/viewtopic-t-41 ... cacti.html
Attachments
mailgraph-cacti.zip
(16.24 KiB) Downloaded 4163 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Moved to Scripts and Templates
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests