diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-05-21 18:56:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-05-21 18:56:05 +0000 |
commit | 54deae27eed83a162ee438ef6bad4a23767757dd (patch) | |
tree | da5333377dfacf22177375aef822a8e696f007eb /collectors/python.d.plugin/smartd_log/smartd_log.chart.py | |
parent | Releasing debian version 1.14.0-1. (diff) | |
download | netdata-54deae27eed83a162ee438ef6bad4a23767757dd.tar.xz netdata-54deae27eed83a162ee438ef6bad4a23767757dd.zip |
Merging upstream version 1.15.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/smartd_log/smartd_log.chart.py')
-rw-r--r-- | collectors/python.d.plugin/smartd_log/smartd_log.chart.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/collectors/python.d.plugin/smartd_log/smartd_log.chart.py b/collectors/python.d.plugin/smartd_log/smartd_log.chart.py index fe1d6324b..12f756c58 100644 --- a/collectors/python.d.plugin/smartd_log/smartd_log.chart.py +++ b/collectors/python.d.plugin/smartd_log/smartd_log.chart.py @@ -440,6 +440,20 @@ class AtaNormalized(BaseAtaSmartAttribute): return self.normalized_value +class Ata3(BaseAtaSmartAttribute): + def value(self): + value = int(self.raw_value) + # https://github.com/netdata/netdata/issues/5919 + # + # 3;151;38684000679; + # 423 (Average 447) + # 38684000679 & 0xFFF -> 423 + # (38684000679 & 0xFFF0000) >> 16 -> 447 + if value > 1e6: + return value & 0xFFF + return value + + class Ata9(BaseAtaSmartAttribute): def value(self): value = int(self.raw_value) @@ -454,7 +468,14 @@ class Ata190(BaseAtaSmartAttribute): class Ata194(BaseAtaSmartAttribute): + # https://github.com/netdata/netdata/issues/3041 + # https://github.com/netdata/netdata/issues/5919 + # + # The low byte is the current temperature, the third lowest is the maximum, and the fifth lowest is the minimum def value(self): + value = int(self.raw_value) + if value > 1e6: + return value & 0xFF return min(int(self.normalized_value), int(self.raw_value)) @@ -475,7 +496,9 @@ class SCSIRaw(BaseSCSISmartAttribute): def ata_attribute_factory(value): name = value[0] - if name == ATTR9: + if name == ATTR3: + return Ata3(*value) + elif name == ATTR9: return Ata9(*value) elif name == ATTR190: return Ata190(*value) |