Bug fixes. There are still more in monitor.py!
This commit is contained in:
parent
2178452f39
commit
70e59f571c
4 changed files with 13 additions and 12 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
error_receivers = admin@example.com
|
error_receivers = admin@example.com
|
||||||
log_file = ~/code/linspector/linspector/log/linspector.log
|
log_file = ~/code/linspector/linspector/log/linspector.log
|
||||||
; available log levels are: "error", "warning", "info" and "debug".
|
; available log levels are: "error", "warning", "info" and "debug".
|
||||||
log_level= x
|
log_level= debug
|
||||||
log_count = 5
|
log_count = 5
|
||||||
log_size = 10485760
|
log_size = 10485760
|
||||||
pid_file = /var/run/user/1000/linspector.pid
|
pid_file = /var/run/user/1000/linspector.pid
|
||||||
|
|
|
||||||
|
|
@ -209,26 +209,26 @@ class Monitor:
|
||||||
self.last_execution = MonitorExecution(self.get_host())
|
self.last_execution = MonitorExecution(self.get_host())
|
||||||
self.service.execute(self.last_execution)
|
self.service.execute(self.last_execution)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
log.debug('debug', err)
|
log('error', err)
|
||||||
|
|
||||||
self.last_execution.set_execution_end()
|
#self.last_execution.set_execution_end()
|
||||||
|
|
||||||
self.handle_threshold(self.service.get_threshold(),
|
#self.handle_threshold(self.service.get_threshold(),
|
||||||
self.last_execution.was_successful())
|
# self.last_execution.was_successful())
|
||||||
|
|
||||||
#log.info("Job " + self.get_job_id() +
|
#log.info("Job " + self.get_job_id() +
|
||||||
# ", Code: " + str(self.last_execution.get_error_code()) +
|
# ", Code: " + str(self.last_execution.get_error_code()) +
|
||||||
# ", Message: " + str(self.last_execution.get_message()))
|
# ", Message: " + str(self.last_execution.get_message()))
|
||||||
|
|
||||||
self.monitor_information.set_response_message(
|
#self.monitor_information.set_response_message(
|
||||||
self.last_execution.get_response_message(self))
|
# self.last_execution.get_response_message(self))
|
||||||
|
|
||||||
self.handle_tasks(self.monitor_information)
|
#self.handle_tasks(self.monitor_information)
|
||||||
else:
|
else:
|
||||||
log('info', "job " + self.get_job_id() + " disabled")
|
log('info', "job " + self.get_job_id() + " disabled")
|
||||||
|
|
||||||
#def get_host(self):
|
def get_host(self):
|
||||||
# return self.host
|
return self.host
|
||||||
|
|
||||||
def get_hostgroups(self):
|
def get_hostgroups(self):
|
||||||
return self.hostgroups
|
return self.hostgroups
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,6 @@ class DummyService(Service):
|
||||||
self.__kwargs = kwargs
|
self.__kwargs = kwargs
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
log('debug', 'dummy object @' + str(self) + str(self.__kwargs['foo']))
|
log('debug', 'dummy object @' + str(self))
|
||||||
|
#log('debug', 'dummy object @' + str(self) + str(self.__kwargs['foo']))
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,5 @@ class FritzboxUplinkService(Service):
|
||||||
self.__kwargs = kwargs
|
self.__kwargs = kwargs
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
log('debug', __name__, 'fritzboxuplink object @' + str(self))
|
log('debug', 'fritzboxuplink object @' + str(self))
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue