1 """
2 This is what job_function needs as parameter for each job to successfully
3 execute.
4 """
5
6 from command import Command
7
8
10 - def __init__(self, hostgroupname, members, hosts, service, threshold, parent=None):
11 self.members = members
12 self.hosts = hosts
13 self.service = service
14 self.threshold = threshold
15 self.parent = parent
16 self.name = hostgroupname + "_" + service.name
17 self.jobs = []
18
21
24
27
29 nextExecution = None
30 for job in self.jobs:
31 jobExec = job.trigger.get_next_fire_time()
32 if nextExecution is None or nextExecution > jobExec:
33 nextExecution = jobExec
34 return nextExecution
35
37 print "about to call command " + str(self.service.command)
38
39
40
41
42
43
44
45