Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question
up vote 8 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.