1

I have installed RHEL 5.4 in my system. I have installed and configured nagios in RHEL 5.4 and nagios is working fine. When I give email address of my gmail in contacts.cfg of nagios configuration file I am receving mails. But when I give my company's domain email address I am not receving the mails. Please help me to configure. The following are the log messages I get when sending the mail.

Gmail log message:

Jan 21 13:55:06 companyname sendmail[21701]: p0L8P6Dv021701: to=john@gmail.com, ctladdr=nagios (501/501), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30304, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p0L8P6o3021702 Message accepted for delivery) 
Jan 21 13:55:09 companyname sendmail[21704]: p0L8P6o3021702: to=<john@gmail.com>, ctladdr=<nagios@companyname.co.in> (501/501), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120595, relay=gmail-smtp-in.l.google.com. [74.125.155.27], dsn=2.0.0, stat=Sent (OK 1295598618 x16si20805320anx.100)

My own domain account:

Jan 21 15:21:47 companyname sendmail[24374]: p0L9plIu024374: from=<nagios@companyname.co.in>, size=317, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] 
Jan 21 15:22:17 companyname sendmail[24393]: p0L9qHYK024393: from=nagios, size=325, class=0, nrcpts=1, msgid=<201101210952.p0L9qHYK024393@curasoftware.co.in>, relay=nagios@localhost 
Jan 21 15:22:17 companyname sendmail[24394]: p0L9qHoW024394: <james@companyname.co.in>... User unknown 
Jan 21 15:22:17 companyname sendmail[24393]: p0L9qHYK024393: to=james@companyname.co.in, ctladdr=nagios (501/501), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30325, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown 

We have Microsoft Exchange server 2007 in which the james ID has been included.

How to configure?

Pierre.Vriens
  • 1,159
  • 34
  • 15
  • 19
user68068
  • 11
  • 2

3 Answers3

1

Check to make sure where companyname.co.in's MX resolves to on your Nagios server. I'd be willing to bet it is resolving to localhost or the local IP address so that Nagios/the local email server is attempting to deliver the mail locally instead of sending to the remote mail server.

There is a description on this question on how to disable local delivery of email for your domain on that system.

Dave Drager
  • 8,315
  • 28
  • 45
1

i had this problem, it wasn't sending to the local domain. the solution is to change the hosts file (i have it in /etc/hosts) to hostname.yourdomain.com and it will be able to send to outside users. as for the problem with the domain email, its a problem with dns try nslookup yourdomain locally and you will see there is no result. you have to go to the dns server and add an entry to your mail server in there in domain.com not in domain.local.

Majed
  • 11
  • 1
0

Have you added your Nagios server IP as a "SMTP Relay" on your exchange server? I have Nagios running in our network and I receive emails in my work email account fine. We are running exchange 2010.

Also you need to add your Exchange server as a relay in your sendmail config file. I don't quite remember on top of my head what string you need to modify, but starts with "DS"

let us know how it goes.