diff --git a/bundles/check-mail-received/items.py b/bundles/check-mail-received/items.py deleted file mode 100644 index ed76f80..0000000 --- a/bundles/check-mail-received/items.py +++ /dev/null @@ -1,5 +0,0 @@ -files = { - '/usr/local/share/icinga/plugins/check_imap_for_mail_from': { - 'mode': '0755', - }, -} diff --git a/bundles/check-mail-received/metadata.py b/bundles/check-mail-received/metadata.py index 038a33f..9441322 100644 --- a/bundles/check-mail-received/metadata.py +++ b/bundles/check-mail-received/metadata.py @@ -18,16 +18,14 @@ def process_metadata(metadata): )) services[f'MAIL RECEIVED ON {name}'] = { - 'command_on_monitored_host': repo.libs.faults.join_faults([ - '/usr/local/share/icinga/plugins/check_imap_for_mail_from', - config['imap_host'], - config.get('imap_user', config['email']), - config['imap_pass'], - my_mail_address, - ]), + 'check_command': 'check_imap_for_mail_from', 'check_interval': '15m', 'retry_interval': '5m', 'vars.sshmon_timeout': 30, + 'vars.imap_host': config['imap_host'], + 'vars.imap_user': config.get('imap_user', config['email']), + 'vars.imap_pass': config['imap_pass'], + 'vars.imap_from': my_mail_address, } return { diff --git a/bundles/check-mail-received/files/check_imap_for_mail_from b/bundles/icinga2/files/check_imap_for_mail_from similarity index 100% rename from bundles/check-mail-received/files/check_imap_for_mail_from rename to bundles/icinga2/files/check_imap_for_mail_from diff --git a/bundles/icinga2/files/icinga2/check_commands.conf b/bundles/icinga2/files/icinga2/check_commands.conf index f5d1afe..e298e30 100644 --- a/bundles/icinga2/files/icinga2/check_commands.conf +++ b/bundles/icinga2/files/icinga2/check_commands.conf @@ -86,6 +86,13 @@ object CheckCommand "check_imap" { } } +object CheckCommand "check_imap_for_mail_from" { + import "plugin-check-command" + import "ipv4-or-ipv6" + + command = [ "/usr/local/share/icinga/plugins/check_imap_for_mail_from", "$imap_host$", "$imap_user$", "$imap_pass$", "$imap_from$" ] +} + object CheckCommand "check_sipgate_account_balance" { import "plugin-check-command" import "ipv4-or-ipv6" diff --git a/bundles/icinga2/items.py b/bundles/icinga2/items.py index 4023117..055bec7 100644 --- a/bundles/icinga2/items.py +++ b/bundles/icinga2/items.py @@ -86,6 +86,9 @@ files = { '/usr/local/share/icinga/plugins/check_freifunk_node': { 'mode': '0755', }, + '/usr/local/share/icinga/plugins/check_imap_for_mail_from': { + 'mode': '0755', + }, '/usr/local/share/icinga/plugins/check_spam_blocklist': { 'mode': '0755', }, @@ -351,6 +354,7 @@ for bundle, metadata in bundle_metadata.items(): }, 'owner': 'nagios', 'group': 'nagios', + 'cascade_skip': False, # may contain faults 'triggers': { 'svc_systemd:icinga2:restart', },