Nagios xi Reports
-
- Posts: 103
- Joined: Wed Aug 05, 2020 11:39 am
Nagios xi Reports
We've got about 300 hosts and 900 service checks. Anytime I try and generate any report the Nagios Webpage will hang for all users and timeout. I followed the instructions here:
https://support.nagios.com/kb/article.php?id=611
As well as added:
Timeout 600
ProxyTimeout 600
To my httpd.conf file. With the increased timeout some reports will run, but should it take 10+ minutes just to generate an SLA report?
https://support.nagios.com/kb/article.php?id=611
As well as added:
Timeout 600
ProxyTimeout 600
To my httpd.conf file. With the increased timeout some reports will run, but should it take 10+ minutes just to generate an SLA report?
-
- Dreams In Code
- Posts: 7682
- Joined: Wed Feb 11, 2015 12:54 pm
Re: Nagios xi Reports
Edit your /etc/php.ini and set these (if they aren't already increased):
Then restart apache and try again:
How large of a report are you running? (meaning how many hosts? how large is the time period?)
Please PM me a copy of your profile, you can download it from Admin > System Profile by clicking the Download Profile button.
Include the output of these commands:
Code: Select all
max_execution_time = 300
memory_limit = 1024M
Code: Select all
service httpd restart
Please PM me a copy of your profile, you can download it from Admin > System Profile by clicking the Download Profile button.
Include the output of these commands:
Code: Select all
ls -lh /usr/local/nagios/var/nagios.log
ls -lh /usr/local/nagios/var/archives
-
- Posts: 103
- Joined: Wed Aug 05, 2020 11:39 am
Re: Nagios xi Reports
Yep those PHP settings were what I modified from the optimization page. A little over 300 hosts at the moment and just 24 hours. PM is on its way.
-
- Dreams In Code
- Posts: 7682
- Joined: Wed Feb 11, 2015 12:54 pm
Re: Nagios xi Reports
Do the reports work if you only select a single host for 24 hours? If so, then next steps may not be needed, I'm not sure why your group is different on them.
The permissions are off, run these commands and test again:
Please send the logs from this directory:
Try restarting php-fpm as well to see if that will pick up your changes:
Attach these files as well:
The permissions are off, run these commands and test again:
Code: Select all
chown nagios.nagios /usr/local/nagios/var/nagios.log
chown -R nagios.nagios /usr/local/nagios/var/archives
Code: Select all
/var/log/php-fpm/
Code: Select all
systemctl restart php-fpm
Code: Select all
/etc/php-fpm.conf
/etc/php-fpm.d/www.conf
-
- Posts: 103
- Joined: Wed Aug 05, 2020 11:39 am
Re: Nagios xi Reports
A singular host comes back immediately with no issue. If I limit it to one hostgroup depending on the report it will work, but usually hang for about 6 minutes. Made the changes and tried all hosts for 24 hours and still timed out. PM'ed you the logs
-
- Dreams In Code
- Posts: 7682
- Joined: Wed Feb 11, 2015 12:54 pm
Re: Nagios xi Reports
Try editing your /etc/httpd/conf.d/php.conf and change this:
To this:
Then restart httpd/php-fpm:
Then test, you may want to increase your max_execution_time to something like 3600 for testing.
Code: Select all
#
# Redirect to local php-fpm (no mod_php in default configuration)
#
<IfModule !mod_php5.c>
<IfModule !mod_php7.c>
# Enable http authorization headers
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
</IfModule>
</IfModule>
To this:
Code: Select all
#
# Redirect to local php-fpm (no mod_php in default configuration)
#
<IfModule !mod_php5.c>
<IfModule !mod_php7.c>
# Enable http authorization headers
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
ProxySet timeout=600
</FilesMatch>
</IfModule>
</IfModule>
Code: Select all
systemctl httpd restart
systemctl php-fpm restart
Code: Select all
/etc/php.ini
-
- Posts: 103
- Joined: Wed Aug 05, 2020 11:39 am
Re: Nagios xi Reports
Adding the ProxySet causes the service to fail to start
Nov 07 15:38:22 vml1038 systemd[1]: Starting The Apache HTTP Server...
Nov 07 15:38:22 vml1038 httpd[1782544]: AH00526: Syntax error on line 29 of /etc/httpd/conf.d/php.conf:
Nov 07 15:38:22 vml1038 httpd[1782544]: ProxySet can not find 'timeout=600' Worker.
Nov 07 15:38:22 vml1038 systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Nov 07 15:38:22 vml1038 systemd[1]: httpd.service: Failed with result 'exit-code'.
Nov 07 15:38:22 vml1038 systemd[1]: Failed to start The Apache HTTP Server.
I'm guessing this is because the first argument for ProxySet should be a worker or something?
Nov 07 15:38:22 vml1038 systemd[1]: Starting The Apache HTTP Server...
Nov 07 15:38:22 vml1038 httpd[1782544]: AH00526: Syntax error on line 29 of /etc/httpd/conf.d/php.conf:
Nov 07 15:38:22 vml1038 httpd[1782544]: ProxySet can not find 'timeout=600' Worker.
Nov 07 15:38:22 vml1038 systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Nov 07 15:38:22 vml1038 systemd[1]: httpd.service: Failed with result 'exit-code'.
Nov 07 15:38:22 vml1038 systemd[1]: Failed to start The Apache HTTP Server.
I'm guessing this is because the first argument for ProxySet should be a worker or something?
-
- Dreams In Code
- Posts: 7682
- Joined: Wed Feb 11, 2015 12:54 pm
Re: Nagios xi Reports
Ok, try changing it from this:
To this:
Then restart apache:
Then test again. If it fails again, please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:
https://support.nagios.com/tickets/
Thank you!
Code: Select all
#
# Redirect to local php-fpm (no mod_php in default configuration)
#
<IfModule !mod_php5.c>
<IfModule !mod_php7.c>
# Enable http authorization headers
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
ProxySet timeout=600
</FilesMatch>
</IfModule>
</IfModule>
Code: Select all
#
# Redirect to local php-fpm (no mod_php in default configuration)
#
<IfModule !mod_php5.c>
<IfModule !mod_php7.c>
# Enable http authorization headers
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
Timeout 600
RequestReadTimeout header=600,minrate=50
RequestReadTimeout body=600,minrate=50
<Proxy "unix:/run/php-fpm/www.sock|fcgi://localhost">
ProxySet timeout=600
</Proxy>
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
</IfModule>
</IfModule>
Code: Select all
service httpd restart
Then test again. If it fails again, please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:
https://support.nagios.com/tickets/
Thank you!
-
- Posts: 103
- Joined: Wed Aug 05, 2020 11:39 am
Re: Nagios xi Reports
Yeah that does seem to solve the issue. Not only does the webpage no longer lock up it also finishes in less than a minute or so.
So it was just timing out? How did increasing the timeout give a quicker return?
So it was just timing out? How did increasing the timeout give a quicker return?
-
- Dreams In Code
- Posts: 7682
- Joined: Wed Feb 11, 2015 12:54 pm
Re: Nagios xi Reports
I don't think they are likely related, I can't think of a reason increasing the timeout would make it go faster, maybe the load is less on the system now that when you ran it before?