diff --git a/examples/minimal.json b/examples/minimal.json index f831165..b64f217 100644 --- a/examples/minimal.json +++ b/examples/minimal.json @@ -13,8 +13,8 @@ "members":{ "root":{ "name": "root", - "_tasks": [ - { "class":"jabber", "type": "jabber", "args": { "rcpt": "hanez@systemchaos.org" }} + "tasks": [ + { "class":"mail", "type": "jabber", "args": { "rcpt": "hanez@systemchaos.org" }} ] } }, @@ -25,10 +25,10 @@ }, "hostgroups":{ "a":{ - "members": ["hanez"], + "members": ["root"], "hosts": [ "a", "b", "c", "d", "e"], "services":[ - { "class": "dummy", "args": { "sleep": 1, "fail": 1 }, "periods": ["fast"], "threshold": 3 }, + { "class": "dummy", "args": { "sleep": 1, "fail": 1 }, "periods": ["fast"], "threshold": 1 } ] } }, diff --git a/linspector/tasks/TaskList.py b/linspector/tasks/TaskList.py index 2e8c5d4..de0fe4e 100644 --- a/linspector/tasks/TaskList.py +++ b/linspector/tasks/TaskList.py @@ -30,7 +30,7 @@ class TaskList(object): for taskInfo in taskInfos: task = self.find_task_by_name(taskInfo["class"]) if task: - task.execute(taskInfo["args"]) + task.execute(msg, taskInfo["args"]) diff --git a/linspector/tasks/mail.py b/linspector/tasks/mail.py index 773e63c..48fae5c 100644 --- a/linspector/tasks/mail.py +++ b/linspector/tasks/mail.py @@ -54,7 +54,6 @@ class MailTask(Task): def execute(self, msg, taskArgs): if "recipient" not in taskArgs: raise "could not execute Mail Task! No recipient given!" - message = MIMEText(msg) message['Subject'] = msg now = datetime.datetime.now()