Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 7 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
add comment

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.