普通情况一小时发送一条邮件告警

This commit is contained in:
aixiao 2022-09-21 16:12:12 +08:00
parent d348935757
commit ba6040f16a

View File

@ -46,7 +46,7 @@ static int error_log(float l_t, int c_t, char *log_file, char *recv_mail, int _i
fp = NULL;
} else {
// 正常温度时
if (tmp_ptr->tm_min >= 10 && tmp_ptr->tm_min <= 12) {
if (tmp_ptr->tm_min >= 10 && tmp_ptr->tm_min < 12) {
sprintf(temperature, "%d.%d.%d %d:%d:%d %s:%.3f℃\n", (1900 + tmp_ptr->tm_year), (1 + tmp_ptr->tm_mon), tmp_ptr->tm_mday, tmp_ptr->tm_hour, tmp_ptr->tm_min, tmp_ptr->tm_sec, "Raspberry CPU temperature", l_t);
sprintf(buffer, "email -r %s -s \"Raspberrypi Temperature\" -t \"%s\"", recv_mail, temperature);
fp = popen(buffer, "r");