Helper class that provides various functions regarding the Linux system.
◆ getCpuStats()
static OMV\System\System::getCpuStats |
( |
| ) |
|
|
static |
Get CPU statistics.
- Returns
- The memory statistics as array or FALSE on failure. array( cpumhz => "2792.999" modelname => "Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz", usage => 12 )
◆ getLoadAverage()
static OMV\System\System::getLoadAverage |
( |
| ) |
|
|
static |
Get load average in regard to both the CPU and IO over time.
- Returns
- The CPU and IO utilization of the last one, five, and 10 minute periods or FALSE on failure.
◆ getLoginDefs()
static OMV\System\System::getLoginDefs |
( |
| ) |
|
|
static |
Get the /etc/login.defs configuration
- Returns
- Array containing the configuration as key/value pairs or FALSE on failure.
◆ getMemoryStats()
static OMV\System\System::getMemoryStats |
( |
| ) |
|
|
static |
Get memory statistics.
- Returns
- The memory statistics as array or FALSE on failure. array( mem ( total => xxx, (bytes) used => xxx, (bytes) free => xxx, (bytes) shared => xxx, (bytes) buffers => xxx, (bytes) cached => xxx, (bytes) ) wobufferscache ( used => xxx, (bytes) free => xxx, (bytes) ) swap ( total => xxx, (bytes) used => xxx, (bytes) free => xxx, (bytes) ) total ( total => xxx, (bytes) used => xxx, (bytes) free => xxx, (bytes) ) )
◆ getNextDevice()
static OMV\System\System::getNextDevice |
( |
|
$type, |
|
|
|
$name |
|
) |
| |
|
static |
Get the next free device name, e.g. md3 or bond2. Note, do not use this method combined with predictable network device names.
- Parameters
-
type | The type of the device, e.g. disk or iface |
name | The device name, e.g. sda, hda, md, eth or bond |
- Returns
- The next free device name, or FALSE on failure.
◆ getRootDeviceFile()
static OMV\System\System::getRootDeviceFile |
( |
| ) |
|
|
static |
Get the device file where the operating system is installed on (e.g. /dev/sda1). To avoid further useless process calls to determine the root device file the value is cached in a static variable when this method is called the first time.
- Returns
- Returns the device file where the operating system is installed on.
- Exceptions
-
◆ isRootDeviceFile()
static OMV\System\System::isRootDeviceFile |
( |
|
$deviceFile, |
|
|
|
$exact = TRUE |
|
) |
| |
|
static |
Check if the given device file contains the operating system.
- Parameters
-
deviceFile | The devicefile to check, e.g. /dev/sdb or /dev/sda1. |
exact | Set to FALSE to detect partitions, too. Defaults to TRUE. |
- Returns
- Returns TRUE if the device file contains the operating system, otherwise FALSE.
◆ uptime()
static OMV\System\System::uptime |
( |
|
$indexed = FALSE | ) |
|
|
static |
Tell how long the system has been running.
- Parameters
-
indexed | Set to FALSE to get the uptime as string, otherwise an indexed array with the fields seconds, minutes, hours and days will be returned. Defaults to FALSE. |
- Returns
- The uptime as formated string, indexed array or FALSE on failure.
The documentation for this class was generated from the following file: