From 13805532bdda0a1ee2696dd47a0c4e0c5597de91 Mon Sep 17 00:00:00 2001 From: Rico Ullmann Date: Tue, 4 Jan 2022 13:33:50 +0100 Subject: [PATCH] monit: add option to check a port without a specific protocol monit does not support all the protocol we use, e.g. ldaps. therefore we can only use a generic tcp check for some ports. --- bundles/monit/files/monitrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/monit/files/monitrc b/bundles/monit/files/monitrc index 46a4960..89b0dd2 100644 --- a/bundles/monit/files/monitrc +++ b/bundles/monit/files/monitrc @@ -44,7 +44,12 @@ 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 sorted(options.get('ports', {}).items()): - if failed port ${port} protocol ${port_options['protocol']} for ${port_options.get('cycles', '5')} cycles then restart + if failed port ${port} +% if port_options.get('protocol', {}): + protocol ${port_options['protocol']} +% endif + for ${port_options.get('cycles', '5')} cycles + then restart % endfor % for domain,http_options in sorted(options.get('http', {}).items()): if failed host ${domain}