Page 2 of 3

Re: Nagios Stats Wizard Slow

Posted: Mon Aug 17, 2020 2:15 am
by andyb4u
I tailed /var/log/httpd/error_log and ran the PHP script but nothing showed up in the log.

Re: Nagios Stats Wizard Slow

Posted: Mon Aug 17, 2020 6:01 pm
by ssax
What version of PHP are they both running?

Code: Select all

php -v
rpm -qa | grep php

Re: Nagios Stats Wizard Slow

Posted: Tue Aug 18, 2020 1:49 am
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.

Re: Nagios Stats Wizard Slow

Posted: Wed Aug 19, 2020 9:28 am
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

Re: Nagios Stats Wizard Slow

Posted: Thu Aug 20, 2020 2:16 am
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

Re: Nagios Stats Wizard Slow

Posted: Thu Aug 20, 2020 2:22 pm
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.

Re: Nagios Stats Wizard Slow

Posted: Mon Aug 24, 2020 5:06 am
by andyb4u
Hi,

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

Code: Select all

php -i

Re: Nagios Stats Wizard Slow

Posted: Mon Aug 24, 2020 10:05 am
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.

Re: Nagios Stats Wizard Slow

Posted: Tue Aug 25, 2020 2:04 am
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

Re: Nagios Stats Wizard Slow

Posted: Tue Aug 25, 2020 5:15 pm
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.