This commit is contained in:
Kekskurse 2019-12-30 18:30:26 +01:00
parent 6be7149779
commit 32a065ed57
1 changed files with 16 additions and 0 deletions

16
monitors/ufw.py Normal file
View File

@ -0,0 +1,16 @@
import os
import psutil
class UFW:
interval = 60;
loopCount = 100
def __init__(self, exporter):
self.exporter = exporter
def run(self):
stream = os.popen('ufw status | grep "Status: active" | wc -l')
output = stream.read()
self.exporter.gauge("ufw.status", int(output))
stream = os.popen('ufw status | grep -E '^[0-9]' | wc -l')
output = stream.read()
self.exporter.gauge("ufw.rules", int(output))