ClearFoundation

ClearOS API

Class Raid

Description

RAID Management Utility.

Class to assist in management and notification of a RAID array.

Located in /api/Raid.class.php (line 59)

Engine
   |
   --Raid
Direct descendents
Class Description
RaidLsi Provides monitoring/management tools for LSI hardware RAID.
Raid3ware RAID Management Utility.
RaidSoftware RAID Management Utility.
Class Constant Summary
 CMD_CAT = '/bin/cat'
 CMD_DF = '/bin/df'
 CMD_DIFF = '/usr/bin/diff'
 CMD_FDISK = '/sbin/fdisk'
 CMD_MPT_STATUS = '/usr/sbin/mpt-status'
 CMD_RAID_SCRIPT = '/var/webconfig/scripts/raid_notification.php'
 CMD_SFDISK = '/sbin/sfdisk'
 CMD_SWAPON = '/sbin/swapon'
 CMD_TW_CLI = '/usr/sbin/tw_cli'
 DEFAULT_CRONTAB_TIME = "0,30 * * * *"
 FILE_CONFIG = '/etc/system/raid.conf'
 FILE_CROND = "app-raid"
 FILE_MDSTAT = '/proc/mdstat'
 FILE_RAID_STATUS = 'raid.status'
 LOG_TAG = 'raid'
 TYPE_LSI = 3
Variable Summary
mixed $config
mixed $interactive
mixed $is_loaded
mixed $status
mixed $type
Method Summary
static Class Create ()
void __construct ()
void CopyPartitionTable (string $from, string $to)
String GetDevicesInUse ()
String GetEmail ()
string GetFormattedBytes (float $input, int $dec)
boolean GetInteractive ()
void GetLevel ()
boolean GetMonitorStatus ()
string GetMount (String $dev)
String GetNotify ()
String GetPartitionTable ( $device)
void GetStatus ()
int GetType ()
array GetTypeDetails ()
array SanityCheckPartition (string $array, string $check)
void SetEmail (string $email)
void SetMonitorStatus (boolean $monitor)
void SetNotify (boolean $status)
void _CreateHardwareRaidReport ( $myraid)
array _CreateSoftwareRaidReport ( $myraid)
void _LoadConfig ()
void _SetParameter (string $key, string $value)
Variables
mixed $config = null (line 91)
  • access: protected
mixed $interactive = false (line 90)
  • access: protected

Redefined in descendants as:
mixed $is_loaded = false (line 94)
  • access: protected
mixed $status = null (line 93)
  • access: protected
mixed $type = null (line 92)
  • access: protected

Inherited Variables

Inherited from Engine

Engine::$errors
Methods
static method Create (line 122)

Create a RAID supported class.

static Class Create ()
Constructor __construct (line 106)

RAID constructor.

void __construct ()

Redefinition of:
Engine::__construct()
Engine constructor.

Redefined in descendants as:
CheckStatusChange (line 626)

Checks the change of status of the RAID array.

  • throws: EngineException
void CheckStatusChange ()
CopyPartitionTable (line 520)

Copy a partition table from one device to another.

  • throws: EngineException
void CopyPartitionTable (string $from, string $to)
  • string $from: from partition device
  • string $to: to partition device
GetDevicesInUse (line 434)

Get the notify status.

  • return: notification email
  • throws: EngineException
String GetDevicesInUse ()
GetEmail (line 377)

Get the notification email.

  • return: notification email
  • throws: EngineException
String GetEmail ()
GetFormattedBytes (line 317)

Formats a value into a human readable byte size.

  • return: the byte size suitable for display to end user
string GetFormattedBytes (float $input, int $dec)
  • float $input: the value
  • int $dec: number of decimal places
GetInteractive (line 227)

Returns whether type of RAID supports interaction - i.e. resync etc.

  • throws: EngineException
boolean GetInteractive ()
GetLevel (line 300)

Returns RAID level.

  • throws: EngineException
void GetLevel ()
GetMonitorStatus (line 394)

Get the monitor status.

  • return: true if monitoring is enabled
boolean GetMonitorStatus ()
GetMount (line 343)

Returns the mount point.

  • return: the mount point
