环境:centos 7.5、zabbix3.4、通过percona 监控mysql
[root@tslave tools]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh nj /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh: line 35: /usr/bin/php: No such file or directory ERROR: run the command manually to investigate the problem: /usr/bin/php -q /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php --host 192.168.1.18 --items gg [root@tslave tools]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gw /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh: line 35: /usr/bin/php: No such file or directory ERROR: run the command manually to investigate the problem: /usr/bin/php -q /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php --host 192.168.1.18 --items gg [root@tslave tools]# yum -y install php php-mysql--安装依赖包 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile base | 3.6 kB 00:00:00 ceph | 2.9 kB 00:00:00 ceph-noarch | 2.9 kB 00:00:00 epel | 3.2 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/2): epel/x86_64/updateinfo | 929 kB 00:00:00 (2/2): epel/x86_64/primary | 3.5 MB 00:00:00 epel 12604/12604 Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:5.4.16-45.el7 will be installed --> Processing Dependency: php-cli(x86-64) = 5.4.16-45.el7 for package: php-5.4.16-45.el7.x86_64 --> Processing Dependency: httpd-mmn = 20120211x8664 for package: php-5.4.16-45.el7.x86_64 --> Processing Dependency: httpd for package: php-5.4.16-45.el7.x86_64 ---> Package php-mysql.x86_64 0:5.4.16-45.el7 will be installed --> Processing Dependency: php-pdo(x86-64) = 5.4.16-45.el7 for package: php-mysql-5.4.16-45.el7.x86_64 --> Running transaction check ---> Package httpd.x86_64 0:2.4.6-80.el7.centos will be installed --> Processing Dependency: httpd-tools = 2.4.6-80.el7.centos for package: httpd-2.4.6-80.el7.centos.x86_64 --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-80.el7.centos.x86_64 --> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-80.el7.centos.x86_64 --> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-80.el7.centos.x86_64 ---> Package php-cli.x86_64 0:5.4.16-45.el7 will be installed ---> Package php-pdo.x86_64 0:5.4.16-45.el7 will be installed --> Running transaction check ---> Package apr.x86_64 0:1.4.8-3.el7_4.1 will be installed ---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed ---> Package httpd-tools.x86_64 0:2.4.6-80.el7.centos will be installed ---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================= Installing: php x86_64 5.4.16-45.el7 base 1.4 M php-mysql x86_64 5.4.16-45.el7 base 101 k Installing for dependencies: apr x86_64 1.4.8-3.el7_4.1 base 103 k apr-util x86_64 1.5.2-6.el7 base 92 k httpd x86_64 2.4.6-80.el7.centos base 2.7 M httpd-tools x86_64 2.4.6-80.el7.centos base 89 k mailcap noarch 2.1.41-2.el7 base 31 k php-cli x86_64 5.4.16-45.el7 base 2.7 M php-pdo x86_64 5.4.16-45.el7 base 99 k Transaction Summary ============================================================================================================================================================= Install 2 Packages (+7 Dependent packages) Total download size: 7.3 M Installed size: 24 M Downloading packages: (1/9): apr-1.4.8-3.el7_4.1.x86_64.rpm | 103 kB 00:00:00 (2/9): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:00 (3/9): httpd-tools-2.4.6-80.el7.centos.x86_64.rpm | 89 kB 00:00:00 (4/9): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00 (5/9): httpd-2.4.6-80.el7.centos.x86_64.rpm | 2.7 MB 00:00:00 (6/9): php-5.4.16-45.el7.x86_64.rpm | 1.4 MB 00:00:00 (7/9): php-mysql-5.4.16-45.el7.x86_64.rpm | 101 kB 00:00:00 (8/9): php-pdo-5.4.16-45.el7.x86_64.rpm | 99 kB 00:00:00 (9/9): php-cli-5.4.16-45.el7.x86_64.rpm | 2.7 MB 00:00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 6.1 MB/s | 7.3 MB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : apr-1.4.8-3.el7_4.1.x86_64 1/9 Installing : apr-util-1.5.2-6.el7.x86_64 2/9 Installing : httpd-tools-2.4.6-80.el7.centos.x86_64 3/9 Installing : php-pdo-5.4.16-45.el7.x86_64 4/9 Installing : php-cli-5.4.16-45.el7.x86_64 5/9 Installing : mailcap-2.1.41-2.el7.noarch 6/9 Installing : httpd-2.4.6-80.el7.centos.x86_64 7/9 Installing : php-5.4.16-45.el7.x86_64 8/9 Installing : php-mysql-5.4.16-45.el7.x86_64 9/9 Verifying : php-5.4.16-45.el7.x86_64 1/9 Verifying : mailcap-2.1.41-2.el7.noarch 2/9 Verifying : php-cli-5.4.16-45.el7.x86_64 3/9 Verifying : apr-util-1.5.2-6.el7.x86_64 4/9 Verifying : httpd-2.4.6-80.el7.centos.x86_64 5/9 Verifying : php-pdo-5.4.16-45.el7.x86_64 6/9 Verifying : php-mysql-5.4.16-45.el7.x86_64 7/9 Verifying : httpd-tools-2.4.6-80.el7.centos.x86_64 8/9 Verifying : apr-1.4.8-3.el7_4.1.x86_64 9/9 Installed: php.x86_64 0:5.4.16-45.el7 php-mysql.x86_64 0:5.4.16-45.el7 Dependency Installed: apr.x86_64 0:1.4.8-3.el7_4.1 apr-util.x86_64 0:1.5.2-6.el7 httpd.x86_64 0:2.4.6-80.el7.centos httpd-tools.x86_64 0:2.4.6-80.el7.centos mailcap.noarch 0:2.1.41-2.el7 php-cli.x86_64 0:5.4.16-45.el7 php-pdo.x86_64 0:5.4.16-45.el7 Complete! [root@tslave tools]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh nj Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory 0 [root@tslave tools]# yum -y install opcache.so Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile No package opcache.so available. Error: Nothing to do [root@tslave tools]# yum install php-opcache -y --安装php-opcache Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package php-pecl-zendopcache.x86_64 0:7.0.5-2.el7 will be installed --> Processing Dependency: /usr/bin/pecl for package: php-pecl-zendopcache-7.0.5-2.el7.x86_64 --> Processing Dependency: /usr/bin/pecl for package: php-pecl-zendopcache-7.0.5-2.el7.x86_64 --> Running transaction check ---> Package php-pear.noarch 1:1.9.4-21.el7 will be installed --> Processing Dependency: php-xml for package: 1:php-pear-1.9.4-21.el7.noarch --> Processing Dependency: php-posix for package: 1:php-pear-1.9.4-21.el7.noarch --> Running transaction check ---> Package php-process.x86_64 0:5.4.16-45.el7 will be installed ---> Package php-xml.x86_64 0:5.4.16-45.el7 will be installed --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml-5.4.16-45.el7.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php-xml-5.4.16-45.el7.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml-5.4.16-45.el7.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml-5.4.16-45.el7.x86_64 --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml-5.4.16-45.el7.x86_64 --> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml-5.4.16-45.el7.x86_64 --> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml-5.4.16-45.el7.x86_64 --> Running transaction check ---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================= Installing: php-pecl-zendopcache x86_64 7.0.5-2.el7 epel 74 k Installing for dependencies: libxslt x86_64 1.1.28-5.el7 base 242 k php-pear noarch 1:1.9.4-21.el7 base 357 k php-process x86_64 5.4.16-45.el7 base 56 k php-xml x86_64 5.4.16-45.el7 base 126 k Transaction Summary ============================================================================================================================================================= Install 1 Package (+4 Dependent packages) Total download size: 855 k Installed size: 3.2 M Downloading packages: (1/5): php-pear-1.9.4-21.el7.noarch.rpm | 357 kB 00:00:00 (2/5): php-pecl-zendopcache-7.0.5-2.el7.x86_64.rpm | 74 kB 00:00:00 (3/5): php-process-5.4.16-45.el7.x86_64.rpm | 56 kB 00:00:00 (4/5): libxslt-1.1.28-5.el7.x86_64.rpm | 242 kB 00:00:00 (5/5): php-xml-5.4.16-45.el7.x86_64.rpm | 126 kB 00:00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 2.4 MB/s | 855 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : php-process-5.4.16-45.el7.x86_64 1/5 Installing : libxslt-1.1.28-5.el7.x86_64 2/5 Installing : php-xml-5.4.16-45.el7.x86_64 3/5 Installing : 1:php-pear-1.9.4-21.el7.noarch 4/5 Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory Installing : php-pecl-zendopcache-7.0.5-2.el7.x86_64 5/5 Failed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory PHP Warning: popen() has been disabled for security reasons in /usr/share/pear/OS/Guess.php on line 242 PHP Warning: fgets() expects parameter 1 to be resource, null given in /usr/share/pear/OS/Guess.php on line 243 PHP Warning: pclose() expects parameter 1 to be resource, null given in /usr/share/pear/OS/Guess.php on line 252 Verifying : php-pecl-zendopcache-7.0.5-2.el7.x86_64 1/5 Verifying : libxslt-1.1.28-5.el7.x86_64 2/5 Verifying : php-process-5.4.16-45.el7.x86_64 3/5 Verifying : php-xml-5.4.16-45.el7.x86_64 4/5 Verifying : 1:php-pear-1.9.4-21.el7.noarch 5/5 Installed: php-pecl-zendopcache.x86_64 0:7.0.5-2.el7 Dependency Installed: libxslt.x86_64 0:1.1.28-5.el7 php-pear.noarch 1:1.9.4-21.el7 php-process.x86_64 0:5.4.16-45.el7 php-xml.x86_64 0:5.4.16-45.el7 Complete! [root@tslave tools]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh nj 0 [root@tslave tools]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gw 93030 [root@tslave tools]#