Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Nagios has been up and running for quite sometime now and no issues till this month. For some reason, Nagios kept failing to send notifications out to our department. Out of curiosity I've sent the email out manually and tailed the mail.log then found out that every email being sent is getting a "Connection Refused." Can this be a permission issue? If so where and why all of the sudden it just stopped working as none has changed in the OS (Ubuntu Core).
Please advise. Cheers!
Is sendmail (or your mailing application) running?
/etc/init.d/sendmail status
Hmm it gave me this:
MSP: is run via cron (20m)
MTA: is not running
QUE: Same as MTA
So I restarted it:
* Restarting Mail Transport Agent (MTA) sendmail 554 5.0.0 No local mailer defined
554 5.0.0 QueueDirectory (Q) option must be set
[ OK ]
What do you think got changed? Like stated on my post, none has changed - just basically stopped all of the sudden.
More than likely, nothing changed. Daemons can die for any number of reasons, and that appears to be the case here. You could check /var/log/mail.log for clues, maybe it'll tell you what happened.
More than likely, nothing changed. Daemons can die for any number of reasons, and that appears to be the case here. You could check /var/log/mail.log for clues, maybe it'll tell you what happened.
Yea did that and saw this clue:
May 6 07:43:04 nagiossrv sendmail[20128]: o46Eh4bx020128: to=admin@csaa.com, ctladdr=nagios (1001/1002), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30319, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Not so sure why this is the case "Connection refused.."
I've checked levels on to 235 and restarted still giving me:
service sendmail restart
* Restarting Mail Transport Agent (MTA) sendmail 554 5.0.0 No local mailer defined
554 5.0.0 QueueDirectory (Q) option must be set [ OK ]
Yea did that and saw this clue:
May 6 07:43:04 nagiossrv sendmail[20128]: o46Eh4bx020128: to=admin@csaa.com, ctladdr=nagios (1001/1002), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30319, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Not so sure why this is the case "Connection refused.."
I've checked levels on to 235 and restarted still giving me:
service sendmail restart
* Restarting Mail Transport Agent (MTA) sendmail 554 5.0.0 No local mailer defined
554 5.0.0 QueueDirectory (Q) option must be set [ OK ]
Ok installed exim4 see if that'll resolve it but now gave me this when restarting sendmail:
service sendmail restart
* Restarting Mail Transport Agent (MTA) sendmail start-stop-daemon: stat /usr/sbin/sendmail-mta: No such file or directory (No such file or directory)
/etc/init.d/sendmail: 1287: /usr/sbin/sendmail-msp: not found [ OK ]
I have finally gave up on troubleshooting this further in which I cleaned up and removed all instances for sendmail.
I then reinstalled and re-configured sendmail referencing our old configs.
Now Nagios is sending email notifications.
Still left clueless on why all of the sudden it stopped working mysteriously...
Problem solved!
The 'connection refused' indicates that the port was not open, ie a daemon was not listening on that port. And on your previous post when you pasted the output of sendmail's status, it said "MTA: is not running", which means your Mail Transport Agent (sendmail) was not running. So it appears your root cause was the Sendmail daemon not actually running.
As for restarting sendmail, I'm not sure if yours actually ever (re)started. You do have '[ OK ]' in your output as if it did, but it also threw an error (sendmail 554 5.0.0 No local mailer defined 554 5.0.0 QueueDirectory (Q) option must be set). Did you ever check sendmail's status after attempting to restart it (/etc/init.d/sendmail status)? Did you verify if the process actually spawned (ps -efww or ps -aux)? Was sendmail listening on port 25 (netstat -lntp)?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.