Postfix monitoring with David Schweikert's Mailgraph?
Moderators: Developers, Moderators
hi
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?
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?
New boy between cacti
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?
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?
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...
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...
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.
'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.
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.
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.
The output of that script should *only* be:
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.
Code: Select all
sent:143 received:228 rejected:217 bounced:70 spam:42 virus:0
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.jpingle wrote:The output of that script should *only* be:
Anything before or after that line will throw off the parsing on the cacti side of things.Code: Select all
sent:143 received:228 rejected:217 bounced:70 spam:42 virus:0
And was that a typo, or did you rewrite that as a perl script? It was originally a bash shell script.
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.
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.
You might try deleting the graph and recreating it, but it may just take some time.
-
- Posts: 2
- Joined: Wed Nov 30, 2005 12:04 pm
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
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 4217 times
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
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]
[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]
Who is online
Users browsing this forum: No registered users and 2 guests