Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yverry opened this issue Oct 16, 2016 · 0 comments · Fixed by #8292
Closed

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

yverry opened this issue Oct 16, 2016 · 0 comments · Fixed by #8292
Labels
bug unexpected problem or unintended behavior

Comments

@yverry
Copy link

yverry commented Oct 16, 2016

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

@sparrc sparrc added the bug unexpected problem or unintended behavior label Oct 17, 2016
@sparrc sparrc added this to the Future Milestone milestone Oct 17, 2016
@danielnelson danielnelson removed this from the Future Milestone milestone Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants