Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have Nagios installed and running like a champ. But for the life of me I cannot get Nagios alerts to send properly through Postfix. What I want is for Postfix to send them out through my Exchange SMTP.
When sending a test mail message via Telnet I get:
I am very possibly going about this cofiguration wrong but it was my understanding that the "relayhost" config would determine what SMTP to send from... which I currently have set as my Exchange SMTP.
This is telling you that your mail server prevents relay which is correct. Most email servers will prevent this sort of action due to spam bots and people using it to realy bad things. You may need to enable it for it to work. Tho I am not sure why it would need that on to send status emails. I am only familiar with using nagios at work not setting it up so its possible all of this is not helpful if so I apologize.
You'll have to tell your Exchange SMTP server to accept mails from the Nagios server. I have mine configured to send to our Gmail for enterprises and works like a charm. And Postfix on my Nagios server accepts mails from all our LAN networks and relays them promptly to Google.
This is telling you that your mail server prevents relay which is correct. Most email servers will prevent this sort of action due to spam bots and people using it to realy bad things. You may need to enable it for it to work. Tho I am not sure why it would need that on to send status emails. I am only familiar with using nagios at work not setting it up so its possible all of this is not helpful if so I apologize.
I have added the Linux box IP as a trusted relay to my Exchange server and still get the same problem. I am wondering if I need to have the linux box hostname and domain changed to match those of the Exchange box?
add both network address range & localhost(127.0.0.0/8) and check
I am continuously reading through everything Google is able to pull up.
All I want is for Nagios to be able to send out alerts to a local distribution group. I know it has to be simple and I am probably over thinking it... /sigh
Did you change the relayhost variable in your config and reload/restart postfix? Have you noticed my relayhost variable is empty? And the Google smtp is in the mydestination variable?
In your config the mydestination should point to your exchange server and probably your localhost/nagiosserver combination to accept mails from Nagios.
Change that if you haven't, restart postfix and try again.
Did you change the relayhost variable in your config and reload/restart postfix? Have you noticed my relayhost variable is empty? And the Google smtp is in the mydestination variable?
In your config the mydestination should point to your exchange server and probably your localhost/nagiosserver combination to accept mails from Nagios.
Change that if you haven't, restart postfix and try again.
Kind regards,
Eric
I made the changes you suggested and no longer get the: 554 5.7.1 <nagios@mydomain.com>: Relay access denied, error. THanks!
But the test mail is not hitting in my inbox and I don't see an SMTP session being established on my Exchange server.
Still running test emails with slightly different settings each time but so far, zilch
Can you connect using telnet to the Exchange server:
Code:
telnet your_server 25
Once connected issue the following commands:
Code:
user yourusername <enter>
pass yourpassword <enter>
MAIL FROM: yourmail@yourdomain.com
RCPT TO: yourmail@yourdomain.com
DATA some text
CTRL-D
then
Code:
quit
to end the session.
That at least will confirm that you are able to connect to the Exchange server correctly and send mail through it.
Also look in the syslog and messages log to see for strange behavior.
Post any results please.
Kind regards,
Eric
I ran the following sucessfully:
root@Nagios-SLC:~# telnet mail.domain.com 25
Trying 192.168.3.10...
Connected to mail.domain.com.
Escape character is '^]'.
220 mail.domain.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Thu, 19 Nov 2009 11:28:44 -0700
MAIL FROM: nagios@domain.com
503 5.5.2 Send hello first
HELO nagios-slc.domain.com
250 mail.domain.com Hello [192.168.3.215]
MAIL FROM: nagios@domain.com
250 2.1.0 nagios@domain.com....Sender OK
RCPT TO: alert@domain.com
250 2.1.5 alert@domain.com
data
354 Start mail input; end with <CRLF>.<CRLF>
test!7
.
250 2.6.0 <PCDC1QVVRBjw60JOXHD00005a43@mail.domain.com> Queued mail for delivery
Hit my inbox right away.
For some reason the linux box doesnt seem to be sending mail out, grr.
Did you look in the logs for specific messages in regards to postfix when you tried to send a message? This time try using the mail command:
Code:
mail -s "TEST SUBJECT LINE" youruser@domain.com
CTRL-D
and check the logs again. Put relevant info from the logs here please. The mail command is the one that's used by Nagios if I recall correct.
You at least narrowed the problem down a lot in my opinion since now you can connect and mail to the Exchange server. So only thing to check is the linux box as you stated
Nov 19 11:47:28 Nagios-SLC postfix/smtp[5951]: fatal: open database /etc/postfix/sasl_passwd.db: No such file or directory
Nov 19 11:47:29 Nagios-SLC postfix/master[5113]: warning: process /usr/lib/postfix/smtp pid 5951 exit status 1
Nov 19 11:47:29 Nagios-SLC postfix/master[5113]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
Nov 19 11:48:29 Nagios-SLC postfix/smtp[5957]: fatal: open database /etc/postfix/sasl_passwd.db: No such file or directory
Nov 19 11:48:30 Nagios-SLC postfix/master[5113]: warning: process /usr/lib/postfix/smtp pid 5957 exit status 1
Nov 19 11:48:30 Nagios-SLC postfix/master[5113]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
Nov 19 11:49:30 Nagios-SLC postfix/smtp[5958]: fatal: open database /etc/postfix/sasl_passwd.db: No such file or directory
Nov 19 11:49:31 Nagios-SLC postfix/master[5113]: warning: process /usr/lib/postfix/smtp pid 5958 exit status 1
Other then that I do not see anything overly significant.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.