Re: Monitor Postfix with SNMP

From: Brent Bice (no email)
Date: Sat May 03 2008 - 23:58:29 EDT

  • Next message: Paweł Leśniak: "Re: Connection refused"

        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




  • Next message: Paweł Leśniak: "Re: Connection refused"





    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs



    Powered By FreeBSD   Powered By FreeBSD