@cryptotaxi247 / netdata-1 / commits / 0ccf21e93

python.d(smartd_log): collect Total LBAs written/read (#16245)

Howard Wilson committed Oct 20, 2023 at 16:30 UTC 0ccf21e9365246392061bd644294a05c7ef0b630
1 file changed +19 -1
collectors/python.d.plugin/smartd_log/smartd_log.chart.py
+19 -1
@@ -39,6 +39,7 @@ ATTR171 = '171'
39 ATTR172 = '172'
40 ATTR173 = '173'
41 ATTR174 = '174'
42 +ATTR177 = '177'
43 ATTR180 = '180'
44 ATTR183 = '183'
45 ATTR190 = '190'
@@ -50,6 +51,8 @@ ATTR199 = '199'
51 ATTR202 = '202'
52 ATTR206 = '206'
53 ATTR233 = '233'
54 +ATTR241 = '241'
55 +ATTR242 = '242'
56 ATTR249 = '249'
57 ATTR_READ_ERR_COR = 'read-total-err-corrected'
58 ATTR_READ_ERR_UNC = 'read-total-unc-errors'
@@ -114,6 +117,8 @@ ORDER = [
117 'offline_uncorrectable_sector_count',
118 'percent_lifetime_used',
119 'media_wearout_indicator',
120 + 'total_lbas_written',
121 + 'total_lbas_read',
122 ]
123
124 CHARTS = {
@@ -329,7 +334,7 @@ CHARTS = {
334 'media_wearout_indicator': {
335 'options': [None, 'Media Wearout Indicator', 'percentage', 'wear', 'smartd_log.media_wearout_indicator', 'line'],
336 'lines': [],
332 - 'attrs': [ATTR233],
337 + 'attrs': [ATTR233, ATTR177],
338 'algo': ABSOLUTE,
339 },
340 'nand_writes_1gib': {
@@ -338,6 +343,18 @@ CHARTS = {
343 'attrs': [ATTR249],
344 'algo': ABSOLUTE,
345 },
346 + 'total_lbas_written': {
347 + 'options': [None, 'Total LBAs Written', 'sectors', 'wear', 'smartd_log.total_lbas_written', 'line'],
348 + 'lines': [],
349 + 'attrs': [ATTR241],
350 + 'algo': ABSOLUTE,
351 + },
352 + 'total_lbas_read': {
353 + 'options': [None, 'Total LBAs Read', 'sectors', 'wear', 'smartd_log.total_lbas_read', 'line'],
354 + 'lines': [],
355 + 'attrs': [ATTR242],
356 + 'algo': ABSOLUTE,
357 + },
358 }
359
360 # NOTE: 'parse_temp' decodes ATA 194 raw value. Not heavily tested. Written by @Ferroin
@@ -519,6 +536,7 @@ def ata_attribute_factory(value):
536 elif name in [
537 ATTR1,
538 ATTR7,
539 + ATTR177,
540 ATTR202,
541 ATTR206,
542 ATTR233,