2013-05-16 23:03:00 +02:00
|
|
|
"""
|
2013-05-27 20:27:57 +02:00
|
|
|
This is what job_function needs as parameter for each job to successfully
|
2013-05-16 23:03:00 +02:00
|
|
|
execute.
|
|
|
|
|
"""
|
|
|
|
|
|
2013-05-27 19:30:49 +02:00
|
|
|
import subprocess
|
|
|
|
|
|
2013-05-16 23:03:00 +02:00
|
|
|
|
2013-05-27 01:44:28 +02:00
|
|
|
class JobInfo:
|
|
|
|
|
def __init__(self, hostgroupname, members, hosts, service, threshold, parent=None):
|
2013-05-16 23:03:00 +02:00
|
|
|
self.members = members
|
2013-05-27 01:44:28 +02:00
|
|
|
self.hosts = hosts
|
2013-05-16 23:03:00 +02:00
|
|
|
self.service = service
|
2013-05-27 01:44:28 +02:00
|
|
|
self.threshold = threshold
|
|
|
|
|
self.parent = parent
|
2013-05-27 20:28:36 +02:00
|
|
|
self.name = hostgroupname + "_" + service.name
|
2013-05-27 01:44:28 +02:00
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
return self.name
|
|
|
|
|
|
2013-05-27 03:13:08 +02:00
|
|
|
def setLogger(self, log):
|
|
|
|
|
self.log = log
|
|
|
|
|
|
|
|
|
|
def handleCall(self):
|
2013-05-27 19:30:49 +02:00
|
|
|
#p = subprocess.Popen("df -h", stdout=subprocess.PIPE, shell=True)
|
|
|
|
|
#(output, err) = p.communicate()
|
|
|
|
|
#print output
|
2013-05-27 03:54:04 +02:00
|
|
|
pass
|