More logging adjustments and improvements. (0.21.1)
This commit is contained in:
parent
ac99346ac9
commit
4f30af83db
9 changed files with 75 additions and 49 deletions
|
|
@ -9,15 +9,15 @@ import os
|
|||
|
||||
|
||||
# TODO: check for all required configuration options and set defaults if needed. do this only for
|
||||
# options in the "linspector" section of linspector.ini.
|
||||
# options in the "linspector" section of linspector.conf.
|
||||
class Configuration:
|
||||
def __init__(self, configuration_path, log):
|
||||
self.__configuration = configparser.ConfigParser()
|
||||
self.__configuration_path = configuration_path
|
||||
self.__log = log
|
||||
|
||||
# print('[linspector] reading configuration file: ' + configuration_path +
|
||||
# '/linspector.conf')
|
||||
log.info('message=reading configuration configfile=' + configuration_path +
|
||||
'/linspector.conf')
|
||||
if os.path.isfile(configuration_path + '/linspector.conf'):
|
||||
try:
|
||||
self.__configuration.read(configuration_path + '/linspector.conf', 'utf-8')
|
||||
|
|
|
|||
|
|
@ -99,11 +99,12 @@ class Linspector:
|
|||
|
||||
if configuration.get_option('linspector', 'timezone'):
|
||||
timezone = configuration.get_option('linspector', 'timezone')
|
||||
if monitors.get(monitor).get_monitor_configuration_option('args', 'timezone'):
|
||||
timezone = monitors.get(monitor).get_monitor_configuration_option('args',
|
||||
if monitors.get(monitor).get_monitor_configuration_option('monitor', 'timezone'):
|
||||
timezone = monitors.get(monitor).get_monitor_configuration_option('monitor',
|
||||
'timezone')
|
||||
else:
|
||||
timezone = 'UTC'
|
||||
# set to local system timezone by as default
|
||||
timezone = datetime.datetime.now(datetime.timezone.utc).astimezone().tzname()
|
||||
|
||||
# add cron and one time run jobs to Linspector. not only "interval" jobs should be
|
||||
# supported.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue