summaryrefslogtreecommitdiffstats
path: root/python.d/freeradius.chart.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:19:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:20:17 +0000
commita64a253794ac64cb40befee54db53bde17dd0d49 (patch)
treec1024acc5f6e508814b944d99f112259bb28b1be /python.d/freeradius.chart.py
parentNew upstream version 1.10.0+dfsg (diff)
downloadnetdata-upstream/1.11.0+dfsg.tar.xz
netdata-upstream/1.11.0+dfsg.zip
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--collectors/python.d.plugin/freeradius/freeradius.chart.py (renamed from python.d/freeradius.chart.py)24
1 files changed, 14 insertions, 10 deletions
diff --git a/python.d/freeradius.chart.py b/collectors/python.d.plugin/freeradius/freeradius.chart.py
index 3acc58d1a..3126831b7 100644
--- a/python.d/freeradius.chart.py
+++ b/collectors/python.d.plugin/freeradius/freeradius.chart.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Description: freeradius netdata python.d module
# Author: l2isbad
+# SPDX-License-Identifier: GPL-3.0-or-later
from re import findall
from subprocess import Popen, PIPE
@@ -20,7 +21,7 @@ ORDER = ['authentication', 'accounting', 'proxy-auth', 'proxy-acct']
CHARTS = {
'authentication': {
- 'options': [None, "Authentication", "packets/s", 'Authentication', 'freerad.auth', 'line'],
+ 'options': [None, 'Authentication', 'packets/s', 'Authentication', 'freerad.auth', 'line'],
'lines': [
['access-accepts', None, 'incremental'],
['access-rejects', None, 'incremental'],
@@ -29,9 +30,10 @@ CHARTS = {
['auth-invalid-requests', 'invalid-requests', 'incremental'],
['auth-malformed-requests', 'malformed-requests', 'incremental'],
['auth-unknown-types', 'unknown-types', 'incremental']
- ]},
+ ]
+ },
'accounting': {
- 'options': [None, "Accounting", "packets/s", 'Accounting', 'freerad.acct', 'line'],
+ 'options': [None, 'Accounting', 'packets/s', 'Accounting', 'freerad.acct', 'line'],
'lines': [
['accounting-requests', 'requests', 'incremental'],
['accounting-responses', 'responses', 'incremental'],
@@ -40,9 +42,10 @@ CHARTS = {
['acct-invalid-requests', 'invalid-requests', 'incremental'],
['acct-malformed-requests', 'malformed-requests', 'incremental'],
['acct-unknown-types', 'unknown-types', 'incremental']
- ]},
+ ]
+ },
'proxy-auth': {
- 'options': [None, "Proxy Authentication", "packets/s", 'Authentication', 'freerad.proxy.auth', 'line'],
+ 'options': [None, 'Proxy Authentication', 'packets/s', 'Authentication', 'freerad.proxy.auth', 'line'],
'lines': [
['proxy-access-accepts', 'access-accepts', 'incremental'],
['proxy-access-rejects', 'access-rejects', 'incremental'],
@@ -51,9 +54,10 @@ CHARTS = {
['proxy-auth-invalid-requests', 'invalid-requests', 'incremental'],
['proxy-auth-malformed-requests', 'malformed-requests', 'incremental'],
['proxy-auth-unknown-types', 'unknown-types', 'incremental']
- ]},
+ ]
+ },
'proxy-acct': {
- 'options': [None, "Proxy Accounting", "packets/s", 'Accounting', 'freerad.proxy.acct', 'line'],
+ 'options': [None, 'Proxy Accounting', 'packets/s', 'Accounting', 'freerad.proxy.acct', 'line'],
'lines': [
['proxy-accounting-requests', 'requests', 'incremental'],
['proxy-accounting-responses', 'responses', 'incremental'],
@@ -62,8 +66,8 @@ CHARTS = {
['proxy-acct-invalid-requests', 'invalid-requests', 'incremental'],
['proxy-acct-malformed-requests', 'malformed-requests', 'incremental'],
['proxy-acct-unknown-types', 'unknown-types', 'incremental']
- ]}
-
+ ]
+ }
}
@@ -105,7 +109,7 @@ class Service(SimpleService):
"""
result = self._get_raw_data()
return dict([(elem[0].lower(), int(elem[1])) for elem in findall(r'((?<=-)[AP][a-zA-Z-]+) = (\d+)', result)])
-
+
def _get_raw_data(self):
"""
The following code is equivalent to