commit
fb918e2d6e
@ -0,0 +1,161 @@
|
|||||||
|
package notify
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/analogj/scrutiny/webapp/backend/pkg"
|
||||||
|
"github.com/analogj/scrutiny/webapp/backend/pkg/models"
|
||||||
|
"github.com/analogj/scrutiny/webapp/backend/pkg/models/measurements"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestShouldNotify_MustSkipPassingDevices(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusPassed,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{}
|
||||||
|
notifyLevel := pkg.NotifyLevelFail
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesAll
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.False(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyLevelFail_FailingSmartDevice(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{}
|
||||||
|
notifyLevel := pkg.NotifyLevelFail
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesAll
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.True(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyLevelFailSmart_FailingSmartDevice(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{}
|
||||||
|
notifyLevel := pkg.NotifyLevelFailSmart
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesAll
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.True(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyLevelFailScrutiny_FailingSmartDevice(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{}
|
||||||
|
notifyLevel := pkg.NotifyLevelFailScrutiny
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesAll
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.False(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyFilterAttributesCritical_WithCriticalAttrs(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{Attributes: map[string]measurements.SmartAttribute{
|
||||||
|
"5": &measurements.SmartAtaAttribute{
|
||||||
|
Status: pkg.AttributeStatusFailedSmart,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
notifyLevel := pkg.NotifyLevelFail
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesCritical
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.True(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyFilterAttributesCritical_WithMultipleCriticalAttrs(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{Attributes: map[string]measurements.SmartAttribute{
|
||||||
|
"5": &measurements.SmartAtaAttribute{
|
||||||
|
Status: pkg.AttributeStatusPassed,
|
||||||
|
},
|
||||||
|
"10": &measurements.SmartAtaAttribute{
|
||||||
|
Status: pkg.AttributeStatusFailedScrutiny,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
notifyLevel := pkg.NotifyLevelFail
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesCritical
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.True(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyFilterAttributesCritical_WithNoCriticalAttrs(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{Attributes: map[string]measurements.SmartAttribute{
|
||||||
|
"1": &measurements.SmartAtaAttribute{
|
||||||
|
Status: pkg.AttributeStatusFailedSmart,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
notifyLevel := pkg.NotifyLevelFail
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesCritical
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.False(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyFilterAttributesCritical_WithNoFailingCriticalAttrs(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{Attributes: map[string]measurements.SmartAttribute{
|
||||||
|
"5": &measurements.SmartAtaAttribute{
|
||||||
|
Status: pkg.AttributeStatusPassed,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
notifyLevel := pkg.NotifyLevelFail
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesCritical
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.False(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestShouldNotify_NotifyFilterAttributesCritical_NotifyLevelFailSmart_WithCriticalAttrsFailingScrutiny(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
//setup
|
||||||
|
device := models.Device{
|
||||||
|
DeviceStatus: pkg.DeviceStatusFailedSmart,
|
||||||
|
}
|
||||||
|
smartAttrs := measurements.Smart{Attributes: map[string]measurements.SmartAttribute{
|
||||||
|
"5": &measurements.SmartAtaAttribute{
|
||||||
|
Status: pkg.AttributeStatusPassed,
|
||||||
|
},
|
||||||
|
"10": &measurements.SmartAtaAttribute{
|
||||||
|
Status: pkg.AttributeStatusFailedScrutiny,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
notifyLevel := pkg.NotifyLevelFailSmart
|
||||||
|
notifyFilterAttributes := pkg.NotifyFilterAttributesCritical
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.False(t, ShouldNotify(device, smartAttrs, notifyLevel, notifyFilterAttributes))
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,222 +1,222 @@
|
|||||||
export const sdd = {
|
export const sdd = {
|
||||||
"data": {
|
'data': {
|
||||||
"device": {
|
'device': {
|
||||||
"CreatedAt": "2021-06-24T21:17:31.30374-07:00",
|
'CreatedAt': '2021-06-24T21:17:31.30374-07:00',
|
||||||
"UpdatedAt": "2021-10-24T16:37:57.013758-07:00",
|
'UpdatedAt': '2021-10-24T16:37:57.013758-07:00',
|
||||||
"DeletedAt": null,
|
'DeletedAt': null,
|
||||||
"wwn": "0x5000cca252c859cc",
|
'wwn': '0x5000cca252c859cc',
|
||||||
"device_name": "sdd",
|
'device_name': 'sdd',
|
||||||
"manufacturer": "ATA",
|
'manufacturer': 'ATA',
|
||||||
"model_name": "WDC_WD80EFAX-68LHPN0",
|
'model_name': 'WDC_WD80EFAX-68LHPN0',
|
||||||
"interface_type": "SCSI",
|
'interface_type': 'SCSI',
|
||||||
"interface_speed": "",
|
'interface_speed': '',
|
||||||
"serial_number": "7SGLXXXXX",
|
'serial_number': '7SGLXXXXX',
|
||||||
"firmware": "",
|
'firmware': '',
|
||||||
"rotational_speed": 0,
|
'rotational_speed': 0,
|
||||||
"capacity": 8001563222016,
|
'capacity': 8001563222016,
|
||||||
"form_factor": "",
|
'form_factor': '',
|
||||||
"smart_support": false,
|
'smart_support': false,
|
||||||
"device_protocol": "SCSI",
|
'device_protocol': 'SCSI',
|
||||||
"device_type": "",
|
'device_type': '',
|
||||||
"label": "",
|
'label': '',
|
||||||
"host_id": "",
|
'host_id': '',
|
||||||
"device_status": 0
|
'device_status': 0
|
||||||
},
|
},
|
||||||
"smart_results": [{
|
'smart_results': [{
|
||||||
"date": "2021-10-24T23:20:44Z",
|
'date': '2021-10-24T23:20:44Z',
|
||||||
"device_wwn": "0x5000cca252c859cc",
|
'device_wwn': '0x5000cca252c859cc',
|
||||||
"device_protocol": "SCSI",
|
'device_protocol': 'SCSI',
|
||||||
"temp": 34,
|
'temp': 34,
|
||||||
"power_on_hours": 43549,
|
'power_on_hours': 43549,
|
||||||
"power_cycle_count": 0,
|
'power_cycle_count': 0,
|
||||||
"attrs": {
|
'attrs': {
|
||||||
"read_correction_algorithm_invocations": {
|
'read_correction_algorithm_invocations': {
|
||||||
"attribute_id": "read_correction_algorithm_invocations",
|
'attribute_id': 'read_correction_algorithm_invocations',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccdelayed": {
|
'read_errors_corrected_by_eccdelayed': {
|
||||||
"attribute_id": "read_errors_corrected_by_eccdelayed",
|
'attribute_id': 'read_errors_corrected_by_eccdelayed',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccfast": {
|
'read_errors_corrected_by_eccfast': {
|
||||||
"attribute_id": "read_errors_corrected_by_eccfast",
|
'attribute_id': 'read_errors_corrected_by_eccfast',
|
||||||
"value": 300357663,
|
'value': 300357663,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_rereads_rewrites": {
|
'read_errors_corrected_by_rereads_rewrites': {
|
||||||
"attribute_id": "read_errors_corrected_by_rereads_rewrites",
|
'attribute_id': 'read_errors_corrected_by_rereads_rewrites',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_total_errors_corrected": {
|
'read_total_errors_corrected': {
|
||||||
"attribute_id": "read_total_errors_corrected",
|
'attribute_id': 'read_total_errors_corrected',
|
||||||
"value": 300357663,
|
'value': 300357663,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_total_uncorrected_errors": {
|
'read_total_uncorrected_errors': {
|
||||||
"attribute_id": "read_total_uncorrected_errors",
|
'attribute_id': 'read_total_uncorrected_errors',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"scsi_grown_defect_list": {
|
'scsi_grown_defect_list': {
|
||||||
"attribute_id": "scsi_grown_defect_list",
|
'attribute_id': 'scsi_grown_defect_list',
|
||||||
"value": 56,
|
'value': 56,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_correction_algorithm_invocations": {
|
'write_correction_algorithm_invocations': {
|
||||||
"attribute_id": "write_correction_algorithm_invocations",
|
'attribute_id': 'write_correction_algorithm_invocations',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccdelayed": {
|
'write_errors_corrected_by_eccdelayed': {
|
||||||
"attribute_id": "write_errors_corrected_by_eccdelayed",
|
'attribute_id': 'write_errors_corrected_by_eccdelayed',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccfast": {
|
'write_errors_corrected_by_eccfast': {
|
||||||
"attribute_id": "write_errors_corrected_by_eccfast",
|
'attribute_id': 'write_errors_corrected_by_eccfast',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_rereads_rewrites": {
|
'write_errors_corrected_by_rereads_rewrites': {
|
||||||
"attribute_id": "write_errors_corrected_by_rereads_rewrites",
|
'attribute_id': 'write_errors_corrected_by_rereads_rewrites',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_total_errors_corrected": {
|
'write_total_errors_corrected': {
|
||||||
"attribute_id": "write_total_errors_corrected",
|
'attribute_id': 'write_total_errors_corrected',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_total_uncorrected_errors": {
|
'write_total_uncorrected_errors': {
|
||||||
"attribute_id": "write_total_uncorrected_errors",
|
'attribute_id': 'write_total_uncorrected_errors',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Status": 0
|
'Status': 0
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
"metadata": {
|
'metadata': {
|
||||||
"read_correction_algorithm_invocations": {
|
'read_correction_algorithm_invocations': {
|
||||||
"display_name": "Read Correction Algorithm Invocations",
|
'display_name': 'Read Correction Algorithm Invocations',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccdelayed": {
|
'read_errors_corrected_by_eccdelayed': {
|
||||||
"display_name": "Read Errors Corrected by ECC Delayed",
|
'display_name': 'Read Errors Corrected by ECC Delayed',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccfast": {
|
'read_errors_corrected_by_eccfast': {
|
||||||
"display_name": "Read Errors Corrected by ECC Fast",
|
'display_name': 'Read Errors Corrected by ECC Fast',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_rereads_rewrites": {
|
'read_errors_corrected_by_rereads_rewrites': {
|
||||||
"display_name": "Read Errors Corrected by ReReads/ReWrites",
|
'display_name': 'Read Errors Corrected by ReReads/ReWrites',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_total_errors_corrected": {
|
'read_total_errors_corrected': {
|
||||||
"display_name": "Read Total Errors Corrected",
|
'display_name': 'Read Total Errors Corrected',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_total_uncorrected_errors": {
|
'read_total_uncorrected_errors': {
|
||||||
"display_name": "Read Total Uncorrected Errors",
|
'display_name': 'Read Total Uncorrected Errors',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"scsi_grown_defect_list": {
|
'scsi_grown_defect_list': {
|
||||||
"display_name": "Grown Defect List",
|
'display_name': 'Grown Defect List',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_correction_algorithm_invocations": {
|
'write_correction_algorithm_invocations': {
|
||||||
"display_name": "Write Correction Algorithm Invocations",
|
'display_name': 'Write Correction Algorithm Invocations',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccdelayed": {
|
'write_errors_corrected_by_eccdelayed': {
|
||||||
"display_name": "Write Errors Corrected by ECC Delayed",
|
'display_name': 'Write Errors Corrected by ECC Delayed',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccfast": {
|
'write_errors_corrected_by_eccfast': {
|
||||||
"display_name": "Write Errors Corrected by ECC Fast",
|
'display_name': 'Write Errors Corrected by ECC Fast',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_rereads_rewrites": {
|
'write_errors_corrected_by_rereads_rewrites': {
|
||||||
"display_name": "Write Errors Corrected by ReReads/ReWrites",
|
'display_name': 'Write Errors Corrected by ReReads/ReWrites',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_total_errors_corrected": {
|
'write_total_errors_corrected': {
|
||||||
"display_name": "Write Total Errors Corrected",
|
'display_name': 'Write Total Errors Corrected',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_total_uncorrected_errors": {
|
'write_total_uncorrected_errors': {
|
||||||
"display_name": "Write Total Uncorrected Errors",
|
'display_name': 'Write Total Uncorrected Errors',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"success": true
|
'success': true
|
||||||
}
|
}
|
||||||
|
@ -1,222 +1,222 @@
|
|||||||
export const sde = {
|
export const sde = {
|
||||||
"data": {
|
'data': {
|
||||||
"device": {
|
'device': {
|
||||||
"CreatedAt": "2021-06-24T21:17:31.304461-07:00",
|
'CreatedAt': '2021-06-24T21:17:31.304461-07:00',
|
||||||
"UpdatedAt": "2021-10-24T16:40:16.495248-07:00",
|
'UpdatedAt': '2021-10-24T16:40:16.495248-07:00',
|
||||||
"DeletedAt": null,
|
'DeletedAt': null,
|
||||||
"wwn": "0x5000cca264ebc248",
|
'wwn': '0x5000cca264ebc248',
|
||||||
"device_name": "sde",
|
'device_name': 'sde',
|
||||||
"manufacturer": "ATA",
|
'manufacturer': 'ATA',
|
||||||
"model_name": "WDC_WD140EDFZ-11A0VA0",
|
'model_name': 'WDC_WD140EDFZ-11A0VA0',
|
||||||
"interface_type": "SCSI",
|
'interface_type': 'SCSI',
|
||||||
"interface_speed": "",
|
'interface_speed': '',
|
||||||
"serial_number": "9RK3XXXXX",
|
'serial_number': '9RK3XXXXX',
|
||||||
"firmware": "",
|
'firmware': '',
|
||||||
"rotational_speed": 0,
|
'rotational_speed': 0,
|
||||||
"capacity": 14000519643136,
|
'capacity': 14000519643136,
|
||||||
"form_factor": "",
|
'form_factor': '',
|
||||||
"smart_support": false,
|
'smart_support': false,
|
||||||
"device_protocol": "SCSI",
|
'device_protocol': 'SCSI',
|
||||||
"device_type": "",
|
'device_type': '',
|
||||||
"label": "",
|
'label': '',
|
||||||
"host_id": "",
|
'host_id': '',
|
||||||
"device_status": 0
|
'device_status': 0
|
||||||
},
|
},
|
||||||
"smart_results": [{
|
'smart_results': [{
|
||||||
"date": "2021-10-24T23:20:44Z",
|
'date': '2021-10-24T23:20:44Z',
|
||||||
"device_wwn": "0x5000cca264ebc248",
|
'device_wwn': '0x5000cca264ebc248',
|
||||||
"device_protocol": "SCSI",
|
'device_protocol': 'SCSI',
|
||||||
"temp": 31,
|
'temp': 31,
|
||||||
"power_on_hours": 5675,
|
'power_on_hours': 5675,
|
||||||
"power_cycle_count": 0,
|
'power_cycle_count': 0,
|
||||||
"attrs": {
|
'attrs': {
|
||||||
"read_correction_algorithm_invocations": {
|
'read_correction_algorithm_invocations': {
|
||||||
"attribute_id": "read_correction_algorithm_invocations",
|
'attribute_id': 'read_correction_algorithm_invocations',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccdelayed": {
|
'read_errors_corrected_by_eccdelayed': {
|
||||||
"attribute_id": "read_errors_corrected_by_eccdelayed",
|
'attribute_id': 'read_errors_corrected_by_eccdelayed',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccfast": {
|
'read_errors_corrected_by_eccfast': {
|
||||||
"attribute_id": "read_errors_corrected_by_eccfast",
|
'attribute_id': 'read_errors_corrected_by_eccfast',
|
||||||
"value": 1410362924,
|
'value': 1410362924,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_rereads_rewrites": {
|
'read_errors_corrected_by_rereads_rewrites': {
|
||||||
"attribute_id": "read_errors_corrected_by_rereads_rewrites",
|
'attribute_id': 'read_errors_corrected_by_rereads_rewrites',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_total_errors_corrected": {
|
'read_total_errors_corrected': {
|
||||||
"attribute_id": "read_total_errors_corrected",
|
'attribute_id': 'read_total_errors_corrected',
|
||||||
"value": 1410362924,
|
'value': 1410362924,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"read_total_uncorrected_errors": {
|
'read_total_uncorrected_errors': {
|
||||||
"attribute_id": "read_total_uncorrected_errors",
|
'attribute_id': 'read_total_uncorrected_errors',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"scsi_grown_defect_list": {
|
'scsi_grown_defect_list': {
|
||||||
"attribute_id": "scsi_grown_defect_list",
|
'attribute_id': 'scsi_grown_defect_list',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_correction_algorithm_invocations": {
|
'write_correction_algorithm_invocations': {
|
||||||
"attribute_id": "write_correction_algorithm_invocations",
|
'attribute_id': 'write_correction_algorithm_invocations',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccdelayed": {
|
'write_errors_corrected_by_eccdelayed': {
|
||||||
"attribute_id": "write_errors_corrected_by_eccdelayed",
|
'attribute_id': 'write_errors_corrected_by_eccdelayed',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccfast": {
|
'write_errors_corrected_by_eccfast': {
|
||||||
"attribute_id": "write_errors_corrected_by_eccfast",
|
'attribute_id': 'write_errors_corrected_by_eccfast',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_rereads_rewrites": {
|
'write_errors_corrected_by_rereads_rewrites': {
|
||||||
"attribute_id": "write_errors_corrected_by_rereads_rewrites",
|
'attribute_id': 'write_errors_corrected_by_rereads_rewrites',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_total_errors_corrected": {
|
'write_total_errors_corrected': {
|
||||||
"attribute_id": "write_total_errors_corrected",
|
'attribute_id': 'write_total_errors_corrected',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": -1,
|
'thresh': -1,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
},
|
},
|
||||||
"write_total_uncorrected_errors": {
|
'write_total_uncorrected_errors': {
|
||||||
"attribute_id": "write_total_uncorrected_errors",
|
'attribute_id': 'write_total_uncorrected_errors',
|
||||||
"value": 0,
|
'value': 0,
|
||||||
"thresh": 0,
|
'thresh': 0,
|
||||||
"transformed_value": 0,
|
'transformed_value': 0,
|
||||||
"status": 0
|
'status': 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Status": 0
|
'Status': 0
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
"metadata": {
|
'metadata': {
|
||||||
"read_correction_algorithm_invocations": {
|
'read_correction_algorithm_invocations': {
|
||||||
"display_name": "Read Correction Algorithm Invocations",
|
'display_name': 'Read Correction Algorithm Invocations',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccdelayed": {
|
'read_errors_corrected_by_eccdelayed': {
|
||||||
"display_name": "Read Errors Corrected by ECC Delayed",
|
'display_name': 'Read Errors Corrected by ECC Delayed',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_eccfast": {
|
'read_errors_corrected_by_eccfast': {
|
||||||
"display_name": "Read Errors Corrected by ECC Fast",
|
'display_name': 'Read Errors Corrected by ECC Fast',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_errors_corrected_by_rereads_rewrites": {
|
'read_errors_corrected_by_rereads_rewrites': {
|
||||||
"display_name": "Read Errors Corrected by ReReads/ReWrites",
|
'display_name': 'Read Errors Corrected by ReReads/ReWrites',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_total_errors_corrected": {
|
'read_total_errors_corrected': {
|
||||||
"display_name": "Read Total Errors Corrected",
|
'display_name': 'Read Total Errors Corrected',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"read_total_uncorrected_errors": {
|
'read_total_uncorrected_errors': {
|
||||||
"display_name": "Read Total Uncorrected Errors",
|
'display_name': 'Read Total Uncorrected Errors',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"scsi_grown_defect_list": {
|
'scsi_grown_defect_list': {
|
||||||
"display_name": "Grown Defect List",
|
'display_name': 'Grown Defect List',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_correction_algorithm_invocations": {
|
'write_correction_algorithm_invocations': {
|
||||||
"display_name": "Write Correction Algorithm Invocations",
|
'display_name': 'Write Correction Algorithm Invocations',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccdelayed": {
|
'write_errors_corrected_by_eccdelayed': {
|
||||||
"display_name": "Write Errors Corrected by ECC Delayed",
|
'display_name': 'Write Errors Corrected by ECC Delayed',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_eccfast": {
|
'write_errors_corrected_by_eccfast': {
|
||||||
"display_name": "Write Errors Corrected by ECC Fast",
|
'display_name': 'Write Errors Corrected by ECC Fast',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_errors_corrected_by_rereads_rewrites": {
|
'write_errors_corrected_by_rereads_rewrites': {
|
||||||
"display_name": "Write Errors Corrected by ReReads/ReWrites",
|
'display_name': 'Write Errors Corrected by ReReads/ReWrites',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_total_errors_corrected": {
|
'write_total_errors_corrected': {
|
||||||
"display_name": "Write Total Errors Corrected",
|
'display_name': 'Write Total Errors Corrected',
|
||||||
"ideal": "",
|
'ideal': '',
|
||||||
"critical": false,
|
'critical': false,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
},
|
},
|
||||||
"write_total_uncorrected_errors": {
|
'write_total_uncorrected_errors': {
|
||||||
"display_name": "Write Total Uncorrected Errors",
|
'display_name': 'Write Total Uncorrected Errors',
|
||||||
"ideal": "low",
|
'ideal': 'low',
|
||||||
"critical": true,
|
'critical': true,
|
||||||
"description": "",
|
'description': '',
|
||||||
"display_type": ""
|
'display_type': ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"success": true
|
'success': true
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
export const sdf = {
|
export const sdf = {
|
||||||
"data": {
|
'data': {
|
||||||
"device": {
|
'device': {
|
||||||
"CreatedAt": "2021-06-24T21:17:31.305246-07:00",
|
'CreatedAt': '2021-06-24T21:17:31.305246-07:00',
|
||||||
"UpdatedAt": "2021-06-24T21:17:31.305246-07:00",
|
'UpdatedAt': '2021-06-24T21:17:31.305246-07:00',
|
||||||
"DeletedAt": null,
|
'DeletedAt': null,
|
||||||
"wwn": "0x50014ee20b2a72a9",
|
'wwn': '0x50014ee20b2a72a9',
|
||||||
"device_name": "sdf",
|
'device_name': 'sdf',
|
||||||
"manufacturer": "ATA",
|
'manufacturer': 'ATA',
|
||||||
"model_name": "WDC_WD60EFRX-68MYMN1",
|
'model_name': 'WDC_WD60EFRX-68MYMN1',
|
||||||
"interface_type": "SCSI",
|
'interface_type': 'SCSI',
|
||||||
"interface_speed": "",
|
'interface_speed': '',
|
||||||
"serial_number": "WD-WXL1HXXXXX",
|
'serial_number': 'WD-WXL1HXXXXX',
|
||||||
"firmware": "",
|
'firmware': '',
|
||||||
"rotational_speed": 0,
|
'rotational_speed': 0,
|
||||||
"capacity": 6001175126016,
|
'capacity': 6001175126016,
|
||||||
"form_factor": "",
|
'form_factor': '',
|
||||||
"smart_support": false,
|
'smart_support': false,
|
||||||
"device_protocol": "",
|
'device_protocol': '',
|
||||||
"device_type": "",
|
'device_type': '',
|
||||||
"label": "",
|
'label': '',
|
||||||
"host_id": "",
|
'host_id': '',
|
||||||
"device_status": 0
|
'device_status': 0
|
||||||
},
|
},
|
||||||
"smart_results": []
|
'smart_results': []
|
||||||
},
|
},
|
||||||
"metadata": null,
|
'metadata': null,
|
||||||
"success": true
|
'success': true
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue