From a8220ab2d293bb7f4b014b79d16b2fb05090fa93 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Feb 2021 12:45:55 +0100 Subject: Adding upstream version 1.29.0. Signed-off-by: Daniel Baumann --- collectors/python.d.plugin/httpcheck/README.md | 22 ++++++++++++++++++---- .../python.d.plugin/httpcheck/httpcheck.chart.py | 3 ++- .../python.d.plugin/httpcheck/httpcheck.conf | 3 +++ 3 files changed, 23 insertions(+), 5 deletions(-) (limited to 'collectors/python.d.plugin/httpcheck') diff --git a/collectors/python.d.plugin/httpcheck/README.md b/collectors/python.d.plugin/httpcheck/README.md index 99b28cfeb..55aad52f0 100644 --- a/collectors/python.d.plugin/httpcheck/README.md +++ b/collectors/python.d.plugin/httpcheck/README.md @@ -1,6 +1,12 @@ -# httpcheck + -Module monitors remote http server for availability and response time. +# HTTP endpoint monitoring with Netdata + +Monitors remote http server for availability and response time. Following charts are drawn per job: @@ -17,7 +23,15 @@ Following charts are drawn per job: - Connection failed: port not listening or blocked - Connection timed out: host or port unreachable -## configuration +## Configuration + +Edit the `python.d/httpcheck.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config python.d/httpcheck.conf +``` Sample configuration and their default values. @@ -32,7 +46,7 @@ server: redirect: yes # optional ``` -### notes +### Notes - The status chart is primarily intended for alarms, badges or for access via API. - A system/service/firewall might block Netdata's access if a portscan or diff --git a/collectors/python.d.plugin/httpcheck/httpcheck.chart.py b/collectors/python.d.plugin/httpcheck/httpcheck.chart.py index fd51370da..75718bb60 100644 --- a/collectors/python.d.plugin/httpcheck/httpcheck.chart.py +++ b/collectors/python.d.plugin/httpcheck/httpcheck.chart.py @@ -3,9 +3,10 @@ # Original Author: ccremer (github.com/ccremer) # SPDX-License-Identifier: GPL-3.0-or-later -import urllib3 import re +import urllib3 + try: from time import monotonic as time except ImportError: diff --git a/collectors/python.d.plugin/httpcheck/httpcheck.conf b/collectors/python.d.plugin/httpcheck/httpcheck.conf index 1e1dd0205..95adba270 100644 --- a/collectors/python.d.plugin/httpcheck/httpcheck.conf +++ b/collectors/python.d.plugin/httpcheck/httpcheck.conf @@ -70,9 +70,12 @@ chart_cleanup: 0 # url: 'http[s]://host-ip-or-dns[:port][path]' # # [required] the remote host url to connect to. If [:port] is missing, it defaults to 80 # # for HTTP and 443 for HTTPS. [path] is optional too, defaults to / +# header: {'Content-Type': 'application/json'} +# # [optional] the HTTP header sent with the request. # method: GET # [optional] the HTTP request method (POST, PUT, DELETE, HEAD etc.) # redirect: yes # [optional] If the remote host returns 3xx status codes, the redirection url will be # # followed (default). +# body: {'key': 'value'} # [optional] the body sent with the request (e.g. POST, PUT, PATCH). # status_accepted: # [optional] By default, 200 is accepted. Anything else will result in 'bad status' in the # # status chart, however: The response time will still be > 0, since the # # host responded with something. -- cgit v1.2.3