前提
個人開発のWebサイトを監視するために、zabbixを立ち上げたいと思っています。
実現したいこと
Zabbixのエラー解消
発生している問題・エラーメッセージ
ダッシュボード画面上には、「Zabbixサーバーの起動:いいえ」となっています。
エラーメッセージです。
fsockopen(): Unable to connect to localhost:10051 (��³����ݤ���ޤ���) [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() → make_status_of_zbx() → get_status() → CZabbixServer->isRunning() → CZabbixServer->request() → CZabbixServer->connect() → fsockopen() in include/classes/server/CZabbixServer.php:577]
サービスとしては正常に起動しているようでした。
# systemctl status zabbix-server ● zabbix-server.service - Zabbix Server with MySQL DB Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; bad; vendor preset: disabled) Active: active (running) since Sat 2022-09-17 14:31:43 JST; 3min 1s ago Main PID: 192381 (zabbix_server) Tasks: 1 (limit: 4648) Memory: 2.4M CPU: 39ms CGroup: /system.slice/zabbix-server.service └─192381 /usr/sbin/zabbix_server -f 9月 17 14:31:43 192-168-2-123 systemd[1]: Started Zabbix Server with MySQL DB.
zabbixサーバログを確認する限りでは、データベースに接続できていないことになっています。
# tail -f zabbix_server.log 192252:20220917:143143.957 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 192252:20220917:143143.957 database is down: reconnecting in 10 seconds 192252:20220917:143143.974 Got signal [signal:15(SIGTERM),sender_pid:1,sender_uid:0,reason:0]. Exiting ... 192252:20220917:143143.974 Zabbix Server stopped. Zabbix 6.0.5 (revision 8da3e1f8419). 192381:20220917:143144.046 Starting Zabbix Server. Zabbix 6.0.5 (revision 8da3e1f8419). 192381:20220917:143144.046 ****** Enabled features ****** 192381:20220917:143144.046 SNMP monitoring: YES 192381:20220917:143144.046 IPMI monitoring: YES 192381:20220917:143144.053 Web monitoring: YES 192381:20220917:143144.053 VMware monitoring: YES 192381:20220917:143144.053 SMTP authentication: YES 192381:20220917:143144.053 ODBC: YES 192381:20220917:143144.053 SSH support: YES 192381:20220917:143144.053 IPv6 support: YES 192381:20220917:143144.053 TLS support: YES 192381:20220917:143144.053 ****************************** 192381:20220917:143144.053 using configuration file: /etc/zabbix_server.conf 192381:20220917:143144.099 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) 192381:20220917:143144.099 database is down: reconnecting in 10 seconds
mysql上には「zabbix」ユーザが存在しています。
mysql> select user, host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | django | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | | zabbix | localhost | +------------------+-----------+ 6 rows in set (0.03 sec) mysql> select * from mysql.user where user='zabbix'\G; *************************** 1. row *************************** Host: localhost User: zabbix Select_priv: N Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: N Grant_priv: N References_priv: N Index_priv: N Alter_priv: N Show_db_priv: N Super_priv: N Create_tmp_table_priv: N Lock_tables_priv: N Execute_priv: N Repl_slave_priv: N Repl_client_priv: N Create_view_priv: N Show_view_priv: N Create_routine_priv: N Alter_routine_priv: N Create_user_priv: N Event_priv: N Trigger_priv: N Create_tablespace_priv: N ssl_type: ssl_cipher: 0x x509_issuer: 0x x509_subject: 0x max_questions: 0 max_updates: 0 max_connections: 0 max_user_connections: 0 plugin: caching_sha2_password authentication_string: XXXX(マスクします) password_expired: N password_last_changed: 2022-09-15 00:35:33 password_lifetime: NULL account_locked: N Create_role_priv: N Drop_role_priv: N Password_reuse_history: NULL Password_reuse_time: NULL Password_require_current: NULL User_attributes: NULL 1 row in set (0.00 sec) mysql> show grants for zabbix@localhost; +------------------------------------------------------------+ | Grants for zabbix@localhost | +------------------------------------------------------------+ | GRANT USAGE ON *.* TO `zabbix`@`localhost` | | GRANT ALL PRIVILEGES ON `zabbix`.* TO `zabbix`@`localhost` | +------------------------------------------------------------+ 2 rows in set (0.00 sec)
該当のソースコード
zabbix設定は下記の通りです。
# cat zabbix.conf.php <?php // Zabbix GUI configuration file. $DB['TYPE'] = 'MYSQL'; $DB['SERVER'] = 'localhost'; $DB['PORT'] = '0'; $DB['DATABASE'] = 'zabbix'; $DB['USER'] = 'zabbix'; $DB['PASSWORD'] = 'password'; // Schema name. Used for PostgreSQL. $DB['SCHEMA'] = ''; // Used for TLS connection. $DB['ENCRYPTION'] = false; $DB['KEY_FILE'] = ''; $DB['CERT_FILE'] = ''; $DB['CA_FILE'] = ''; $DB['VERIFY_HOST'] = false; $DB['CIPHER_LIST'] = ''; // Vault configuration. Used if database credentials are stored in Vault secrets manager. $DB['VAULT_URL'] = ''; $DB['VAULT_DB_PATH'] = ''; $DB['VAULT_TOKEN'] = ''; // Use IEEE754 compatible value range for 64-bit Numeric (float) history values. // This option is enabled by default for new Zabbix installations. // For upgraded installations, please read database upgrade notes before enabling this option. $DB['DOUBLE_IEEE754'] = true; $ZBX_SERVER = 'localhost'; $ZBX_SERVER_PORT = '10051'; $ZBX_SERVER_NAME = ''; $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
SELinuxは無効にしています。
# getenforce Disabled
ファイアーウォールは、許可しています。
# firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: eth0 sources: services: dhcpv6-client http https ssh ports: 10050/tcp 10051/tcp protocols: forward: yes masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
試したこと
$ZBX_SERVERの値を、下記に書き得ることを試しましたが改善はありませんでした。
- 127.0.0.1
- 独自ドメイン
補足情報(FW/ツールのバージョンなど)
システム構成
- Conoha VPS Server
- Cent Stream 9
- Nginx
- Mysql
- Zabbix
各種バージョン
# cat /etc/redhat-release CentOS Stream release 9
# zabbix_server -V zabbix_server (Zabbix) 6.0.5 Revision 8da3e1f8419 30 May 2022, compilation time: May 31 2022 00:00:00 Copyright (C) 2022 Zabbix SIA License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it according to the license. There is NO WARRANTY, to the extent permitted by law. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). Compiled with OpenSSL 3.0.1 14 Dec 2021 Running with OpenSSL 3.0.1 14 Dec 2021
# mysql --version mysql Ver 8.0.30 for Linux on x86_64 (Source distribution)
# php-fpm -v PHP 8.0.20 (fpm-fcgi) (built: Jun 8 2022 00:33:06) Copyright (c) The PHP Group Zend Engine v4.0.20, Copyright (c) Zend Technologies
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/09/19 14:18