|
|
|
|
104
|
tm_t, value_t = self.__target_storage__[self.FOLLOW_KEY]
|
104
|
tm_t, value_t = self.__target_storage__[self.FOLLOW_KEY]
|
105
|
except KeyError:
|
105
|
except KeyError:
|
106
|
if value_s is not None:
|
106
|
if value_s is not None:
|
107
|
- 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))
|
|
|
|
|
107
|
+ 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)
|
108
|
return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.UNKNOWN, "Device exists, but no data received")
|
108
|
return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.UNKNOWN, "Device exists, but no data received")
|
109
|
else:
|
109
|
else:
|
110
|
tm = time.time()
|
110
|
tm = time.time()
|
111
|
dt = tm - tm_t
|
111
|
dt = tm - tm_t
|
112
|
if value_t != value_s and dt > self.FOLLOW_REQUEST_ERROR:
|
112
|
if value_t != value_s and dt > self.FOLLOW_REQUEST_ERROR:
|
113
|
- 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))
|
|
|
|
|
113
|
+ 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))
|
114
|
elif value_t != value_s and dt > self.FOLLOW_REQUEST_WARNING:
|
114
|
elif value_t != value_s and dt > self.FOLLOW_REQUEST_WARNING:
|
115
|
- 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)))
|
|
|
|
|
115
|
+ 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)))
|
116
|
return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.OK, "Requested setpoint equal valve setpoint %.1f°C" % value_s)
|
116
|
return self.__nagios_return__(self.MONITORING_FOLLOW_SETPOINT, nagios.Nagios.OK, "Requested setpoint equal valve setpoint %.1f°C" % value_s)
|
117
|
#
|
117
|
#
|
118
|
# BATTERY
|
118
|
# BATTERY
|