mirror of
https://github.com/bashclub/check-opnsense.git
synced 2024-12-25 16:20:12 +01:00
Update opnsense_checkmk_agent.py
This commit is contained in:
parent
602562e1a5
commit
fe69f8d975
@ -263,7 +263,12 @@ class checkmk_checker(object):
|
|||||||
def check_openvpn(self):
|
def check_openvpn(self):
|
||||||
_ret = [""]
|
_ret = [""]
|
||||||
_cfr = self._config_reader().get("openvpn")
|
_cfr = self._config_reader().get("openvpn")
|
||||||
|
if type(_cfr) != dict:
|
||||||
|
return _ret
|
||||||
|
try:
|
||||||
_monitored_clients = dict(map(lambda x: (x.get("common_name").upper(),dict(x,current=[])),_cfr.get("openvpn-csc")))
|
_monitored_clients = dict(map(lambda x: (x.get("common_name").upper(),dict(x,current=[])),_cfr.get("openvpn-csc")))
|
||||||
|
except:
|
||||||
|
_monitored_clients = {}
|
||||||
_now = time.time()
|
_now = time.time()
|
||||||
for _server in _cfr.get("openvpn-server",[]):
|
for _server in _cfr.get("openvpn-server",[]):
|
||||||
_server["name"] = _server.get("description") if _server.get("description") else "OpenVPN_{protocoll}_{local_port}".format(**_server)
|
_server["name"] = _server.get("description") if _server.get("description") else "OpenVPN_{protocoll}_{local_port}".format(**_server)
|
||||||
|
Loading…
Reference in New Issue
Block a user