def send_mail(self, alarm_state): now = time.strftime("%Y-%m-%d %H:%M:%S") alarm_info = alarm_state.copy() alarm_info["ts"] = now mail_center.add_alarm_info(alarm_info) log.error("send mail %s %s" % (alarm_info['key_word'], alarm_info['msg']))
def send_mail(self, alarm_state): now = time.strftime("%Y-%m-%d %H:%M:%S") alarm_info = alarm_state.copy() alarm_info["ts"] = now mail_center.add_alarm_info(alarm_info) log.error("send mail %s %s" % (alarm_info["key_word"], alarm_info["msg"]))
def send_mail(self, state, msg): now = time.strftime("%Y-%m-%d %H:%M:%S") if state != contants.ALARM_OK: mail_center.add_alarm_info({"ts": now,"name":self.rule.name,"host":self.host,"state":state,"msg":msg}) log.info("send mail %s %s %s" % (self.rule.name, state, msg) )