openmediavault  4.0 (Arrakis)
The open network attached storage solution
Public Member Functions | Public Attributes | Protected Attributes | List of all members
OMV\System\Storage\SmartInformation Class Reference

Public Member Functions

 __construct ($deviceFile, $type, $sd=null)
 
 getDeviceFile ()
 
 getType ()
 
 refresh ()
 
 getExtendedInformation ()
 
 getAttributes ()
 
 getAttribute ($id)
 
 getSelfTestLogs ()
 
 getInformation ()
 
 getTemperature ()
 
 getOverallStatus ()
 

Public Attributes

const SMART_ASSESSMENT_GOOD = "GOOD"
 
const SMART_ASSESSMENT_BAD_ATTRIBUTE_IN_THE_PAST = "BAD_ATTRIBUTE_IN_THE_PAST"
 
const SMART_ASSESSMENT_BAD_SECTOR = "BAD_SECTOR"
 
const SMART_ASSESSMENT_BAD_ATTRIBUTE_NOW = "BAD_ATTRIBUTE_NOW"
 
const SMART_ASSESSMENT_BAD_SECTOR_MANY = "BAD_SECTOR_MANY"
 
const SMART_ASSESSMENT_BAD_STATUS = "BAD_STATUS"
 

Protected Attributes

 $deviceFile = ""
 
 $type = ""
 
 $sd = NULL
 

Detailed Description

This class implements methods to get and process S.M.A.R.T. AT Attachment (ATA) information and properties.

Constructor & Destructor Documentation

◆ __construct()

OMV\System\Storage\SmartInformation::__construct (   $deviceFile,
  $type,
  $sd = null 
)

Constructor

Parameters
deviceFileSpecifies the device file, e.g.
/dev/sdb
  • /dev/cciss/c0d0
  • /dev/disk/by-id/scsi-SATA_ST3200XXXX2AS_5XWXXXR6
  • /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
typeSpecifies the type of the device, e.g. 'ata', 'cciss' or '3ware'. For more details please check the option '-d' in http://smartmontools.sourceforge.net/man5/smartd.conf.5.html.
sdThe storage device object. Defaults to NULL.

Member Function Documentation

◆ getAttribute()

OMV\System\Storage\SmartInformation::getAttribute (   $id)

Get a specific attribute by ID.

Returns
An object with the requested attribute data, otherwise FALSE.

◆ getAttributes()

OMV\System\Storage\SmartInformation::getAttributes ( )

Get the S.M.A.R.T. attributes data structure.

Returns
An array of S.M.A.R.T. attributes data.

◆ getDeviceFile()

OMV\System\Storage\SmartInformation::getDeviceFile ( )

Get the device path, e.g. /dev/sda.

Returns
The device path.

◆ getExtendedInformation()

OMV\System\Storage\SmartInformation::getExtendedInformation ( )

Get the plain text 'smartctl' command output.

Returns
The command output.

◆ getInformation()

OMV\System\Storage\SmartInformation::getInformation ( )

Get various device information.

Returns
An array of strings.

◆ getOverallStatus()

OMV\System\Storage\SmartInformation::getOverallStatus ( )

Get the overall assessment for the device.

Returns
Returns the following strings:
GOOD
  • BAD_ATTRIBUTE_NOW
  • BAD_ATTRIBUTE_IN_THE_PAST
  • BAD_SECTOR
  • BAD_SECTOR_MANY
  • BAD_STATUS or otherwise FALSE.

◆ getSelfTestLogs()

OMV\System\Storage\SmartInformation::getSelfTestLogs ( )

Get the S.M.A.R.T. Self-test log structure.

Returns
An array of S.M.A.R.T. self-test logs.

◆ getTemperature()

OMV\System\Storage\SmartInformation::getTemperature ( )

Get the device temperature in °C (value only, no unit).

Returns
The temperature value, otherwise FALSE.

◆ getType()

OMV\System\Storage\SmartInformation::getType ( )

Get the type of the device, e.g. 'ata', 'sat', 'cciss' or '3ware'. Note, this can be an empty string.

Returns
The device type.

◆ refresh()

OMV\System\Storage\SmartInformation::refresh ( )

Refresh the cached information.

Returns
None.

The documentation for this class was generated from the following file: