Update opnsense_checkmk_agent.py

deleted comments
This commit is contained in:
spiritbreaker22 2023-06-08 09:38:31 +02:00 committed by GitHub
parent 2e8cb29319
commit 3a3283d53c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -978,7 +978,7 @@ class checkmk_checker(object):
def checklocal_ipsec_new(self): def checklocal_ipsec_new(self):
_ret =[] _ret =[]
try: try:
_swanctl_config = self._config_reader().get("OPNsense").get("Swanctl").get("Connections") #.get("Connection") _swanctl_config = self._config_reader().get("OPNsense").get("Swanctl").get("Connections")
if type(_swanctl_config) != dict: if type(_swanctl_config) != dict:
return [] return []
except: except:
@ -996,10 +996,7 @@ class checkmk_checker(object):
_json_data = {} _json_data = {}
for _connection in _connections_config: for _connection in _connections_config:
_uuid = _connection.get("@uuid","") _uuid = _connection.get("@uuid","")
_remote = _connection.get("remote_addrs")
_name = _connection.get("description") _name = _connection.get("description")
#_ret.append( "Connection: '%s' rem: '%s' uuid: '%s'" % (_name,_remote,_uuid) )
#continue
if len(_name.strip()) < 1: if len(_name.strip()) < 1:
_name = _connection.get("remote_addrs") _name = _connection.get("remote_addrs")
_condata = _json_data.get(f"{_uuid}",{}) _condata = _json_data.get(f"{_uuid}",{})