corrected backend-check
This commit is contained in:
parent
b8ec2a9e40
commit
a977ea2c07
3 changed files with 5 additions and 6 deletions
|
|
@ -13,8 +13,8 @@
|
||||||
"members":{
|
"members":{
|
||||||
"root":{
|
"root":{
|
||||||
"name": "root",
|
"name": "root",
|
||||||
"_tasks": [
|
"tasks": [
|
||||||
{ "class":"jabber", "type": "jabber", "args": { "rcpt": "hanez@systemchaos.org" }}
|
{ "class":"mail", "type": "jabber", "args": { "rcpt": "hanez@systemchaos.org" }}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -25,10 +25,10 @@
|
||||||
},
|
},
|
||||||
"hostgroups":{
|
"hostgroups":{
|
||||||
"a":{
|
"a":{
|
||||||
"members": ["hanez"],
|
"members": ["root"],
|
||||||
"hosts": [ "a", "b", "c", "d", "e"],
|
"hosts": [ "a", "b", "c", "d", "e"],
|
||||||
"services":[
|
"services":[
|
||||||
{ "class": "dummy", "args": { "sleep": 1, "fail": 1 }, "periods": ["fast"], "threshold": 3 },
|
{ "class": "dummy", "args": { "sleep": 1, "fail": 1 }, "periods": ["fast"], "threshold": 1 }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class TaskList(object):
|
||||||
for taskInfo in taskInfos:
|
for taskInfo in taskInfos:
|
||||||
task = self.find_task_by_name(taskInfo["class"])
|
task = self.find_task_by_name(taskInfo["class"])
|
||||||
if task:
|
if task:
|
||||||
task.execute(taskInfo["args"])
|
task.execute(msg, taskInfo["args"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ class MailTask(Task):
|
||||||
def execute(self, msg, taskArgs):
|
def execute(self, msg, taskArgs):
|
||||||
if "recipient" not in taskArgs:
|
if "recipient" not in taskArgs:
|
||||||
raise "could not execute Mail Task! No recipient given!"
|
raise "could not execute Mail Task! No recipient given!"
|
||||||
|
|
||||||
message = MIMEText(msg)
|
message = MIMEText(msg)
|
||||||
message['Subject'] = msg
|
message['Subject'] = msg
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue