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
Test for existing http response header #16662
Test for existing http response header #16662
Comments
Implemented in netdata/go.d.plugin#1451 Example configurations# "value" is a pattern, syntax: https://github.com/netdata/go.d.plugin/tree/master/pkg/matcher#supported-format
jobs:
# The "X-Robots-Tag" header must be present in the HTTP response header,
# but the value of the header does not matter.
# This config checks for the presence of the header regardless of its value.
- name: local
url: http://127.0.0.1:8080
header_match:
- key: X-Robots-Tag
# The "X-Robots-Tag" header must be present in the HTTP response header
# only if its value is equal to "noindex, nofollow".
# This config checks both the presence of the header and its value.
- name: local
url: http://127.0.0.1:8080
header_match:
- key: X-Robots-Tag
value: '= noindex,nofollow'
# The "X-Robots-Tag" header must not be present in the HTTP response header
# but the value of the header does not matter.
# This config checks for the presence of the header regardless of its value.
- name: local
url: http://127.0.0.1:8080
header_match:
- key: X-Robots-Tag
exclude: yes
# The "X-Robots-Tag" header must not be present in the HTTP response header
# only if its value is equal to "noindex, nofollow".
# This config checks both the presence of the header and its value.
- name: local
url: http://127.0.0.1:8080
header_match:
- key: X-Robots-Tag
exclude: yes
value: '= noindex,nofollow'
If you think I need to adjust something, feel free to comment. It will be in the nightly release later this week. |
Hey, this is really cool. Can't wait to test it! We will report. |
Should be available in today's nightly release (tomorrow). |
Thank you - is the new feature part of httpcheck? Should the config go into httpcheck.conf? |
Yes, see configuration examples in #16662 (comment). |
This issue has been mentioned on the Netdata Community Forums. There might be relevant details there: |
@ilyam8 It works, but without alert notification. www-example-com does not have a x-robot--tag header.
The chart shows a line at the 0 level. Expectation is to receive an alter notification. What do you think? |
@kingfisher77 you are right, I forgot to add the alert. Added in #16736. |
Hi @ilyam8 The change in health.d/httpcheck.conf did not yet arrived. We are on v1.44.0-148-nightly. health.d/httpcheck.conf is still from 28.11. Do we miss something? |
Are you using custom |
I understand. Sorry for not thinking twice. I did indeed have a health.d/httpcheck.conf with no changes of my own. Maybe to try something out. Will keep an eye on the new feature now! |
The space between the "=" and the value "noindex,nofollow" was too much in our case. If we remove it, it works:
And: in our case there is no space between noindex and nofollow. |
Hi @ilyam8 The job runs every 60 seconds. There is another job for the same URL. Is there possibly a connection with two jobs on the same URL?
Debug:
Alert email:
|
We run a curl on the domain and the header in a loop every 2 seconds and get no error message. |
It is this alert - timeout on request, no unexpected headers. netdata/health/health.d/httpcheck.conf Lines 60 to 73 in a3d5e6c
The default timeout is 1 second, you can increase it using the |
Ok. Thank you. |
Problem
We would like to test for the existence of a http response header.
Description
http response header like "x-robots-tag: noindex,nofollow" could be tested e.g. for websites which should not be indexed by search engines.
Importance
Important to have
Value proposition
The quality of an automated application deployment also depends on the existence of http response headers. With this function in Netdata, this quality level can be better measured.
Proposed implementation
Feature could be implemented as an addition to HTTP Endpoints.
The text was updated successfully, but these errors were encountered: