PHP-FPMのrawデータ取得が失敗する
以下の構成です。デフォルトテンプレートのPHP-FPMのrawデータ取得をしようとしていますが、404エラーで失敗します。
何か分かるひとはいないでしょうか。
・Alma Linux/9.4
・Zabbix/6.0.31
・MySQL/8.0.36
・PHP-fpm/8.2.13
・Apache/2.4.57
・該当アイテム
PHP-FPM: Get status page
web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]
・エラー内容
Preprocessing failed for: HTTP/1.1 404 Not Found..Connection: close..Content-Length: 196..Content-Type: text/html; charset=...
1. Failed: cannot perform regular expression "^[.\s\S]*({.+})" match for value of type "string": pattern does not match
TNK - 投稿数: 4754
アクセスしているパスが正しいか、想定しているリクエストが
Webサーバー側に届いているか確認してみてください。
Yasumi - 投稿数: 380
ありがとうございます。
コマンドを実行してみたところ、下記のエラーが返ってきました。
=====================================================
[root@ZBX01 php-fpm.d]# zabbix_get -s xxx.xxx.xxx.xxx -k 'web.page.get["xxx.xxx.xxx.xxx,"ping","80"]'
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 196
Content-Type: text/html; charset=iso-8859-1
Date: Wed, 26 Jun 2024 00:59:21 GMT
Server: Apache/2.4.57 (AlmaLinux)
404 Not Found
Not Found
The requested URL was not found on this server.
=====================================================
類似例だと、下記の記事と同様の事案にも思えますが、HTTP/1.1を使ってアイテムデータを取得することは叶わないのでしょうか。。。
https://qiita.com/krhitoshi/items/507c67fb34fd62ca95a0
TNK - 投稿数: 4754
Webサーバー側に取得したいURLでアクセスできるのか設定を確認し
てください。
404エラーになっているようなので、/pingにアクセスする設定が
Webサーバー側に設定無いか設定に誤りがある可能性があります。
Zabbixで確認する前に、Webブラウザやcurlコマンドなどでアクセ
スできるか確認されましたか?
Yasumi - 投稿数: 380
ありがとうございます。
基本的な知識に不足していたのですが、下記を参照することで進展できました。
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/ph...
=====================================================
[root@ZBX01 php-fpm.d]# curl -L 127.0.0.1/status
pool: www
process manager: dynamic
start time: 26/Jun/2024:14:37:19 +0900
start since: 494
accepted conn: 6
listen queue: 0
max listen queue: 0
listen queue len: 0
idle processes: 4
active processes: 1
total processes: 5
max active processes: 1
max children reached: 0
slow requests: 0
=====================================================
しかしこれって、/etc/php-fpm.d/www.confではなくzabbix.confで許可するのが正ですかね…?
そのあたりの説明が参照先にも記載されていないので、よく分からず。。。