Email notification details

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Email notification details

Post 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?
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Email notification details

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Email notification details

Post by abrist »

An example of the check and the output thereof would be useful to trouble shoot this.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: Email notification details

Post by tariqondego »

Thanks,LONGSERVICEOUTPUT worked,its giving me the information I need.
Locked