Top | ![]() |
![]() |
![]() |
![]() |
gboolean | bd_smart_check_deps () |
void | bd_smart_close () |
gboolean | bd_smart_init () |
GQuark | bd_smart_error_quark () |
gboolean | bd_smart_is_tech_avail () |
BDSmartATA * | bd_smart_ata_get_info () |
BDSmartATA * | bd_smart_ata_get_info_from_data () |
BDSmartATA * | bd_smart_ata_copy () |
void | bd_smart_ata_free () |
BDSmartATAAttribute * | bd_smart_ata_attribute_copy () |
void | bd_smart_ata_attribute_free () |
BDSmartSCSI * | bd_smart_scsi_get_info () |
void | bd_smart_scsi_free () |
BDSmartSCSI * | bd_smart_scsi_copy () |
gboolean | bd_smart_set_enabled () |
gboolean | bd_smart_device_self_test () |
#define | BD_SMART_ERROR |
enum | BDSmartError |
enum | BDSmartTech |
enum | BDSmartTechMode |
#define | BD_SMART_TYPE_ATA |
#define | BD_SMART_TYPE_ATA_ATTRIBUTE |
BDSmartATAAttribute | |
enum | BDSmartATAAttributeUnit |
enum | BDSmartATAAttributeFlag |
enum | BDSmartATACapabilities |
enum | BDSmartATAOfflineDataCollectionCapabilities |
enum | BDSmartATAOfflineDataCollectionStatus |
enum | BDSmartATASelfTestStatus |
BDSmartATA | |
enum | BDSmartSCSIInformationalException |
enum | BDSmartSCSIBackgroundScanStatus |
BDSmartSCSI | |
enum | BDSmartSelfTestOp |
void
bd_smart_close (void
);
Cleans up after the plugin. **This function is called automatically by the library's functions that unload it.**
gboolean
bd_smart_init (void
);
Initializes the plugin. **This function is called automatically by the library's initialization functions.**
gboolean bd_smart_is_tech_avail (BDSmartTech tech
,guint64 mode
,GError **error
);
tech |
the queried tech |
|
mode |
a bit mask of queried modes of operation (BDSmartTechMode) for |
|
error |
place to store error (details about why the |
[out][nullable] |
BDSmartATA * bd_smart_ata_get_info (const gchar *device
,GError **error
);
Retrieve SMART information from the drive.
ATA SMART log or NULL
in case of an error (with error
set).
Tech category: BD_SMART_TECH_ATA
-BD_SMART_TECH_MODE_INFO
.
[transfer full]
BDSmartATA * bd_smart_ata_get_info_from_data (const guint8 *data
,gsize data_len
,GError **error
);
Retrieve SMART information from the supplied data.
data |
binary data to parse. |
[array length=data_len] |
data_len |
length of the data supplied. |
|
error |
place to store error (if any). |
[out][optional] |
ATA SMART log or NULL
in case of an error (with error
set).
Tech category: BD_SMART_TECH_ATA
-BD_SMART_TECH_MODE_INFO
.
[transfer full]
BDSmartATA *
bd_smart_ata_copy (BDSmartATA *data
);
Creates a new copy of data
.
[skip]
BDSmartATAAttribute *
bd_smart_ata_attribute_copy (BDSmartATAAttribute *attr
);
Creates a new copy of attr
.
[skip]
void
bd_smart_ata_attribute_free (BDSmartATAAttribute *attr
);
Frees attr
.
[skip]
BDSmartSCSI * bd_smart_scsi_get_info (const gchar *device
,GError **error
);
Retrieve SMART information from SCSI or SAS-compliant drive.
SCSI SMART log or NULL
in case of an error (with error
set).
Tech category: BD_SMART_TECH_SCSI
-BD_SMART_TECH_MODE_INFO
.
[transfer full]
BDSmartSCSI *
bd_smart_scsi_copy (BDSmartSCSI *data
);
Creates a new copy of data
.
[skip]
gboolean bd_smart_set_enabled (const gchar *device
,gboolean enabled
,GError **error
);
Enables or disables SMART functionality on device.
device |
SMART-capable device. |
|
enabled |
whether to enable or disable the SMART functionality |
|
error |
place to store error (if any). |
[out][optional] |
TRUE
when the functionality was set successfully or FALSE
in case of an error (with error
set).
Tech category: BD_SMART_TECH_ATA
-BD_SMART_TECH_MODE_INFO
gboolean bd_smart_device_self_test (const gchar *device
,BDSmartSelfTestOp operation
,GError **error
);
Executes or aborts device self-test.
device |
device to trigger the test on. |
|
operation |
BDSmartSelfTestOp self-test operation. |
|
error |
place to store error (if any). |
[out][optional] |
TRUE
when the self-test was trigerred successfully or FALSE
in case of an error (with error
set).
Tech category: BD_SMART_TECH_ATA
-BD_SMART_TECH_MODE_SELFTEST
#define BD_SMART_TYPE_ATA_ATTRIBUTE (bd_smart_ata_attribute_get_type ())
typedef struct { guint8 id; gchar *name; gchar *well_known_name; gint value; gint worst; gint threshold; gboolean failed_past; gboolean failing_now; guint64 value_raw; guint16 flags; gint64 pretty_value; BDSmartATAAttributeUnit pretty_value_unit; gchar *pretty_value_string; } BDSmartATAAttribute;
Attribute Identifier. |
||
A free-form representation of the attribute name, implementation-dependent (e.g. libatasmart internal strings or smartmontools' drivedb.h names). |
||
Translated well-known attribute name (in libatasmart style, e.g. 'raw-read-error-rate') or |
||
The normalized value or -1 if unknown. |
||
The worst normalized value of -1 if unknown. |
||
The threshold of a normalized value or -1 if unknown. |
||
Indicates a failure that happened in the past (the normalized worst value is below the threshold). |
||
Indicates a failure that is happening now (the normalized value is below the threshold). |
||
The raw value of the attribute. |
||
Bitmask of attribute flags. See BDSmartATAAttributeFlag. |
||
Numerical representation of the parsed raw value, presented in |
||
BDSmartATAAttributeUnit |
The unit of the parsed raw value. |
|
A free-form string representation of the raw value intended for user presentation or |
Pre-failure/advisory bit: If the value of this bit equals zero, an attribute value less than or equal to its corresponding attribute threshold indicates an advisory condition where the usage or age of the device has exceeded its intended design life period. If the value of this bit equals one, an attribute value less than or equal to its corresponding attribute threshold indicates a prefailure condition where imminent loss of data is being predicted. |
||
On-line data collection bit: If the value of this bit equals zero, then the attribute value is updated only during off-line data collection activities. If the value of this bit equals one, then the attribute value is updated during normal operation of the device or during both normal operation and off-line testing. |
||
Performance type bit (vendor specific). |
||
Errorrate type bit (vendor specific). |
||
Eventcount bit (vendor specific). |
||
Selfpereserving bit (vendor specific). |
||
Reserved. |
Offline data collection activity was never started. |
||
Offline data collection activity was completed without error. Indicates a passed test. |
||
Offline data collection activity is in progress. |
||
Offline data collection activity was suspended by an interrupting command from host. |
||
Offline data collection activity was aborted by an interrupting command from host. |
||
Offline data collection activity was aborted by the device with a fatal error. Indicates a failed test. |
||
Offline data collection activity is in a Vendor Specific state. |
||
Offline data collection activity is in a Reserved state. |
The previous self-test routine completed without error or no self-test has ever been run. |
||
The self-test routine was aborted by the host. |
||
The self-test routine was interrupted by the host with a hard or soft reset. |
||
A fatal error or unknown test error occurred while the device was executing its self-test routine and the device was unable to complete the self-test routine. |
||
The previous self-test completed having a test element that failed and the test element that failed is not known. |
||
The previous self-test completed having the electrical element of the test failed. |
||
The previous self-test completed having the servo (and/or seek) element of the test failed. |
||
The previous self-test completed having the read element of the test failed. |
||
The previous self-test completed having a test element that failed and the device is suspected of having handling damage. |
||
Self-test routine in progress. |
typedef struct { gboolean smart_supported; gboolean smart_enabled; gboolean overall_status_passed; BDSmartATAOfflineDataCollectionStatus offline_data_collection_status; gboolean auto_offline_data_collection_enabled; gint offline_data_collection_completion; guint offline_data_collection_capabilities; BDSmartATASelfTestStatus self_test_status; gint self_test_percent_remaining; gint self_test_polling_short; gint self_test_polling_extended; gint self_test_polling_conveyance; guint smart_capabilities; BDSmartATAAttribute **attributes; guint power_on_time; guint64 power_cycle_count; guint temperature; } BDSmartATA;
Indicates that the device has SMART capability. |
||
Indicates that the SMART support is enabled. |
||
|
||
BDSmartATAOfflineDataCollectionStatus |
The offline data collection status. See BDSmartATAOfflineDataCollectionStatus. |
|
|
||
Total time in seconds to complete Offline data collection. |
||
Bitmask of offline data collection capabilities, see BDSmartATAOfflineDataCollectionCapabilities. Only supported with the smartmontools plugin. |
||
BDSmartATASelfTestStatus |
Self-test execution status. See BDSmartATASelfTestStatus. |
|
The percentage remaining of a running self-test. |
||
Short self-test routine recommended polling time in minutes or 0 if not supported. |
||
Extended self-test routine recommended polling time in minutes or 0 if not supported. |
||
Conveyance self-test routine recommended polling time in minutes or 0 if not supported. |
||
Bitmask of device misc. SMART capabilities. See BDSmartATACapabilities. Only supported with the smartmontools plugin. |
||
BDSmartATAAttribute ** |
A list of reported SMART attributes. |
[array zero-terminated=1] |
The count of minutes in power-on state. |
||
The count of full hard disk power on/off cycles. |
||
The current drive temperature in Kelvin or 0 when temperature is not reported. |
typedef struct { gboolean smart_supported; gboolean smart_enabled; gboolean overall_status_passed; BDSmartSCSIInformationalException scsi_ie; guint8 scsi_ie_asc; guint8 scsi_ie_ascq; gchar *scsi_ie_string; BDSmartSCSIBackgroundScanStatus background_scan_status; gdouble background_scan_progress; guint background_scan_runs; guint background_medium_scan_runs; guint read_errors_corrected_eccfast; guint read_errors_corrected_eccdelayed; guint read_errors_corrected_rereads; guint read_errors_corrected_total; guint read_errors_uncorrected; guint64 read_processed_bytes; guint write_errors_corrected_eccfast; guint write_errors_corrected_eccdelayed; guint write_errors_corrected_rewrites; guint write_errors_corrected_total; guint write_errors_uncorrected; guint64 write_processed_bytes; guint start_stop_cycle_count; guint start_stop_cycle_lifetime; guint load_unload_cycle_count; guint load_unload_cycle_lifetime; guint scsi_grown_defect_list; guint power_on_time; gboolean temperature_warning_enabled; guint temperature; guint temperature_drive_trip; } BDSmartSCSI;
Indicates that the device has SMART capability. |
||
Indicates that the SMART support is enabled. |
||
|
||
BDSmartSCSIInformationalException |
The reported SCSI Informational Exception in a simplified form. See BDSmartSCSIInformationalException. |
|
The reported SCSI Informational Exception ASC (Additional Sense Code) value (only values of 0xb - warnings and 0x5d - impending failures are taken in account). |
||
The reported SCSI Informational Exception ASCQ (Additional Sense Code Qualifier) value. |
||
String representation of the current SCSI Informational Exception. |
||
BDSmartSCSIBackgroundScanStatus |
Background scan status, see BDSmartSCSIBackgroundScanStatus. |
|
Percent of a background scan progress. |
||
Number of background scans performed. |
||
Number of background medium scans performed. |
||
Error counter log - read errors corrected by ECC fast. |
||
Error counter log - read errors corrected by ECC delayed. |
||
Error counter log - read errors corrected by rereads. |
||
Error counter log - total read errors corrected. |
||
Error counter log - total uncorrected read errors. |
||
Error counter log - total bytes processed. |
||
Error counter log - write errors corrected by ECC fast. |
||
Error counter log - write errors corrected by ECC delayed. |
||
Error counter log - write errors corrected by rewrites. |
||
Error counter log - total write errors corrected. |
||
Error counter log - total uncorrected write errors. |
||
Error counter log - total bytes processed. |
||
Accumulated start-stop cycles. |
||
Specified cycle count over device lifetime. |
||
Accumulated load-unload cycles. |
||
Specified load-unload count over device lifetime. |
||
Elements in grown defect list. |
||
Accumulated power on time in minutes. |
||
Indicates that temperature warning is enabled. |
||
The current drive temperature in Kelvin or 0 when temperature is not reported. |
||
The drive trip temperature in Kelvin or 0 when temperature is not reported. |
Abort a running SMART self-test. |
||
SMART Immediate Offline Test in background (ATA) or a default self test in foreground (SCSI). |
||
SMART Short Self Test in background (ATA) or "Background short" self-test (SCSI). |
||
SMART Extended Self Test in background (ATA) or "Background long" self-test (SCSI). |
||
SMART Conveyance Self Test in background (ATA only). |