diff --git a/linspector/core/job.py b/linspector/core/job.py index 62c85d9..9735907 100644 --- a/linspector/core/job.py +++ b/linspector/core/job.py @@ -78,18 +78,17 @@ class Job: self.jobIndex = 0 self.jobInfos[self.jobIndex] = jobInfo - def handle_threshold(self, jobInfo, serviceThreshold, executionSucessful): if executionSucessful: if self.jobThreshold > 0: #TODO: maybe set threshold_handling for each service optionally; will override core setting! if self.core["threshold_handling"] == "reset": # Reset counter to 0 - self.log.debug("Threshold Reset") + logger.debug("Threshold Reset") self.jobThreshold = 0 else: # Decrement the counter (default) - self.log.debug("Threshold Decrement") + logger.debug("Threshold Decrement") self.jobThreshold -= 1 else: self.jobThreshold += 1 @@ -102,7 +101,6 @@ class Job: for member in self.members: self.taskList.execute_task_infos(jobInfo.get_message(), member.get_tasks()) - def handle_call(self): logger.debug("handle call") logger.debug(self.service) diff --git a/linspector/tasks/mail.py b/linspector/tasks/mail.py index 48fae5c..81fbeb0 100644 --- a/linspector/tasks/mail.py +++ b/linspector/tasks/mail.py @@ -54,15 +54,17 @@ class MailTask(Task): def execute(self, msg, taskArgs): if "recipient" not in taskArgs: raise "could not execute Mail Task! No recipient given!" + + logger.debug("Eecuting Task!") + message = MIMEText(msg) message['Subject'] = msg now = datetime.datetime.now() message['Date'] = now.strftime("%a, %d %b %Y %H:%M:%S") - #TODO: totally unstable just to use values from core. make checks before...! message['From'] = self.fromName message['To'] = taskArgs["recipient"] s = smtplib.SMTP(self.host, self.port) - s.login(self.userName, self.password) + #s.login(self.userName, self.password) s.sendmail(self.fromName, taskArgs["recipient"], message.as_string()) s.quit() diff --git a/linspector/tasks/task.py b/linspector/tasks/task.py index fd5a962..6e014fc 100644 --- a/linspector/tasks/task.py +++ b/linspector/tasks/task.py @@ -61,6 +61,7 @@ class TaskList(object): for taskInfo in taskInfos: task = self.find_task_by_name(taskInfo["class"]) if task: + logger.debug("Starting Task Execution...") task.execute(msg, taskInfo["args"]) except: pass