string GetMount (String $dev)
  • String $dev: a device
GetNotify (line 416)

Get the notify status.

  • return: notification email
  • throws: EngineException
String GetNotify ()
GetPartitionTable (line 480)

Get partition table.

  • return: device
  • throws: EngineException
String GetPartitionTable ( $device)
  • $device
GetStatus (line 285)

Returns status of RAID.

  • throws: EngineException
void GetStatus ()
GetType (line 212)

Returns type of RAID.

  • throws: EngineException
int GetType ()
GetTypeDetails (line 242)

Returns type of RAID.

  • throws: EngineException
array GetTypeDetails ()
SanityCheckPartition (line 558)

Performs a sanity check on partition table to see it matches.

  • throws: EngineException
array SanityCheckPartition (string $array, string $check)
  • string $array: the array to find a device that is clean
  • string $check: the device to check partition against
SendStatusChangeNotification (line 685)

Sends a status change notification to admin.

  • throws: EngineException
void SendStatusChangeNotification ( $lines)
  • $lines
SetEmail (line 731)

Set the RAID notificatoin email.

  • throws: EngineException
void SetEmail (string $email)
  • string $email: a valid email
SetMonitorStatus (line 758)

Set RAID monitoring status.

  • throws: EngineException
void SetMonitorStatus (boolean $monitor)
  • boolean $monitor: toggles monitoring
SetNotify (line 786)

Set RAID notification.

  • throws: EngineException
void SetNotify (boolean $status)
  • boolean $status: toggles notification
_CreateHardwareRaidReport (line 922)

Report for hardware RAID.

  • throws: EngineException
void _CreateHardwareRaidReport ( $myraid)
  • $myraid
_CreateSoftwareRaidReport (line 871)

Report for software RAID.

  • throws: EngineException
array _CreateSoftwareRaidReport ( $myraid)
  • $myraid
_LoadConfig (line 820)

Loads configuration files.

  • throws: EngineException
  • access: protected
void _LoadConfig ()
_SetParameter (line 846)

Generic set routine.

  • throws: EngineException
  • private:
void _SetParameter (string $key, string $value)
  • string $key: key name
  • string $value: value for the key

Inherited Methods

Inherited From Engine

Engine::__construct()
Engine::AddValidationError()
Engine::CheckValidationErrors()
Engine::CopyValidationErrors()
Engine::GetValidationErrors()
Engine::Log()
Engine::__destruct()
Class Constants
CMD_CAT = '/bin/cat' (line 71)
CMD_DF = '/bin/df' (line 72)
CMD_DIFF = '/usr/bin/diff' (line 73)
CMD_FDISK = '/sbin/fdisk' (line 74)
CMD_MPT_STATUS = '/usr/sbin/mpt-status' (line 78)
CMD_RAID_SCRIPT = '/var/webconfig/scripts/raid_notification.php' (line 79)
CMD_SFDISK = '/sbin/sfdisk' (line 75)
CMD_SWAPON = '/sbin/swapon' (line 76)
CMD_TW_CLI = '/usr/sbin/tw_cli' (line 77)
DEFAULT_CRONTAB_TIME = "0,30 * * * *" (line 70)
FILE_CONFIG = '/etc/system/raid.conf' (line 66)
FILE_CROND = "app-raid" (line 69)
FILE_MDSTAT = '/proc/mdstat' (line 67)
FILE_RAID_STATUS = 'raid.status' (line 68)
LOG_TAG = 'raid' (line 65)
STATUS_CLEAN = 0 (line 84)
STATUS_DEGRADED = 1 (line 85)
STATUS_REMOVED = 4 (line 88)
STATUS_SPARE = 5 (line 89)
STATUS_SYNCING = 2 (line 86)
STATUS_SYNC_PENDING = 3 (line 87)
TYPE_3WARE = 2 (line 82)
TYPE_LSI = 3 (line 83)
TYPE_SOFTWARE = 1 (line 81)
TYPE_UNKNOWN = 0 (line 80)

Inherited Constants

Inherited from Engine

Engine::COMMAND_API

Documentation generated on Fri, 28 Aug 2009 20:32:16 -0400 by phpDocumentor 1.3.2