Nagios Stats Wizard Slow

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
andyb4u
Posts: 114
Joined: Tue Aug 15, 2017 1:58 am

Re: Nagios Stats Wizard Slow

Post by andyb4u »

I tailed /var/log/httpd/error_log and ran the PHP script but nothing showed up in the log.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Stats Wizard Slow

Post by ssax »

What version of PHP are they both running?

Code: Select all

php -v
rpm -qa | grep php
andyb4u
Posts: 114
Joined: Tue Aug 15, 2017 1:58 am

Re: Nagios Stats Wizard Slow

Post by andyb4u »

Both Systems have:

PHP 5.4.16 (cli) (built: Oct 29 2019 09:56:22)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

php-pgsql-5.4.16-48.el7.x86_64
php-mcrypt-5.4.16-7.el7.x86_64
php-common-5.4.16-48.el7.x86_64
php-snmp-5.4.16-48.el7.x86_64
php-pecl-ssh2-0.12-1.el7.x86_64
php-ldap-5.4.16-48.el7.x86_64
php-devel-5.4.16-48.el7.x86_64
php-5.4.16-48.el7.x86_64
php-mysql-5.4.16-48.el7.x86_64
php-imap-5.4.16-9.el7.x86_64
php-gd-5.4.16-48.el7.x86_64
php-mssql-5.4.16-9.el7.x86_64
php-process-5.4.16-48.el7.x86_64
php-pear-1.9.4-21.el7.noarch
php-mbstring-5.4.16-48.el7.x86_64
php-pdo-5.4.16-48.el7.x86_64
php-xml-5.4.16-48.el7.x86_64
php-pear-HTML-Template-IT-1.3.0-2.el5.noarch
php-cli-5.4.16-48.el7.x86_64

Running:

Code: Select all

php -v
on the system that was slow to return the PHP script is also slow.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Stats Wizard Slow

Post by ssax »

If php -v is slow then it's either load, IO wait, or something with your php modules.

What do these output on the slow system?

Code: Select all

time /usr/bin/php /usr/local/nagios/libexec/check_nagios_performance.php ahc15
time /usr/bin/php --no-php-ini /usr/local/nagios/libexec/check_nagios_performance.php ahc15
andyb4u
Posts: 114
Joined: Tue Aug 15, 2017 1:58 am

Re: Nagios Stats Wizard Slow

Post by andyb4u »

Code: Select all

time /usr/bin/php /usr/local/nagios/libexec/check_nagios_performance.php ahc15
OK - Total Checks:265; On-Demand:223; Scheduled:42 | Total_Checks=265;;; On_Demand=223;;; Sched_Checks=42;;;

real    0m16.916s
user    0m0.103s
sys     0m0.022s

Code: Select all

time /usr/bin/php --no-php-ini /usr/local/nagios/libexec/check_nagios_performance.php ahc15
OK - Total Checks:263; On-Demand:222; Scheduled:41 | Total_Checks=263;;; On_Demand=222;;; Sched_Checks=41;;;

real    0m0.079s
user    0m0.068s
sys     0m0.011s
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Stats Wizard Slow

Post by ssax »

What is the full output of these commands on both servers:

Code: Select all

php -i
It's likely a php module causing it since without the ini file it's fast.
andyb4u
Posts: 114
Joined: Tue Aug 15, 2017 1:58 am

Re: Nagios Stats Wizard Slow

Post by andyb4u »

Hi,

I've PM'd the output from both servers of

Code: Select all

php -i
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Stats Wizard Slow

Post by ssax »

You can try something like this:

https://blog.nexcess.net/diagnosing-slo ... achegrind/

What is the output of these commands on both systems?

Code: Select all

ls -l /etc/php.d
The only other way I know would be to remove each extension one by one until you found the offending module that is slowing it down.
andyb4u
Posts: 114
Joined: Tue Aug 15, 2017 1:58 am

Re: Nagios Stats Wizard Slow

Post by andyb4u »

From the server experiencing slowness with php:

Code: Select all

