Alerting via email not sending email

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
ebounous
Posts: 7
Joined: Mon Jan 05, 2015 12:12 pm

Alerting via email not sending email

Post by ebounous »

I have setup and tested an alert in Log Server. I setup a dashboard and query for when a Windows account is locked out. When checking the alerts page, after locking out an account, the status changes to critical. I set the alert to check every 1m, look back every 1m, and thresholds of 1,1. The status even shows critical. It's not trying to email the elert. When on the box via command line, it's not logging in /var/log/maillog (file is empty) and I can't find where it's logging on the centos box. This was downloaded as a VM from nagios and running centos 6.6. Where is this logging the tries to alert via email and what mail program is it using. I am trying to send via smtp through our exchange server, which is successfully setup to send email as an smtp relay.

Thanks in advance for any help
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Alerting via email not sending email

Post by scottwilkerson »

What version of Log Server are you running? What settings Do you have in Administration -> Mail Settings
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ebounous
Posts: 7
Joined: Mon Jan 05, 2015 12:12 pm

Re: Alerting via email not sending email

Post by ebounous »

Nagios Log Server (2015R1.3) is up-to-date

I have From Email '[email protected]'
SMTP server
The IP of our Exchange relay
NO SMTP security (The receive connector on our exchange server is allowing email from that IP address)
SMTP port 25
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Alerting via email not sending email

Post by tgriep »

Could you go to Administration -> Mail Settings and click on the Test Settings button and see if the email comes through?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Alerting via email not sending email

Post by jolson »

After using the 'test settings' button as described by tgriep, please issue the following on all of your nodes:

Code: Select all

tail /var/log/maillog
I could not get logs to appear on my second test node, while they did appear on my first node.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
ebounous
Posts: 7
Joined: Mon Jan 05, 2015 12:12 pm

Re: Alerting via email not sending email

Post by ebounous »

no, the test button does not work... and there was nothing being put in the log file, until I looked again today. The log file is showing that email is trying to send via our DNS MX record setting, not the smart host setup within the smart host parameter.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Alerting via email not sending email

Post by jolson »

Could you please run this command before you go through testing this so we can see if there are any errors that are popping up from adjusting the email settings, saving and generating an alert:

Code: Select all

tail -f /var/log/httpd/error_log
After getting that command started, please adjust your SMTP settings and save to ensure there are no errors that pop up.

If there are errors, please report them. Could you also report the text that you saw in your maillog earlier?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
wadebradshaw
Posts: 2
Joined: Sat Apr 04, 2015 3:43 am

Re: Alerting via email not sending email

Post by wadebradshaw »

In order to relay mail to our Exchange server, I had to make a few adjustments to sendmail.mc and recompile it to sendmail.cf using m4.

# this line tells sendmail to relay all mail to our exchange server; replace 192.168.x.x with your exchange server that will receive the email
define(`SMART_HOST', `192.168.x.x')dnl

# this line disables having sendmail use dns when sending mail
define(`confSERVICE_SWITCH_FILE',`/etc/mail/service.switch')dnl

Created this service.switch file in /etc/mail
####### start of file #######

hosts files
aliases files

####### end of file #######

Also added this entry to /etc/hosts
192.168.x.x EmailServerNetbiosName EmailServerFQDN
Then restarted sendmail with “service sendmail restart”

Ref’d this article to fix this: http://stackoverflow.com/questions/4397 ... a-firewall

Hope this helps.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Alerting via email not sending email

Post by tmcdonald »

Thanks!

Due to the age of the thread I will be closing it now, but feel free to post other fixes you wish to share.
Former Nagios employee
Locked