Some more logging stuff.
This commit is contained in:
parent
af4d26ea80
commit
5d99640480
3 changed files with 19 additions and 6 deletions
|
|
@ -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
|
# i currently only increase the 3rd number because the goal is that 0.20.* will become the first
|
||||||
# stable version.
|
# stable version.
|
||||||
__version__ = '0.19.33.dev1'
|
__version__ = '0.19.34.dev1'
|
||||||
__author__ = 'Johannes Findeisen <you@hanez.org>'
|
__author__ = 'Johannes Findeisen <you@hanez.org>'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
; required options:
|
; required options:
|
||||||
[monitor]
|
[monitor]
|
||||||
; The description must not but should be a unique description of the monitor for better identifying it in the database
|
; The description must not but should be a unique description of the monitor for better identifying it in the datastore
|
||||||
; if a data storage tasks is being used.
|
; if a task is being used.
|
||||||
description = Cable Provider
|
description = Cable Provider
|
||||||
service = net.fritzboxuplink
|
service = net.fritzboxuplink
|
||||||
hosts = 192.168.0.1,192.168.23.24,@group1,@testgroup1
|
hosts = 192.168.0.1,192.168.23.24,@group1,@testgroup1
|
||||||
|
|
|
||||||
|
|
@ -29,19 +29,32 @@ class Monitor:
|
||||||
str(err))
|
str(err))
|
||||||
try:
|
try:
|
||||||
self.__interval = int(configuration.get_option('linspector', 'default_interval'))
|
self.__interval = int(configuration.get_option('linspector', 'default_interval'))
|
||||||
log('warning', 'set default_interval as per configuration to core with '
|
log('warning', 'set default_interval as per core configuration with '
|
||||||
'identifier ' + identifier + ' to: ' + str(self.__interval))
|
'identifier: ' + identifier + ' to: ' + str(self.__interval))
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
log('warning', 'no default_interval found in core configuration for identifier ' +
|
log('warning', 'no default_interval found in core configuration for identifier ' +
|
||||||
identifier + ', set to default interval 300 seconds. error: ' + str(err))
|
identifier + ', set to default interval 300 seconds. error: ' + str(err))
|
||||||
# default interval is 300 seconds (5 minutes) if not set in the monitor
|
# default interval is 300 seconds (5 minutes) if not set in the monitor
|
||||||
# configuration args or a default_interval in the core configuration.
|
# configuration args or a default_interval in the core configuration.
|
||||||
self.__interval = 300
|
self.__interval = 300
|
||||||
|
|
||||||
self.__log = log
|
self.__log = log
|
||||||
self.__monitor_configuration = monitor_configuration
|
self.__monitor_configuration = monitor_configuration
|
||||||
self.__notification_list = []
|
self.__notification_list = []
|
||||||
self.__notifications = notifications
|
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.__services = services
|
||||||
self.__task_list = [] # put tasks for the dedicated job here.
|
self.__task_list = [] # put tasks for the dedicated job here.
|
||||||
self.__tasks = tasks
|
self.__tasks = tasks
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue