mailgraph is a good tool at analysing mail server log, it supports many MTA(including sendmail, postfix, exim,etc.), with support for mailscanner,spamassassin,etc.
As a whole, mailgraph can tell mail server statistics like how many messages sent/ received/ bounced/ rejected/ virus/ spam per time interval, which can be used as a sign of mail server healthy.
This plugin includes a patch for mailgraph so that it will also output its statistics counter to an external file(plus the rra file),and a check_mailstat.pl which check the stat counter to see if it’s ok, emit WARN/CRITICAl result if not.It can run on nagios server, or on remote server via NRPE.
see Readme file in the package for install instructions.
Downloads:
7 comments
2 pings
Sven P
March 16, 2011 at 6:37 am (UTC 8)
Hi There,
a really cool Plugin
But can you please add Performance Data Output so that i can graph the Mailstats with PNP4Nagios? That wourld be great.
Thank you very much for that Script and your Answer
Greetins
Sven
Curu Wong
March 17, 2011 at 6:49 pm (UTC 8)
I am glad that you like it. I have released the 0.9.1 version, which added perfdata output(and it includes a PNP4Nagios template).
Dan Candea
August 5, 2011 at 1:05 am (UTC 8)
I made a pnp4nagios template which is similar with the one from mailgraph.cgi. Maybe you want to include it in the package. The data is displayed only in two graphs.
http://docs.quah.ro/nagios/check_mailstat.php
Curu Wong
August 5, 2011 at 10:31 pm (UTC 8)
There was a PNP4Nagios in v0.9.1.
I want to have a look at your template first, but it seems I can’t get it from the provided link, it shows me a php error,would you please check that?
Pierre-Yves Dubreucq
August 19, 2011 at 5:20 pm (UTC 8)
Hi,
I don’t use PNP4Nagios but I’m using Centreon http://www.centreon.com/
I’ve modified this script to graph with Centreon
On line 97 subsitute ” ” by “;”
like that :
Replace :
my $perfdata = sprintf "sent=%-6.2f received=%-6.2f bounced=%-6.2f rejected=%-6.2f virus=%-6.2f spam=%-6.2f", @stat_counter;
Par :
my $perfdata = sprintf "sent=%-6.2f;received=%-6.2f;bounced=%-6.2f;rejected=%-6.2f;virus=%-6.2f;spam=%-6.2f", @stat_counter;
Could you tell me if your script with this modification stay compatible with pnp4nagios ?
If it’s true, could you update your plugin ?
Thanks by advance.
Curu Wong
August 20, 2011 at 10:18 am (UTC 8)
Hi, It may break PNP4Nagios if substitute ” ” by “;”
Basically, PNP4Nagios uses the same logic as the perl module Nagios::Plugin::Performance when parsing performance data. Reading the source code of that module, you will find that blank character(including space) is used to seperate different perfdata metric, whereas semicolon(;) is used to seprate fields of a single metric.
If you have read section 2.6 of the Nagios plug-in development guidelines, you will know the recommended format of perf data.
Dan Candea
November 9, 2011 at 12:03 am (UTC 8)
@Curu Wong
it tries to interpret the php. just acces the link without the script
http://docs.quah.ro/nagios/
To save use the right side icon.
DBsysNet # Databases, Systems, Networks » Supervision de postfix via mailgraph avec le plugin check_mailstat.pl via Nagios/Centreon
September 16, 2011 at 10:26 pm (UTC 8)
[...] cela nous allons utiliser le plugins check_mailstat.pl avec une petite adaptation du script afin de le rendre compatible avec la génération de graphe [...]
Databases, Systems, Networks » Supervision de postfix via mailgraph avec le plugin check_mailstat.pl via Nagios/Centreon
March 25, 2012 at 2:10 am (UTC 8)
[...] cela nous allons utiliser le plugins check_mailstat.pl avec une petite adaptation du script afin de le rendre compatible avec la génération de graphe [...]