Page 1 of 2

Scheduled Report Log

Posted: Tue Mar 02, 2021 3:16 pm
by acentek
Where can I find the logs for sending out the Scheduled Reports? I looking to see why a report may not have been sent over the weekend. The process is working because the report was sent out yesterday and today, but it was reported to me that one report from a user is missing. I'm not sure where to look for the proper logs.



Thanks

Re: Scheduled Report Log

Posted: Wed Mar 03, 2021 3:50 pm
by benjaminsmith
Hi,

There's a log available and it is located at the following path.

Code: Select all

/usr/local/nagiosxi/var/scheduledreporting.log
Also, in the schedule reporting page in the user interface, you'll find a My Scheduled Reports history tab with recent activity to compare against the log.

As far as troubleshooting errors, the Apache logs are helpful. If there's an issue, try to run a tail -f on the log below and send a scheduled report using the Send Now option in the Actions menu. The post the output to the thread. Thanks, Benjamin

Code: Select all

/var/log/httpd/error_log

Re: Scheduled Report Log

Posted: Fri Mar 12, 2021 1:22 pm
by acentek
Thank you, while those are helpful, that doesn't really tell me if the reports actually went out or not. I created a report and sent it out 4 times to myself and only received one copy. So what happened? That's where I'm not sure where to look. Thanks!

Re: Scheduled Report Log

Posted: Mon Mar 15, 2021 10:42 am
by benjaminsmith
Hi @acentek,

Did you check the spam folder? The other reports may have ended up there. To confirm if the reports left the server, please check the mail log.

If you are using SMTP for sending email messages, then go to Admin > System Config > Email Settings and make sure logging is enabled, and then check the following file.

Code: Select all

/usr/local/nagiosxi/tmp/phpmailer.log
Otherwise, check the sendmail folder at:

Code: Select all

/var/log/maillog
If you discover any errors in the log, please post them to the thread. Otherwise, if the reports were sent as expected, then it's usually a filtering issue on the mail server side.

--Benjamin

Re: Scheduled Report Log

Posted: Wed Mar 17, 2021 7:47 am
by acentek
Reports are still being weird. From one user they are missing the report from 3 days last week. Today it showed up but the CSV was blank. I made a copy of the Scheduled Report so I could then manually send it to myself and it came in with data. So not sure what is going on there either.

Logging was not selected in Admin > System Config > Email Settings - so that will help now. Thank you for sharing that tip and the location of the log files.

Output of /var/log/maillog

Mar 17 07:38:28 nagios postfix/pickup[113889]: 1CFC2C05B872: uid=0 from=<root>
Mar 17 07:38:28 nagios postfix/cleanup[98776]: 1CFC2C05B872: message-id=<[email protected]>
Mar 17 07:38:28 nagios postfix/qmgr[1973]: 1CFC2C05B872: from=<[email protected]>, size=510780, nrcpt=1 (queue active)
Mar 17 07:38:28 nagios postfix/local[98783]: 1CFC2C05B872: to=<[email protected]>, orig_to=<root>, relay=local, delay=193, delays=193/0.01/0/0.01, dsn=5.2.2, status=bounced (cannot update mailbox /var/mail/root for user root. error writing message: File too large)
Mar 17 07:38:28 nagios postfix/cleanup[98776]: 23E06C070DFB: message-id=<[email protected]>
Mar 17 07:38:28 nagios postfix/bounce[98793]: 1CFC2C05B872: sender non-delivery notification: 23E06C070DFB
Mar 17 07:38:28 nagios postfix/qmgr[1973]: 23E06C070DFB: from=<>, size=2742, nrcpt=1 (queue active)
Mar 17 07:38:28 nagios postfix/qmgr[1973]: 1CFC2C05B872: removed
Mar 17 07:38:28 nagios postfix/local[98783]: 23E06C070DFB: to=<[email protected]>, relay=local, delay=0.02, delays=0/0/0/0.01, dsn=5.2.2, status=bounced (cannot update mailbox /var/mail/root for user root. error writing message: File too large)
Mar 17 07:38:28 nagios postfix/qmgr[1973]: 23E06C070DFB: removed

