Opened 8 years ago
Closed 7 years ago
#774 closed enhancement (wontfix)
Add machine-readable output formating
Reported by: | lynxchaus | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | smartctl | Version: | 6.5 |
Keywords: | Cc: |
Description
Patch adds machine
simple comma-delimited output format.
example output:
# smartctl -A -f machine /dev/sda
1,Raw_Read_Error_Rate,0x000f,117,97,6,Pre-fail,Always,-,133234088
3,Spin_Up_Time,0x0003,96,95,0,Pre-fail,Always,-,0
4,Start_Stop_Count,0x0032,99,99,20,Old_age,Always,-,1386
5,Reallocated_Sector_Ct,0x0033,100,100,36,Pre-fail,Always,-,0
7,Seek_Error_Rate,0x000f,78,60,30,Pre-fail,Always,-,81588632
9,Power_On_Hours,0x0032,86,86,0,Old_age,Always,-,12439
10,Spin_Retry_Count,0x0013,100,100,97,Pre-fail,Always,-,0
12,Power_Cycle_Count,0x0032,99,99,20,Old_age,Always,-,1391
187,Reported_Uncorrect,0x0032,97,97,0,Old_age,Always,-,3
189,High_Fly_Writes,0x003a,100,100,0,Old_age,Always,-,0
190,Airflow_Temperature_Cel,0x0022,48,43,45,Old_age,Always,In_the_past,52 (Min/Max 25/52 #152)
194,Temperature_Celsius,0x0022,52,57,0,Old_age,Always,-,52 (0 17 0 0 0)
195,Hardware_ECC_Recovered,0x001a,45,42,0,Old_age,Always,-,19427128
197,Current_Pending_Sector,0x0012,100,100,0,Old_age,Always,-,1
198,Offline_Uncorrectable,0x0010,100,100,0,Old_age,Offline,-,1
199,UDMA_CRC_Error_Count,0x003e,200,200,0,Old_age,Always,-,0
200,Multi_Zone_Error_Rate,0x0000,100,253,0,Old_age,Offline,-,0
202,Data_Address_Mark_Errs,0x0032,100,253,0,Old_age,Always,-,0
Attachments (1)
Change History (5)
by , 8 years ago
Attachment: | add-machine-format.patch added |
---|
comment:1 by , 8 years ago
Milestone: | → undecided |
---|---|
Priority: | major → minor |
follow-up: 3 comment:2 by , 8 years ago
Ahha, search google around "parse smartctl output" - every time people reinvent wheel on $LANG with all sorts of regex parsers.
Generate JSON is easy but shut-up all other noise from smartctl - is not. There is banner, "start reading of ..." and other.
Maybe create -Q switch to make tool really silent?
comment:3 by , 7 years ago
Of course the JSON output will not contain the current banner as is - but likely the smartmontools version/platform/build info as JSON.
comment:4 by , 7 years ago
Milestone: | undecided |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Topic will be addressed by JSON, see ticket #766.
Thanks for this patch. Sorry, not applied for now for various reasons: