diff --git a/src/util.cc b/src/util.cc index 5ad34f9..44a24ac 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1360,7 +1360,7 @@ void logAlarm(string type, string msg) envs.push_back("ALARM_TYPE="+type); envs.push_back("ALARM_MESSAGE="+msg); - warning("(alarm) %s %s\n", type.c_str(), msg.c_str()); + warning("(alarm) %s: %s\n", type.c_str(), msg.c_str()); for (auto &s : alarm_shells_) { diff --git a/src/wmbus.cc b/src/wmbus.cc index 4100104..81fdc6c 100644 --- a/src/wmbus.cc +++ b/src/wmbus.cc @@ -3434,7 +3434,7 @@ void WMBusCommonImplementation::checkStatus() if (protocol_error_count_ >= 20) { string msg; - strprintf(msg, "Hit max protocol errors(%d)! Resetting device %s %s!", protocol_error_count_, toString(type()), device().c_str()); + strprintf(msg, "too many protocol errors(%d) resetting %s %s", protocol_error_count_, device().c_str(), toString(type())); logAlarm("device_failure", msg); bool ok = reset(); if (ok) @@ -3444,7 +3444,7 @@ void WMBusCommonImplementation::checkStatus() return; } - strprintf(msg, "Failed to reset wmbus device %s %s! Emergency exit!", toString(type()), device().c_str()); + strprintf(msg, "failed to reset wmbus device %s %s exiting wmbusmeters", device().c_str(), toString(type())); logAlarm("device_failure", msg); manager_->stop(); return; @@ -3473,10 +3473,10 @@ void WMBusCommonImplementation::checkStatus() string now = strdatetime(&nowtm); string msg; - strprintf(msg, "Hit timeout(%d s) and %s is within expected activity (%s)!" - " Now %d seconds since last telegram was received! Resetting device %s %s!", - timeout_, now.c_str(), expected_activity_.c_str(), - since, toString(type()), device().c_str()); + strprintf(msg, "%d seconds of inactivity resetting %s %s " + "(timeout %ds expected %s now %s)", + since, device().c_str(), toString(type()), + timeout_, expected_activity_.c_str(), now.c_str()); logAlarm("inactivity", msg); @@ -3487,7 +3487,7 @@ void WMBusCommonImplementation::checkStatus() } else { - strprintf(msg, "Failed to reset wmbus device %s %s! Emergency exit!", toString(type()), device().c_str()); + strprintf(msg, "failed to reset wmbus device %s %s exiting wmbusmeters", device().c_str(), toString(type())); logAlarm("device_failure", msg); manager_->stop(); } diff --git a/tests/test_alarm.sh b/tests/test_alarm.sh index 6bd9ba7..6cc8017 100755 --- a/tests/test_alarm.sh +++ b/tests/test_alarm.sh @@ -15,7 +15,7 @@ echo "RUNNING $TESTNAME ..." $PROG --useconfig=tests/config7 --device=simulations/simulation_alarm.txt | sed 's/....-..-.. ..:../1111-11-11 11:11/' > $TEST/test_output.txt cat > $TEST/test_expected.txt < /tmp/wmbusmeters_alarm_expected <