Page 1 of 1

Email notification details

Posted: Wed Sep 10, 2014 8:40 am
by tariqondego
i have the following command:

Code: Select all

define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nComment: $SERVICEACKCOMMENT$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ " $CONTACTEMAIL$
}
But at the moment nothing is getting displayed under 'SERVICEOUTPUTS' parameter,i need more details under Additional Info eg remaining disk space etc,what parameter do i need to use?

Re: Email notification details

Posted: Wed Sep 10, 2014 8:47 am
by eloyd
First, it's SERVICEOUTPUT not SERVICEOUTPUTS, but your command line reference is correct.

My question would be: is your check actually creating a line of text? I ask because I see nothing wrong with your statement as it stands. You can look at http://nagios.sourceforge.net/docs/3_0/macrolist.html to get an idea of what Macros are available. You might want to use LONGSERVICEOUTPUT instead. SERVICEOUTPUT only includes the first line while LONGSERVICEOUTPUT uses more.

Re: Email notification details

Posted: Wed Sep 10, 2014 5:03 pm
by abrist
An example of the check and the output thereof would be useful to trouble shoot this.

Re: Email notification details

Posted: Thu Sep 11, 2014 1:50 am
by tariqondego
Thanks,LONGSERVICEOUTPUT worked,its giving me the information I need.