- record.data['email'] = TECH
- record.data['action'] = ['noop']
- record.data['takeaction'] = False
- record.data['message'] = record.data['message'][0]
- record.data['stage'] = 'stage_actinoneweek'
-
- elif 'reboot_node' in record.data['stage']:
- record.data['email'] = TECH
- record.data['action'] = ['noop']
- record.data['message'] = record.data['message'][0]
- record.data['stage'] = 'stage_actinoneweek'
- record.data['takeaction'] = False
-
- elif 'improvement' in record.data['stage']:
- print "backing off of %s" % self.hostname
- record.data['action'] = ['close_rt']
- record.data['takeaction'] = True
- record.data['message'] = record.data['message'][0]
- record.data['stage'] = 'monitor-end-record'
-
- elif 'actinoneweek' in record.data['stage']:
- if delta >= 7 * SPERDAY:
- record.data['email'] = TECH | PI
- record.data['stage'] = 'stage_actintwoweeks'
- record.data['message'] = record.data['message'][1]
- record.data['action'] = ['nocreate' ]
- record.data['time'] = current_time # reset clock for waitforever
- record.data['takeaction'] = True
- elif delta >= 3* SPERDAY and not 'second-mail-at-oneweek' in record.data:
- record.data['email'] = TECH
- record.data['message'] = record.data['message'][0]
- record.data['action'] = ['sendmailagain-waitforoneweekaction' ]
- record.data['second-mail-at-oneweek'] = True
- record.data['takeaction'] = False
- else:
- record.data['message'] = None
- record.data['action'] = ['waitforoneweekaction' ]
- print "ignoring this record for: %s" % self.hostname
- return None # don't send if there's no action
-
- elif 'actintwoweeks' in record.data['stage']:
- if delta >= 7 * SPERDAY:
- record.data['email'] = TECH | PI | USER
- record.data['stage'] = 'stage_waitforever'
- record.data['message'] = record.data['message'][2]
- record.data['action'] = ['suspendslices']
- record.data['time'] = current_time # reset clock for waitforever
- record.data['takeaction'] = True
- elif delta >= 3* SPERDAY and not 'second-mail-at-twoweeks' in record.data:
- record.data['email'] = TECH | PI
- record.data['message'] = record.data['message'][1]
- record.data['action'] = ['sendmailagain-waitfortwoweeksaction' ]
- record.data['second-mail-at-twoweeks'] = True
- record.data['takeaction'] = False
- else:
- record.data['message'] = None
- record.data['action'] = ['waitfortwoweeksaction']
- return None # don't send if there's no action
-
- elif 'ticket_waitforever' in record.data['stage']:
- record.data['email'] = TECH
- record.data['takeaction'] = True
- if 'first-found' not in record.data:
- record.data['first-found'] = True
- record.data['log'] += " firstfound"
- record.data['action'] = ['ticket_waitforever']
- record.data['message'] = None
- record.data['time'] = current_time
- else:
- if delta >= 7*SPERDAY:
- record.data['action'] = ['ticket_waitforever']
- record.data['message'] = None
- record.data['time'] = current_time # reset clock
- else:
- record.data['action'] = ['ticket_waitforever']
- record.data['message'] = None
- return None