PDF Files generated too big

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

PDF Files generated too big

Post by rajasegar »

Nagios 2014R1.2

We have noticed that the PDF file generated in Nagios is way too big.

For example on the scheduled report generated by Nagios - 2.8 Mb
Same page generated using Web Page plugin - 700k.

Please advice on this.

Thanks
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: PDF Files generated too big

Post by lmiltchev »

What is the time period that you are using? I tested this with "This Month". I saved the report as PDF from the Web page, and also scheduled the report. I can see a very small difference in the size of the PDFs...

18.6 KB (19,113 bytes) - web
18.6 KB (19,115 bytes) - scheduled
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: PDF Files generated too big

Post by rajasegar »

Tried scheduling a One Time Report and the web page hung.

Code: Select all

[nagios@nagiosprodxi1 debug]$ sudo tail -f /var/log/httpd/error_log
[Tue Jul 22 11:20:01 2014] [error] [client 10.17.44.34] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20971521 bytes) in /usr/local/nagiosxi/html/includes/utils-reports.inc.php on line 437, referer: http://10.17.19.235/nagiosxi/reports/
[Tue Jul 22 11:24:05 2014] [error] [client 10.17.44.34] File does not exist: /usr/local/nagiosxi/html/includes/js/jquery/colorpicker/images/colorpicker_overlay.png, referer: http://10.17.19.235/nagiosxi/dashboards/
[Tue Jul 22 11:27:01 2014] [error] [client 10.17.44.34] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20971500 bytes) in /usr/local/nagiosxi/html/includes/utils-reports.inc.php on line 436, referer: http://10.17.19.235/nagiosxi/reports/
[Tue Jul 22 13:41:56 2014] [error] [client 10.17.44.34] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 21495769 bytes) in /usr/local/nagiosxi/html/includes/utils-reports.inc.php on line 441, referer: http://10.17.19.235/nagiosxi/reports/
Please advice how to increase this memory.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: PDF Files generated too big

Post by abrist »

Check your php memory_limit:

Code: Select all

cat /etc/php.ini | grep memory_limit
Increase the php.ini limits to 256 or 512:

Code: Select all

memory_limit = 512M
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: PDF Files generated too big

Post by rajasegar »

abrist wrote:Check your php memory_limit:

Code: Select all

cat /etc/php.ini | grep memory_limit
Increase the php.ini limits to 256 or 512:

Code: Select all

memory_limit = 512M
Changed and restarted httpd.
This time no more error message. The page timed out and cannot connect to website anymore.
Had to restart httpd to get back to normal.

Code: Select all

[Wed Jul 23 07:57:16 2014] [notice] caught SIGTERM, shutting down
[Wed Jul 23 07:57:17 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Jul 23 07:57:17 2014] [notice] Digest: generating secret for digest authentication ...
[Wed Jul 23 07:57:17 2014] [notice] Digest: done
[Wed Jul 23 07:57:17 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
[Wed Jul 23 08:06:51 2014] [notice] caught SIGTERM, shutting down
[Wed Jul 23 08:06:51 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Jul 23 08:06:51 2014] [notice] Digest: generating secret for digest authentication ...
[Wed Jul 23 08:06:51 2014] [notice] Digest: done
[Wed Jul 23 08:06:51 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: PDF Files generated too big

Post by lmiltchev »

Can you schedule a report now? Are you still having the issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: PDF Files generated too big

Post by rajasegar »

lmiltchev wrote:Can you schedule a report now? Are you still having the issue?
As per the post above, it hangs the web server when I tried to do a One Time run on the default Dashboard.
I did not bother to schedule it since, it might do the same thing.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: PDF Files generated too big

Post by abrist »

What report are you running? The report may hang if it tries to pull in too much data or if it tries to access a giant db table or log file.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: PDF Files generated too big

Post by rajasegar »

abrist wrote:What report are you running? The report may hang if it tries to pull in too much data or if it tries to access a giant db table or log file.
It is scheduling my default dashboard attached.
Nagios XI - Dashboard - Home Page.zip
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: PDF Files generated too big

Post by lmiltchev »

Probably we will need to schedule a remote session to further troubleshoot the issue. Is this an option for you?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked