Monitor Postfix with SNMP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Monitor Postfix with SNMP

Scappatura Rocco
Hello,

I would like to know if is there exists any Postfix-specific MIB.

In particular, I would like to gather information about:

- the size of Postix queues (in particular 'active' queue)
- the average delay of a message spent inside a Postfix queue

so that I can trace these values trhough a software MRTG-like.

I'm running a Postfix+Amavisd-new+MySQL platform. Could I distinguish
statistics for these services:

- smtp
- 127.0.0.1:10025

?

At this time, all Postfix logs are put in a single file (/var/log/mail).
Maybe do I need to separate the logs of "127.0.0.1:10025" services? Is
there any way to do so? If yes, what is it?

TIA,

rocsca

Reply | Threaded
Open this post in threaded view
|

RE: Monitor Postfix with SNMP

Scappatura Rocco
> Rocco Scappatura schrieb:
> > Hello,
> >
> > I would like to know if is there exists any Postfix-specific MIB.
> >
> > In particular, I would like to gather information about:
> >
> > - the size of Postix queues (in particular 'active' queue)
> > - the average delay of a message spent inside a Postfix queue
> >
> > so that I can trace these values trhough a software MRTG-like.
> >
> > I'm running a Postfix+Amavisd-new+MySQL platform. Could I
> distinguish
> > statistics for these services:
> >
> > - smtp
> > - 127.0.0.1:10025
> >
> > ?
> >
> > At this time, all Postfix logs are put in a single file
> (/var/log/mail).
> > Maybe do I need to separate the logs of "127.0.0.1:10025"
> services? Is
> > there any way to do so? If yes, what is it?
> >
> > TIA,
> >
> > rocsca
> >
>
> Hi,
>
> no postfix MTA subagent available. Would be a nice job to do.
>
> But you can get a lot of information about the MTA using
> net-snmp with custom scripts or log-match.

Thanks Michael,

I saw a few of things that reports statistic about Postfix, but it
should be comfortable to get some hint on what use, to be safe..

rocsca
Reply | Threaded
Open this post in threaded view
|

Re: Monitor Postfix with SNMP

Wietse Venema
In reply to this post by Scappatura Rocco
Rocco Scappatura:

> Hello,
>
> I would like to know if is there exists any Postfix-specific MIB.
>
> In particular, I would like to gather information about:
>
> - the size of Postix queues (in particular 'active' queue)
> - the average delay of a message spent inside a Postfix queue
>
> so that I can trace these values trhough a software MRTG-like.
>
> I'm running a Postfix+Amavisd-new+MySQL platform. Could I distinguish
> statistics for these services:
>
> - smtp
> - 127.0.0.1:10025
>
> ?
>
> At this time, all Postfix logs are put in a single file (/var/log/mail).
> Maybe do I need to separate the logs of "127.0.0.1:10025" services? Is
> there any way to do so? If yes, what is it?

This requires the existence of a Postfix command that provides such
information.  I am sure that if someone implements such a command,
then someone will write an SNMP adapter for it.

I will oppose a feature that is accessible with SNMP only.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Monitor Postfix with SNMP

ml@sd2i.com
In reply to this post by Scappatura Rocco

Le 2 mai 08 à 09:40, Rocco Scappatura a écrit :

> Hello,
>
> I would like to know if is there exists any Postfix-specific MIB.
>
> In particular, I would like to gather information about:
>
> - the size of Postix queues (in particular 'active' queue)


As a quick start, munin provide a perl plugin that monitor each queue.


Regards.

Reply | Threaded
Open this post in threaded view
|

Re: Monitor Postfix with SNMP

Brent Bice
In reply to this post by Scappatura Rocco
    Thanks, Rocco for pointing out I'd forgotten to CC the list in my
reply... (sheepish grin)  Here it is for what it's worth...

Rocco Scappatura wrote:
 > Hello,
 >
 > I would like to know if is there exists any Postfix-specific MIB.

    'Don't think so, but here's what we're doing.  In
/etc/snmp/snmpd.conf, I added:
# Added for monitoring postfix stats
pass .1.3.6.1.4.1.2021.255 /usr/local/bin/fetch_mail_statistics.pl
/data/log/maillog /data/log/mailstats.db .1.3.6.1.4.1.2021.255
pass .1.3.6.1.4.1.2021.254 /usr/local/bin/countqueue.pl
.1.3.6.1.4.1.2021.254
pass .1.3.6.1.4.1.2021.253 /usr/local/bin/queueage.pl .1.3.6.1.4.1.2021.253

    The first perl script was written by someone else quite a while ago.
I vaguely recall having to massage it a little to make it work with the
latest version/s of postfix but don't recall now what I changed.  The
other two scripts were quickie hacks I did based on the first one.

    Anyway, once you drop those pass lines into snmpd.conf and then HUP
the snmp daemon you can have mrtg or cacti or whatever query for things
under the specified MIB OIDs (basically, any query that starts with the
OID specified in the pass statement is handed to the script to parse and
figure out how to respond to).

    For instance, I've got a data template in cacti that defines
"postfix_deferred" to be an snmp query for .1.3.6.1.4.1.2021.255.2

    I'll attach the three perl scripts (zip'd) here. I make no claim to
their beauty or elegance - I'm not a real perl hacker, I just use it
when I don't have time to write something in C (or when other admins
here might need to maintain it). :-)

Brent

postfix-scripts.zip (4K) Download Attachment