wip
This commit is contained in:
parent
f3c5da7404
commit
6cdc371616
1 changed files with 14 additions and 9 deletions
|
@ -3,7 +3,6 @@ defaults = {
|
||||||
'services': {
|
'services': {
|
||||||
'test': {
|
'test': {
|
||||||
'vars.command': '/bin/ls /',
|
'vars.command': '/bin/ls /',
|
||||||
'host_name': node.name,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -13,20 +12,26 @@ defaults = {
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'monitoring/services',
|
'monitoring/services',
|
||||||
)
|
)
|
||||||
def service_defaults(metadata):
|
def default_check_command(metadata):
|
||||||
|
services = {}
|
||||||
|
|
||||||
|
for name, conf in metadata.get('monitoring/services').items():
|
||||||
|
services[name] = {}
|
||||||
|
|
||||||
|
if 'host_name' not in conf:
|
||||||
|
services[name]['host_name'] = node.name
|
||||||
|
|
||||||
|
if 'check_command' not in conf:
|
||||||
|
services[name]['check_command'] = 'sshmon'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'monitoring': {
|
'monitoring': {
|
||||||
'services': {
|
'services': services,
|
||||||
name: {
|
|
||||||
'check_command': 'sshmon',
|
|
||||||
}
|
|
||||||
for name, conf in metadata.get('monitoring/services').items()
|
|
||||||
if 'check_command' not in conf
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'users/sshmon/authorized_users'
|
'users/sshmon/authorized_users'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue