LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-10-2011, 04:03 PM   #1
steveo9876
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
Nagios3, Postfix: all notification emails go to root!


I have nagios and postfix on the same ubuntu box.

Postfix is able to send emails out as root and my user id to my gmail acct, but not as user nagios, which does own the nagios process. I haven't been able to find a way to authorize user nagios to send email (really), but I don't know if this is the underlying issue. Frankly I don't care what acct they originate from as long as they arrive.

Currently, all notification emails are being dumped locally into root's mailbox. There are no errors in either the nagios.log or the mail.log.

I've added my gmail address to the contacts.cfg, replaced it in the nagios.cfg, and put it every other place I could find root's mailbox mentioned. I've also created an alias for root to my gmail acct with no luck (didn't want to do that fearing I'd receive emails for other system events, but it didn't work anyway).

I'm sure this is a simple fix, but I'm at a loss; I've been googling this for a week.

I can provide configs if necessary, but I'm hoping that this will be an obvious issue to someone.

Any help would be appreciated.

Thanks in advance.
 
Old 08-10-2011, 06:17 PM   #2
arunpmenon
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Rep: Reputation: 0
Could you please paste your contacts.cfg file here.

Just want to check, hope you have restarted nagios after editing the contact file and ran newaliases after adding new alias for root.
 
Old 08-11-2011, 07:42 AM   #3
steveo9876
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Yes, I restart the service after every config change. Notifications are being delivered to root's mailbox.

One other thing I forgot to mention. I tried using another smtp server as a relay, but I was receiving connection refused messages in the nagios log despite the fact that I was able to connect on port 25 and send mail without issue.


# Just one contact defined by default - the Nagios admin (that's you)
# This contact definition inherits a lot of default values from the 'generic-contact'
# template which is defined elsewhere.

define contact{
contact_name nagiosadmin
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-email host_notification_commands host-notify-by-email
mygmailacct@gmail.com
}



# We only have one contact in this simple configuration file, so there is
# no need to create more than one contact group.

define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
 
Old 08-12-2011, 12:07 PM   #4
arunpmenon
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Rep: Reputation: 0
You need to define the email ids with the parameter email. So that nagios can understand the mail address. Please update your mail id in contacts.cfg like.

email mygmailacct@gmail.com

-----------------------------
define contact{
contact_name nagiosadmin
alias Nagios Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-email host_notification_commands host-notify-by-email
email mygmailacct@gmail.com
}
------------------------------

Hope this will fix your issue.
 
  


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
CentOS Linux Postfix emails as root only nixster Linux - Software 1 02-26-2010 07:43 AM
procmail; recipe help; returning notification on overly large emails TheLinuxDuck Programming 2 02-05-2010 01:28 AM
Not receiving notification emails Nylex LQ Suggestions & Feedback 2 09-07-2005 08:49 AM
postfix / fetchmail email notification wolfipa Linux - Newbie 0 01-26-2005 02:11 AM
Postfix Notification via MSN Messenger dlublink Linux - Networking 1 12-15-2004 01:12 PM


All times are GMT -5. The time now is 08:31 AM.

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