UFW
This commit is contained in:
parent
6be7149779
commit
32a065ed57
1 changed files with 16 additions and 0 deletions
16
monitors/ufw.py
Normal file
16
monitors/ufw.py
Normal 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))
|
Loading…
Reference in a new issue