bundles/check-mail-received: move check source to icinga2 itself

This commit is contained in:
Franzi 2022-01-02 14:50:32 +01:00
parent 8be40c4adc
commit dc2b2ae86b
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 16 additions and 12 deletions

View file

@ -1,5 +0,0 @@
files = {
'/usr/local/share/icinga/plugins/check_imap_for_mail_from': {
'mode': '0755',
},
}

View file

@ -18,16 +18,14 @@ def process_metadata(metadata):
)) ))
services[f'MAIL RECEIVED ON {name}'] = { services[f'MAIL RECEIVED ON {name}'] = {
'command_on_monitored_host': repo.libs.faults.join_faults([ 'check_command': 'check_imap_for_mail_from',
'/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_interval': '15m', 'check_interval': '15m',
'retry_interval': '5m', 'retry_interval': '5m',
'vars.sshmon_timeout': 30, '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 { return {

View file

@ -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" { object CheckCommand "check_sipgate_account_balance" {
import "plugin-check-command" import "plugin-check-command"
import "ipv4-or-ipv6" import "ipv4-or-ipv6"

View file

@ -86,6 +86,9 @@ files = {
'/usr/local/share/icinga/plugins/check_freifunk_node': { '/usr/local/share/icinga/plugins/check_freifunk_node': {
'mode': '0755', 'mode': '0755',
}, },
'/usr/local/share/icinga/plugins/check_imap_for_mail_from': {
'mode': '0755',
},
'/usr/local/share/icinga/plugins/check_spam_blocklist': { '/usr/local/share/icinga/plugins/check_spam_blocklist': {
'mode': '0755', 'mode': '0755',
}, },
@ -351,6 +354,7 @@ for bundle, metadata in bundle_metadata.items():
}, },
'owner': 'nagios', 'owner': 'nagios',
'group': 'nagios', 'group': 'nagios',
'cascade_skip': False, # may contain faults
'triggers': { 'triggers': {
'svc_systemd:icinga2:restart', 'svc_systemd:icinga2:restart',
}, },