Not send e-mail notification

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
RockerMan
Posts: 70
Joined: Fri Nov 01, 2013 12:16 am

Re: Not send e-mail notification

Post by RockerMan »

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 -

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$
        }

Try using single ' or no " at all and let us know the result.
I did not testing with single quotes ', simply put in your example for e-mail sending in my code - and it worked!

Thank you very much, rkennedy :)

Topic can be closed.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Not send e-mail notification

Post by rkennedy »

Good to hear! You're welcome.

Closing this one out. Feel free to make a new thread if you need any assistance in the future.
Former Nagios Employee
Locked