diff options
author | Micah <micah@riseup.net> | 2016-03-17 19:43:54 +0000 |
---|---|---|
committer | Micah <micah@riseup.net> | 2016-03-17 19:43:54 +0000 |
commit | b06f002c52b5398e564dd0cb2764145a376ecdbc (patch) | |
tree | 4127464b0abb07eff4874fc3a27fccddfc45f0c5 | |
parent | d02d11ba8567ba8ccf257b44196e24e480974275 (diff) | |
parent | 11f3c6f95d9492d4943aacb510458fb5a407e9fb (diff) |
Merge branch 'improve_notification_mails' into 'master'
Improve notification mails
The mail subject line is too long for some mail clients,
so i removed the $NOTIFICATIONTYPE$ variable from it,
because it is not needed to understand the problem/recovery.
This is an example of a mail send out using this change:
Subject: WARNING - aardwolf: APT
***** Nagios *****
Notification Type: PROBLEM
Host: aardwolf.unstable.bitmask.i (aardwolf)
Address: 199.119.112.205
Service: APT
State: WARNING
Duration: 0d 0h 13m 5s
Date/Time: Fri Jan 15 10:04:55 UTC 2016
Output: WARN - APT WARNING: 20 packages available for upgrade (0 critical updates).
Before it looked like this:
Subject: ** PROBLEM Service Alert: aardwolf/APT is WARNING **
***** Nagios *****
Notification Type: PROBLEM
Service: APT
Host: aardwolf
Address: 199.119.112.205
State: WARNING
Date/Time: Thu Mar 10 21:57:23 UTC 2016
Additional Info:
WARN - APT WARNING: 1 packages available for upgrade (0 critical updates).
See merge request !22
-rw-r--r-- | manifests/defaults/commands.pp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index e80e147..0f24411 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -136,9 +136,9 @@ class nagios::defaults::commands { default: { nagios_command { 'notify-host-by-email': - command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\nHost: \$HOSTNAME\$\\nState: \$HOSTSTATE\$\\nAddress: \$HOSTADDRESS\$\\nInfo: \$HOSTOUTPUT\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\" | ${mail_cmd_location} -s \"** \$NOTIFICATIONTYPE\$ Host Alert: \$HOSTNAME\$ is \$HOSTSTATE\$ **\" \$CONTACTEMAIL\$"; + command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\n\\nHost: \$HOSTNAME\$ (\$HOSTALIAS\$)\\nAddress: \$HOSTADDRESS\$\\nState: \$HOSTSTATE\$\\nDuration: \$HOSTDURATION\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\\nOutput: \$HOSTOUTPUT\$\" | ${mail_cmd_location} -s \"\$NOTIFICATIONTYPE\$: \$HOSTSTATE\$ - \$HOSTNAME\$\" \$CONTACTEMAIL\$"; 'notify-service-by-email': - command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\n\\nService: \$SERVICEDESC\$\\nHost: \$HOSTALIAS\$\\nAddress: \$HOSTADDRESS\$\\nState: \$SERVICESTATE\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\\nAdditional Info:\\n\\n\$SERVICEOUTPUT\$\" | ${mail_cmd_location} -s \"** \$NOTIFICATIONTYPE\$ Service Alert: \$HOSTALIAS\$/\$SERVICEDESC\$ is \$SERVICESTATE\$ **\" \$CONTACTEMAIL\$"; + command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\n\\nHost: \$HOSTNAME\$ (\$HOSTALIAS\$)\\nAddress: \$HOSTADDRESS\$\\n\\nService: \$SERVICEDESC\$\\nState: \$SERVICESTATE\$\\nDuration: \$SERVICEDURATION\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\\nOutput: \$SERVICEOUTPUT\$\" | ${mail_cmd_location} -s \"\$NOTIFICATIONTYPE\$: \$SERVICESTATE\$ - \$HOSTALIAS\$/\$SERVICEDESC\$\" \$CONTACTEMAIL\$"; } } } |