diff --git a/bin/linspector b/bin/linspector index 327c654..f45626b 100755 --- a/bin/linspector +++ b/bin/linspector @@ -37,7 +37,7 @@ logger = logging.getLogger('linspector') # i currently only increase the 3rd number because the goal is that 0.20.* will become the first # stable version. -__version__ = '0.19.33.dev1' +__version__ = '0.19.34.dev1' __author__ = 'Johannes Findeisen ' diff --git a/etc/monitors/network1/gateway.conf b/etc/monitors/network1/gateway.conf index c8adc13..b350b24 100644 --- a/etc/monitors/network1/gateway.conf +++ b/etc/monitors/network1/gateway.conf @@ -1,7 +1,7 @@ ; required options: [monitor] -; The description must not but should be a unique description of the monitor for better identifying it in the database -; if a data storage tasks is being used. +; The description must not but should be a unique description of the monitor for better identifying it in the datastore +; if a task is being used. description = Cable Provider service = net.fritzboxuplink hosts = 192.168.0.1,192.168.23.24,@group1,@testgroup1 diff --git a/linspector/core/monitor.py b/linspector/core/monitor.py index 39030ff..60f59f8 100644 --- a/linspector/core/monitor.py +++ b/linspector/core/monitor.py @@ -29,19 +29,32 @@ class Monitor: str(err)) try: self.__interval = int(configuration.get_option('linspector', 'default_interval')) - log('warning', 'set default_interval as per configuration to core with ' - 'identifier ' + identifier + ' to: ' + str(self.__interval)) + log('warning', 'set default_interval as per core configuration with ' + 'identifier: ' + identifier + ' to: ' + str(self.__interval)) except Exception as err: log('warning', 'no default_interval found in core configuration for identifier ' + identifier + ', set to default interval 300 seconds. error: ' + str(err)) # default interval is 300 seconds (5 minutes) if not set in the monitor # configuration args or a default_interval in the core configuration. self.__interval = 300 + self.__log = log self.__monitor_configuration = monitor_configuration self.__notification_list = [] self.__notifications = notifications - self.__service = monitor_configuration.get('monitor', 'service') + try: + self.__service = monitor_configuration.get('monitor', 'service') + except Exception as err: + # if no service is set in the monitor configuration, the service is set to misc.dummy + # instead. just to make Linspector run but with no real result. + log('debug', 'no service set for identifier: ' + identifier + ' setting to ' + 'misc.dummy as ' + 'default to ensure ' + 'Linspector will run. ' + 'error: ' + str(err)) + + self.__service = 'misc.dummy' + self.__services = services self.__task_list = [] # put tasks for the dedicated job here. self.__tasks = tasks