I'm running Nagios 3. It is generating the alerts that are based on my conditions that I had mentioned.
What I want now is to customize my email alerts with a detailed messages. I need to send alerts for my tomcat logs along with the stack trace.
In my commands.cfg
file, I have command_line
like this :
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/local/bin/sendEmail -v -f x.x.x.x. -t x.x.x.x -s smtp.gmail.com:587 -xu x.x.x..x -xp x.x.x.x. -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$"
How do I customize it? Where are the variables like $SERVICEOUTPUT$
coming from?