Enable Debug Logging
To enable debug logging you need to edit the class.phpmailer.php file and define the following:
public $SMTPDebug = 4;
By default the value is set to 0.
The following commands will make that change for you:
cd /usr/local/nagiosfusion/html/includes/utils/phpmailer/
sed -i 's/public \$SMTPDebug.*/public \$SMTPDebug = 4;/g' class.phpmailer.php
cd /usr/local/nagiosxi/html/includes/phpmailer/
sed -i 's/public \$SMTPDebug.*/public \$SMTPDebug = 4;/g' class.phpmailer.php
View Debug Output
To view the debug output you need to send a test email.
Open the Nagios Fusion web interface and navigate to Admin > System Configuration > Email Settings.
Click the Send a Test Email button which will then take you to the Test Email Settings page.
Here you need to click the Sent Test Email button.
Open the Nagios XI web interface and navigate to Admin > System Config > Manage Email Settings.
Click the Send a Test Email button which will then take you to the Test Email Settings page.
Here you need to click the Sent Test Email button.
The output generated from the test will be placed as raw text at the top of the page, here is an example:
You can see in the screenshot above that there was an authentication issue. The output you see on your screen will be different and you can use that output to further troubleshoot your SMTP problems.
Disable Debug Logging
When you no longer require the debug logging you will need to disable it by editing the class.phpmailer.php file and define the following:
public $SMTPDebug = 0;
The following commands will make that change for you:
cd /usr/local/nagiosfusion/html/includes/utils/phpmailer/
sed -i 's/public \$SMTPDebug.*/public \$SMTPDebug = 0;/g' class.phpmailer.php
cd /usr/local/nagiosxi/html/includes/phpmailer/
sed -i 's/public \$SMTPDebug.*/public \$SMTPDebug = 0;/g' class.phpmailer.php
© Copyright 2000-2023 COGITO SOFTWARE CO.,LTD. All rights reserved