Re: Not send e-mail notification
Posted: Thu Mar 17, 2016 6:17 am
I did not testing with single quotes ', simply put in your example for e-mail sending in my code - and it worked!rkennedy wrote:I believe there is an error in your formatting, specifically this part serviceoutput="$SERVICEOUTPUT$"" (too many ""), and this part --service="$SERVICEDESC$" -
Try using single ' or no " at all and let us know the result. Keep in mind you'll need the " after the printf, and " before printf closes out at |
Here's a standard notify-service-by-email -Try using single ' or no " at all and let us know the result.Code: Select all
# 'notify-service-by-email' command definition define command{ command_name 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$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ }
Thank you very much, rkennedy
Topic can be closed.