bundles/sshmon: import from work repository
This commit is contained in:
parent
eaf268aea9
commit
c7362df6c4
12 changed files with 773 additions and 0 deletions
57
bundles/sshmon/items.py
Normal file
57
bundles/sshmon/items.py
Normal file
|
@ -0,0 +1,57 @@
|
|||
def collect_commands():
|
||||
check_commands = {}
|
||||
|
||||
for bundle, bundle_config in node.metadata.get('icinga2_api', {}).items():
|
||||
for service, service_config in bundle_config.get('services', {}).items():
|
||||
# The default for check_command is also set in metadata.py
|
||||
# and in icinga2 bundle
|
||||
if (
|
||||
service_config.get('check_command', 'sshmon') == 'sshmon' and
|
||||
'vars.sshmon_command' in service_config and
|
||||
'command_on_monitored_host' in service_config
|
||||
):
|
||||
check_commands[service_config['vars.sshmon_command']] = service_config['command_on_monitored_host']
|
||||
|
||||
return check_commands
|
||||
|
||||
|
||||
pkg_apt = {
|
||||
'gawk': {}, # needed by check_ram
|
||||
'libwww-perl': {}, # needed by check_nginx_status
|
||||
'sysstat': {}, # needed by check_cpu_stats
|
||||
'monitoring-plugins': {},
|
||||
}
|
||||
|
||||
check_commands = collect_commands()
|
||||
|
||||
files = {
|
||||
'/etc/sshmon.cfg': {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'check_commands': check_commands,
|
||||
},
|
||||
},
|
||||
'/etc/sudoers.d/sshmon': {
|
||||
'source': 'sudoers',
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'check_commands': check_commands,
|
||||
},
|
||||
},
|
||||
'/usr/local/sbin/sshmon': {
|
||||
'mode': '0755',
|
||||
},
|
||||
}
|
||||
|
||||
for check in {
|
||||
'cpu_stats',
|
||||
'mounts',
|
||||
'ram',
|
||||
'http_url_for_string',
|
||||
'https_certificate_at_url',
|
||||
'http_wget',
|
||||
'systemd_unit',
|
||||
}:
|
||||
files["/usr/local/share/icinga/plugins/check_{}".format(check)] = {
|
||||
'mode': "0755",
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue