]> arthur.barton.de Git - netdata.git/blobdiff - python.d/sensors.chart.py
sensors: ignore overflow value
[netdata.git] / python.d / sensors.chart.py
index 7abe7f0809d45a5f20f47147501bf8126072544f..f2960958a67158066c85f2056ff429063dc3e283 100644 (file)
@@ -49,6 +49,13 @@ CHARTS = {
         ]}
 }
 
+LIMITS = {
+    'temperature': [-127, 1000],
+    'voltage': [-127, 127],
+    'current': [-127, 127],
+    'fan': [0, 65535]
+}
+
 TYPE_MAP = {
     0: 'voltage',
     1: 'fan',
@@ -82,6 +89,11 @@ class Service(SimpleService):
                     for sf in sfi:
                         val = sensors.get_value(chip, sf.number)
                         break
+                    typeName = TYPE_MAP[feature.type]
+                    if typeName in LIMITS:
+                        limit = LIMITS[typeName];
+                        if val < limit[0] or val > limit[1]:
+                            continue
                     data[prefix + "_" + str(feature.name.decode())] = int(val * 1000)
         except Exception as e:
             self.error(e)