summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-02-07 01:31:50 +0100
committermh <mh@immerda.ch>2011-02-07 01:31:50 +0100
commit1c4844d696b7ab50b8e1337d6d294e75b73189b2 (patch)
treeb797e3bc1bb7ee77488c6b363483c8cb5b9a1bd5 /manifests
parent85e6650451538486bd72b1206caf898d573ba987 (diff)
fix mail cmd on centos
Diffstat (limited to 'manifests')
-rw-r--r--manifests/defaults/commands.pp10
1 files changed, 7 insertions, 3 deletions
diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp
index 933f3b9..3c6bc9c 100644
--- a/manifests/defaults/commands.pp
+++ b/manifests/defaults/commands.pp
@@ -118,12 +118,16 @@ class nagios::defaults::commands {
# notification commands
+ $mail_cmd_location = $operatingsystem ? {
+ centos => '/bin/mail',
+ default => '/usr/bin/mail'
+ }
+
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" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$';
+ 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$";
'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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$'
-
+ 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$";
}
}