From 82e5932d9c4b589856746d31835ee50da3185ce8 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 10 Jun 2024 11:31:00 +0200 Subject: [PATCH] clients/upsmon.c: for OB UPS and communications failure, leave just the debug log message [#2454] Signed-off-by: Jim Klimov --- clients/upsmon.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/clients/upsmon.c b/clients/upsmon.c index 65b0234c88..6dd7c2b9ca 100644 --- a/clients/upsmon.c +++ b/clients/upsmon.c @@ -1111,6 +1111,20 @@ static int is_ups_critical(utype_t *ups) ups->sys); return 1; } + + if (ups->linestate == 0) { + /* Just a message for post-mortem troubleshooting: + * no flag flips, no return values issued just here + * (note the message is likely to appear on every + * cycle when the communications are down, to help + * track when this was the case; no log throttling). + */ + upsdebugx(1, + "UPS [%s] was last known to be not fully online " + "and currently is not communicating, just so you " + "know (waiting for DEADTIME to elapse)", + ups->sys); + } } /* administratively OFF (long enough, see OFFDURATION) */