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
Alerting via email not sending email
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Alerting via email not sending email
What version of Log Server are you running? What settings Do you have in Administration -> Mail Settings
Re: Alerting via email not sending email
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
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
Re: Alerting via email not sending email
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!
Re: Alerting via email not sending email
After using the 'test settings' button as described by tgriep, please issue the following on all of your nodes:
I could not get logs to appear on my second test node, while they did appear on my first node.
Code: Select all
tail /var/log/maillogRe: Alerting via email not sending email
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.
Re: Alerting via email not sending email
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:
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?
Code: Select all
tail -f /var/log/httpd/error_logIf there are errors, please report them. Could you also report the text that you saw in your maillog earlier?
-
wadebradshaw
- Posts: 2
- Joined: Sat Apr 04, 2015 3:43 am
Re: Alerting via email not sending email
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.
# 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.
Re: Alerting via email not sending email
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.
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