Skip to content

Commit

Permalink
fix(icinga): indent format in notification template
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Mar 9, 2021
1 parent abbc01a commit d680e2d
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions sa_tools_core/templates/icinga/notification.mako
Original file line number Diff line number Diff line change
Expand Up @@ -160,49 +160,55 @@ Host: ${env.NAGIOS_HOSTALIAS}
Duration: ${env.NAGIOS_HOSTDURATION}
Date/Time: ${env.NAGIOS_LONGDATETIME}
Additional Info:
%if notify_type == 'wework':
%if notify_type == 'wework':
%if env.NAGIOS_HOSTOUTPUT:
> ${env.NAGIOS_HOSTOUTPUT}
%endif
%if env.NAGIOS_LONGHOSTOUTPUT:
> ${env.NAGIOS_LONGHOSTOUTPUT}
%elif notify_type == 'telegram':
%endif
|
%elif notify_type == 'telegram':
```
${env.NAGIOS_HOSTOUTPUT}
${env.NAGIOS_LONGHOSTOUTPUT}
```
%else:
%else:
${env.NAGIOS_HOSTOUTPUT}
${env.NAGIOS_LONGHOSTOUTPUT}
%endif
%if env.NOTIFICATIONAUTHORNAME:
%endif
%if env.NOTIFICATIONAUTHORNAME:
Comment: [${env.NOTIFICATIONAUTHORNAME}] ${env.NOTIFICATIONCOMMENT}
%endif
%endif
%elif env.TARGET_TYPE == 'service':
${short_env.time}
${'Duration: %s' % env.NAGIOS_SERVICEDURATION if env.SERVICE_DURATION_SEC and float(env.SERVICE_DURATION_SEC) > 1 else ''}
${'Contacts: %s' % env.NAGIOS__SERVICECONTACT if env.NAGIOS__SERVICECONTACT else ''}
Additional Info:
%if notify_type == 'wework':
%if env.NAGIOS_SERVICEOUTPUT:
%if notify_type == 'wework':
%if env.NAGIOS_SERVICEOUTPUT:
> ${env.NAGIOS_SERVICEOUTPUT}
%endif
%if env.NAGIOS_LONGSERVICEOUTPUT:
%endif
%if env.NAGIOS_LONGSERVICEOUTPUT:
> ${env.NAGIOS_LONGSERVICEOUTPUT}
%endif
%endif
|
%elif notify_type == 'telegram':
%elif notify_type == 'telegram':
```
${env.NAGIOS_SERVICEOUTPUT}
${env.NAGIOS_LONGSERVICEOUTPUT}
```
%else:
%else:
${env.NAGIOS_SERVICEOUTPUT}
${env.NAGIOS_LONGSERVICEOUTPUT}
%endif
%if env.NOTIFICATIONAUTHORNAME:
%endif
%if env.NOTIFICATIONAUTHORNAME:
Comment: [${env.NOTIFICATIONAUTHORNAME}] ${env.NOTIFICATIONCOMMENT}
%endif
%endif
%endif
Expand Down

0 comments on commit d680e2d

Please sign in to comment.