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

poll_http_status_healthy_above & poll_http_status_healthy_below not working ? #98

Closed
mathieudebrito opened this issue Sep 10, 2021 · 3 comments

Comments

@mathieudebrito
Copy link

mathieudebrito commented Sep 10, 2021

Hi guys !

I use poll_http_status_healthy_below & poll_http_status_healthy_above to check for a 401 to be the right response status for my-website.com. (my-website.com is protected behind an .htaccess, that's why I look for a 401)

Here is my config file :

[[probe.service.node]]
id = "my-website.com"
label = "my-website.com"
mode = "poll"
poll_http_status_healthy_above = 400
poll_http_status_healthy_below = 403
replicas = ["https://my-website.com/"]

Vigil logs are :

pooling idle connection for ("https", my-website.com) 
(DEBUG) - response '401 Unauthorized' for https://my-website.com/?1631287140
(DEBUG) - prober poll result received for http target: https://my-website.com/?1631287140 with status: 401
(DEBUG) - will probe replica: HTTPS("https://my-website.com/") with retry count: 2
(DEBUG) - prober poll will fire for http target: https://my-website.com/?1631287140 with method: Head and body: ''
(DEBUG) - reuse idle connection for ("https", my-website.com) 
(DEBUG) - flushed 121 bytes 
(DEBUG) - parsed 5 headers 
(DEBUG) - incoming body is empty 
(DEBUG) - pooling idle connection for ("https", my-website.com) 
(DEBUG) - response '401 Unauthorized' for https://my-website.com/?1631287140
(DEBUG) - prober poll result received for http target: https://my-website.com/?1631287140 with status: 401
(DEBUG) - replica probe result: sites:my-website.com:https://my-website.com/ => Dead

And my status page is show red as you can imagine.
Is it a bug on your side ? Or did I miss a specific setting ?
I followed the documentation.

Best regards,
Sincerely

@valeriansaliou
Copy link
Owner

Hello,

By default, Vigil performs an HTTP HEAD. Your server probably does not respond with the same status code for HTTP HEAD requests.

You can try forcing an HTTP GET by adding, just below your other http_ configurations, the following rule:

http_method = "GET"

Let me know if that works.

@mathieudebrito
Copy link
Author

mathieudebrito commented Sep 10, 2021 via email

@valeriansaliou
Copy link
Owner

valeriansaliou commented Sep 10, 2021

Ah snap sorry, forgot about these ones, what defines an healthy status code should go in the common "metrics" section, see:

https://github.com/valeriansaliou/vigil/blob/master/config.cfg#L36

Those cannot be configured per-node. http_method, though, should go within the [[probe.service.node]] section.

Vigil does not panic if you enter extraneous configuration keys somewhere, it only panics if it recognizes a key and its format is invalid, or the key is not set when it is required.

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