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/haproxy/README.md | 20 +++++++++++++++++--- collectors/python.d.plugin/haproxy/haproxy.chart.py | 7 ++----- 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'collectors/python.d.plugin/haproxy') diff --git a/collectors/python.d.plugin/haproxy/README.md b/collectors/python.d.plugin/haproxy/README.md index c4bb0447e..33d34f1ad 100644 --- a/collectors/python.d.plugin/haproxy/README.md +++ b/collectors/python.d.plugin/haproxy/README.md @@ -1,6 +1,12 @@ -# haproxy + -Module monitors frontend and backend metrics such as bytes in, bytes out, sessions current, sessions in queue current. +# HAProxy monitoring with Netdata + +Monitors frontend and backend metrics such as bytes in, bytes out, sessions current, sessions in queue current. And health metrics such as backend servers status (server check should be used). Plugin can obtain data from url **OR** unix socket. @@ -28,7 +34,15 @@ It produces: - number of failed servers for every backend (in DOWN state) -## configuration +## Configuration + +Edit the `python.d/haproxy.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/haproxy.conf +``` Sample: diff --git a/collectors/python.d.plugin/haproxy/haproxy.chart.py b/collectors/python.d.plugin/haproxy/haproxy.chart.py index 8df712943..6f94c9a07 100644 --- a/collectors/python.d.plugin/haproxy/haproxy.chart.py +++ b/collectors/python.d.plugin/haproxy/haproxy.chart.py @@ -179,7 +179,6 @@ CHARTS = { } } - METRICS = { 'bin': {'algorithm': 'incremental', 'divisor': 1024}, 'bout': {'algorithm': 'incremental', 'divisor': 1024}, @@ -193,7 +192,6 @@ METRICS = { 'hrsp_other': {'algorithm': 'incremental', 'divisor': 1} } - BACKEND_METRICS = { 'qtime': {'algorithm': 'absolute', 'divisor': 1}, 'ctime': {'algorithm': 'absolute', 'divisor': 1}, @@ -201,7 +199,6 @@ BACKEND_METRICS = { 'ttime': {'algorithm': 'absolute', 'divisor': 1} } - REGEX = dict(url=re_compile(r'idle = (?P[0-9]+)'), socket=re_compile(r'Idle_pct: (?P[0-9]+)')) @@ -309,7 +306,7 @@ class Service(UrlService, SocketService): name, METRICS[metric]['algorithm'], 1, METRICS[metric]['divisor']]) self.definitions['fhrsp_total']['lines'].append(['_'.join(['frontend', 'hrsp_total', idx]), - name, 'incremental', 1, 1]) + name, 'incremental', 1, 1]) for back in self.data['backend']: name, idx = back['# pxname'], back['# pxname'].replace('.', '_') for metric in METRICS: @@ -317,7 +314,7 @@ class Service(UrlService, SocketService): name, METRICS[metric]['algorithm'], 1, METRICS[metric]['divisor']]) self.definitions['bhrsp_total']['lines'].append(['_'.join(['backend', 'hrsp_total', idx]), - name, 'incremental', 1, 1]) + name, 'incremental', 1, 1]) for metric in BACKEND_METRICS: self.definitions['b' + metric]['lines'].append(['_'.join(['backend', metric, idx]), name, BACKEND_METRICS[metric]['algorithm'], 1, -- cgit v1.2.3