Hi,
I have a problem when I want to send a test email on Nagios (linux centos) and I need your help .
I configured nagios to send notifications from my email address ****@gmail.com, The email settings are as follows:
Send From: ***@gmail.com
Send Method: SMTP with Basic Auth
SMTP Settings:
host : smtp.gmail.com
port : 587
username :****@gmail.com
password : "the same password for my gmail account"
Security: Tls
the error message is:
Mailer said: [12-13-2023 20:02:32] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.gmail.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
An error occurred sending a test email!
thanks
test message is not sent
Re: test message is not sent
Thanks for reaching out @amintay,
I would reference this article here to debug further.
https://support.nagios.com/kb/article.php?id=820
When I set mine up to replicate the issue, I got an invalid second factor error. I would think this changes based on your configuration.
I would reference this article here to debug further.
https://support.nagios.com/kb/article.php?id=820
When I set mine up to replicate the issue, I got an invalid second factor error. I would think this changes based on your configuration.
Re: test message is not sent
First of all, thank you for your comment.
I did the manipulation described in the link, but I cannot get the debugging
If you have any other leads I would be grateful.
here are the two screenshots
I did the manipulation described in the link, but I cannot get the debugging






If you have any other leads I would be grateful.
here are the two screenshots
You do not have the required permissions to view the files attached to this post.
Re: test message is not sent
There should also be a commented out line around line 195 in /usr/local/nagiosxi/html/includes/utils-email.inc.php
to
Code: Select all
// Debugging
// $mail->SMTPDebug = 4; // full debug
Code: Select all
// Debugging
$mail->SMTPDebug = 4; // full debug
Re: test message is not sent
Hi ANDERSON,
I followed this procedure and it worked. I got the logs.
after the analysis, I was able to identify the problem and it was solved.
thank you very much

I followed this procedure and it worked. I got the logs.
after the analysis, I was able to identify the problem and it was solved.
thank you very much



-
- Posts: 2
- Joined: Tue Dec 26, 2023 9:54 pm
Re: test message is not sent
It seems like you've configured Nagios on CentOS to send notifications via email using your Gmail account but are encountering issues. Here are a few steps and considerations to help troubleshoot the problem:
Check Network Connectivity:
Ensure that your CentOS server has internet access and can reach smtp.gmail.com on port 587.
Verify Gmail Account Credentials:
Double-check that the username and password provided for your Gmail account are accurate. Also, ensure that your Gmail account allows less secure apps to access it. You may need to enable "Allow less secure apps" in your Gmail account settings.
Firewall Configuration:
Verify that your firewall allows outgoing connections on port 587. If a firewall is active, open the necessary port for SMTP communication. slope game
Check Network Connectivity:
Ensure that your CentOS server has internet access and can reach smtp.gmail.com on port 587.
Verify Gmail Account Credentials:
Double-check that the username and password provided for your Gmail account are accurate. Also, ensure that your Gmail account allows less secure apps to access it. You may need to enable "Allow less secure apps" in your Gmail account settings.
Firewall Configuration:
Verify that your firewall allows outgoing connections on port 587. If a firewall is active, open the necessary port for SMTP communication. slope game
Re: test message is not sent
thank you, problem solved