diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
commit | c21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /collectors/python.d.plugin/haproxy | |
parent | Adding upstream version 1.43.2. (diff) | |
download | netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.tar.xz netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.zip |
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/haproxy')
-rw-r--r-- | collectors/python.d.plugin/haproxy/haproxy.chart.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/collectors/python.d.plugin/haproxy/haproxy.chart.py b/collectors/python.d.plugin/haproxy/haproxy.chart.py index 6f94c9a07..f412febb7 100644 --- a/collectors/python.d.plugin/haproxy/haproxy.chart.py +++ b/collectors/python.d.plugin/haproxy/haproxy.chart.py @@ -44,6 +44,7 @@ ORDER = [ 'bctime', 'health_sup', 'health_sdown', + 'health_smaint', 'health_bdown', 'health_idle' ] @@ -167,6 +168,10 @@ CHARTS = { 'options': [None, 'Backend Servers In UP State', 'health servers', 'health', 'haproxy_hs.up', 'line'], 'lines': [] }, + 'health_smaint': { + 'options': [None, 'Backend Servers In MAINT State', 'maintenance servers', 'health', 'haproxy_hs.maint', 'line'], + 'lines': [] + }, 'health_bdown': { 'options': [None, 'Is Backend Failed?', 'boolean', 'health', 'haproxy_hb.down', 'line'], 'lines': [] @@ -267,6 +272,8 @@ class Service(UrlService, SocketService): if server_status(server, name, 'UP')]) stat_data['hsdown_' + idx] = len([server for server in self.data['servers'] if server_status(server, name, 'DOWN')]) + stat_data['hsmaint_' + idx] = len([server for server in self.data['servers'] + if server_status(server, name, 'MAINT')]) stat_data['hbdown_' + idx] = 1 if backend.get('status') == 'DOWN' else 0 for metric in BACKEND_METRICS: stat_data['_'.join(['backend', metric, idx])] = backend.get(metric) or 0 @@ -321,6 +328,7 @@ class Service(UrlService, SocketService): BACKEND_METRICS[metric]['divisor']]) self.definitions['health_sup']['lines'].append(['hsup_' + idx, name, 'absolute']) self.definitions['health_sdown']['lines'].append(['hsdown_' + idx, name, 'absolute']) + self.definitions['health_smaint']['lines'].append(['hsmaint_' + idx, name, 'absolute']) self.definitions['health_bdown']['lines'].append(['hbdown_' + idx, name, 'absolute']) @@ -352,7 +360,7 @@ def parse_data_(data): def server_status(server, backend_name, status='DOWN'): - return server.get('# pxname') == backend_name and server.get('status') == status + return server.get('# pxname') == backend_name and server.get('status').partition(' ')[0] == status def url_remove_params(url): |