* [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field
@ 2022-07-21 10:45 Matthias Heiserer
2022-07-21 10:45 ` [pve-devel] [PATCH pve-storage] fix #4165: disk: SMART: add normalized field Matthias Heiserer
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Matthias Heiserer @ 2022-07-21 10:45 UTC (permalink / raw)
To: pve-devel, pbs-devel
This makes it consistent with the naming scheme in PVE/GUI.
Keep value for API stability reasons, and remove it in next major version.
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
src/tools/disks/smart.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/tools/disks/smart.rs b/src/tools/disks/smart.rs
index 3738cdfd..787971e9 100644
--- a/src/tools/disks/smart.rs
+++ b/src/tools/disks/smart.rs
@@ -25,8 +25,11 @@ pub enum SmartStatus {
pub struct SmartAttribute {
/// Attribute name
name: String,
- /// Attribute raw value
+ // fixme remove value in major release
+ /// duplicate of raw - kept for API stability
value: String,
+ /// Attribute raw value
+ raw: String,
// the rest of the values is available for ATA type
/// ATA Attribute ID
#[serde(skip_serializing_if = "Option::is_none")]
@@ -146,7 +149,8 @@ pub fn get_smart_data(disk: &super::Disk, health_only: bool) -> Result<SmartData
attributes.push(SmartAttribute {
name,
- value: raw_value,
+ value: raw_value.clone(),
+ raw: raw_value,
id: Some(id),
flags: Some(flags),
normalized: Some(normalized),
@@ -180,6 +184,7 @@ pub fn get_smart_data(disk: &super::Disk, health_only: bool) -> Result<SmartData
attributes.push(SmartAttribute {
name: name.to_string(),
value: value.to_string(),
+ raw: value.to_string(),
id: None,
flags: None,
normalized: None,
--
2.30.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [pve-devel] [PATCH pve-storage] fix #4165: disk: SMART: add normalized field
2022-07-21 10:45 [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Matthias Heiserer
@ 2022-07-21 10:45 ` Matthias Heiserer
2022-09-23 10:29 ` [pve-devel] applied: [pbs-devel] " Thomas Lamprecht
2022-07-21 10:45 ` [pve-devel] [PATCH widget-toolkit] fix #4165: SMART: use changed columns from the API Matthias Heiserer
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Matthias Heiserer @ 2022-07-21 10:45 UTC (permalink / raw)
To: pve-devel, pbs-devel
This makes it consistent with the naming scheme in PBS/GUI.
Keep value for API stability reasons and remove it in the next major version.
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
PVE/Diskmanage.pm | 2 ++
.../hdd_smart/sda_smart_expected.json | 24 ++++++++++++++++++
.../hdd_smart/sdb_smart_expected.json | 21 ++++++++++++++++
.../ssd_smart/sda_smart_expected.json | 23 +++++++++++++++++
.../ssd_smart/sdb_smart_expected.json | 25 +++++++++++++++++++
.../ssd_smart/sdc_smart_expected.json | 1 +
.../ssd_smart/sdd_smart_expected.json | 25 +++++++++++++++++++
.../ssd_smart/sde_smart_expected.json | 24 ++++++++++++++++++
8 files changed, 145 insertions(+)
diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
index 8ed7a8b..ec0bdf3 100644
--- a/PVE/Diskmanage.pm
+++ b/PVE/Diskmanage.pm
@@ -123,7 +123,9 @@ sub get_smart_data {
$entry->{name} = $2 if defined $2;
$entry->{flags} = $3 if defined $3;
# the +0 makes a number out of the strings
+ # fixme remove next line in major release, use normalized instead
$entry->{value} = $4+0 if defined $4;
+ $entry->{normalized} = $4+0 if defined $4;
$entry->{worst} = $5+0 if defined $5;
# some disks report the default threshold as --- instead of 000
if (defined($6) && $6 eq '---') {
diff --git a/test/disk_tests/hdd_smart/sda_smart_expected.json b/test/disk_tests/hdd_smart/sda_smart_expected.json
index 01bb860..73cd01c 100644
--- a/test/disk_tests/hdd_smart/sda_smart_expected.json
+++ b/test/disk_tests/hdd_smart/sda_smart_expected.json
@@ -4,6 +4,7 @@
"threshold" : 6,
"fail" : "-",
"flags" : "POSR--",
+ "normalized" : 117,
"value" : 117,
"id" : " 1",
"raw" : "158983656",
@@ -12,6 +13,7 @@
},
{
"flags" : "PO----",
+ "normalized" : 92,
"value" : 92,
"raw" : "0",
"name" : "Spin_Up_Time",
@@ -21,6 +23,7 @@
"threshold" : 0
},
{
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--CK",
"id" : " 4",
@@ -31,6 +34,7 @@
"fail" : "-"
},
{
+ "normalized" : 100,
"value" : 100,
"flags" : "PO--CK",
"id" : " 5",
@@ -42,6 +46,7 @@
},
{
"flags" : "POSR--",
+ "normalized" : 75,
"value" : 75,
"raw" : "30779387",
"worst" : 60,
@@ -56,11 +61,13 @@
"name" : "Power_On_Hours",
"id" : " 9",
"flags" : "-O--CK",
+ "normalized" : 99,
"value" : 99,
"fail" : "-",
"threshold" : 0
},
{
+ "normalized" : 100,
"value" : 100,
"flags" : "PO--C-",
"id" : " 10",
@@ -72,6 +79,7 @@
},
{
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100,
"id" : " 12",
"raw" : "190",
@@ -84,6 +92,7 @@
"threshold" : 0,
"fail" : "-",
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100,
"id" : "183",
"raw" : "0",
@@ -94,6 +103,7 @@
"fail" : "-",
"threshold" : 99,
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100,
"raw" : "0",
"worst" : 100,
@@ -105,6 +115,7 @@
"name" : "Reported_Uncorrect",
"raw" : "0",
"id" : "187",
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--CK",
"fail" : "-",
@@ -112,6 +123,7 @@
},
{
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100,
"raw" : "0 0 0",
"worst" : 100,
@@ -124,6 +136,7 @@
"threshold" : 0,
"fail" : "-",
"flags" : "-O-RCK",
+ "normalized" : 100,
"value" : 100,
"id" : "189",
"raw" : "0",
@@ -135,6 +148,7 @@
"name" : "Airflow_Temperature_Cel",
"raw" : "31 (Min/Max 20/33)",
"id" : "190",
+ "normalized" : 69,
"value" : 69,
"flags" : "-O---K",
"fail" : "-",
@@ -147,6 +161,7 @@
"name" : "G-Sense_Error_Rate",
"raw" : "0",
"id" : "191",
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--CK"
},
@@ -156,12 +171,14 @@
"name" : "Power-Off_Retract_Count",
"worst" : 100,
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"fail" : "-"
},
{
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100,
"raw" : "201",
"worst" : 100,
@@ -173,6 +190,7 @@
{
"fail" : "-",
"threshold" : 0,
+ "normalized" : 31,
"value" : 31,
"flags" : "-O---K",
"name" : "Temperature_Celsius",
@@ -181,6 +199,7 @@
"id" : "194"
},
{
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--C-",
"id" : "197",
@@ -195,6 +214,7 @@
"name" : "Offline_Uncorrectable",
"raw" : "0",
"id" : "198",
+ "normalized" : 100,
"value" : 100,
"flags" : "----C-",
"fail" : "-",
@@ -203,6 +223,7 @@
{
"threshold" : 0,
"fail" : "-",
+ "normalized" : 200,
"value" : 200,
"flags" : "-OSRCK",
"id" : "199",
@@ -216,6 +237,7 @@
"worst" : 253,
"id" : "240",
"flags" : "------",
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"threshold" : 0
@@ -227,11 +249,13 @@
"worst" : 253,
"raw" : "24013587236",
"id" : "241",
+ "normalized" : 100,
"value" : 100,
"flags" : "------"
},
{
"flags" : "------",
+ "normalized" : 100,
"value" : 100,
"id" : "242",
"raw" : "66916845706732",
diff --git a/test/disk_tests/hdd_smart/sdb_smart_expected.json b/test/disk_tests/hdd_smart/sdb_smart_expected.json
index 41e55fb..ae0f014 100644
--- a/test/disk_tests/hdd_smart/sdb_smart_expected.json
+++ b/test/disk_tests/hdd_smart/sdb_smart_expected.json
@@ -7,11 +7,13 @@
"name" : "Raw_Read_Error_Rate",
"worst" : 63,
"raw" : "215697022",
+ "normalized" : 83,
"value" : 83,
"flags" : "POSR--"
},
{
"flags" : "PO----",
+ "normalized" : 92,
"value" : 92,
"id" : " 3",
"raw" : "0",
@@ -23,6 +25,7 @@
{
"fail" : "-",
"threshold" : 20,
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--CK",
"worst" : 100,
@@ -32,6 +35,7 @@
},
{
"flags" : "PO--CK",
+ "normalized" : 100,
"value" : 100,
"id" : " 5",
"raw" : "0",
@@ -46,6 +50,7 @@
"name" : "Seek_Error_Rate",
"worst" : 60,
"flags" : "POSR--",
+ "normalized" : 91,
"value" : 91,
"threshold" : 30,
"fail" : "-"
@@ -56,6 +61,7 @@
"worst" : 89,
"id" : " 9",
"flags" : "-O--CK",
+ "normalized" : 89,
"value" : 89,
"fail" : "-",
"threshold" : 0
@@ -63,6 +69,7 @@
{
"fail" : "-",
"threshold" : 97,
+ "normalized" : 100,
"value" : 100,
"flags" : "PO--C-",
"worst" : 100,
@@ -78,6 +85,7 @@
"name" : "Power_Cycle_Count",
"worst" : 100,
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
@@ -85,6 +93,7 @@
"worst" : 100,
"raw" : "0",
"id" : "184",
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--CK",
"fail" : "-",
@@ -98,6 +107,7 @@
"name" : "Reported_Uncorrect",
"worst" : 100,
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
@@ -108,6 +118,7 @@
"name" : "Command_Timeout",
"worst" : 100,
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
@@ -118,10 +129,12 @@
"name" : "High_Fly_Writes",
"id" : "189",
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
"flags" : "-O-RCK",
+ "normalized" : 45,
"value" : 45,
"raw" : "55 (147 229 55 24 0)",
"worst" : 36,
@@ -138,6 +151,7 @@
"name" : "G-Sense_Error_Rate",
"id" : "191",
"flags" : "-O---K",
+ "normalized" : 100,
"value" : 100
},
{
@@ -148,11 +162,13 @@
"worst" : 100,
"name" : "Power-Off_Retract_Count",
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
"fail" : "-",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--CK",
"name" : "Load_Cycle_Count",
@@ -164,6 +180,7 @@
"threshold" : 0,
"fail" : "-",
"flags" : "-O--CK",
+ "normalized" : 55,
"value" : 55,
"id" : "194",
"raw" : "55 (0 16 0 0 0)",
@@ -177,6 +194,7 @@
"name" : "Hardware_ECC_Recovered",
"worst" : 13,
"raw" : "215697022",
+ "normalized" : 23,
"value" : 23,
"flags" : "-O---K"
},
@@ -185,6 +203,7 @@
"name" : "Current_Pending_Sector",
"raw" : "0",
"id" : "197",
+ "normalized" : 100,
"value" : 100,
"flags" : "-O--C-",
"fail" : "-",
@@ -195,6 +214,7 @@
"name" : "Offline_Uncorrectable",
"raw" : "0",
"id" : "198",
+ "normalized" : 100,
"value" : 100,
"flags" : "----C-",
"fail" : "-",
@@ -203,6 +223,7 @@
{
"fail" : "-",
"threshold" : 0,
+ "normalized" : 200,
"value" : 200,
"flags" : "-OSRCK",
"worst" : 200,
diff --git a/test/disk_tests/ssd_smart/sda_smart_expected.json b/test/disk_tests/ssd_smart/sda_smart_expected.json
index a71fab2..2b42cf8 100644
--- a/test/disk_tests/ssd_smart/sda_smart_expected.json
+++ b/test/disk_tests/ssd_smart/sda_smart_expected.json
@@ -10,6 +10,7 @@
"flags" : "POSR-K",
"raw" : "0",
"fail" : "-",
+ "normalized" : 100,
"value" : 100
},
{
@@ -20,12 +21,14 @@
"flags" : "-O--CK",
"raw" : "0",
"fail" : "-",
+ "normalized" : 100,
"value" : 100
},
{
"name" : "Power_On_Hours",
"threshold" : 0,
"worst" : 100,
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"raw" : "1309",
@@ -40,9 +43,11 @@
"flags" : "-O--CK",
"fail" : "-",
"id" : " 12",
+ "normalized" : 100,
"value" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"raw" : "0",
"flags" : "-O--CK",
@@ -53,6 +58,7 @@
"worst" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"id" : "172",
"raw" : "0",
@@ -70,12 +76,14 @@
"flags" : "-O--CK",
"fail" : "-",
"id" : "173",
+ "normalized" : 100,
"value" : 100
},
{
"name" : "Unexpect_Power_Loss_Ct",
"threshold" : 0,
"worst" : 100,
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"raw" : "53",
@@ -87,6 +95,7 @@
"flags" : "PO--CK",
"fail" : "-",
"id" : "180",
+ "normalized" : 0,
"value" : 0,
"threshold" : 0,
"name" : "Unused_Reserve_NAND_Blk",
@@ -100,6 +109,7 @@
"raw" : "0",
"flags" : "-O--CK",
"id" : "183",
+ "normalized" : 100,
"value" : 100
},
{
@@ -110,12 +120,14 @@
"flags" : "-O--CK",
"raw" : "0",
"fail" : "-",
+ "normalized" : 100,
"value" : 100
},
{
"name" : "Reported_Uncorrect",
"threshold" : 0,
"worst" : 100,
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"flags" : "-O--CK",
@@ -130,6 +142,7 @@
"fail" : "-",
"flags" : "-O---K",
"raw" : "32 (Min/Max 22/46)",
+ "normalized" : 68,
"value" : 68
},
{
@@ -137,6 +150,7 @@
"flags" : "-O--CK",
"fail" : "-",
"id" : "196",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"name" : "Reallocated_Event_Count",
@@ -147,6 +161,7 @@
"fail" : "-",
"flags" : "-O--CK",
"raw" : "0",
+ "normalized" : 100,
"value" : 100,
"worst" : 100,
"name" : "Current_Pending_Sector",
@@ -160,6 +175,7 @@
"raw" : "0",
"fail" : "-",
"id" : "198",
+ "normalized" : 100,
"value" : 100
},
{
@@ -170,9 +186,11 @@
"fail" : "-",
"raw" : "0",
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"id" : "202",
"flags" : "----CK",
@@ -186,6 +204,7 @@
"name" : "Write_Error_Rate",
"threshold" : 0,
"worst" : 100,
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"raw" : "0",
@@ -200,9 +219,11 @@
"raw" : "0",
"flags" : "-O--CK",
"id" : "210",
+ "normalized" : 100,
"value" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"id" : "246",
"fail" : "-",
@@ -220,9 +241,11 @@
"raw" : "211228065",
"flags" : "-O--CK",
"id" : "247",
+ "normalized" : 100,
"value" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"raw" : "253276904",
diff --git a/test/disk_tests/ssd_smart/sdb_smart_expected.json b/test/disk_tests/ssd_smart/sdb_smart_expected.json
index 6f55c3e..0614754 100644
--- a/test/disk_tests/ssd_smart/sdb_smart_expected.json
+++ b/test/disk_tests/ssd_smart/sdb_smart_expected.json
@@ -10,6 +10,7 @@
"flags" : "-O--CK",
"raw" : "0",
"id" : " 5",
+ "normalized" : 100,
"value" : 100
},
{
@@ -20,9 +21,11 @@
"fail" : "-",
"raw" : "1259",
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"id" : " 12",
"raw" : "191",
@@ -37,6 +40,7 @@
"raw" : "0",
"flags" : "PO--CK",
"fail" : "-",
+ "normalized" : 100,
"value" : 100,
"worst" : 100,
"threshold" : 10,
@@ -46,6 +50,7 @@
"threshold" : 0,
"name" : "Program_Fail_Count",
"worst" : 100,
+ "normalized" : 100,
"value" : 100,
"raw" : "0",
"flags" : "-O--CK",
@@ -60,12 +65,14 @@
"fail" : "-",
"flags" : "-O--CK",
"raw" : "0",
+ "normalized" : 100,
"value" : 100
},
{
"worst" : 100,
"threshold" : 0,
"name" : "Unsafe_Shutdown_Count",
+ "normalized" : 100,
"value" : 100,
"id" : "174",
"raw" : "164",
@@ -73,6 +80,7 @@
"fail" : "-"
},
{
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"flags" : "PO--CK",
@@ -86,6 +94,7 @@
"worst" : 100,
"threshold" : 0,
"name" : "SATA_Downshift_Count",
+ "normalized" : 100,
"value" : 100,
"id" : "183",
"raw" : "0",
@@ -96,6 +105,7 @@
"worst" : 100,
"name" : "End-to-End_Error",
"threshold" : 90,
+ "normalized" : 100,
"value" : 100,
"id" : "184",
"fail" : "-",
@@ -106,6 +116,7 @@
"worst" : 100,
"name" : "Reported_Uncorrect",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"id" : "187",
"fail" : "-",
@@ -120,12 +131,14 @@
"fail" : "-",
"raw" : "28 (Min/Max 21/30)",
"flags" : "-O---K",
+ "normalized" : 72,
"value" : 72
},
{
"worst" : 100,
"threshold" : 0,
"name" : "Unsafe_Shutdown_Count",
+ "normalized" : 100,
"value" : 100,
"id" : "192",
"raw" : "164",
@@ -137,6 +150,7 @@
"fail" : "-",
"raw" : "28",
"flags" : "-O---K",
+ "normalized" : 100,
"value" : 100,
"worst" : 100,
"name" : "Temperature_Internal",
@@ -146,6 +160,7 @@
"worst" : 100,
"threshold" : 0,
"name" : "Current_Pending_Sector",
+ "normalized" : 100,
"value" : 100,
"id" : "197",
"raw" : "0",
@@ -156,6 +171,7 @@
"worst" : 100,
"threshold" : 0,
"name" : "CRC_Error_Count",
+ "normalized" : 100,
"value" : 100,
"id" : "199",
"flags" : "-OSRCK",
@@ -170,9 +186,11 @@
"fail" : "-",
"flags" : "-O--CK",
"raw" : "296600",
+ "normalized" : 100,
"value" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"id" : "226",
"raw" : "3747",
@@ -190,6 +208,7 @@
"raw" : "0",
"flags" : "-O--CK",
"fail" : "-",
+ "normalized" : 100,
"value" : 100
},
{
@@ -200,6 +219,7 @@
"flags" : "-O--CK",
"fail" : "-",
"id" : "228",
+ "normalized" : 100,
"value" : 100
},
{
@@ -207,12 +227,14 @@
"raw" : "0",
"flags" : "PO--CK",
"id" : "232",
+ "normalized" : 100,
"value" : 100,
"name" : "Available_Reservd_Space",
"threshold" : 10,
"worst" : 100
},
{
+ "normalized" : 97,
"value" : 97,
"fail" : "-",
"flags" : "-O--CK",
@@ -223,6 +245,7 @@
"worst" : 97
},
{
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"raw" : "0/0",
@@ -240,9 +263,11 @@
"fail" : "-",
"raw" : "296600",
"flags" : "-O--CK",
+ "normalized" : 100,
"value" : 100
},
{
+ "normalized" : 100,
"value" : 100,
"id" : "242",
"fail" : "-",
diff --git a/test/disk_tests/ssd_smart/sdc_smart_expected.json b/test/disk_tests/ssd_smart/sdc_smart_expected.json
index f0cffcf..fad095b 100644
--- a/test/disk_tests/ssd_smart/sdc_smart_expected.json
+++ b/test/disk_tests/ssd_smart/sdc_smart_expected.json
@@ -3,6 +3,7 @@
"health" : "PASSED",
"attributes" : [
{
+ "normalized" : 99,
"value" : 99,
"fail" : "-",
"raw" : "34",
diff --git a/test/disk_tests/ssd_smart/sdd_smart_expected.json b/test/disk_tests/ssd_smart/sdd_smart_expected.json
index a85e7d7..8e0bebf 100644
--- a/test/disk_tests/ssd_smart/sdd_smart_expected.json
+++ b/test/disk_tests/ssd_smart/sdd_smart_expected.json
@@ -7,6 +7,7 @@
"worst" : 100,
"raw" : "0",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"name" : "Reallocated_Sector_Ct"
},
@@ -17,6 +18,7 @@
"id" : " 9",
"name" : "Power_On_Hours",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"raw" : "799"
},
@@ -24,6 +26,7 @@
"name" : "Power_Cycle_Count",
"raw" : "92",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"fail" : "-",
"worst" : 100,
@@ -37,10 +40,12 @@
"id" : "165",
"name" : "Unknown_Attribute",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"raw" : "9699447"
},
{
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"raw" : "1",
@@ -56,6 +61,7 @@
"fail" : "-",
"worst" : 100,
"raw" : "46",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"name" : "Unknown_Attribute"
@@ -63,6 +69,7 @@
{
"name" : "Unknown_Attribute",
"raw" : "5",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"fail" : "-",
@@ -75,6 +82,7 @@
"id" : "169",
"worst" : 100,
"fail" : "-",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"raw" : "1079",
@@ -83,6 +91,7 @@
{
"raw" : "0",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"name" : "Unknown_Attribute",
"id" : "170",
@@ -97,12 +106,14 @@
"flags" : "-O--CK",
"name" : "Unknown_Attribute",
"raw" : "0",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0
},
{
"name" : "Unknown_Attribute",
"raw" : "0",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"fail" : "-",
@@ -113,6 +124,7 @@
{
"name" : "Unknown_Attribute",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"raw" : "1",
"worst" : 100,
@@ -122,6 +134,7 @@
},
{
"name" : "Unknown_Attribute",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"raw" : "22",
@@ -136,12 +149,14 @@
"flags" : "-O--CK",
"id" : "184",
"name" : "End-to-End_Error",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"raw" : "0"
},
{
"name" : "Reported_Uncorrect",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"raw" : "0",
@@ -153,6 +168,7 @@
{
"name" : "Command_Timeout",
"raw" : "0",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"fail" : "-",
@@ -162,6 +178,7 @@
},
{
"threshold" : 0,
+ "normalized" : 73,
"value" : 73,
"raw" : "27 (Min/Max 23/64)",
"name" : "Temperature_Celsius",
@@ -176,6 +193,7 @@
"flags" : "-O--CK",
"id" : "199",
"name" : "UDMA_CRC_Error_Count",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"raw" : "0"
@@ -183,6 +201,7 @@
{
"name" : "Unknown_SSD_Attribute",
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"raw" : "146029805602",
"worst" : 100,
@@ -192,6 +211,7 @@
},
{
"raw" : "100",
+ "normalized" : 100,
"value" : 100,
"threshold" : 4,
"name" : "Available_Reservd_Space",
@@ -202,6 +222,7 @@
},
{
"threshold" : 0,
+ "normalized" : 100,
"value" : 100,
"raw" : "1574",
"name" : "Media_Wearout_Indicator",
@@ -216,6 +237,7 @@
"fail" : "-",
"worst" : 100,
"raw" : "2303",
+ "normalized" : 100,
"value" : 100,
"threshold" : 0,
"name" : "Unknown_Attribute"
@@ -227,6 +249,7 @@
"flags" : "----CK",
"name" : "Total_LBAs_Written",
"raw" : "2111",
+ "normalized" : 253,
"value" : 253,
"threshold" : 0
},
@@ -237,11 +260,13 @@
"id" : "242",
"name" : "Total_LBAs_Read",
"threshold" : 0,
+ "normalized" : 253,
"value" : 253,
"raw" : "1542"
},
{
"name" : "Unknown_Attribute",
+ "normalized" : 0,
"value" : 0,
"threshold" : 0,
"raw" : "0",
diff --git a/test/disk_tests/ssd_smart/sde_smart_expected.json b/test/disk_tests/ssd_smart/sde_smart_expected.json
index 1d45c1d..0fa1214 100644
--- a/test/disk_tests/ssd_smart/sde_smart_expected.json
+++ b/test/disk_tests/ssd_smart/sde_smart_expected.json
@@ -9,12 +9,14 @@
"flags": "-O--CK",
"name": "Raw_Read_Error_Rate",
"threshold": 50,
+ "normalized": 120,
"value": 120,
"worst": 120
},
{
"id": " 5",
"fail": "-",
+ "normalized": 100,
"value": 100,
"worst": 100,
"threshold": 3,
@@ -28,6 +30,7 @@
"raw": "7963h+07m+54.620s",
"flags": "-O--CK",
"worst": 91,
+ "normalized": 91,
"value": 91,
"name": "Power_On_Hours_and_Msec",
"threshold": 0
@@ -38,6 +41,7 @@
"threshold": 0,
"name": "Power_Cycle_Count",
"worst": 99,
+ "normalized": 99,
"value": 99,
"flags": "-O--CK",
"raw": "1153"
@@ -46,6 +50,7 @@
"flags": "-O-R--",
"raw": "0",
"worst": 100,
+ "normalized": 100,
"value": 100,
"threshold": 0,
"name": "Program_Fail_Count",
@@ -60,6 +65,7 @@
"name": "Erase_Fail_Count",
"threshold": 0,
"worst": 100,
+ "normalized": 100,
"value": 100
},
{
@@ -67,6 +73,7 @@
"id": "174",
"raw": "113",
"flags": "----CK",
+ "normalized": 0,
"value": 0,
"worst": 0,
"threshold": 0,
@@ -75,6 +82,7 @@
{
"id": "177",
"fail": "-",
+ "normalized": 0,
"value": 0,
"worst": 0,
"name": "Wear_Range_Delta",
@@ -88,6 +96,7 @@
"threshold": 0,
"name": "Program_Fail_Count",
"worst": 100,
+ "normalized": 100,
"value": 100,
"fail": "-",
"id": "181"
@@ -95,6 +104,7 @@
{
"threshold": 0,
"name": "Erase_Fail_Count",
+ "normalized": 100,
"value": 100,
"worst": 100,
"flags": "-O--CK",
@@ -105,6 +115,7 @@
{
"flags": "-O--C-",
"raw": "0",
+ "normalized": 100,
"value": 100,
"worst": 100,
"threshold": 0,
@@ -113,6 +124,7 @@
"id": "187"
},
{
+ "normalized": 27,
"value": 27,
"worst": 49,
"name": "Airflow_Temperature_Cel",
@@ -126,6 +138,7 @@
"threshold": 0,
"name": "Temperature_Celsius",
"worst": 49,
+ "normalized": 27,
"value": 27,
"flags": "-O---K",
"raw": "27 (Min/Max 2/49)",
@@ -136,6 +149,7 @@
"id": "195",
"fail": "-",
"worst": 120,
+ "normalized": 120,
"value": 120,
"threshold": 0,
"name": "ECC_Uncorr_Error_Count",
@@ -149,10 +163,12 @@
"flags": "PO--CK",
"threshold": 3,
"name": "Reallocated_Event_Count",
+ "normalized": 100,
"value": 100,
"worst": 100
},
{
+ "normalized": 120,
"value": 120,
"worst": 120,
"threshold": 0,
@@ -165,6 +181,7 @@
{
"raw": "0/0",
"flags": "--SRC-",
+ "normalized": 120,
"value": 120,
"worst": 120,
"threshold": 0,
@@ -173,6 +190,7 @@
"id": "204"
},
{
+ "normalized": 100,
"value": 100,
"worst": 100,
"threshold": 0,
@@ -186,6 +204,7 @@
"id": "231",
"fail": "-",
"worst": 91,
+ "normalized": 91,
"value": 91,
"name": "SSD_Life_Left",
"threshold": 11,
@@ -197,12 +216,14 @@
"flags": "-O--CK",
"name": "SandForce_Internal",
"threshold": 0,
+ "normalized": 0,
"value": 0,
"worst": 0,
"fail": "-",
"id": "233"
},
{
+ "normalized": 0,
"value": 0,
"worst": 0,
"name": "SandForce_Internal",
@@ -214,6 +235,7 @@
},
{
"worst": 0,
+ "normalized": 0,
"value": 0,
"name": "Lifetime_Writes_GiB",
"threshold": 0,
@@ -225,6 +247,7 @@
{
"flags": "-O--CK",
"raw": "34599",
+ "normalized": 0,
"value": 0,
"worst": 0,
"threshold": 0,
@@ -236,6 +259,7 @@
"threshold": 10,
"name": "Unknown_Attribute",
"worst": 99,
+ "normalized": 99,
"value": 99,
"flags": "------",
"raw": "4063273",
--
2.30.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [pve-devel] [PATCH widget-toolkit] fix #4165: SMART: use changed columns from the API
2022-07-21 10:45 [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Matthias Heiserer
2022-07-21 10:45 ` [pve-devel] [PATCH pve-storage] fix #4165: disk: SMART: add normalized field Matthias Heiserer
@ 2022-07-21 10:45 ` Matthias Heiserer
2022-09-22 10:35 ` [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Dominik Csapak
2022-09-23 10:28 ` [pve-devel] applied: " Thomas Lamprecht
3 siblings, 0 replies; 7+ messages in thread
From: Matthias Heiserer @ 2022-07-21 10:45 UTC (permalink / raw)
To: pve-devel, pbs-devel
Makes the column names and the data name in the API consistent.
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
src/window/DiskSmart.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/window/DiskSmart.js b/src/window/DiskSmart.js
index 3c8040b..fc4b2cc 100644
--- a/src/window/DiskSmart.js
+++ b/src/window/DiskSmart.js
@@ -37,13 +37,13 @@ Ext.define('Proxmox.window.DiskSmart', {
renderer: Ext.String.htmlEncode,
},
{
- text: gettext('Value'),
+ text: gettext('Raw'),
dataIndex: 'raw',
renderer: Ext.String.htmlEncode,
},
{
text: gettext('Normalized'),
- dataIndex: 'value',
+ dataIndex: 'normalized',
width: 60,
},
{
@@ -154,7 +154,7 @@ Ext.define('Proxmox.window.DiskSmart', {
Ext.define('pmx-smart-attribute', {
extend: 'Ext.data.Model',
fields: [
- { name: 'id', type: 'number' }, 'name', 'value', 'worst', 'threshold', 'flags', 'fail', 'raw',
+ { name: 'id', type: 'number' }, 'name', 'raw', 'worst', 'threshold', 'flags', 'fail', 'normalized',
],
idProperty: 'name',
});
--
2.30.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field
2022-07-21 10:45 [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Matthias Heiserer
2022-07-21 10:45 ` [pve-devel] [PATCH pve-storage] fix #4165: disk: SMART: add normalized field Matthias Heiserer
2022-07-21 10:45 ` [pve-devel] [PATCH widget-toolkit] fix #4165: SMART: use changed columns from the API Matthias Heiserer
@ 2022-09-22 10:35 ` Dominik Csapak
2022-09-23 10:31 ` [pve-devel] [pbs-devel] " Thomas Lamprecht
2022-09-23 10:28 ` [pve-devel] applied: " Thomas Lamprecht
3 siblings, 1 reply; 7+ messages in thread
From: Dominik Csapak @ 2022-09-22 10:35 UTC (permalink / raw)
To: Proxmox VE development discussion, Matthias Heiserer, pbs-devel
all 3 patches LGTM
the only (minor) thing is that the wt patch could have handled the current situation
(pve raw+value, pbs normalized+value), e.g by using the field 'convert' or 'calculate'
methods of extjs (we could have had a 'real_raw' and 'real_normalized' that uses
the values depending on which exist) then we would not need a depends/breaks on the
versions (not sure which direction here)
if everybody else is ok with these dependencies, consider these patches:
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.cspak@proxmox.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [pve-devel] applied: [pbs-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field
2022-07-21 10:45 [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Matthias Heiserer
` (2 preceding siblings ...)
2022-09-22 10:35 ` [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Dominik Csapak
@ 2022-09-23 10:28 ` Thomas Lamprecht
3 siblings, 0 replies; 7+ messages in thread
From: Thomas Lamprecht @ 2022-09-23 10:28 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Matthias Heiserer,
pve-devel
Am 21/07/2022 um 12:45 schrieb Matthias Heiserer:
> This makes it consistent with the naming scheme in PVE/GUI.
> Keep value for API stability reasons, and remove it in next major version.
>
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> src/tools/disks/smart.rs | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
>
applied, with Dominik's T-b/R-b and a small follow up (see below), thanks!
> diff --git a/src/tools/disks/smart.rs b/src/tools/disks/smart.rs
> index 3738cdfd..787971e9 100644
> --- a/src/tools/disks/smart.rs
> +++ b/src/tools/disks/smart.rs
> @@ -25,8 +25,11 @@ pub enum SmartStatus {
> pub struct SmartAttribute {
> /// Attribute name
> name: String,
> - /// Attribute raw value
> + // fixme remove value in major release
Please capitalize FIXME, as that way most editors will highlight it by default,
additionally include the specific major release this should be removed. I changed
it to:
// FIXME: remove value with next major relase (PBS 3.0)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [pve-devel] applied: [pbs-devel] [PATCH pve-storage] fix #4165: disk: SMART: add normalized field
2022-07-21 10:45 ` [pve-devel] [PATCH pve-storage] fix #4165: disk: SMART: add normalized field Matthias Heiserer
@ 2022-09-23 10:29 ` Thomas Lamprecht
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Lamprecht @ 2022-09-23 10:29 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Matthias Heiserer,
pve-devel
Am 21/07/2022 um 12:45 schrieb Matthias Heiserer:
> This makes it consistent with the naming scheme in PBS/GUI.
> Keep value for API stability reasons and remove it in the next major version.
>
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> PVE/Diskmanage.pm | 2 ++
> .../hdd_smart/sda_smart_expected.json | 24 ++++++++++++++++++
> .../hdd_smart/sdb_smart_expected.json | 21 ++++++++++++++++
> .../ssd_smart/sda_smart_expected.json | 23 +++++++++++++++++
> .../ssd_smart/sdb_smart_expected.json | 25 +++++++++++++++++++
> .../ssd_smart/sdc_smart_expected.json | 1 +
> .../ssd_smart/sdd_smart_expected.json | 25 +++++++++++++++++++
> .../ssd_smart/sde_smart_expected.json | 24 ++++++++++++++++++
> 8 files changed, 145 insertions(+)
>
>
applied, with Dominik's R-b & T-B trailers and a similar followup w.r.t. the FIXME comment
as in PBS, thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [pve-devel] [pbs-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field
2022-09-22 10:35 ` [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Dominik Csapak
@ 2022-09-23 10:31 ` Thomas Lamprecht
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Lamprecht @ 2022-09-23 10:31 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Dominik Csapak,
Proxmox VE development discussion, Matthias Heiserer
Am 22/09/2022 um 12:35 schrieb Dominik Csapak:
>
> the only (minor) thing is that the wt patch could have handled the current situation
> (pve raw+value, pbs normalized+value), e.g by using the field 'convert' or 'calculate'
> methods of extjs (we could have had a 'real_raw' and 'real_normalized' that uses
> the values depending on which exist) then we would not need a depends/breaks on the
> versions (not sure which direction here)
>
> if everybody else is ok with these dependencies, consider these patches:
This cannot really be solved by dependencies, as the frontend (normally) doesn't
run on the same host as the backend, so a newer frontend (e.g., connected through
another cluster node) "breaks". So as long as its easy as in this case, I really
would do backward compat handling in the frontend.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-09-23 10:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 10:45 [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Matthias Heiserer
2022-07-21 10:45 ` [pve-devel] [PATCH pve-storage] fix #4165: disk: SMART: add normalized field Matthias Heiserer
2022-09-23 10:29 ` [pve-devel] applied: [pbs-devel] " Thomas Lamprecht
2022-07-21 10:45 ` [pve-devel] [PATCH widget-toolkit] fix #4165: SMART: use changed columns from the API Matthias Heiserer
2022-09-22 10:35 ` [pve-devel] [PATCH proxmox-backup] fix #4165: SMART: add raw field Dominik Csapak
2022-09-23 10:31 ` [pve-devel] [pbs-devel] " Thomas Lamprecht
2022-09-23 10:28 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox