Created
April 22, 2020 18:14
-
-
Save eksiscloud/af8edac99749a7bb70f045afc60bdfa3 to your computer and use it in GitHub Desktop.
Monit: Postfix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Postfix | |
check process postfix with pidfile /var/spool/postfix/pid/master.pid | |
group mail | |
start program = "/etc/init.d/postfix start" | |
stop program = "/etc/init.d/postfix stop" | |
if failed host YOUR-RELAY-HOST port 587 | |
type tcp protocol smtp using tls | |
with timeout 15 seconds | |
then alert | |
if 3 restarts within 5 cycles then timeout | |
depends on postfix_rc | |
depend postdrop_bin | |
depend postqueue_bin | |
depend master_cf | |
depend main_cf | |
check file postfix_rc with path /etc/init.d/postfix | |
group mail | |
if failed checksum then unmonitor | |
if failed permission 755 then unmonitor | |
if failed uid root then unmonitor | |
if failed gid root then unmonitor | |
check file postdrop_bin with path /usr/sbin/postdrop | |
group mail | |
if failed checksum then unmonitor | |
if failed permission 2555 then unmonitor | |
if failed uid root then unmonitor | |
if failed gid postdrop then unmonitor | |
check file postqueue_bin with path /usr/sbin/postqueue | |
group mail | |
if failed checksum then unmonitor | |
if failed permission 2555 then unmonitor | |
if failed uid root then unmonitor | |
if failed gid postdrop then unmonitor | |
check file master_cf with path /etc/postfix/master.cf | |
group mail | |
include /etc/monit/templates/rootrc | |
check file main_cf with path /etc/postfix/main.cf | |
group postfix | |
include /etc/monit/templates/rootrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
YOUR-RELAY-HOST is that service who will deliver emails of a server, like Amazon SES, Gmail or Mailgun.