Dirk Alders 4 kuukautta sitten
vanhempi
commit
c526b6d575
3 muutettua tiedostoa jossa 9 lisäystä ja 9 poistoa
  1. 1
    1
      check_raspi_temp
  2. 1
    1
      check_shelly
  3. 7
    7
      z_server/devices/__init__.py

+ 1
- 1
check_raspi_temp Näytä tiedosto

39
     else:
39
     else:
40
         status = n.OK
40
         status = n.OK
41
     #
41
     #
42
-    n.exit(status, f"cpu-temperature={cpu_temp}°C - gpu-temperature: {gpu_temp}°C")
42
+    n.exit(status, f"cpu-temperature={cpu_temp:.1f} C - gpu-temperature: {gpu_temp:.1f} C")

+ 1
- 1
check_shelly Näytä tiedosto

89
             status = n.WARNING
89
             status = n.WARNING
90
         else:
90
         else:
91
             status = n.OK
91
             status = n.OK
92
-        n.exit(status, f"temperature: {temperature}°C < {TMP_WARNING} < {TMP_ERROR}")
92
+        n.exit(status, f"temperature: {temperature} C < {TMP_WARNING} < {TMP_ERROR}")

+ 7
- 7
z_server/devices/__init__.py Näytä tiedosto

110
                 tm_t, value_t = self.__target_storage__[self.KEY_SETPOINT]
110
                 tm_t, value_t = self.__target_storage__[self.KEY_SETPOINT]
111
             except KeyError:
111
             except KeyError:
112
                 if value_s is not None:
112
                 if value_s is not None:
113
-                    return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.OK, "Current temperature setpoint %.1f°C, but never received a setpoint. That might be okay." % value_s)
113
+                    return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.OK, "Current temperature setpoint %.1f C, but never received a setpoint. That might be okay." % value_s)
114
                 return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.UNKNOWN, "Device exists, but no data received")
114
                 return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.UNKNOWN, "Device exists, but no data received")
115
             else:
115
             else:
116
                 tm = time.time()
116
                 tm = time.time()
117
                 dt = tm - tm_t
117
                 dt = tm - tm_t
118
                 if value_t != value_s and dt > self.FOLLOW_REQUEST_ERROR:
118
                 if value_t != value_s and dt > self.FOLLOW_REQUEST_ERROR:
119
-                    return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.ERROR, "Requested setpoint %.1f°C unequal valve setpoint %.1f°C since %.1fmin" % (value_t, value_s, (time.time()-tm_s)/60))
119
+                    return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.ERROR, "Requested setpoint %.1f C unequal valve setpoint %.1f C since %.1fmin" % (value_t, value_s, (time.time()-tm_s)/60))
120
                 elif value_t != value_s and dt > self.FOLLOW_REQUEST_WARNING:
120
                 elif value_t != value_s and dt > self.FOLLOW_REQUEST_WARNING:
121
-                    return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.WARNING, "Requested setpoint %.1f°C unequal valve setpoint %.1f°C since %.1fmin" % (value_t, value_s, (time.time()-tm_s)))
122
-                return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.OK, "Requested setpoint equal valve setpoint %.1f°C" % value_s)
121
+                    return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.WARNING, "Requested setpoint %.1f C unequal valve setpoint %.1f C since %.1fmin" % (value_t, value_s, (time.time()-tm_s)))
122
+                return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.OK, "Requested setpoint equal valve setpoint %.1f C" % value_s)
123
         #
123
         #
124
         # BATTERY
124
         # BATTERY
125
         #
125
         #
220
             elif value_s <= 5:
220
             elif value_s <= 5:
221
                 return self.__nagios_return__(DID_ACTOR, nagios.Nagios.OK, "No monitoring in Summer Mode")
221
                 return self.__nagios_return__(DID_ACTOR, nagios.Nagios.OK, "No monitoring in Summer Mode")
222
             elif value_c > value_s + self.ACTOR_ERR_OFFSET:
222
             elif value_c > value_s + self.ACTOR_ERR_OFFSET:
223
-                return self.__nagios_return__(DID_ACTOR, nagios.Nagios.ERROR, "Current Temperature much to high %.1f°C > %.1f°C" % (value_c, value_s))
223
+                return self.__nagios_return__(DID_ACTOR, nagios.Nagios.ERROR, "Current Temperature much to high %.1f C > %.1f C" % (value_c, value_s))
224
             elif value_c > value_s + self.ACTOR_WARN_OFFSET:
224
             elif value_c > value_s + self.ACTOR_WARN_OFFSET:
225
-                return self.__nagios_return__(DID_ACTOR, nagios.Nagios.WARNING, "Current Temperature to high %.1f°C > %.1f°C" % (value_c, value_s))
225
+                return self.__nagios_return__(DID_ACTOR, nagios.Nagios.WARNING, "Current Temperature to high %.1f C > %.1f C" % (value_c, value_s))
226
             else:
226
             else:
227
-                return self.__nagios_return__(DID_ACTOR, nagios.Nagios.OK, "Current Temperature okay %.1f°C > %.1f°C" % (value_c, value_s))
227
+                return self.__nagios_return__(DID_ACTOR, nagios.Nagios.OK, "Current Temperature okay %.1f C > %.1f C" % (value_c, value_s))
228
         else:
228
         else:
229
             return super().status(key)
229
             return super().status(key)
230
 
230
 

Loading…
Peruuta
Tallenna