Check mailrelay

Script: check_mailrelay

It is a plugin to read mail relay from mailer configuration and start a tcp check on the found server.

Return values:

  • unknown - configuration file was not found or not readable
  • ok - configuration was parsed and target port of mail relay server is reachable
  • critical - configuration was parsed and target port of mail relay server is NOT reachable

Requirements

  • postfix

Standalone installation

From this repository you need next to this script:

  • inc_pluginfunctions shared function for all IML checks written in bash

Syntax

./check_mailrelay -h
______________________________________________________________________

CHECK_MAILRELAY
v1.0

(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3

https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_mailrelay.html
______________________________________________________________________

Check TCP port of mail relay server.

SYNTAX:

    check_mailrelay -m 

OPTIONS:

    -h or --help   Show this help.
    -m MAILER      For extensions in furture: set a mailer
                   default: "postfix"
    -f FILE        set a custom config file. The default file depends on
                   mailing daemon

PARAMETERS:

    MAILER         Type of mailer
    FILE           Custom location of configuration

EXAMPLE:

    check_mailrelay -f /opt/postfix/etc/mail.cf

Examples

./check_mailrelay
OK: Mailrelay smtp.example.com:587 (postfix)