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

[apps::haproxy::web::plugin] - Cannot decode response (add --debug option to display returned content) #5458

Open
FranckLANTZ opened this issue Feb 20, 2025 · 2 comments

Comments

@FranckLANTZ
Copy link

Hello,
I'm trying to use this plugin, but it seems that it can't decode the response. In debug mode I can clearly see the html code with all the backends without any particular error message.

command sample
/usr/lib/centreon/plugins//centreon_haproxy_web.pl --plugin=apps::haproxy::web::plugin --mode=backend-usage --hostname='xxx' --port='xxx' --proto='http' --username='xxx' --password='xxx' --filter-name='.*' --verbose --credentials --basic --debug

response begin

Authorization: Basic ==
Content-Type:application/json
Accept:application/json

=> Recv header: HTTP/1.1 200 OK
=> Recv header: Cache-Control: no-cache
=> Recv header: Content-Type: text/html
=> Recv header: Transfer-Encoding: chunked
=> Recv header:
=> Recv data: 001c2f

Perhaps it's because response is chunked, but I can find any parameter to change it.

Any idea ?

Best regards,

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

I have the feeling that the response is not being retrieved because it is in Content-Type: text/html and Content-Type:application/json.
To compare, you can check the behaviour of the HAPRoxy demo with the following command:

 perl centreon_plugins.pl --plugin=apps::haproxy::web::plugin  --hostname='demo.haproxy.org' --port='80' --urlpath='/;json' --mode=backend-usage --debug

@FranckLANTZ
Copy link
Author

Thank you,

With the '/;json' parameter on the demo website, it works.

Will try to reconfigure stat part of my LB to add a application/json header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants