Skip to content

inputs: php-fpm url scheme handle '?' #1906

@yverry

Description

@yverry

Hi,

telegraf inputs phpfpm doesn't handle '?' char.
In my nginx setup the pool name is a variable like:

# PHP-FPM Monitoring section
    set $pool "default";
    if ($arg_pool) {
            set $pool $arg_pool;
    }

    location ~ "/fpm-(status|ping)" {
        include       /etc/nginx/fastcgi_params;
        fastcgi_pass  unix:/var/run/php-fpm_$pool.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
         ....
    }

with this config you can call the pool name directly with:

http://localhost/fpm-status?pool=<mysuperpoolname>

Relevant telegraf.conf:

put in your config to use phpfpm inputs like :

[phpfpm]
  urls = ["http://localhost/fpm-status?pool=pool0","http://localhost/fpm-status?pool=pool1"]

System info:

telegraf 1.0.1

Expected behavior:

127.0.0.1 - - [16/Oct/2016:22:39:00 +0200] "GET /fpm-status?pool=pool0 HTTP/1.1" 200 215 "-" "Go-http-client/1.1"
127.0.0.1 - - [16/Oct/2016:22:39:00 +0200] "GET /fpm-status?pool=pool1 HTTP/1.1" 200 206 "-" "Go-http-client/1.1"

Actual behavior:

127.0.0.1 - - [16/Oct/2016:22:26:00 +0200] "GET /fpm-status HTTP/1.1" 502 166 "-" "Go-http-client/1.1"
127.0.0.1 - - [16/Oct/2016:22:26:00 +0200] "GET /fpm-status HTTP/1.1" 502 166 "-" "Go-http-client/1.1"

Workaround

I replace '?' with %3F like:

[phpfpm]
  urls = ["http://localhost/fpm-status%3Fpool=pool0","http://localhost/fpm-status%3Fpool=pool1"]

Regards,
Yann

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions