I’ve set up my php-fpm status in /status. I’m having problems collecting this information with php-fpm_exporter using a tcp connection.
My stack: Docker(aws ecs ec2) + Nginx+php-fpm
php-fpm-exporter errors
www.conf
<code>[pool]
listen = 0.0.0.0:9000
...
pm.status_path = /status
</code>
<code>[pool]
listen = 0.0.0.0:9000
...
pm.status_path = /status
</code>
[pool]
listen = 0.0.0.0:9000
...
pm.status_path = /status
default.conf
<code>server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
if ($http_x_forwarded_proto = 'http') {
return 301 https://$host$request_uri;
}
index index.php index.html index.htm default.html default.htm;
location /_upload/s3/ {
try_files $uri $uri/ /_upload/s3/get.php?$args;
}
error_page 500 /errors/500.php;
error_page 404 /errors/404.php;
error_page 403 /errors/perm.php;
autoindex off;
location ~ [^/].php(/|$) {
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
}
location /v2 {
try_files $uri $uri/ /v2/index.html;
}
location /status {
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
</code>
<code>server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
if ($http_x_forwarded_proto = 'http') {
return 301 https://$host$request_uri;
}
index index.php index.html index.htm default.html default.htm;
location /_upload/s3/ {
try_files $uri $uri/ /_upload/s3/get.php?$args;
}
error_page 500 /errors/500.php;
error_page 404 /errors/404.php;
error_page 403 /errors/perm.php;
autoindex off;
location ~ [^/].php(/|$) {
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
}
location /v2 {
try_files $uri $uri/ /v2/index.html;
}
location /status {
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
</code>
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
if ($http_x_forwarded_proto = 'http') {
return 301 https://$host$request_uri;
}
index index.php index.html index.htm default.html default.htm;
location /_upload/s3/ {
try_files $uri $uri/ /_upload/s3/get.php?$args;
}
error_page 500 /errors/500.php;
error_page 404 /errors/404.php;
error_page 403 /errors/perm.php;
autoindex off;
location ~ [^/].php(/|$) {
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
}
location /v2 {
try_files $uri $uri/ /v2/index.html;
}
location /status {
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
When I access <ip>/status
I have access to the status.
return 1
When I access <ip>:9000/status
I get a connection refused message
return 2
Notes:
- The same logic applies to the browser and internal ip.
- I need the connection to be made via IP, because the exporter runs on another server and connects to the docker application via IP.
New contributor
juan ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.