LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setup sendEmail to get alert from Nagios (https://www.linuxquestions.org/questions/linux-newbie-8/setup-sendemail-to-get-alert-from-nagios-4175442084/)

AHUN 12-18-2012 11:14 PM

setup sendEmail to get alert from Nagios
 
Dear All,

Recently i have setup Nagios Server to monitor all my servers. To Setup i followed below link:

http://www.unixmen.com/how-to-instal...centos-fedora/
http://danxlog.blogspot.in/2010/07/n...r-to-send.html

Now i am not able to setup sendEmail properly. i am getting below error:

Error: Unexpected start of object definition in file '/usr/local/nagios/etc/objects/commands.cfg' on line 33. Make sure you close preceding objects before starting a new one.
Error processing object config files!

Here is code at line 33 in file /usr/local/nagios/etc/objects/commands.cfg

# 'notify-service-by-email' command definition
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$" | /usr/local/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -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$" }

please suggest me, How to fix this.

Thanks
AHUN

chrism01 12-19-2012 07:21 AM

Read the msg carefully; it's telling you that you've started a new definition without(!) closing the previous one(s) correctly.

AHUN 12-19-2012 10:47 PM

yes i got it.

Thanks for your help!

now it is working for me.

Thanks


All times are GMT -5. The time now is 07:55 AM.