diff --git a/agent_based/checkpoint_fw_ls.py b/agent_based/checkpoint_fw_ls.py index 6aeda580de8ec0afefb0271d0cdc9fd6e9b38cac..5319ef1b55838a37eaf1684def36c57d38690175 100644 --- a/agent_based/checkpoint_fw_ls.py +++ b/agent_based/checkpoint_fw_ls.py @@ -117,31 +117,33 @@ _fwLocalLoggingStat = { } -def parse_checkpoint_fw_ls(string_table: List[StringTable]) -> Dict: - if string_table != [[], []]: - over_all, log_servers = string_table - +def parse_checkpoint_fw_ls(string_table: List[StringTable]) -> Optional[Dict]: + over_all, log_servers = string_table + try: fwlsconnoverall, fwlsconnoveralldesc, fwlocalloggingdesc, fwlocalloggingstat, fwlocalloggingwriterate, \ fwlogginghandlingrate = over_all[0] - parsed = {} - parsed.update({'over all': CheckPointFwLsOverAll( - fwlsconnoverall=int(fwlsconnoverall), - fwlsconnoveralldesc=fwlsconnoveralldesc, - fwlocalloggingdesc=fwlocalloggingdesc, - fwlocalloggingstat=int(fwlocalloggingstat), - fwLocalLoggingWriteRate=int(fwlocalloggingwriterate) if fwlocalloggingwriterate.isdigit() else None, - fwLoggingHandlingRate=int(fwlogginghandlingrate) if fwlogginghandlingrate.isdigit() else None, + except (IndexError, ValueError): + return + + parsed = {} + parsed.update({'over all': CheckPointFwLsOverAll( + fwlsconnoverall=int(fwlsconnoverall), + fwlsconnoveralldesc=fwlsconnoveralldesc, + fwlocalloggingdesc=fwlocalloggingdesc, + fwlocalloggingstat=int(fwlocalloggingstat), + fwLocalLoggingWriteRate=int(fwlocalloggingwriterate) if fwlocalloggingwriterate.isdigit() else None, + fwLoggingHandlingRate=int(fwlogginghandlingrate) if fwlogginghandlingrate.isdigit() else None, + )}) + + for fwLSConnIndex, fwLSConnName, fwLSConnState, fwLSConnStateDesc, fwLSConnSendRate in log_servers: + parsed.update({fwLSConnName: CheckPointFwLs( + fwLSConnIndex=int(fwLSConnIndex), + fwLSConnName=fwLSConnName, + fwLSConnState=int(fwLSConnState), + fwLSConnStateDesc=fwLSConnStateDesc, + fwLSConnSendRate=int(fwLSConnSendRate) if fwLSConnSendRate.isdigit() else None, )}) - for fwLSConnIndex, fwLSConnName, fwLSConnState, fwLSConnStateDesc, fwLSConnSendRate in log_servers: - parsed.update({fwLSConnName: CheckPointFwLs( - fwLSConnIndex=int(fwLSConnIndex), - fwLSConnName=fwLSConnName, - fwLSConnState=int(fwLSConnState), - fwLSConnStateDesc=fwLSConnStateDesc, - fwLSConnSendRate=int(fwLSConnSendRate) if fwLSConnSendRate.isdigit() else None, - )}) - return parsed diff --git a/agent_based/checkpoint_fwm_ls.py b/agent_based/checkpoint_fwm_ls.py index 52d12ee9c44a8cc7d6b905ecb4087243b078798d..57b01eb8809cbf7090f968ebad1e90c88d42eca7 100644 --- a/agent_based/checkpoint_fwm_ls.py +++ b/agent_based/checkpoint_fwm_ls.py @@ -191,9 +191,7 @@ def parse_checkpoint_fwm_ls(string_table: List[StringTable]) -> Optional[CheckPo try: lsvermajor, lsverminor, lsbuildnumber, lsfwmisalive, lsstatcode, lsstatshortdescr, \ lsstatlongdescr = string_table[0][0] - except IndexError: - return - except ValueError: + except (IndexError, ValueError): return checkpointfwmr77 = CheckPointFwmR77( diff --git a/checkpoint_log_server.mkp b/checkpoint_log_server.mkp index 918dc91f4e23aea816ee80dd39b0ce14dec287e5..22ff9234a6d976dbb9507f2131b2c591a189f036 100644 Binary files a/checkpoint_log_server.mkp and b/checkpoint_log_server.mkp differ diff --git a/packages/checkpoint_log_server b/packages/checkpoint_log_server index 423b8342426557ea1f32dad0bfaa2fc96eb9f0d0..103a1dd82815015053948bb4da11c2afc7b3e6a4 100644 --- a/packages/checkpoint_log_server +++ b/packages/checkpoint_log_server @@ -13,5 +13,5 @@ 'title': 'Check Point Log service status', 'version': '20210816.v0.2b', 'version.min_required': '2.0.0', - 'version.packaged': '2021.07.14', + 'version.packaged': '2021.09.20', 'version.usable_until': None} \ No newline at end of file diff --git a/web/plugins/wato/checkpoint_fw_ls.py b/web/plugins/wato/checkpoint_fw_ls.py index 765f189c90000da54a94819437d4320a6e6ff756..a0405d0545f99cc8b94f98a25d1c764d8ca3347b 100644 --- a/web/plugins/wato/checkpoint_fw_ls.py +++ b/web/plugins/wato/checkpoint_fw_ls.py @@ -10,7 +10,6 @@ from cmk.gui.i18n import _ from cmk.gui.valuespec import ( Dictionary, TextAscii, - FixedValue, MonitoringState, DropdownChoice, )