ls -l /etc/php.d
total 128
-rw-r--r--  1 root root 49 Oct 29  2019 curl.ini
-rw-r--r--  1 root root 47 Oct 29  2019 dom.ini
-rw-r--r--  1 root root 57 Oct 29  2019 fileinfo.ini
-rw-r--r--  1 root root 45 Oct 29  2019 gd.ini
-rw-r--r--  1 root root 49 Apr 26  2019 imap.ini
-rw-r--r--  1 root root 49 Oct 29  2019 json.ini
-rw-r--r--  1 root root 49 Oct 29  2019 ldap.ini
-rw-r--r--  1 root root 57 Oct 29  2019 mbstring.ini
-rw-r--r--  1 root root 53 Sep 17  2018 mcrypt.ini
-rw-r--r--  1 root root 51 Apr 26  2019 mssql.ini
-rw-r--r--  1 root root 53 Oct 29  2019 mysqli.ini
-rw-r--r--  1 root root 51 Oct 29  2019 mysql.ini
-rw-r--r--  1 root root 59 Apr 26  2019 pdo_dblib.ini
-rw-r--r--  1 root root 47 Oct 29  2019 pdo.ini
-rw-r--r--  1 root root 59 Oct 29  2019 pdo_mysql.ini
-rw-r--r--  1 root root 59 Oct 29  2019 pdo_pgsql.ini
-rw-r--r--  1 root root 61 Oct 29  2019 pdo_sqlite.ini
-rw-r--r--  1 root root 51 Oct 29  2019 pgsql.ini
-rw-r--r--  1 root root 49 Oct 29  2019 phar.ini
-rw-r--r--  1 root root 51 Oct 29  2019 posix.ini
-rw-r--r--  1 root root 49 Oct 29  2019 snmp.ini
-rw-r--r--. 1 root root 23 Mar  1  2018 sourceguardian.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sqlite3.ini
-rw-r--r--. 1 root root 49 Jan 18  2014 ssh2.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sysvmsg.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sysvsem.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sysvshm.ini
-rw-r--r--  1 root root 49 Oct 29  2019 wddx.ini
-rw-r--r--  1 root root 59 Oct 29  2019 xmlreader.ini
-rw-r--r--  1 root root 59 Oct 29  2019 xmlwriter.ini
-rw-r--r--  1 root root 47 Oct 29  2019 xsl.ini
-rw-r--r--  1 root root 47 Oct 29  2019 zip.ini
From the other server not experiencing slowness:

Code: Select all

ls -l /etc/php.d
total 128
-rw-r--r--  1 root root 49 Oct 29  2019 curl.ini
-rw-r--r--  1 root root 47 Oct 29  2019 dom.ini
-rw-r--r--  1 root root 57 Oct 29  2019 fileinfo.ini
-rw-r--r--  1 root root 45 Oct 29  2019 gd.ini
-rw-r--r--  1 root root 49 Apr 26  2019 imap.ini
-rw-r--r--  1 root root 49 Oct 29  2019 json.ini
-rw-r--r--  1 root root 49 Oct 29  2019 ldap.ini
-rw-r--r--  1 root root 57 Oct 29  2019 mbstring.ini
-rw-r--r--  1 root root 53 May 17  2018 mcrypt.ini
-rw-r--r--  1 root root 51 Apr 26  2019 mssql.ini
-rw-r--r--  1 root root 53 Oct 29  2019 mysqli.ini
-rw-r--r--  1 root root 51 Oct 29  2019 mysql.ini
-rw-r--r--  1 root root 59 Apr 26  2019 pdo_dblib.ini
-rw-r--r--  1 root root 47 Oct 29  2019 pdo.ini
-rw-r--r--  1 root root 59 Oct 29  2019 pdo_mysql.ini
-rw-r--r--  1 root root 59 Oct 29  2019 pdo_pgsql.ini
-rw-r--r--  1 root root 61 Oct 29  2019 pdo_sqlite.ini
-rw-r--r--  1 root root 51 Oct 29  2019 pgsql.ini
-rw-r--r--  1 root root 49 Oct 29  2019 phar.ini
-rw-r--r--  1 root root 51 Oct 29  2019 posix.ini
-rw-r--r--  1 root root 49 Oct 29  2019 snmp.ini
-rw-r--r--. 1 root root 23 Sep 19  2017 sourceguardian.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sqlite3.ini
-rw-r--r--. 1 root root 49 Jan 18  2014 ssh2.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sysvmsg.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sysvsem.ini
-rw-r--r--  1 root root 55 Oct 29  2019 sysvshm.ini
-rw-r--r--  1 root root 49 Oct 29  2019 wddx.ini
-rw-r--r--  1 root root 59 Oct 29  2019 xmlreader.ini
-rw-r--r--  1 root root 59 Oct 29  2019 xmlwriter.ini
-rw-r--r--  1 root root 47 Oct 29  2019 xsl.ini
-rw-r--r--  1 root root 47 Oct 29  2019 zip.ini
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Stats Wizard Slow

Post by ssax »

This might make it easier, run this command from the slow one:

Code: Select all

time php -n -d curl.so -d dom.so -d fileinfo.so -d gd.so -d imap.so -d json.so -d ldap.so -d mbstring.so -d mcrypt.so -d mssql.so -d mysqli.so -d mysql.so -d pdo_dblib.so -d pdo.so -d pdo_mysql.so -d pdo_pgsql.so -d pdo_sqlite.so -d pgsql.so -d phar.so -d posix.so -d snmp.so -d sqlite3.so -d ssh2.so -d sysvmsg.so -d sysvsem.so -d sysvshm.so -d wddx.so -d xmlreader.so -d xmlwriter.so -d xsl.so -d zip.so /usr/local/nagios/libexec/check_nagios_performance.php ahc15
Then remove one of the -d NAME.so entries and run it again, keep doing it until you find out which one is causing the slowness.

Then only other way I know would be for you to remove them from

Code: Select all

/etc/php.d
one by one but that will affect your web server as well.
Locked