- def stageIswaitforever(self):
- if 'waitforever' in self.data['stage']:
- return True
- else:
- return False
-
- def severity(self):
- category = self.data['category']
- prev_category = self.data['prev_category']
- val = cmpCategoryVal(category, prev_category)
- return val
-
- def improved(self):
- return self.severity() > 0
-
- def end_record(self):
- return node_end_record(self.hostname)
-
- def reset_stage(self):
- self.data['stage'] = 'findbad'
- return True
-
- def open_tickets(self):
- if self.ticket and self.ticket.status['status'] == 'open':
- return 1
- return 0
- def setIntrospect(self):
- pass
-
- def email_notice(self):
- message = self._get_message_for_condition()
- message.send(self._get_contacts_for_condition())
- return True
- def close_ticket(self):
- if self.ticket:
- self.ticket.closeTicket()
-
- def exempt_from_penalties(self):
- bl = database.dbLoad("l_blacklist")
- return self.hostname in bl
-
- def penalties(self):
- return []
- def escellate_penalty(self):
- return True
- def reduce_penalty(self):
- return True
-
-
- def atTarget(self):
- return self.target.verify(self.data)
-
- def _get_condition(self):
- return self.data['category'].lower()
-
- def _get_stage(self):
- "improvement"
- "firstnotice_noop"
- "secondnotice_noslicecreation"
- "thirdnotice_disableslices"
-
- delta = current_time - self.data['time']
+class Action(MonRecord):
+ def __init__(self, host, data):
+ self.host = host
+ MonRecord.__init__(self, data)
+ return