bundles/icinga2: do not send recovery emails
This commit is contained in:
parent
763a071acc
commit
c5eb2f4f70
3 changed files with 13 additions and 44 deletions
|
@ -51,8 +51,9 @@ parser.add_argument(
|
|||
type=str,
|
||||
)
|
||||
parser.add_argument(
|
||||
'--escalation',
|
||||
action='store_true',
|
||||
'--notification-type',
|
||||
type=str,
|
||||
required=True,
|
||||
)
|
||||
|
||||
def log_to_syslog(message):
|
||||
|
@ -67,7 +68,7 @@ def log_to_syslog(message):
|
|||
|
||||
|
||||
def notify_per_sms():
|
||||
if args.state.lower() in ['up', 'ok']:
|
||||
if args.notification_type.lower() == 'recovery':
|
||||
output_text = ''
|
||||
else:
|
||||
output_text = '\n\n{}'.format(args.output)
|
||||
|
@ -112,6 +113,10 @@ def notify_per_sms():
|
|||
|
||||
|
||||
def notify_per_mail():
|
||||
if args.notification_type.lower() == 'recovery':
|
||||
# Do not send recovery emails.
|
||||
return
|
||||
|
||||
# editorconfig-checker-disable
|
||||
text = """
|
||||
_ _
|
||||
|
@ -166,7 +171,7 @@ if __name__ == '__main__':
|
|||
|
||||
log_to_syslog(' '.join(argv))
|
||||
|
||||
if args.mail and not args.escalation:
|
||||
if args.mail:
|
||||
notify_per_mail()
|
||||
|
||||
if args.sms:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue