Identify drives by a Scrutiny UUID instead of wwn (#960)

* Generate a UUIDv5 from a random namespace  based on WWN, model name, and serial number
* Migrate sqlite and influxdb data accordingly
* Update frontend API routes and components
* Fixes #923
This commit is contained in:
Aram Akhavan
2026-03-25 20:16:17 -07:00
committed by GitHub
parent e4c40f7e80
commit c3b2eb2b4f
69 changed files with 815 additions and 402 deletions
@@ -40,7 +40,7 @@ export class DetailsMockApi implements TreoMockApi
register(): void
{
this._treoMockApiService
.onGet('/api/device/0x5002538e40a22954/details')
.onGet('/api/device/ecfaaf20-d1f6-558b-b33a-3e8db19a6c2c/details')
.reply(() => {
return [
@@ -50,7 +50,7 @@ export class DetailsMockApi implements TreoMockApi
});
this._treoMockApiService
.onGet('/api/device/0x5000cca264eb01d7/details')
.onGet('/api/device/3ea22b35-682b-49fb-a655-abffed108e48/details')
.reply(() => {
return [
@@ -60,7 +60,7 @@ export class DetailsMockApi implements TreoMockApi
});
this._treoMockApiService
.onGet('/api/device/0x5000cca264ec3183/details')
.onGet('/api/device/42caca8a-9b95-5c75-b059-305771a2a193/details')
.reply(() => {
return [
@@ -70,7 +70,7 @@ export class DetailsMockApi implements TreoMockApi
});
this._treoMockApiService
.onGet('/api/device/0x5000cca252c859cc/details')
.onGet('/api/device/d8796fe7-2422-520c-8991-e970993dad3e/details')
.reply(() => {
return [
@@ -80,7 +80,17 @@ export class DetailsMockApi implements TreoMockApi
});
this._treoMockApiService
.onGet('/api/device/0x5000cca264ebc248/details')
.onGet('/api/device/00328b73-9f8a-53ad-8f20-8d0b1be00f47/details')
.reply(() => {
return [
200,
_.cloneDeep(sde)
];
});
this._treoMockApiService
.onGet('/api/device/e5ccc378-24fc-5a9d-b1ce-8732096a9ea5/details')
.reply(() => {
return [
@@ -5,6 +5,7 @@ export const sda = {
'UpdatedAt': '2021-10-24T16:37:56.981833-07:00',
'DeletedAt': null,
'wwn': '0x5002538e40a22954',
'scrutiny_uuid': 'ecfaaf20-d1f6-558b-b33a-3e8db19a6c2c',
'device_name': 'sda',
'manufacturer': 'ATA',
'model_name': 'Samsung_SSD_860_EVO_500GB',
@@ -26,6 +27,7 @@ export const sda = {
'smart_results': [{
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5002538e40a22954',
'scrutiny_uuid': 'ecfaaf20-d1f6-558b-b33a-3e8db19a6c2c',
'device_protocol': 'NVMe',
'temp': 36,
'power_on_hours': 2401,
@@ -5,12 +5,13 @@ export const sdb = {
'UpdatedAt': '2021-10-24T17:06:39.436996-07:00',
'DeletedAt': null,
'wwn': '0x5000cca264eb01d7',
'scrutiny_uuid': '3ea22b35-682b-49fb-a655-abffed108e48',
'device_name': 'sdb',
'manufacturer': 'ATA',
'model_name': 'WDC_WD140EDFZ-11A0VA0',
'interface_type': 'SCSI',
'interface_speed': '',
'serial_number': '9RK1XXXXX',
'serial_number': '9RK1XXXX',
'firmware': '81.00A81',
'rotational_speed': 0,
'capacity': 14000519643136,
@@ -25,6 +26,7 @@ export const sdb = {
'smart_results': [{
'date': '2021-10-24T20:34:04Z',
'device_wwn': '0x5000cca264eb01d7',
'scrutiny_uuid': '3ea22b35-682b-49fb-a655-abffed108e48',
'device_protocol': 'ATA',
'temp': 32,
'power_on_hours': 1730,
@@ -245,6 +247,7 @@ export const sdb = {
}, {
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5000cca264eb01d7',
'scrutiny_uuid': '3ea22b35-682b-49fb-a655-abffed108e48',
'device_protocol': 'ATA',
'temp': 32,
'power_on_hours': 1730,
@@ -5,6 +5,7 @@ export const sdc = {
'UpdatedAt': '2021-10-24T16:37:56.74865-07:00',
'DeletedAt': null,
'wwn': '0x5000cca264ec3183',
'scrutiny_uuid': '42caca8a-9b95-5c75-b059-305771a2a193',
'device_name': 'sdc',
'manufacturer': 'ATA',
'model_name': 'WDC_WD140EDFZ-11A0VA0',
@@ -25,6 +26,7 @@ export const sdc = {
'smart_results': [{
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5000cca264ec3183',
'scrutiny_uuid': '42caca8a-9b95-5c75-b059-305771a2a193',
'device_protocol': 'ATA',
'temp': 25,
'power_on_hours': 65592,
@@ -5,6 +5,7 @@ export const sdd = {
'UpdatedAt': '2021-10-24T16:37:57.013758-07:00',
'DeletedAt': null,
'wwn': '0x5000cca252c859cc',
'scrutiny_uuid': 'd8796fe7-2422-520c-8991-e970993dad3e',
'device_name': 'sdd',
'manufacturer': 'ATA',
'model_name': 'WDC_WD80EFAX-68LHPN0',
@@ -25,6 +26,7 @@ export const sdd = {
'smart_results': [{
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5000cca252c859cc',
'scrutiny_uuid': 'd8796fe7-2422-520c-8991-e970993dad3e',
'device_protocol': 'SCSI',
'temp': 34,
'power_on_hours': 43549,
@@ -5,6 +5,7 @@ export const sde = {
'UpdatedAt': '2021-10-24T16:40:16.495248-07:00',
'DeletedAt': null,
'wwn': '0x5000cca264ebc248',
'scrutiny_uuid': '00328b73-9f8a-53ad-8f20-8d0b1be00f47',
'device_name': 'sde',
'manufacturer': 'ATA',
'model_name': 'WDC_WD140EDFZ-11A0VA0',
@@ -25,6 +26,7 @@ export const sde = {
'smart_results': [{
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5000cca264ebc248',
'scrutiny_uuid': '00328b73-9f8a-53ad-8f20-8d0b1be00f47',
'device_protocol': 'SCSI',
'temp': 31,
'power_on_hours': 5675,
@@ -5,6 +5,7 @@ export const sdf = {
'UpdatedAt': '2021-06-24T21:17:31.305246-07:00',
'DeletedAt': null,
'wwn': '0x50014ee20b2a72a9',
'scrutiny_uuid': 'e5ccc378-24fc-5a9d-b1ce-8732096a9ea5',
'device_name': 'sdf',
'manufacturer': 'ATA',
'model_name': 'WDC_WD60EFRX-68MYMN1',
@@ -4,12 +4,13 @@ import * as moment from 'moment';
export const summary = {
'data': {
'summary': {
'0x5000c500673e6b5f': {
'acfbce7d-0e19-579b-895e-85809dab63fb': {
'device': {
'CreatedAt': '2021-04-30T08:17:13.155217-07:00',
'UpdatedAt': '2021-04-30T08:17:13.155217-07:00',
'DeletedAt': null,
'wwn': '0x5000c500673e6b5f',
'scrutiny_uuid': 'acfbce7d-0e19-579b-895e-85809dab63fb',
'device_name': 'sdg',
'device_label': '14TB-WD-DRIVE2',
'device_uuid': '',
@@ -32,12 +33,13 @@ export const summary = {
'archived': false
}
},
'0x5000cca252c859cc': {
'd8796fe7-2422-520c-8991-e970993dad3e': {
'device': {
'CreatedAt': '2021-04-30T08:17:13.152705-07:00',
'UpdatedAt': '2021-05-02T14:22:50.357164-07:00',
'DeletedAt': null,
'wwn': '0x5000cca252c859cc',
'scrutiny_uuid': 'd8796fe7-2422-520c-8991-e970993dad3e',
'device_name': 'sdd',
'device_label': '14TB-WD-DRIVE1',
'device_uuid': '806cf4bc-d160-4d96-8ee9-3ab7cf2a2e1f',
@@ -69,21 +71,22 @@ export const summary = {
'temp': 34
}]
},
'0x5000cca264eb01d7': {
'3ea22b35-682b-49fb-a655-abffed108e48': {
'device': {
'CreatedAt': '2021-04-28T20:52:49.047154-07:00',
'UpdatedAt': '2021-05-02T14:22:49.86136-07:00',
'DeletedAt': null,
'wwn': '0x5000cca264eb01d7',
'scrutiny_uuid': '3ea22b35-682b-49fb-a655-abffed108e48',
'device_name': 'sdb',
'device_label': '14TB-WD-DRIVE5',
'device_uuid': '8125ec6d-a7e4-4950-ac84-72d6a4d67128',
'device_serial_id': 'ata-WDC_WD140EDFZ-11A0VA0-9RK1XXXXX',
'device_serial_id': 'ata-WDC_WD140EDFZ-11A0VA0-9RK1XXXX',
'manufacturer': 'ATA',
'model_name': 'WDC_WD140EDFZ-11A0VA0',
'interface_type': 'SCSI',
'interface_speed': '',
'serial_number': '9RK1XXXXX',
'serial_number': '9RK1XXXX',
'firmware': '81.00A81',
'rotational_speed': 0,
'capacity': 14000519643136,
@@ -106,12 +109,13 @@ export const summary = {
'temp': 32
}]
},
'0x5000cca264ebc248': {
'00328b73-9f8a-53ad-8f20-8d0b1be00f47': {
'device': {
'CreatedAt': '2021-04-30T08:17:13.153782-07:00',
'UpdatedAt': '2021-05-02T14:22:50.385282-07:00',
'DeletedAt': null,
'wwn': '0x5000cca264ebc248',
'scrutiny_uuid': '00328b73-9f8a-53ad-8f20-8d0b1be00f47',
'device_name': 'sde',
'device_label': '14TB-WD-DRIVE3',
'device_uuid': '9eb60cde-d6d0-4172-b520-b241a6a5477f',
@@ -134,12 +138,13 @@ export const summary = {
'archived': false
}
},
'0x5000cca264ec3183': {
'42caca8a-9b95-5c75-b059-305771a2a193': {
'device': {
'CreatedAt': '2021-04-30T08:17:13.151906-07:00',
'UpdatedAt': '2021-05-02T14:49:51.645012-07:00',
'DeletedAt': null,
'wwn': '0x5000cca264ec3183',
'scrutiny_uuid': '42caca8a-9b95-5c75-b059-305771a2a193',
'device_name': 'sdc',
'device_label': '14TB-WD-DRIVE6',
'device_uuid': 'e1378723-7861-49b9-8e01-0bd063f0ecdd',
@@ -555,12 +560,13 @@ export const summary = {
'temp': 39
}]
},
'0x50014ee20b2a72a9': {
'e5ccc378-24fc-5a9d-b1ce-8732096a9ea5': {
'device': {
'CreatedAt': '2021-04-30T08:17:13.15451-07:00',
'UpdatedAt': '2021-04-30T08:17:13.15451-07:00',
'DeletedAt': null,
'wwn': '0x50014ee20b2a72a9',
'scrutiny_uuid': 'e5ccc378-24fc-5a9d-b1ce-8732096a9ea5',
'device_name': 'sdf',
'device_label': '8.0TB-WD-4',
'device_uuid': 'fc684dcc-aa2f-44f3-a958-d302dc7dd46d',
@@ -583,12 +589,13 @@ export const summary = {
'archived': false
}
},
'0x5002538e40a22954': {
'ecfaaf20-d1f6-558b-b33a-3e8db19a6c2c': {
'device': {
'CreatedAt': '2021-04-30T08:17:13.150792-07:00',
'UpdatedAt': '2021-05-02T14:22:50.330706-07:00',
'DeletedAt': null,
'wwn': '0x5002538e40a22954',
'scrutiny_uuid': 'ecfaaf20-d1f6-558b-b33a-3e8db19a6c2c',
'device_name': 'sda',
'device_label': '',
'device_uuid': '',