Page 1 of 1

PDF Report Fails to Send

Posted: Sun Feb 12, 2017 4:18 pm
by ckiernan
I am running Nagios XI 5.4.0 on Centos 7.2.1511. I have a scheduled report configured. If I run the report in browser and choose to download the report as a pdf, it works fine. If I choose to send an email of the report with a pdf attachment, either I get no error and the email never comes, or I get the error below. Emails with any of the other attachment options go though fine.

Report failed to send. ARGV: Array ( [0] => /usr/local/nagiosxi/html/includes/components/scheduledreporting/sendreport.php [1] => --report=X2UVRU [2] => --username=nagiosadmin ) ARGS: Array ( [report] => X2UVRU [username] => nagiosadmin ) SR: Array ( [name] => Weekly Production Load [type] => [url] => reports/availability.php?reportperiod=thismonth&startdate=&enddate=&host=&service=&hostgroup=&servicegroup=Production+Load&advanced=1&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&servicegraphs=1 [dontdisplay] => 0 [recipients] => [email protected] [frequency] => Weekly [subject] => Production Load Report [body] => Production load report for the past month. [schedule] => Array ( [hour] => 09 [minute] => 00 [ampm] => AM [dayofweek] => 1 [dayofmonth] => 1 ) [attachments] => Array ( [pdf] => on [jpg] => on ) ) SRO: Array ( [source] => report [attachments] => Array ( [pdf] => Array ( [type] => PDF [file] => Availability_Report.pdf [urlopts] => mode=pdf [icon] => fa-file-pdf-o ) [jpg] => Array ( [type] => JPG [file] => Availability_Report.jpg [urlopts] => mode=jpg [icon] => fa-file-image-o ) [csv] => Array ( [type] => CSV (Combined) [file] => Availability_Report.csv [urlopts] => mode=csv&csvtype=combined [icon] => fa-file-text-o ) [csvhost] => Array ( [type] => CSV (Host data only) [file] => Host_Availability.csv [urlopts] => mode=csv&csvtype=host [icon] => fa-file-text-o ) [csvservice] => Array ( [type] => CSV (Service data only) [file] => Service_Availability.csv [urlopts] => mode=csv&csvtype=service [icon] => fa-file-text-o ) ) ) ATTACHMENT[pdf]=on URL=>https://nm.trumid.com/nagiosxi//reports ... S&mode=pdf FILE=>Availability_Report.pdf Attached: '/usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-X2UVRU-Availability_Report.pdf' ATTACHMENT[jpg]=on URL=>https://nm.trumid.com/nagiosxi//reports ... S&mode=jpg FILE=>Availability_Report.jpg Attached: '/usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-X2UVRU-Availability_Report.jpg' EMAIL: Array ( [from] => Nagios XI [to] => [email protected] [subject] => Nagios Report: Production Load Report [attachment] => Array ( [0] => Array ( [0] => /usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-X2UVRU-Availability_Report.pdf [1] => Availability_Report.pdf ) [1] => Array ( [0] => /usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-X2UVRU-Availability_Report.jpg [1] => Availability_Report.jpg ) ) [message] => This scheduled report was automatically generated by Nagios XI and sent to you as requested by nagiosadmin (Nagios Administrator). Production load report for the past month. You can directly access this report at: https://nm.trumid.com/nagiosxi/?xiwindo ... graphs%3D1 Access Nagios XI at: https://nm.trumid.com/nagiosxi/ )

Please let me know if I can provide any additional information.

Thanks,

Chris

Re: PDF Report Fails to Send

Posted: Mon Feb 13, 2017 10:39 am
by rkennedy
There were a few odd bugs with 5.4.0 depending on which version you received relating to notifications like this - could you upgrade and try once again?

Re: PDF Report Fails to Send

Posted: Mon Feb 13, 2017 11:58 am
by ckiernan
I will upgrade this evening and report back. Thanks.

Re: PDF Report Fails to Send

Posted: Mon Feb 13, 2017 12:21 pm
by dwhitfield
Fantastic. We are here until 5pm US Central. If you respond after that, we'll get back to you tomorrow. Thanks!

Re: PDF Report Fails to Send

Posted: Wed Feb 15, 2017 1:26 pm
by ckiernan
The upgrade didn't correct the problem but I've not had time to troubleshoot further yet. Hopefully this week.

Re: PDF Report Fails to Send

Posted: Wed Feb 15, 2017 2:04 pm
by rkennedy
Can you PM over a profile to myself and dwhitfield to review? This will have quite a few log files, and may lead to what the problem is. (Admin -> System Profile -> Download Profile)

The other files I'd be interested in seeing are -

Code: Select all

/var/log/httpd/error_log
/var/log/httpd/ssl_error_log
/var/log/httpd/access_log
/var/log/httpd/ssl_access_log

Re: PDF Report Fails to Send

Posted: Wed Mar 01, 2017 2:01 pm
by tmcdonald
Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up?

Re: PDF Report Fails to Send

Posted: Thu Mar 02, 2017 10:13 am
by ckiernan
I just sent the requested information over. I did just notice that the report sends with a pdf successfully if I don't select "Display service performance graphs". It fails with graphs. There are 70 graphs in this report.

Thanks,

Chris

Re: PDF Report Fails to Send

Posted: Thu Mar 02, 2017 12:13 pm
by dwhitfield
in your /etc/php.ini please set the following

Code: Select all

max_execution_time = 60     ; Maximum execution time of each script, in  seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing request data
memory_limit = 256M      ; Maximum amount of memory a script may consume 
You've got PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 34827903 bytes) in /usr/local/nagiosxi/html/includes/phpmailer/class.smtp.php on line 655 in your error_log.

It's possible you just need to give the machine more resources, but clearly you're exceeding the limit.