LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-18-2012, 11:14 PM   #1
AHUN
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Rep: Reputation: Disabled
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
 
Old 12-19-2012, 07:21 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Read the msg carefully; it's telling you that you've started a new definition without(!) closing the previous one(s) correctly.
 
Old 12-19-2012, 10:47 PM   #3
AHUN
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
yes i got it.

Thanks for your help!

now it is working for me.

Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Nagios service alert on HTTP linuxandtsm Linux - Newbie 3 03-02-2012 03:48 PM
Nagios: send email/alert user s0tGaL Linux - Newbie 5 07-30-2010 10:25 AM
[SOLVED] NAGIOS mail notification by alert type sem007 Linux - Software 4 06-12-2010 02:52 AM
Not receive sms alert from nagios with gammu c_parapat Linux - Server 2 11-16-2009 11:22 PM
No email alert from Nagios packets Linux - Software 0 10-18-2005 11:56 AM


All times are GMT -5. The time now is 12:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration