monit #4
1 changed files with 7 additions and 0 deletions
|
@ -43,3 +43,10 @@ check process postfix matching "/usr/lib/postfix/sbin/master"
|
||||||
start program = "/bin/systemctl start postfix.service"
|
start program = "/bin/systemctl start postfix.service"
|
||||||
stop program = "/bin/systemctl stop postfix.service"
|
stop program = "/bin/systemctl stop postfix.service"
|
||||||
if failed port 25 protocol smtp for 5 cycles then restart
|
if failed port 25 protocol smtp for 5 cycles then restart
|
||||||
|
|
||||||
|
% for service,options in monit.get('services', {}).items():
|
||||||
|
check process ${service} matching "${options['bin']}"
|
||||||
|
start program = "/bin/systemctl start ${options.get('systemd_unit', 'service')}.service"
|
||||||
|
stop program = "/bin/systemctl stop ${options.get('systemd_unit', 'service')}.service"
|
||||||
|
|
||||||
|
% endfor
|
||||||
|
|
Loading…
Reference in a new issue