just some cleanups and ideas in hanez.json
This commit is contained in:
parent
1e8ad1f110
commit
134bdf39a4
4 changed files with 12 additions and 14 deletions
|
|
@ -19,7 +19,7 @@
|
|||
"class": "tcpconnect",
|
||||
"args": { "port": 80 },
|
||||
"periods": ["always"],
|
||||
"threshold": 10
|
||||
"threshold": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -34,6 +34,14 @@
|
|||
"max_logfile_size": 1024000,
|
||||
"max_logfile_count": 4,
|
||||
"max_worker_threads": 8,
|
||||
"members":[ "root" ]
|
||||
"members":[ "root" ],
|
||||
"tasks": {
|
||||
"jabber":{
|
||||
"server": "systemchaos.org",
|
||||
"port": 5222,
|
||||
"user": "linspector",
|
||||
"password": "hallo_welt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ class JabberTask(Task):
|
|||
client.connect(server=('systemchaos.org', 5222))
|
||||
client.auth('linspector', 'PASSWORD', 'alert')
|
||||
client.sendInitPresence()
|
||||
message = xmpp.Message('hanez@systemchaos.org', msg)
|
||||
message = xmpp.Message(self.recipient, msg)
|
||||
message.setAttr('type', 'chat')
|
||||
client.send(message)
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class SmsTask(Task):
|
|||
self.set_task_type(kwargs["type"])
|
||||
self.recipient = kwargs["args"]["rcpt"]
|
||||
|
||||
def execute_task(self, msg):
|
||||
def execute(self, msg):
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,21 +4,11 @@ The task class.
|
|||
|
||||
|
||||
class Task:
|
||||
"""
|
||||
Base class for all built-in Tasks.
|
||||
"""
|
||||
|
||||
def set_task_type(self, taskType):
|
||||
self._taskType = taskType
|
||||
|
||||
def get_task_type(self):
|
||||
"""
|
||||
:return: the type set by set_type_task
|
||||
"""
|
||||
return self._taskType
|
||||
|
||||
def some_other_irrelevant_methods(self):
|
||||
pass
|
||||
|
||||
def execute(self, msg):
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue