nginx: check http/s connections with monit

This commit is contained in:
Rico 2022-01-04 12:00:15 +01:00
parent 8afbfeb1e7
commit 18b2ebbcc0
Signed by: stillbeben
GPG Key ID: AE1066B5BD0B5041
1 changed files with 27 additions and 0 deletions

View File

@ -148,6 +148,33 @@ def monitoring(metadata):
},
}
@metadata_reactor.provides(
'monit/services/nginx/http',
)
def monithttp(metadata):
http = {}
for vname, vconfig in metadata.get('nginx/vhosts', {}).items():
domain = vconfig.get('domain', vname)
if vconfig['ssl']:
scheme = 'https'
else:
scheme = 'http'
http[domain] = {
'scheme': scheme,
}
return {
'monit': {
'services': {
'nginx': {
'http': http,
},
},
},
}
@metadata_reactor.provides(
'firewall/port_rules/80',