Page 1 of 2

Capacity Planning Report issue

Posted: Fri Sep 11, 2020 11:45 am
by lrnnetops
Hi Team,

Please find below nagios XI server details.

Operating System - Centos 7
Nagios XI Version = 5.6.5
CPU core - 4
Memory - 16 GB

We are trying to automate capacity planning report monthly. We tried with below method.

1 - Manually executed capacity planning report for single host for 1 month. able to download & send report on mail. wkhtmltopdf took almost more than 10 minutes.

2 - Manually executed capacity planning report for single host for more than 1 month . Unable to download nor send report on mail. wkhtmltopdf took infinite time to run. Spike load on server. received mail but attached file in mail was corrupted but same time we checked & found "wkhtmltopdf" process was still running on the server. we had to kill process.

3 - 2 - Manually executed capacity planning report for single hostgroup for 1 month . Unable to download nor send report on mail. wkhtmltopdf took infinite time to run. Spike load on server. received mail but attached file in mail was corrupted, but same time we checked & found "wkhtmltopdf" process was still running on the server. we had to kill process.

Details of wkhtmltopdf & wkhtmltoimage as below

wkhtmltopdf --version
wkhtmltopdf 0.12.1.3 (with patched qt)

wkhtmltoimage --version
wkhtmltoimage 0.12.1.3 (with patched qt)

Please let us know fix for the issue we facing.

Regards,
Rohan

Re: Capacity Planning Report issue

Posted: Fri Sep 11, 2020 5:20 pm
by ssax
Please attach your /etc/php.ini, we likely need to tweak some settings.

Please PM me a copy of your profile as well so we can check for other issues that could be affecting it, you can download it from Admin > System Profile > Download Profile button.

Thank you!

Re: Capacity Planning Report issue

Posted: Tue Sep 15, 2020 12:33 pm
by lrnnetops
Hi ssax,

Please find attached php.ini file.
php.ini
We exported profile, but as per our security policy we wont be able to share all the details with you. Please let us know what details you want to check from profile details we will check with our security team & if possible we will share with you.

We have attached system info.
Nagios XI - System Info.txt
Regards,
Rohan

Re: Capacity Planning Report issue

Posted: Wed Sep 16, 2020 5:35 pm
by ssax
Please edit your /etc/php.ini and change these:

Code: Select all

max_execution_time = 30
;max_input_vars = 1000
memory_limit = 128M
To these:

Code: Select all

max_execution_time = 900
max_input_vars = 50000
memory_limit = 1024M
Then restart apache and try again:

Code: Select all

service httpd restart

Re: Capacity Planning Report issue

Posted: Wed Sep 16, 2020 5:37 pm
by cdienger
The output shows a corrupted table in the database and the php.ini memory limit is set to the default which we normally have to increase. Correct the database error following https://assets.nagios.com/downloads/nag ... tabase.pdf and increase the limits set in the php.ini per https://support.nagios.com/kb/article/n ... e-611.html

Re: Capacity Planning Report issue

Posted: Thu Sep 24, 2020 12:41 pm
by lrnnetops
HI cdienger,

We have repaired the DB.
db-repair.jpg
Hi ssax,

We have made changes as recommended in php.ini but still we haven't seen any improvement in performance. it still having same delay.

Regards,
Rohan Talkar

Re: Capacity Planning Report issue

Posted: Fri Sep 25, 2020 12:45 pm
by ssax
Try increasing your /etc/php.ini max_execution_time to an even higher value like 3600.

If you run this tail command (as root):

Code: Select all

tail -Fn0 /var/log/httpd/*error_log
Then replicate the capacity planning report issue, do you see any errors being output from the still running tail command?

What is the output of these commands?

Code: Select all

ps aux
sar

Re: Capacity Planning Report issue

Posted: Mon Sep 28, 2020 6:55 am
by lrnnetops
Hi ssax,

We have made the suggested changes in php.ini still we receiving PDF in mail as corrupted file.

Attached requested output (Apache error logs, ps aux & sar).
sys-output.txt
Please let us know how to fix this issue.

Re: Capacity Planning Report issue

Posted: Mon Sep 28, 2020 6:19 pm
by ssax
You have crashed DB tables:
Sep 15 09:30:20 XXXX ndo2db[2458]: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Please repair them:

https://assets.nagios.com/downloads/nag ... tabase.pdf

I'm also seeing this:
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php.ini on line 375 in Unknown on line 0
Edit your /etc/php.ini and change line 375 from this:

Code: Select all

#expose_php = On
To this:

Code: Select all

;expose_php = On

Code: Select all

service httpd restart
Then test again.

Re: Capacity Planning Report issue

Posted: Tue Sep 29, 2020 8:33 am
by lrnnetops
Hi ssax,

As per suggestion we have corrected "/etc/php.ini" file => restarted apahe.

Performed DB repair with "sh /usr/local/nagiosxi/scripts/repair_databases.sh" command. attached output for db repair.
nagiosxi-db-repair-ouput.txt
We executed capacity planning report after that for 1 month on hostgroup having 16 hosts. below is the summary.

1 - Click on Email this report on 10:03 AM IST.
2 - Received mail with PDF file attached on 10:19 AM IST
3 - Checked PDF file it cupped.
4 - "wkhtmltopdf" process created for the task is still running on the server & occupied the server resources.
wkhtmltopdf_long-running_process.jpg
Provided solution did not worked.

We need fix on this on high priority as we have to share details with our management. please involve your dev team if required.

Regards,
Rohan