summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/varnish/varnish.chart.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/python.d.plugin/varnish/varnish.chart.py (renamed from python.d/varnish.chart.py)29
1 files changed, 20 insertions, 9 deletions
diff --git a/python.d/varnish.chart.py b/collectors/python.d.plugin/varnish/varnish.chart.py
index d8145c0b6..d889c2b33 100644
--- a/python.d/varnish.chart.py
+++ b/collectors/python.d.plugin/varnish/varnish.chart.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Description: varnish netdata python.d module
# Author: l2isbad
+# SPDX-License-Identifier: GPL-3.0-or-later
import re
@@ -12,13 +13,22 @@ from bases.FrameworkServices.ExecutableService import ExecutableService
priority = 60000
retries = 60
-ORDER = ['session_connections', 'client_requests',
- 'all_time_hit_rate', 'current_poll_hit_rate', 'cached_objects_expired', 'cached_objects_nuked',
- 'threads_total', 'threads_statistics', 'threads_queue_len',
- 'backend_connections', 'backend_requests',
- 'esi_statistics',
- 'memory_usage',
- 'uptime']
+ORDER = [
+ 'session_connections',
+ 'client_requests',
+ 'all_time_hit_rate',
+ 'current_poll_hit_rate',
+ 'cached_objects_expired',
+ 'cached_objects_nuked',
+ 'threads_total',
+ 'threads_statistics',
+ 'threads_queue_len',
+ 'backend_connections',
+ 'backend_requests',
+ 'esi_statistics',
+ 'memory_usage',
+ 'uptime'
+]
CHARTS = {
'session_connections': {
@@ -213,8 +223,9 @@ class Service(ExecutableService):
data.update(dict((param, value) for _, param, value in server_stats))
- data['memory_allocated'] = data['s0.g_bytes']
- data['memory_free'] = data['s0.g_space']
+ # varnish 5 uses default.g_bytes and default.g_space
+ data['memory_allocated'] = data.get('s0.g_bytes') or data.get('default.g_bytes')
+ data['memory_free'] = data.get('s0.g_space') or data.get('default.g_space')
return data