Full status information in Nagios email notification?

I have set up Nagios to monitor my servers and I have written a few custion checks.

When I get a notification email, I only get the first line of the status information and I have to use the web interface to see the rest of it.

Is it possible to get the full status information in the email ? How would I configure that ?


Solution 1:

Somewhere in your NAGIOS config, you should have a definition of the command used to send email notifications. If it's anything like mine, this will say

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$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
        }

If you change that Additional Info:\n\n$SERVICEOUTPUT$" in the code that generates the body of the email to say Additional Info:\n\n$SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$ you should get all the lines of your service output, not just the first. Check your NAGIOS doco on host macros for more things you might want to include.