0

when ever i am trying to restart my nagios and postfix aswell in ubuntu,the var/log/mail.log file was not getting updated with current proceedings.Please help me to solve this issue.

  • default nagios log file location /var/log/nagios3/nagios.log did u install default packages from ubuntu or compiled from source? – PKumar Oct 26 '15 at 6:25
  • i installed default packages from ubuntu – veeru Oct 26 '15 at 9:17
  • then every thing should be working as expected until you make some changes in configuration files. – PKumar Oct 26 '15 at 13:04
0

Nagios for sending mail using command from /usr/local/nagios/etc/objects/commands.cfg.

Based on nagios comments

################################################################################
#
# SAMPLE NOTIFICATION COMMANDS
#
# These are some example notification commands.  They may or may not work on
# your system without modification.  As an example, some systems will require 
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
#
################################################################################

Install mail or xmail

sudo apt-get install mailx

and in the same file check do command use /usr/bin/mail

Example

# 'notify-host-by-email' command definition
define command{
    command_name    notify-host-by-email
    command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "## $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ ##" $CONTACTEMAIL$
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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