Exemplo n.º 1
0
 def test_periodic_alive_reminder_sends_no_alert_if_mute_key_present(self):
     hours = timedelta(hours=float(1))
     until = str(datetime.now() + hours)
     key = Keys.get_alive_reminder_mute()
     self.redis.set_for(key, until, hours)
     self.counter_channel.reset()  # ignore previous alerts
     self.par.send_alive_alert()
     self.redis.remove(key)
     self.assertEqual(self.counter_channel.warning_count, 0)
     self.assertEqual(self.counter_channel.critical_count, 0)
     self.assertEqual(self.counter_channel.info_count, 0)
     self.assertEqual(self.counter_channel.error_count, 0)
Exemplo n.º 2
0
 def send_alive_alert(self) -> None:
     # If it is not the case that Redis is enabled and the reminder is muted,
     # inform the node operator that the alerter is still running.
     if not (self._redis_enabled
             and self._redis.exists(Keys.get_alive_reminder_mute())):
         self._channel_set.alert_info(AlerterAliveAlert())