Dirk Alders 4 ay önce
ebeveyn
işleme
c526b6d575
3 değiştirilmiş dosya ile 9 ekleme ve 9 silme
  1. 1
    1
      check_raspi_temp
  2. 1
    1
      check_shelly
  3. 7
    7
      z_server/devices/__init__.py

+ 1
- 1
check_raspi_temp Dosyayı Görüntüle

@@ -39,4 +39,4 @@ if __name__ == "__main__":
39 39
     else:
40 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 Dosyayı Görüntüle

@@ -89,4 +89,4 @@ if __name__ == "__main__":
89 89
             status = n.WARNING
90 90
         else:
91 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 Dosyayı Görüntüle

@@ -110,16 +110,16 @@ class base(object):
110 110
                 tm_t, value_t = self.__target_storage__[self.KEY_SETPOINT]
111 111
             except KeyError:
112 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 114
                 return self.__nagios_return__(DID_FOLLOWS_SETPOINT, nagios.Nagios.UNKNOWN, "Device exists, but no data received")
115 115
             else:
116 116
                 tm = time.time()
117 117
                 dt = tm - tm_t
118 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 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 124
         # BATTERY
125 125
         #
@@ -220,11 +220,11 @@ class brennenstuhl_heatingvalve(base):
220 220
             elif value_s <= 5:
221 221
                 return self.__nagios_return__(DID_ACTOR, nagios.Nagios.OK, "No monitoring in Summer Mode")
222 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 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 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 228
         else:
229 229
             return super().status(key)
230 230
 

Loading…
İptal
Kaydet