File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
collectors/python.d.plugin/smartd_log Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,20 @@ def value(self):
440440 return self .normalized_value
441441
442442
443+ class Ata3 (BaseAtaSmartAttribute ):
444+ def value (self ):
445+ value = int (self .raw_value )
446+ # https://github.com/netdata/netdata/issues/5919
447+ #
448+ # 3;151;38684000679;
449+ # 423 (Average 447)
450+ # 38684000679 & 0xFFF -> 423
451+ # (38684000679 & 0xFFF0000) >> 16 -> 447
452+ if value > 1e6 :
453+ return value & 0xFFF
454+ return value
455+
456+
443457class Ata9 (BaseAtaSmartAttribute ):
444458 def value (self ):
445459 value = int (self .raw_value )
@@ -454,7 +468,14 @@ def value(self):
454468
455469
456470class Ata194 (BaseAtaSmartAttribute ):
471+ # https://github.com/netdata/netdata/issues/3041
472+ # https://github.com/netdata/netdata/issues/5919
473+ #
474+ # The low byte is the current temperature, the third lowest is the maximum, and the fifth lowest is the minimum
457475 def value (self ):
476+ value = int (self .raw_value )
477+ if value > 1e6 :
478+ return value & 0xFF
458479 return min (int (self .normalized_value ), int (self .raw_value ))
459480
460481
@@ -475,7 +496,9 @@ def value(self):
475496def ata_attribute_factory (value ):
476497 name = value [0 ]
477498
478- if name == ATTR9 :
499+ if name == ATTR3 :
500+ return Ata3 (* value )
501+ elif name == ATTR9 :
479502 return Ata9 (* value )
480503 elif name == ATTR190 :
481504 return Ata190 (* value )
You can’t perform that action at this time.
0 commit comments