nginx: check http/s connections with monit
This commit is contained in:
parent
8afbfeb1e7
commit
18b2ebbcc0
1 changed files with 27 additions and 0 deletions
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue