telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

nginx plugin missing server value

Open ojan opened this issue 11 years ago • 6 comments

Hello,

With Telegraf 0.15 and InfluxDB 0.9.3 RC1, when i activate the nginx plugin with this configuration

[nginx]
urls = ["http://nginx-01/nginx_status"]

I get this response with telegraf -config /etc/opt/telegraf/telegraf.conf -test

> [server=""] nginx_active value=48
> [server=""] nginx_accepts value=1985
> [server=""] nginx_handled value=1985
> [server=""] nginx_requests value=2640
> [server=""] nginx_reading value=0
> [server=""] nginx_writing value=1
> [server=""] nginx_waiting value=47

And then find in the telegraf.log

Error in plugins: unable to parse 'nginx_active,host=nginx-01,server= value=33i': missing tag value

Bug or misconfiguration on my side ?

ojan avatar Aug 20 '15 15:08 ojan

Looks like a bug to me, I'll look into it

@ojan in the meantime, try removing http:// from your url like below and see if that gives you a valid server tag.

[nginx]
urls = ["nginx-01/nginx_status"]

sparrc avatar Aug 20 '15 16:08 sparrc

nevermind, the issue is due to not catching an error from net.SplitHostPort, I'll have a PR up soon

sparrc avatar Aug 20 '15 16:08 sparrc

@ojan the solution will be to add a port to your url, I believe this should work:

[nginx]
urls = ["http://nginx-01:80/nginx_status"]

sparrc avatar Aug 20 '15 16:08 sparrc

the solution will be to add a port to your url, I believe this should work

Works for me. thanks for the workaround

ojan avatar Aug 20 '15 17:08 ojan

Same problem here:

Error in plugins: unable to parse 'nginx_active,host=localhost.localdomain,server= value=23i': missing tag value

Same solution:

[nginx]
urls = ["http://localhost:80/nginx_status"]

skynet avatar Aug 21 '15 03:08 skynet

Closing this issue, the fix is in 0.1.6, thanks for the report!

sparrc avatar Aug 24 '15 16:08 sparrc