Downloads: 90

Reviews: 0

  • Postfix-1597226432518.png
    Postfix-1597226432518.png

Collect postfix statistic and log messages.

Collector Configuration Details

LoadPlugin tail
<Plugin "Tail">
    <File "/var/log/mail.log">
        Instance "postfix"
                # critical
                <Match>
                        Regex ": killed: "
                        DSType "CounterInc"
                        Type "counter"
                        Instance "killed"
                </Match>
                <Match>
                        Regex ": fatal: "
                        DSType "CounterInc"
                        Type "counter"
                        Instance "fatal"
                </Match>
                <Match>
                        Regex ": warning: "
                        DSType "CounterInc"
                        Type "counter"
                        Instance "warning"
                </Match>
        # number of connections
        # (incoming)
        <Match>
            Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: connect from\\>"
            DSType "CounterInc"
            Type "counter"
            Instance "connection-in-open"
        </Match>
        <Match>
            Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: disconnect from\\>"
            DSType "CounterInc"
            Type "counter"
            Instance "connection-in-close"
        </Match>
        <Match>
            Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: lost connection after .* from\\>"
            DSType "CounterInc"
            Type "counter"
            Instance "connection-in-lost"
        </Match>
        <Match>
            Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: timeout after .* from\\>"
            DSType "CounterInc"
            Type "counter"
            Instance "connection-in-timeout"
        </Match>
        <Match>
            Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: setting up TLS connection from\\>"
            DSType "CounterInc"
            Type "counter"
            Instance "connection-in-TLS-setup"
        </Match>
        <Match>
            Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: [A-Za-z]+ TLS connection established from\\>"
            DSType "CounterInc"
            Type "counter"
            Instance "connection-in-TLS-established"
        </Match>
    # auth success
        <Match>
            Regex ": imap-login: Login: user=<.*>, .*, session=<.*>"
            DSType "CounterInc"
            Type "counter"
            Instance "auth_imap_login"
        </Match>
        <Match>
            Regex ": pop3-login: Login: user=<.*>, .*, session=<.*>"
            DSType "CounterInc"
            Type "counter"
            Instance "auth_pop3_login"
        </Match>
        # auth failed imap
        <Match>
            Regex ": imap-login: Disconnected \\((auth failed|no auth attempts)"
            DSType "CounterInc"
            Type "counter"
            Instance "auth_imap_failed"
        </Match>
        <Match>
            Regex ": imap-login: Disconnected: Too many invalid commands"
            DSType "CounterInc"
            Type "counter"
            Instance "auth_imap_invalid_commands"
        </Match>
    # auth failed pop3
        <Match>
            Regex ": pop3-login: Disconnected \\((auth failed|no auth attempts)"
            DSType "CounterInc"
            Type "counter"
            Instance "auth_pop3_failed"
        </Match>
        <Match>
            Regex ": pop3-login: Disconnected: Too many invalid commands"
            DSType "CounterInc"
            Type "counter"
            Instance "auth_pop3_invalid_commands"
        </Match>
    # auth failed other
        <Match>
            Regex ": SASL LOGIN authentication failed:"
            DSType "CounterInc"
            Type "counter"
            Instance "auth_sasl_failed"
        </Match>
    # rejects smtp
        <Match>
            Regex "smtp\\[[0-9+]\\]:.*(Message rejected under suspicion of SPAM|Spam message rejected|The email message was detected as spam)"
            DSType "CounterInc"
            Type "counter"
            Instance "rejected_smtp__spam"
        </Match>
        <Match>
            Regex "smtp\\[[0-9+]\\]:.*Recipient address rejected: mailbox full"
            DSType "CounterInc"
            Type "counter"
            Instance "rejected_smtp__mailbox_full"
        </Match>
        <Match>
            Regex "smtp\\[[0-9+]\\]:.*Temporarily rejected. Try again later"
            DSType "CounterInc"
            Type "counter"
            Instance "rejected_smtp__temporary"
        </Match>
        <Match>
            Regex "smtp\\[[0-9+]\\]:.*recipient address rejected: Blocked"
            DSType "CounterInc"
            Type "counter"
            Instance "rejected_smtp__blocked"
        </Match>
    # reject smtpd
        <Match>
            Regex "550 5\\.1\\.1 <.*>: Recipient address rejected: User unknown in virtual mailbox table"
            DSType "CounterInc"
            Type "counter"
            Instance "rejected-unknown_rcpt_addr"
        </Match>
        <Match>
            Regex "450 4\\.7\\.25 Client host rejected: cannot find your hostname, "
            DSType "CounterInc"
            Type "counter"
            Instance "rejected-cannot_find_hostname"
        </Match>
        <Match>
            Regex "450 4\\.7\\.1 <.*>: Helo command rejected: Host not found"
            DSType "CounterInc"
            Type "counter"
            Instance "rejected-host_not_found"
        </Match>
        <Match>
            Regex "454 4\\.7\\.1 <.*>: Relay access denied"
            DSType "CounterInc"
            Type "counter"
            Instance "rejected-relay_access_denied"
        </Match>
    # status codes
        <Match>
            Regex "status=deferred"
            DSType "CounterInc"
            Type "counter"
            Instance "status-deferred"
        </Match>
        <Match>
            Regex "status=forwarded"
            DSType "CounterInc"
            Type "counter"
            Instance "status-forwarded"
        </Match>
        <Match>
            Regex "status=reject"
            DSType "CounterInc"
            Type "counter"
            Instance "status-reject"
        </Match>
        <Match>
            Regex "status=sent"
            DSType "CounterInc"
            Type "counter"
            Instance "status-sent"
        </Match>
        <Match>
            Regex "status=bounced"
            DSType "CounterInc"
            Type "counter"
            Instance "status-bounced"
        </Match>
        <Match>
            Regex "status=SOFTBOUNCE"
            DSType "CounterInc"
            Type "counter"
            Instance "status-softbounce"
        </Match>
        # message size
        <Match>
            Regex "size=([0-9]*)"
            DSType "CounterAdd"
            Type "ipt_bytes"
            Instance "size"
        </Match>
        # delays (see [1] for details)
        # total time spent in the Postfix queue
        <Match>
            Regex "delay=([\.0-9]*)"
            DSType "GaugeAverage"
            Type "gauge"
            Instance "delay"
        </Match>
        # time spent before the queue manager, including message transmission
        <Match>
            Regex "delays=([\.0-9]*)/[\.0-9]*/[\.0-9]*/[\.0-9]*"
            DSType "GaugeAverage"
            Type "gauge"
            Instance "delay-before_queue_mgr"
        </Match>
        # time spent in the queue manager
        <Match>
            Regex "delays=[\.0-9]*/([\.0-9]*)/[\.0-9]*/[\.0-9]*"
            DSType "GaugeAverage"
            Type "gauge"
            Instance "delay-in_queue_mgr"
        </Match>
        # connection setup time including DNS, HELO and TLS
        <Match>
            Regex "delays=[\.0-9]*/[\.0-9]*/([\.0-9]*)/[\.0-9]*"
            DSType "GaugeAverage"
            Type "gauge"
            Instance "delay-setup_time"
        </Match>
        # message transmission time
        <Match>
            Regex "delays=[\.0-9]*/[\.0-9]*/[\.0-9]*/([\.0-9]*)"
            DSType "GaugeAverage"
            Type "gauge"
            Instance "delay-trans_time"
        </Match>
    </File>
</Plugin>
Dependencies: