LinuxQuestions.org
Latest LQ Deal: Linux Power User 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 01-03-2010, 10:05 AM   #1
NewtoUbuntu8.1
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Rep: Reputation: 0
Question help required with nagios email notifications


I am trying to get E-Mail notifications working in Nagios 3.2. I have configured Nagios to monitor 5 hosts and over 10 services. I am running Nagios on Ubuntu 9.10

The problem is that I cannot for the life of me get E-Mail notifications working

when I check the Mail Log I am getting a mail bounced message with unknown user statement.

here is an entry from the mail.log

Jan 3 15:51:45 John-Ubuntu postfix/pickup[27948]: 3EFCA40AB7: uid=1001 from=<nagios>

Jan 3 15:51:45 John-Ubuntu postfix/cleanup[28609]: 3EFCA40AB7: message-id=<20100103155145.3EFCA40AB7@John-Ubuntu>

Jan 3 15:51:45 John-Ubuntu postfix/qmgr[27949]: 3EFCA40AB7: from=<nagios@workemail.com>, size=533, nrcpt=1 (queue active)

Jan 3 15:51:45 John-Ubuntu postfix/local[28615]: 3EFCA40AB7: to=<itmanager@workemail .com>, relay=local, delay=0.34, delays=0.21/0.04/0/0.09, dsn=5.1.1, status=bounced (unknown user: "itmanager")

Jan 3 15:51:45 John-Ubuntu postfix/cleanup[28609]: 7611740AB8: message-id=<20100103155145.7611740AB8@John-Ubuntu>

Jan 3 15:51:45 John-Ubuntu postfix/qmgr[27949]: 7611740AB8: from=<>, size=2254, nrcpt=1 (queue active)

Jan 3 15:51:45 John-Ubuntu postfix/bounce[28616]: 3EFCA40AB7: sender non-delivery notification: 7611740AB8

Jan 3 15:51:45 John-Ubuntu postfix/qmgr[27949]: 3EFCA40AB7: removed

Jan 3 15:51:45 John-Ubuntu postfix/local[28615]: 7611740AB8: to=<nagios@workemail .com>, relay=local, delay=0.14, delays=0.07/0/0/0.07, dsn=2.0.0, status=sent (delivered to mailbox)

Jan 3 15:51:45 John-Ubuntu postfix/qmgr[27949]: 7611740AB8: removed

Can anybody PLEASE point me in the right direction to solve this problem.
 
Old 01-03-2010, 10:19 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

In order to get the email notifications working you'll need to direct the mail to a real email server. Do you have that setup on your server too? Or do you want to relay the mails to an external mail server using a MTA like postfix? Looks like you're just sending to local mail server. You'll need at least a server set up to accept those mails and then the tools to read them, being command line or via pop/imap/web protocol.

Kind regards,

Eric
 
Old 01-03-2010, 10:43 AM   #3
NewtoUbuntu8.1
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Hi Eric, I want to relay the mails to an external mail server! I have installed postfix onto the machine

Last edited by NewtoUbuntu8.1; 01-03-2010 at 10:44 AM.
 
Old 01-03-2010, 10:50 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

Ok, postfix can do the job if you configure it correctly. To what external server are you going to relay? Gmail, Yahoo, Hotmail? If one of these, are you behind a static WAN IP? The reason I ask this is because the mentioned email servers don't accept relaying from dynamic IP, so you might have to use some tricks. If relaying to for example you're own company's mailserver then it should be easy enough to set up.

Kind regards,

Eric
 
Old 01-03-2010, 10:57 AM   #5
NewtoUbuntu8.1
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Hi,
I want to relay the notifications to our own company's mailserver
 
Old 01-03-2010, 11:07 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Then there are two parts you have to take into account. First you'll have to relay all the mail on your nagios server to the mailserver of your company. Second you'll have to tell your mailserver to accepts mails coming from your nagios server.

The main.cf (postfix main configuration file) should hold something like this:
Code:
myhostname = yournagios.serverhostname.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = yourmailserver.hostname.com, localhost, srvnagios.domain.es
relayhost = 
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost
canonical_maps = hash:/etc/postfix/canonical
relay_domains = yournagios.serverhostname.com
Of course you'll have to change the fictive domain names I put in there.
After changing config don't forget to reload or restart postfix.

The second part is up to you, to tell your mailserver to accept mails from your nagios server (allow relaying for that server).

Kind regards,

Eric
 
Old 01-03-2010, 12:16 PM   #7
NewtoUbuntu8.1
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Hi,
I edited the main.cf file, restarted postfix, restarted nagios and then forced an alarm from one of the hosts, in the log I got the following entry:

an 3 18:13:07 John-Ubuntu postfix/cleanup[27266]: fatal: open database /etc/postfix/canonical.db: No such file or directory
Jan 3 18:13:08 John-Ubuntu postfix/master[26530]: warning: process /usr/lib/postfix/cleanup pid 27266 exit status 1
Jan 3 18:13:08 John-Ubuntu postfix/master[26530]: warning: /usr/lib/postfix/cleanup: bad command startup -- throttling

kind regards

John
 
Old 01-03-2010, 12:20 PM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Delete the line that says:
Code:
canonical_maps = hash:/etc/postfix/canonical
in your main.cf file and restart postfix. Then try again. That was my mistake, sorry about that.

Kind regards,

Eric
 
1 members found this post helpful.
Old 01-03-2010, 12:29 PM   #9
NewtoUbuntu8.1
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Hi Eric,

It looks very promising now the entry in the log now states:
Queued mail for delivery.

When I am back in work tomorrow I will check it all out.
Thanks a million for you assistance, if I have any further problems I will add a new entry to this post.

Thanks again.

Kind Regards

John
 
Old 01-03-2010, 12:32 PM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi John,

Glad to hear that. And you're welcome, that's what the Linux community and LQ is all about in my opinion, to help each other and in doing so grow bigger then Mickey$oft ever imagined.

Kind regards,

Eric
 
Old 01-03-2010, 12:33 PM   #11
NewtoUbuntu8.1
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Thumbs up

Hi Eric,
Just to let you know that the emails are now being sent out OK, I have just received notification via my blackberry.

Problem Solved.

Kind Regards

John
 
Old 01-03-2010, 12:34 PM   #12
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello John,

That's the fastest confirmation ever If you consider this thread as solved you can mark it as such by using the Thread Tools.

Kind regards,

Eric
 
1 members found this post helpful.
Old 02-15-2011, 12:36 AM   #13
tagzfernando
LQ Newbie
 
Registered: Feb 2011
Location: Philippines
Distribution: Linux mint
Posts: 9

Rep: Reputation: 0
relay notifications to GMAIL

Hi Eric,

I have the same problem but in my case I'm using GMAIL in relaying notifications.Do you have any work around on this case?


Thanks,
Tagz
 
Old 10-13-2011, 03:10 PM   #14
rockoboyt
LQ Newbie
 
Registered: Oct 2011
Posts: 4

Rep: Reputation: Disabled
sendmail in nagios

I can't seem to get any of my email notifications to go out. i've followed everything in the steps in this article and still not working. Here's what the log is showing...

Oct 13 15:48:06 monitor1 sendEmail[27228]: WARNING => SMTP-AUTH: No mutually supported authentication methods available
Oct 13 15:48:06 monitor1 sendEmail[27228]: ERROR => ERROR => SMTP-AUTH: Authentication to mail.myserver.net:25 failed.
 
  


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 and Postfix Email Notifications cazter2 Linux - Networking 18 11-19-2009 02:31 PM
Nagios: Server Notifications DaveQB Linux - Software 3 03-26-2009 09:02 PM
Nagios Email notifications jackie001 Linux - Newbie 3 11-14-2008 10:58 AM
Nagios e-Mail notifications netmaster3620 Linux - Newbie 1 07-01-2008 07:33 PM
Nagios notifications nuganen Linux - Newbie 1 06-20-2008 02:13 PM


All times are GMT -5. The time now is 01:44 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