code: def last_time_non_ok_or_up(self):
          
          non_ok_times = [x for x in [self.last_time_warning,
                                      self.last_time_critical,
                                      self.last_time_unknown]
                          if x > self.last_time_ok]
          if not non_ok_times:
              last_time_non_ok = 0  # todo: program_start would be better?
          else:
              last_time_non_ok = min(non_ok_times)
          return last_time_non_ok
docs: Get the last time the service was in a non-OK state
  
          :return: the nearest last time the service was not ok
          :rtype: int