|
@@ -2,56 +2,65 @@ package smart
|
|
|
|
|
|
// DevicesList was used for storing the disk scanning result
|
|
|
type DevicesList struct {
|
|
|
- JSONFormatVersion []int `json:"json_format_version"`
|
|
|
- Smartctl struct {
|
|
|
- Version []int `json:"version"`
|
|
|
- SvnRevision string `json:"svn_revision"`
|
|
|
- PlatformInfo string `json:"platform_info"`
|
|
|
- BuildInfo string `json:"build_info"`
|
|
|
- Argv []string `json:"argv"`
|
|
|
- Messages []struct {
|
|
|
- String string `json:"string"`
|
|
|
- Severity string `json:"severity"`
|
|
|
- } `json:"messages"`
|
|
|
- ExitStatus int `json:"exit_status"`
|
|
|
- } `json:"smartctl"`
|
|
|
+ /*
|
|
|
+ JSONFormatVersion []int `json:"json_format_version"`
|
|
|
+ Smartctl struct {
|
|
|
+ Version []int `json:"version"`
|
|
|
+ SvnRevision string `json:"svn_revision"`
|
|
|
+ PlatformInfo string `json:"platform_info"`
|
|
|
+ BuildInfo string `json:"build_info"`
|
|
|
+ Argv []string `json:"argv"`
|
|
|
+ Messages []struct {
|
|
|
+ String string `json:"string"`
|
|
|
+ Severity string `json:"severity"`
|
|
|
+ } `json:"messages"`
|
|
|
+ ExitStatus int `json:"exit_status"`
|
|
|
+ } `json:"smartctl"`
|
|
|
+ */
|
|
|
Devices []struct {
|
|
|
- Name string `json:"name"`
|
|
|
- InfoName string `json:"info_name"`
|
|
|
- Type string `json:"type"`
|
|
|
- Protocol string `json:"protocol"`
|
|
|
+ Name string `json:"name"`
|
|
|
+ InfoName string `json:"info_name"`
|
|
|
+ Type string `json:"type"`
|
|
|
+ Protocol string `json:"protocol"`
|
|
|
+ Smart DeviceSMART `json:"smart"`
|
|
|
} `json:"devices"`
|
|
|
}
|
|
|
|
|
|
// DeviceSMART was used for storing each disk smart information
|
|
|
type DeviceSMART struct {
|
|
|
- JSONFormatVersion []int `json:"json_format_version"`
|
|
|
- Smartctl struct {
|
|
|
- Version []int `json:"version"`
|
|
|
- SvnRevision string `json:"svn_revision"`
|
|
|
- PlatformInfo string `json:"platform_info"`
|
|
|
- BuildInfo string `json:"build_info"`
|
|
|
- Argv []string `json:"argv"`
|
|
|
- Messages []struct {
|
|
|
- String string `json:"string"`
|
|
|
- Severity string `json:"severity"`
|
|
|
- } `json:"messages"`
|
|
|
- ExitStatus int `json:"exit_status"`
|
|
|
- } `json:"smartctl"`
|
|
|
- Device struct {
|
|
|
- Name string `json:"name"`
|
|
|
- InfoName string `json:"info_name"`
|
|
|
- Type string `json:"type"`
|
|
|
- Protocol string `json:"protocol"`
|
|
|
- } `json:"device"`
|
|
|
+ /*
|
|
|
+ JSONFormatVersion []int `json:"json_format_version"`
|
|
|
+ Smartctl struct {
|
|
|
+ Version []int `json:"version"`
|
|
|
+ SvnRevision string `json:"svn_revision"`
|
|
|
+ PlatformInfo string `json:"platform_info"`
|
|
|
+ BuildInfo string `json:"build_info"`
|
|
|
+ Argv []string `json:"argv"`
|
|
|
+ Messages []struct {
|
|
|
+ String string `json:"string"`
|
|
|
+ Severity string `json:"severity"`
|
|
|
+ } `json:"messages"`
|
|
|
+ ExitStatus int `json:"exit_status"`
|
|
|
+ } `json:"smartctl"`
|
|
|
+ */
|
|
|
+ /*
|
|
|
+ Device struct {
|
|
|
+ Name string `json:"name"`
|
|
|
+ InfoName string `json:"info_name"`
|
|
|
+ Type string `json:"type"`
|
|
|
+ Protocol string `json:"protocol"`
|
|
|
+ } `json:"device"`
|
|
|
+ */
|
|
|
ModelFamily string `json:"model_family"`
|
|
|
ModelName string `json:"model_name"`
|
|
|
SerialNumber string `json:"serial_number"`
|
|
|
- Wwn struct {
|
|
|
- Naa int `json:"naa"`
|
|
|
- Oui int `json:"oui"`
|
|
|
- ID int64 `json:"id"`
|
|
|
- } `json:"wwn"`
|
|
|
+ /*
|
|
|
+ Wwn struct {
|
|
|
+ Naa int `json:"naa"`
|
|
|
+ Oui int `json:"oui"`
|
|
|
+ ID int64 `json:"id"`
|
|
|
+ } `json:"wwn"`
|
|
|
+ */
|
|
|
FirmwareVersion string `json:"firmware_version"`
|
|
|
UserCapacity struct {
|
|
|
Blocks int `json:"blocks"`
|
|
@@ -84,52 +93,56 @@ type DeviceSMART struct {
|
|
|
BitsPerUnit int `json:"bits_per_unit"`
|
|
|
} `json:"current"`
|
|
|
} `json:"interface_speed"`
|
|
|
- LocalTime struct {
|
|
|
- TimeT int `json:"time_t"`
|
|
|
- Asctime string `json:"asctime"`
|
|
|
- } `json:"local_time"`
|
|
|
+ /*
|
|
|
+ LocalTime struct {
|
|
|
+ TimeT int `json:"time_t"`
|
|
|
+ Asctime string `json:"asctime"`
|
|
|
+ } `json:"local_time"`
|
|
|
+ */
|
|
|
SmartStatus struct {
|
|
|
Passed bool `json:"passed"`
|
|
|
} `json:"smart_status"`
|
|
|
- AtaSmartData struct {
|
|
|
- OfflineDataCollection struct {
|
|
|
- Status struct {
|
|
|
- Value int `json:"value"`
|
|
|
- String string `json:"string"`
|
|
|
- } `json:"status"`
|
|
|
- CompletionSeconds int `json:"completion_seconds"`
|
|
|
- } `json:"offline_data_collection"`
|
|
|
- SelfTest struct {
|
|
|
- Status struct {
|
|
|
- Value int `json:"value"`
|
|
|
- String string `json:"string"`
|
|
|
- Passed bool `json:"passed"`
|
|
|
- } `json:"status"`
|
|
|
- PollingMinutes struct {
|
|
|
- Short int `json:"short"`
|
|
|
- Extended int `json:"extended"`
|
|
|
- Conveyance int `json:"conveyance"`
|
|
|
- } `json:"polling_minutes"`
|
|
|
- } `json:"self_test"`
|
|
|
- Capabilities struct {
|
|
|
- Values []int `json:"values"`
|
|
|
- ExecOfflineImmediateSupported bool `json:"exec_offline_immediate_supported"`
|
|
|
- OfflineIsAbortedUponNewCmd bool `json:"offline_is_aborted_upon_new_cmd"`
|
|
|
- OfflineSurfaceScanSupported bool `json:"offline_surface_scan_supported"`
|
|
|
- SelfTestsSupported bool `json:"self_tests_supported"`
|
|
|
- ConveyanceSelfTestSupported bool `json:"conveyance_self_test_supported"`
|
|
|
- SelectiveSelfTestSupported bool `json:"selective_self_test_supported"`
|
|
|
- AttributeAutosaveEnabled bool `json:"attribute_autosave_enabled"`
|
|
|
- ErrorLoggingSupported bool `json:"error_logging_supported"`
|
|
|
- GpLoggingSupported bool `json:"gp_logging_supported"`
|
|
|
- } `json:"capabilities"`
|
|
|
- } `json:"ata_smart_data"`
|
|
|
- AtaSctCapabilities struct {
|
|
|
- Value int `json:"value"`
|
|
|
- ErrorRecoveryControlSupported bool `json:"error_recovery_control_supported"`
|
|
|
- FeatureControlSupported bool `json:"feature_control_supported"`
|
|
|
- DataTableSupported bool `json:"data_table_supported"`
|
|
|
- } `json:"ata_sct_capabilities"`
|
|
|
+ /*
|
|
|
+ AtaSmartData struct {
|
|
|
+ OfflineDataCollection struct {
|
|
|
+ Status struct {
|
|
|
+ Value int `json:"value"`
|
|
|
+ String string `json:"string"`
|
|
|
+ } `json:"status"`
|
|
|
+ CompletionSeconds int `json:"completion_seconds"`
|
|
|
+ } `json:"offline_data_collection"`
|
|
|
+ SelfTest struct {
|
|
|
+ Status struct {
|
|
|
+ Value int `json:"value"`
|
|
|
+ String string `json:"string"`
|
|
|
+ Passed bool `json:"passed"`
|
|
|
+ } `json:"status"`
|
|
|
+ PollingMinutes struct {
|
|
|
+ Short int `json:"short"`
|
|
|
+ Extended int `json:"extended"`
|
|
|
+ Conveyance int `json:"conveyance"`
|
|
|
+ } `json:"polling_minutes"`
|
|
|
+ } `json:"self_test"`
|
|
|
+ Capabilities struct {
|
|
|
+ Values []int `json:"values"`
|
|
|
+ ExecOfflineImmediateSupported bool `json:"exec_offline_immediate_supported"`
|
|
|
+ OfflineIsAbortedUponNewCmd bool `json:"offline_is_aborted_upon_new_cmd"`
|
|
|
+ OfflineSurfaceScanSupported bool `json:"offline_surface_scan_supported"`
|
|
|
+ SelfTestsSupported bool `json:"self_tests_supported"`
|
|
|
+ ConveyanceSelfTestSupported bool `json:"conveyance_self_test_supported"`
|
|
|
+ SelectiveSelfTestSupported bool `json:"selective_self_test_supported"`
|
|
|
+ AttributeAutosaveEnabled bool `json:"attribute_autosave_enabled"`
|
|
|
+ ErrorLoggingSupported bool `json:"error_logging_supported"`
|
|
|
+ GpLoggingSupported bool `json:"gp_logging_supported"`
|
|
|
+ } `json:"capabilities"`
|
|
|
+ } `json:"ata_smart_data"`
|
|
|
+ AtaSctCapabilities struct {
|
|
|
+ Value int `json:"value"`
|
|
|
+ ErrorRecoveryControlSupported bool `json:"error_recovery_control_supported"`
|
|
|
+ FeatureControlSupported bool `json:"feature_control_supported"`
|
|
|
+ DataTableSupported bool `json:"data_table_supported"`
|
|
|
+ } `json:"ata_sct_capabilities"`
|
|
|
+ */
|
|
|
AtaSmartAttributes struct {
|
|
|
Revision int `json:"revision"`
|
|
|
Table []struct {
|
|
@@ -163,40 +176,42 @@ type DeviceSMART struct {
|
|
|
Temperature struct {
|
|
|
Current int `json:"current"`
|
|
|
} `json:"temperature"`
|
|
|
- AtaSmartSelfTestLog struct {
|
|
|
- Standard struct {
|
|
|
+ /*
|
|
|
+ AtaSmartSelfTestLog struct {
|
|
|
+ Standard struct {
|
|
|
+ Revision int `json:"revision"`
|
|
|
+ Table []struct {
|
|
|
+ Type struct {
|
|
|
+ Value int `json:"value"`
|
|
|
+ String string `json:"string"`
|
|
|
+ } `json:"type"`
|
|
|
+ Status struct {
|
|
|
+ Value int `json:"value"`
|
|
|
+ String string `json:"string"`
|
|
|
+ Passed bool `json:"passed"`
|
|
|
+ } `json:"status,omitempty"`
|
|
|
+ LifetimeHours int `json:"lifetime_hours"`
|
|
|
+ } `json:"table"`
|
|
|
+ Count int `json:"count"`
|
|
|
+ ErrorCountTotal int `json:"error_count_total"`
|
|
|
+ ErrorCountOutdated int `json:"error_count_outdated"`
|
|
|
+ } `json:"standard"`
|
|
|
+ } `json:"ata_smart_self_test_log"`
|
|
|
+ AtaSmartSelectiveSelfTestLog struct {
|
|
|
Revision int `json:"revision"`
|
|
|
Table []struct {
|
|
|
- Type struct {
|
|
|
- Value int `json:"value"`
|
|
|
- String string `json:"string"`
|
|
|
- } `json:"type"`
|
|
|
+ LbaMin int `json:"lba_min"`
|
|
|
+ LbaMax int `json:"lba_max"`
|
|
|
Status struct {
|
|
|
Value int `json:"value"`
|
|
|
String string `json:"string"`
|
|
|
- Passed bool `json:"passed"`
|
|
|
- } `json:"status,omitempty"`
|
|
|
- LifetimeHours int `json:"lifetime_hours"`
|
|
|
+ } `json:"status"`
|
|
|
} `json:"table"`
|
|
|
- Count int `json:"count"`
|
|
|
- ErrorCountTotal int `json:"error_count_total"`
|
|
|
- ErrorCountOutdated int `json:"error_count_outdated"`
|
|
|
- } `json:"standard"`
|
|
|
- } `json:"ata_smart_self_test_log"`
|
|
|
- AtaSmartSelectiveSelfTestLog struct {
|
|
|
- Revision int `json:"revision"`
|
|
|
- Table []struct {
|
|
|
- LbaMin int `json:"lba_min"`
|
|
|
- LbaMax int `json:"lba_max"`
|
|
|
- Status struct {
|
|
|
- Value int `json:"value"`
|
|
|
- String string `json:"string"`
|
|
|
- } `json:"status"`
|
|
|
- } `json:"table"`
|
|
|
- Flags struct {
|
|
|
- Value int `json:"value"`
|
|
|
- RemainderScanEnabled bool `json:"remainder_scan_enabled"`
|
|
|
- } `json:"flags"`
|
|
|
- PowerUpScanResumeMinutes int `json:"power_up_scan_resume_minutes"`
|
|
|
- } `json:"ata_smart_selective_self_test_log"`
|
|
|
+ Flags struct {
|
|
|
+ Value int `json:"value"`
|
|
|
+ RemainderScanEnabled bool `json:"remainder_scan_enabled"`
|
|
|
+ } `json:"flags"`
|
|
|
+ PowerUpScanResumeMinutes int `json:"power_up_scan_resume_minutes"`
|
|
|
+ } `json:"ata_smart_selective_self_test_log"`
|
|
|
+ */
|
|
|
}
|