From 2e8ed699bbce55e57d3ccd3d026a3c5ac6a80b54 Mon Sep 17 00:00:00 2001 From: Chriz Date: Thu, 25 May 2023 20:05:23 +0200 Subject: [PATCH] Add files via upload caching issue fixed --- opnsense_checkmk_agent.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/opnsense_checkmk_agent.py b/opnsense_checkmk_agent.py index ca43ac5..249fc4d 100644 --- a/opnsense_checkmk_agent.py +++ b/opnsense_checkmk_agent.py @@ -27,7 +27,7 @@ ## * smartdisk - install the mkp from https://github.com/bashclub/checkmk-smart plugins os-smart ## * squid - install the mkp from https://exchange.checkmk.com/p/squid and forwarder -> listen on loopback active -__VERSION__ = "1.0.3" +__VERSION__ = "1.0.4" import sys import os @@ -217,7 +217,10 @@ class checkmk_checker(object): except: _cachetime = 0 try: - _lines.append(self._run_cache_prog(_plugin_file,_cachetime)) + if _cachetime > 0: + _lines.append(self._run_cache_prog(_plugin_file,_cachetime)) + else: + _lines.append(self._run_prog(_plugin_file)) except: _errors.append(traceback.format_exc()) @@ -241,7 +244,10 @@ class checkmk_checker(object): except: _cachetime = 0 try: - _lines.append(self._run_cache_prog(_local_file,_cachetime)) + if _cachetime > 0: + _lines.append(self._run_cache_prog(_local_file,_cachetime)) + else: + _lines.append(self._run_prog(_local_file)) except: _errors.append(traceback.format_exc())