From 65871f1d13640baf8fadce593d6a3e093b91bb4a Mon Sep 17 00:00:00 2001 From: Rico Ullmann Date: Tue, 4 Jan 2022 11:41:08 +0100 Subject: [PATCH] monit: add option to check ports for a specific service --- bundles/monit/files/monitrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bundles/monit/files/monitrc b/bundles/monit/files/monitrc index 55ce3f5..10058fe 100644 --- a/bundles/monit/files/monitrc +++ b/bundles/monit/files/monitrc @@ -48,5 +48,8 @@ check process postfix matching "/usr/lib/postfix/sbin/master" 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" +% for port,port_options in options.get('ports', {}).items(): + if failed port ${port} protocol ${port_options['protocol']} for ${port_options.get('cycles', '5')} cycles then restart +% endfor % endfor