openvpn plugin: ignore UNDEF clients
VPNable committed
May 19, 2018 at 00:45 UTC
a482a0f086f68521d1669b7bb4934846cd158a95
1 file changed
+4
-2
python.d/ovpn_status_log.chart.py
+4
-2
@@ -107,8 +107,10 @@ class Service(SimpleService):
107
108
data = dict(users=0, bytes_in=0, bytes_out=0)
109
for row in raw_data:
110
- row = ' '.join(row.split(',')) if ',' in row else ' '.join(row.split())
111
- match = self.regex['tls'].search(row)
110
+ columns = row.split(',') if ',' in row else row.split()
111
+ if columns[0] == 'UNDEF': continue # see https://openvpn.net/archive/openvpn-users/2004-08/msg00116.html
112
+
113
+ match = self.regex['tls'].search(' '.join(columns))
114
if match:
115
match = match.groupdict()
116
data['users'] += 1