From 1e5f61ed765f1baaa6c2926e3f820f922491d3cb Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Fri, 22 Dec 2023 07:14:29 +0100 Subject: [PATCH] follow setpoint: monitoring message improved --- z_server/devices/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/z_server/devices/__init__.py b/z_server/devices/__init__.py index 478eb77..984c2a6 100644 --- a/z_server/devices/__init__.py +++ b/z_server/devices/__init__.py @@ -104,15 +104,15 @@ class base(object): tm_t, value_t = self.__target_storage__[self.FOLLOW_KEY] except KeyError: if value_s is not None: - return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.OK, "Current temperature setpoint %.1f°C (age=%.1fmin), but never received a setpoint. That might be okay." % (value_s, (time.time()-tm_s)/60)) + return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.OK, "Current temperature setpoint %.1f°C, but never received a setpoint. That might be okay." % value_s) return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.UNKNOWN, "Device exists, but no data received") else: tm = time.time() dt = tm - tm_t if value_t != value_s and dt > self.FOLLOW_REQUEST_ERROR: - return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.ERROR, "Requested setpoint unequal valve setpoint %.1f°C since %.1fmin" % (value_s, (time.time()-tm_s)/60)) + return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.ERROR, "Requested setpoint %.1f°C unequal valve setpoint %.1f°C since %.1fmin" % (value_t, value_s, (time.time()-tm_s)/60)) elif value_t != value_s and dt > self.FOLLOW_REQUEST_WARNING: - return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.WARNING, "Requested setpoint unequal valve setpoint %.1f°C since %.1fmin" % (value_s, (time.time()-tm_s))) + return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.WARNING, "Requested setpoint %.1f°C unequal valve setpoint %.1f°C since %.1fmin" % (value_t, value_s, (time.time()-tm_s))) return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.OK, "Requested setpoint equal valve setpoint %.1f°C" % value_s) # # BATTERY