That just repeats every 5 minutes - there is no other useful data in there that I can see.

Re: Scheduled Report Log

Posted: Wed Mar 17, 2021 8:00 am
by acentek
After selecting Logging in Email Settings, I sent another report through so I could look at the log. So it sent but I was hoping for more info and who it was sent to, to verify the recipients. Looks like I'll have to assume that it went out to who it is supposed to.

[root@nagios ~]# cat /usr/local/nagiosxi/tmp/phpmailer.log
[03-17-2021 07:54:18] Message sent! (method=smtp;host=acentek;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
You have mail in /var/spool/mail/root

Re: Scheduled Report Log

Posted: Wed Mar 17, 2021 5:34 pm
by ssax
That log doesn't currently list that information, I have created a feature request on your behalf:

Code: Select all

FR: XI - phpmailer.log show what it sent and who it sent to help with debugging
What I usually do is tail these files to correlate them:

Code: Select all

tail -Fn0 /var/log/maillog /var/log/httpd/error_log /var/log/httpd/ssl_error_log /usr/local/nagiosxi/var/eventman.log /usr/local/nagiosxi/tmp/phpmailer.log /usr/local/nagiosxi/var/scheduledreporting.log /usr/local/nagiosxi/var/wkhtmltox.log
Then force the report to be sent and that should show what occurrs.

Please attach your /etc/php.ini file.

Please PM me a copy of your profile.zip, you can download it from Admin > System Profile by clicking the Download Profile button.

Re: Scheduled Report Log

Posted: Fri Mar 19, 2021 9:21 am
by acentek
Today I received two reports for Notifications - same thing. Yesterday was the same. We did not receive our WARNING - State Report. I've attached a screenshot of what we should be getting daily. Notifications - Top Alert Producers and WARNING State History - are reports going to multiple people. (The other two are individual reports - haven't head if those are good or not just focusing on the reported issues)

Most of the commands sent didn't return useful info.

[03-19-2021 06:00:05] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=acentek-;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[03-19-2021 06:00:05] Message sent! (method=smtp;host=acentek-;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[03-19-2021 06:00:05] Message sent! (method=smtp;host=acentek-;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[03-19-2021 06:00:05] Message sent! (method=smtp;host=acentek-;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[03-19-2021 06:00:05] Message sent! (method=smtp;host=acentek-;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[03-19-2021 07:00:08] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=acentek-;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[03-19-2021 08:00:14] Message sent! (method=smtp;host=acentek-;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[03-19-2021 08:00:14] Message sent! (method=smtp;host=acentek-;port=;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report

I'll PM the profile.zip

Thanks for the help!!

Eric

Re: Scheduled Report Log

Posted: Fri Mar 19, 2021 3:16 pm
by ssax
You're running PHP 5.4, given you're using TLS I would upgrade to PHP 7 following the guide below:

https://support.nagios.com/kb/article/n ... 7-860.html

Taken from the link above:
Note: PHP Mailer requires PHP 5.6 or higher to use a TLS 1.2 connection.
You can also try changing the port from 25 to 587 in the XI settings and see if that helps, I had a customer that did that and it resolved it for them as well.

Re: Scheduled Report Log

Posted: Fri Apr 23, 2021 12:42 pm
by acentek
I did not receive a report this morning

Output from:
cat /usr/local/nagiosxi/tmp/phpmailer.log

[04-23-2021 06:00:03] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=.protection.outlook.com;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[04-23-2021 06:00:03] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=.protection.outlook.com;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[04-23-2021 06:00:03] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=.protection.outlook.com;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[04-23-2021 06:00:03] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=.protection.outlook.com;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[04-23-2021 07:00:07] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=.protection.outlook.com;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[04-23-2021 08:00:08] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=.protection.outlook.com;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report
[04-23-2021 08:00:08] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=.protection.outlook.com;port=25;security=tls), Referer: includes/components/scheduledreporting > Scheduled Report

Think this is still PHP related?
Thanks!