initial commit of file from CVS for smeserver-phpsysinfo on Sat Sep 7 20:53:46 AEST 2024
61
root/opt/phpsysinfo/plugins/bat/bat_bootstrap.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<div class="col-lg-6" id="block_bat" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">Battery Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="bat" class="table table-hover table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Items</th>
|
||||
<th>Values</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr id="bat_DesignCapacity" style="display:none">
|
||||
<th>Design capacity</th>
|
||||
<td><span data-bind="DesignCapacity"></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="bat_RemainingCapacity" style="display:none">
|
||||
<th>Remaining capacity</th>
|
||||
<td><span data-bind="RemainingCapacity"></span></td>
|
||||
<td><span data-bind="RemainingCapacityBar"></span></td>
|
||||
</tr>
|
||||
<tr id="bat_ChargingState" style="display:none">
|
||||
<th>Charging state</th>
|
||||
<td><span data-bind="ChargingState"></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="bat_DesignVoltage" style="display:none">
|
||||
<th>Design voltage</th>
|
||||
<td><span data-bind="DesignVoltage"></span></td>
|
||||
<td><span data-bind="DesignVoltageMax"></span></td>
|
||||
</tr>
|
||||
<tr id="bat_PresentVoltage" style="display:none">
|
||||
<th>Present voltage</th>
|
||||
<td><span data-bind="PresentVoltage"></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="bat_BatteryType" style="display:none">
|
||||
<th>Battery Type</th>
|
||||
<td><span data-bind="BatteryType"></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="bat_BatteryTemperature" style="display:none">
|
||||
<th>Battery Temperature</th>
|
||||
<td><span data-bind="BatteryTemperature"></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="bat_BatteryCondition" style="display:none">
|
||||
<th>Battery Condition</th>
|
||||
<td><span data-bind="BatteryCondition"></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="bat_CycleCount" style="display:none">
|
||||
<th>Cycle Count</th>
|
||||
<td><span data-bind="CycleCount"></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
539
root/opt/phpsysinfo/plugins/bat/class.bat.inc.php
Normal file
@@ -0,0 +1,539 @@
|
||||
<?php
|
||||
/**
|
||||
* BAT Plugin, which displays battery state
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_BAT
|
||||
* @author Erkan V
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version $Id: class.bat.inc.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class BAT extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = array();
|
||||
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
|
||||
case 'command':
|
||||
if (PSI_OS == 'WINNT') {
|
||||
$_cim = null; //root\CIMv2
|
||||
$_wmi = null; //root\WMI
|
||||
// don't set this params for local connection, it will not work
|
||||
$strHostname = '';
|
||||
$strUser = '';
|
||||
$strPassword = '';
|
||||
try {
|
||||
// initialize the wmi object
|
||||
$objLocatorCIM = new COM('WbemScripting.SWbemLocator');
|
||||
if ($strHostname == "") {
|
||||
$_cim = $objLocatorCIM->ConnectServer();
|
||||
|
||||
} else {
|
||||
$_cim = $objLocatorCIM->ConnectServer($strHostname, 'root\CIMv2', $strHostname.'\\'.$strUser, $strPassword);
|
||||
}
|
||||
|
||||
// initialize the wmi object
|
||||
$objLocatorWMI = new COM('WbemScripting.SWbemLocator');
|
||||
if ($strHostname == "") {
|
||||
$_wmi = $objLocatorWMI->ConnectServer($strHostname, 'root\WMI');
|
||||
|
||||
} else {
|
||||
$_wmi = $objLocatorWMI->ConnectServer($strHostname, 'root\WMI', $strHostname.'\\'.$strUser, $strPassword);
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
$this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed.");
|
||||
}
|
||||
$buffer_info = '';
|
||||
$buffer_state = '';
|
||||
$bufferWB = CommonFunctions::getWMI($_cim, 'Win32_Battery', array('EstimatedChargeRemaining', 'DesignVoltage', 'BatteryStatus', 'Chemistry'));
|
||||
if (sizeof($bufferWB)>0) {
|
||||
$capacity = '';
|
||||
if (isset($bufferWB[0]['EstimatedChargeRemaining'])) {
|
||||
$capacity = $bufferWB[0]['EstimatedChargeRemaining'];
|
||||
}
|
||||
if (isset($bufferWB[0]['BatteryStatus'])) {
|
||||
switch ($bufferWB[0]['BatteryStatus']) {
|
||||
case 1: $batstat = 'Discharging'; break;
|
||||
case 2: $batstat = 'AC connected'; break;
|
||||
case 3: $batstat = 'Fully Charged'; break;
|
||||
case 4: $batstat = 'Low'; break;
|
||||
case 5: $batstat = 'Critical'; break;
|
||||
case 6: $batstat = 'Charging'; break;
|
||||
case 7: $batstat = 'Charging and High'; break;
|
||||
case 8: $batstat = 'Charging and Low'; break;
|
||||
case 9: $batstat = 'Charging and Critical'; break;
|
||||
case 10: $batstat = 'Undefined'; break;
|
||||
case 11: $batstat = 'Partially Charged'; break;
|
||||
default: $batstat = '';
|
||||
}
|
||||
if ($batstat != '') $buffer_state .= 'POWER_SUPPLY_STATUS='.$batstat."\n";
|
||||
}
|
||||
$techn = '';
|
||||
if (isset($bufferWB[0]['Chemistry'])) {
|
||||
switch ($bufferWB[0]['Chemistry']) {
|
||||
case 1: $techn = 'Other'; break;
|
||||
case 2: $techn = 'Unknown'; break;
|
||||
case 3: $techn = 'PbAc'; break;
|
||||
case 4: $techn = 'NiCd'; break;
|
||||
case 5: $techn = 'NiMH'; break;
|
||||
case 6: $techn = 'Li-ion'; break;
|
||||
case 7: $techn = 'Zinc-air'; break;
|
||||
case 8: $techn = 'Li-poly'; break;
|
||||
}
|
||||
}
|
||||
$bufferWPB = CommonFunctions::getWMI($_cim, 'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity', 'FullChargeCapacity'));
|
||||
if (isset($bufferWPB[0]['DesignVoltage'])) {
|
||||
$buffer_info .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.($bufferWPB[0]['DesignVoltage']*1000)."\n";
|
||||
}
|
||||
// sometimes Chemistry from Win32_Battery returns 2 but Win32_PortableBattery returns e.g. 6
|
||||
if ((($techn == '') || ($techn == 'Unknown')) && isset($bufferWPB[0]['Chemistry'])) {
|
||||
switch ($bufferWPB[0]['Chemistry']) {
|
||||
case 1: $techn = 'Other'; break;
|
||||
case 2: $techn = 'Unknown'; break;
|
||||
case 3: $techn = 'PbAc'; break;
|
||||
case 4: $techn = 'NiCd'; break;
|
||||
case 5: $techn = 'NiMH'; break;
|
||||
case 6: $techn = 'Li-ion'; break;
|
||||
case 7: $techn = 'Zinc-air'; break;
|
||||
case 8: $techn = 'Li-poly'; break;
|
||||
}
|
||||
}
|
||||
if ($techn != '') $buffer_info .= 'POWER_SUPPLY_TECHNOLOGY='.$techn."\n";
|
||||
|
||||
$bufferBS = CommonFunctions::getWMI($_wmi, 'BatteryStatus', array('RemainingCapacity', 'Voltage'));
|
||||
if (sizeof($bufferBS)>0) {
|
||||
if (isset($bufferBS[0]['RemainingCapacity']) && ($bufferBS[0]['RemainingCapacity']>0)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_ENERGY_NOW='.($bufferBS[0]['RemainingCapacity']*1000)."\n";
|
||||
$capacity = '';
|
||||
}
|
||||
if (isset($bufferBS[0]['Voltage']) && ($bufferBS[0]['Voltage']>0)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferBS[0]['Voltage']*1000)."\n";
|
||||
} elseif (isset($bufferWB[0]['DesignVoltage'])) {
|
||||
$buffer_state .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferWB[0]['DesignVoltage']*1000)."\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($bufferWPB[0]['FullChargeCapacity'])) {
|
||||
$bufferBFCC = CommonFunctions::getWMI($_wmi, 'BatteryFullChargedCapacity', array('FullChargedCapacity'));
|
||||
if ((sizeof($bufferBFCC)>0) && isset($bufferBFCC[0]['FullChargedCapacity'])) {
|
||||
$bufferWPB[0]['FullChargeCapacity'] = $bufferBFCC[0]['FullChargedCapacity'];
|
||||
}
|
||||
}
|
||||
if (isset($bufferWPB[0]['FullChargeCapacity'])) {
|
||||
$buffer_info .= 'POWER_SUPPLY_ENERGY_FULL='.($bufferWPB[0]['FullChargeCapacity']*1000)."\n";
|
||||
if ($capacity != '') $buffer_state .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[0]['FullChargeCapacity']*10)."\n");
|
||||
if (isset($bufferWPB[0]['DesignCapacity']) && ($bufferWPB[0]['DesignCapacity']!=0))
|
||||
$buffer_info .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[0]['DesignCapacity']*1000)."\n";
|
||||
} elseif (isset($bufferWPB[0]['DesignCapacity'])) {
|
||||
$buffer_info .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[0]['DesignCapacity']*1000)."\n";
|
||||
if ($capacity != '') $buffer_state .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[0]['DesignCapacity']*10)."\n");
|
||||
} else {
|
||||
if ($capacity != '') $buffer_state .= 'POWER_SUPPLY_CAPACITY='.$capacity."\n";
|
||||
}
|
||||
|
||||
$bufferBCC = CommonFunctions::getWMI($_wmi, 'BatteryCycleCount', array('CycleCount'));
|
||||
if ((sizeof($bufferBCC)>0) && isset($bufferBCC[0]['CycleCount']) && ($bufferBCC[0]['CycleCount']>0)) {
|
||||
$buffer_info .= 'POWER_SUPPLY_CYCLE_COUNT='.$bufferBCC[0]['CycleCount']."\n";
|
||||
}
|
||||
}
|
||||
} elseif (PSI_OS == 'Darwin') {
|
||||
$buffer_info = '';
|
||||
$buffer_state = '';
|
||||
CommonFunctions::executeProgram('ioreg', '-w0 -l -n AppleSmartBattery -r', $buffer_info, false);
|
||||
} elseif (PSI_OS == 'FreeBSD') {
|
||||
$buffer_info = '';
|
||||
$buffer_state = '';
|
||||
CommonFunctions::executeProgram('acpiconf', '-i batt', $buffer_info, false);
|
||||
} else {
|
||||
$buffer_info = '';
|
||||
$buffer_state = '';
|
||||
$bat_name = PSI_PLUGIN_BAT_DEVICE;
|
||||
$rfts_bi = CommonFunctions::rfts('/proc/acpi/battery/'.$bat_name.'/info', $buffer_info, 0, 4096, false);
|
||||
$rfts_bs = CommonFunctions::rfts('/proc/acpi/battery/'.$bat_name.'/state', $buffer_state, 0, 4096, false);
|
||||
if (!$rfts_bi && !$rfts_bs) {
|
||||
$buffer_info = '';
|
||||
$buffer_state = '';
|
||||
if (!CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/uevent', $buffer_info, 0, 4096, false)) {
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/battery/uevent', $buffer_info, 0, 4096, false)) {
|
||||
$bat_name = 'battery';
|
||||
} else {
|
||||
CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/uevent', $buffer_info, 0, 4096, PSI_DEBUG); // Once again but with debug
|
||||
}
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/voltage_min_design', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.$buffer1."\n";
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/voltage_max_design', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_VOLTAGE_MAX_DESIGN='.$buffer1."\n";
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/voltage_now', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_VOLTAGE_NOW='.$buffer1."\n";
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/energy_full', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_ENERGY_FULL='.$buffer1."\n";
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/energy_now', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_ENERGY_NOW='.$buffer1."\n";
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/charge_full', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_CHARGE_FULL='.$buffer1."\n";
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/charge_now', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_CHARGE_NOW='.$buffer1."\n";
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/capacity', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_CAPACITY='.$buffer1;
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/technology', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_TECHNOLOGY='.$buffer1;
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/status', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_STATUS='.$buffer1;
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/batt_temp', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_TEMP='.$buffer1;
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/batt_vol', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_VOLTAGE_NOW='.$buffer1;
|
||||
}
|
||||
if (CommonFunctions::rfts('/sys/class/power_supply/'.$bat_name.'/health', $buffer1, 1, 4096, false)) {
|
||||
$buffer_state .= 'POWER_SUPPLY_HEALTH='.$buffer1;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'data':
|
||||
CommonFunctions::rfts(APP_ROOT."/data/bat_info.txt", $buffer_info);
|
||||
CommonFunctions::rfts(APP_ROOT."/data/bat_state.txt", $buffer_state);
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addConfigError("__construct()", "PSI_PLUGIN_BAT_ACCESS");
|
||||
break;
|
||||
}
|
||||
$this->_filecontent['info'] = preg_split("/\n/", $buffer_info, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$this->_filecontent['state'] = preg_split("/\n/", $buffer_state, -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (empty($this->_filecontent)) {
|
||||
return;
|
||||
}
|
||||
foreach ($this->_filecontent['info'] as $roworig) {
|
||||
if (preg_match('/^[dD]esign capacity:\s*(.*) (.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity_max'] = $data[1];
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = trim($data[2]);
|
||||
} elseif ($bat['capacity_unit'] != trim($data[2])) {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^[lL]ast full capacity:\s*(.*) (.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity'] = $data[1];
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = trim($data[2]);
|
||||
} elseif ($bat['capacity_unit'] != trim($data[2])) {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^cycle count:\s*(.*)$/', trim($roworig), $data) && ($data[1]>0)) {
|
||||
$bat['cycle_count'] = $data[1];
|
||||
} elseif (preg_match('/^[dD]esign voltage:\s*(.*) (.*)$/', trim($roworig), $data)) {
|
||||
if ($data[2]=="mV") { // uV or mV detection
|
||||
$bat['design_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['design_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^battery type:\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_type'] = $data[1];
|
||||
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CYCLE_COUNT=(.*)$/', trim($roworig), $data) && ($data[1]>0)) {
|
||||
$bat['cycle_count'] = $data[1];
|
||||
} elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_MIN_DESIGN=(.*)$/', trim($roworig), $data)) {
|
||||
if ($data[1]<100000) { // uV or mV detection
|
||||
$bat['design_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['design_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_MAX_DESIGN=(.*)$/', trim($roworig), $data)) {
|
||||
if ($data[1]<100000) { // uV or mV detection
|
||||
$bat['design_voltage_max'] = $data[1];
|
||||
} else {
|
||||
$bat['design_voltage_max'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity'] = ($data[1]/1000);
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = "mWh";
|
||||
} elseif ($bat['capacity_unit'] != "mWh") {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CHARGE_FULL=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity'] = ($data[1]/1000);
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = "mAh";
|
||||
} elseif ($bat['capacity_unit'] != "mAh") {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_NOW=(.*)$/', trim($roworig), $data)) {
|
||||
if (!isset($bat['capacity_unit']) || ($bat['capacity_unit'] == "mWh")) {
|
||||
$bat['capacity_unit'] = "mWh";
|
||||
$bat['remaining_capacity'] = ($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CHARGE_NOW=(.*)$/', trim($roworig), $data)) {
|
||||
if (!isset($bat['capacity_unit']) || ($bat['capacity_unit'] == "mAh")) {
|
||||
$bat['capacity_unit'] = "mAh";
|
||||
$bat['remaining_capacity'] = ($data[1]/1000);
|
||||
}
|
||||
|
||||
/* auxiary */
|
||||
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL_DESIGN=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity_max'] = ($data[1]/1000);
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = "mWh";
|
||||
} elseif ($bat['capacity_unit'] != "mWh") {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CHARGE_FULL_DESIGN=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity_max'] = ($data[1]/1000);
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = "mAh";
|
||||
} elseif ($bat['capacity_unit'] != "mAh") {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_NOW=(.*)$/', trim($roworig), $data)) {
|
||||
if ($data[1]<100000) { // uV or mV detection
|
||||
$bat['present_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['present_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CAPACITY=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['capacity'] = $data[1];
|
||||
} elseif (preg_match('/^POWER_SUPPLY_TEMP=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_temperature'] = $data[1]/10;
|
||||
} elseif (preg_match('/^POWER_SUPPLY_TECHNOLOGY=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_type'] = $data[1];
|
||||
} elseif (preg_match('/^POWER_SUPPLY_STATUS=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['charging_state'] = $data[1];
|
||||
} elseif (preg_match('/^POWER_SUPPLY_HEALTH=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_condition'] = $data[1];
|
||||
|
||||
/* Darwin */
|
||||
} elseif (preg_match('/^"MaxCapacity"\s*=\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity'] = $data[1];
|
||||
} elseif (preg_match('/^"CurrentCapacity"\s*=\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['remaining_capacity'] = $data[1];
|
||||
} elseif (preg_match('/^"Voltage"\s*=\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['present_voltage'] = $data[1];
|
||||
} elseif (preg_match('/^"BatteryType"\s*=\s*"(.*)"$/', trim($roworig), $data)) {
|
||||
$bat['battery_type'] = $data[1];
|
||||
} elseif (preg_match('/^"Temperature"\s*=\s*(.*)$/', trim($roworig), $data)) {
|
||||
if ($data[1]>0) $bat['battery_temperature'] = $data[1]/100;
|
||||
} elseif (preg_match('/^"DesignCapacity"\s*=\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity_max'] = $data[1];
|
||||
} elseif (preg_match('/^"CycleCount"\s*=\s*(.*)$/', trim($roworig), $data) && ($data[1]>0)) {
|
||||
$bat['cycle_count'] = $data[1];
|
||||
/* auxiary */
|
||||
} elseif (preg_match('/^"FullyCharged"\s*=\s*Yes$/', trim($roworig), $data)) {
|
||||
$bat['charging_state_f'] = true;
|
||||
} elseif (preg_match('/^"IsCharging"\s*=\s*Yes$/', trim($roworig), $data)) {
|
||||
$bat['charging_state_i'] = true;
|
||||
} elseif (preg_match('/^"ExternalConnected"\s*=\s*Yes$/', trim($roworig), $data)) {
|
||||
$bat['charging_state_e'] = true;
|
||||
|
||||
/* FreeBSD */
|
||||
} elseif (preg_match('/^Type:\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_type'] = $data[1];
|
||||
} elseif (preg_match('/^State:\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['charging_state'] = $data[1];
|
||||
} elseif (preg_match('/^Present voltage:\s*(.*) (.*)$/', trim($roworig), $data)) {
|
||||
if ($data[2]=="mV") { // uV or mV detection
|
||||
$bat['present_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['present_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^Voltage:\s*(.*) (.*)$/', trim($roworig), $data)) {
|
||||
if ($data[2]=="mV") { // uV or mV detection
|
||||
$bat['present_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['present_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^Remaining capacity:\s*(.*)%$/', trim($roworig), $data)) {
|
||||
$bat['capacity'] = $data[1];
|
||||
}
|
||||
}
|
||||
foreach ($this->_filecontent['state'] as $roworig) {
|
||||
if (preg_match('/^remaining capacity:\s*(.*) (.*)$/', trim($roworig), $data)) {
|
||||
if (!isset($bat['capacity_unit']) || ($bat['capacity_unit'] == trim($data[2]))) {
|
||||
$bat['capacity_unit'] = trim($data[2]);
|
||||
$bat['remaining_capacity'] = $data[1];
|
||||
}
|
||||
} elseif (preg_match('/^present voltage:\s*(.*) (.*)$/', trim($roworig), $data)) {
|
||||
if ($data[2]=="mV") { // uV or mV detection
|
||||
$bat['present_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['present_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^charging state:\s*(.*)$/', trim($roworig), $data)) {
|
||||
$bat['charging_state'] = $data[1];
|
||||
|
||||
} elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_MIN_DESIGN=(.*)$/', trim($roworig), $data)) {
|
||||
if ($data[1]<100000) { // uV or mV detection
|
||||
$bat['design_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['design_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_MAX_DESIGN=(.*)$/', trim($roworig), $data)) {
|
||||
if ($data[1]<100000) { // uV or mV detection
|
||||
$bat['design_voltage_max'] = $data[1];
|
||||
} else {
|
||||
$bat['design_voltage_max'] = round($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity'] = ($data[1]/1000);
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = "mWh";
|
||||
} elseif ($bat['capacity_unit'] != "mWh") {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CHARGE_FULL=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['design_capacity'] = ($data[1]/1000);
|
||||
if (!isset($bat['capacity_unit'])) {
|
||||
$bat['capacity_unit'] = "mAh";
|
||||
} elseif ($bat['capacity_unit'] != "mAh") {
|
||||
$bat['capacity_unit'] = "???";
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_NOW=(.*)$/', trim($roworig), $data)) {
|
||||
if (!isset($bat['capacity_unit']) || ($bat['capacity_unit'] == "mWh")) {
|
||||
$bat['capacity_unit'] = "mWh";
|
||||
$bat['remaining_capacity'] = ($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CHARGE_NOW=(.*)$/', trim($roworig), $data)) {
|
||||
if (!isset($bat['capacity_unit']) || ($bat['capacity_unit'] == "mAh")) {
|
||||
$bat['capacity_unit'] = "mAh";
|
||||
$bat['remaining_capacity'] = ($data[1]/1000);
|
||||
}
|
||||
} elseif (preg_match('/^POWER_SUPPLY_VOLTAGE_NOW=(.*)$/', trim($roworig), $data)) {
|
||||
if ($data[1]<100000) { // uV or mV detection
|
||||
$bat['present_voltage'] = $data[1];
|
||||
} else {
|
||||
$bat['present_voltage'] = round($data[1]/1000);
|
||||
}
|
||||
|
||||
} elseif (preg_match('/^POWER_SUPPLY_CAPACITY=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['capacity'] = $data[1];
|
||||
} elseif (preg_match('/^POWER_SUPPLY_TEMP=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_temperature'] = $data[1]/10;
|
||||
} elseif (preg_match('/^POWER_SUPPLY_TECHNOLOGY=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_type'] = $data[1];
|
||||
} elseif (preg_match('/^POWER_SUPPLY_STATUS=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['charging_state'] = $data[1];
|
||||
} elseif (preg_match('/^POWER_SUPPLY_HEALTH=(.*)$/', trim($roworig), $data)) {
|
||||
$bat['battery_condition'] = $data[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($bat)) $this->_result[0] = $bat;
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLElement entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
foreach ($this->_result as $bat_item) {
|
||||
$xmlbat = $this->xml->addChild("Bat");
|
||||
if ((!isset($bat_item['remaining_capacity']) || (isset($bat_item['design_capacity']) && ($bat_item['design_capacity'] == 0))) &&
|
||||
isset($bat_item['capacity']) && ($bat_item['capacity']>=0)) {
|
||||
$xmlbat->addAttribute("DesignCapacity", 100);
|
||||
$xmlbat->addAttribute("RemainingCapacity", $bat_item['capacity']);
|
||||
$xmlbat->addAttribute("CapacityUnit", "%");
|
||||
} else {
|
||||
if (isset($bat_item['design_capacity'])) {
|
||||
$xmlbat->addAttribute("DesignCapacity", $bat_item['design_capacity']);
|
||||
} elseif (isset($bat_item['design_capacity_max'])) {
|
||||
$xmlbat->addAttribute("DesignCapacity", $bat_item['design_capacity_max']);
|
||||
}
|
||||
if (isset($bat_item['remaining_capacity'])) {
|
||||
$xmlbat->addAttribute("RemainingCapacity", $bat_item['remaining_capacity']);
|
||||
}
|
||||
if (isset($bat_item['capacity_unit'])) {
|
||||
$xmlbat->addAttribute("CapacityUnit", $bat_item['capacity_unit']);
|
||||
}
|
||||
}
|
||||
if (isset($bat_item['design_voltage'])) {
|
||||
$xmlbat->addAttribute("DesignVoltage", $bat_item['design_voltage']);
|
||||
if (isset($bat_item['design_voltage_max']) && ($bat_item['design_voltage_max'] != $bat_item['design_voltage'])) {
|
||||
$xmlbat->addAttribute("DesignVoltageMax", $bat_item['design_voltage_max']);
|
||||
}
|
||||
} elseif (isset($bat_item['design_voltage_max'])) {
|
||||
$xmlbat->addAttribute("DesignVoltage", $bat_item['design_voltage_max']);
|
||||
}
|
||||
if (isset($bat_item['present_voltage'])) {
|
||||
$xmlbat->addAttribute("PresentVoltage", $bat_item['present_voltage']);
|
||||
}
|
||||
if (isset($bat_item['charging_state'])) {
|
||||
$xmlbat->addAttribute("ChargingState", $bat_item['charging_state']);
|
||||
} else {
|
||||
if (isset($bat_item['charging_state_i'])) {
|
||||
$xmlbat->addAttribute("ChargingState", 'Charging');
|
||||
} elseif (!isset($bat_item['charging_state_e'])) {
|
||||
$xmlbat->addAttribute("ChargingState", 'Discharging');
|
||||
} elseif (isset($bat_item['charging_state_f'])) {
|
||||
$xmlbat->addAttribute("ChargingState", 'Fully Charged');
|
||||
} else {
|
||||
$xmlbat->addAttribute("ChargingState", 'Unknown state');
|
||||
}
|
||||
}
|
||||
if (isset($bat_item['battery_type'])) {
|
||||
$xmlbat->addAttribute("BatteryType", $bat_item['battery_type']);
|
||||
}
|
||||
if (isset($bat_item['battery_temperature'])) {
|
||||
$xmlbat->addAttribute("BatteryTemperature", $bat_item['battery_temperature']);
|
||||
}
|
||||
if (isset($bat_item['design_capacity'])
|
||||
&& isset($bat_item['design_capacity_max']) && ($bat_item['design_capacity_max'] != 0)
|
||||
&& (!isset($bat['capacity_unit']) || ($bat['capacity_unit'] != "???"))) {
|
||||
if (isset($bat_item['battery_condition'])) {
|
||||
$xmlbat->addAttribute("BatteryCondition", min(100, round(100*$bat_item['design_capacity']/$bat_item['design_capacity_max']))."% ".$bat_item['battery_condition']);
|
||||
} else {
|
||||
$xmlbat->addAttribute("BatteryCondition", min(100, round(100*$bat_item['design_capacity']/$bat_item['design_capacity_max']))."%");
|
||||
}
|
||||
} elseif (isset($bat_item['battery_condition'])) {
|
||||
$xmlbat->addAttribute("BatteryCondition", $bat_item['battery_condition']);
|
||||
}
|
||||
if (isset($bat_item['cycle_count'])) {
|
||||
$xmlbat->addAttribute("CycleCount", $bat_item['cycle_count']);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
}
|
168
root/opt/phpsysinfo/plugins/bat/js/bat.js
Normal file
@@ -0,0 +1,168 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
//
|
||||
// $Id: bat.js 661 2012-08-27 11:26:39Z namiltd $
|
||||
//
|
||||
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar */
|
||||
|
||||
"use strict";
|
||||
|
||||
var bat_show = false, bat_table;
|
||||
/**
|
||||
* insert content into table
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function bat_populate(xml) {
|
||||
|
||||
bat_table.fnClearTable();
|
||||
|
||||
$("Plugins Plugin_BAT Bat", xml).each(function bat_getitem(idp) {
|
||||
var DesignCapacity = "", DesignVoltage = "", BatteryType = "",RemainingCapacity = "", PresentVoltage = "", ChargingState = "", BatteryTemperature = "", BatteryCondition = "", CapacityUnit = "", CycleCount = "", DesignVoltageMax = "";
|
||||
DesignCapacity = $(this).attr("DesignCapacity");
|
||||
DesignVoltage = $(this).attr("DesignVoltage");
|
||||
BatteryType = $(this).attr("BatteryType");
|
||||
RemainingCapacity = $(this).attr("RemainingCapacity");
|
||||
PresentVoltage = $(this).attr("PresentVoltage");
|
||||
ChargingState = $(this).attr("ChargingState");
|
||||
BatteryTemperature = $(this).attr("BatteryTemperature");
|
||||
BatteryCondition = $(this).attr("BatteryCondition");
|
||||
CapacityUnit = $(this).attr("CapacityUnit");
|
||||
CycleCount = $(this).attr("CycleCount");
|
||||
DesignVoltageMax = $(this).attr("DesignVoltageMax");
|
||||
|
||||
if (CapacityUnit == undefined) {
|
||||
CapacityUnit = "mWh";
|
||||
}
|
||||
|
||||
if ((CapacityUnit == "%") && (RemainingCapacity != undefined)) {
|
||||
bat_table.fnAddData([genlang(4, true, "BAT"), createBar(round(parseInt(RemainingCapacity, 10),0)), ' ']);
|
||||
} else if (DesignCapacity == undefined) {
|
||||
if (RemainingCapacity != undefined) bat_table.fnAddData([genlang(4, true, "BAT"), RemainingCapacity+' '+CapacityUnit, ' ']);
|
||||
} else {
|
||||
bat_table.fnAddData([genlang(3, true, "BAT"), DesignCapacity+' '+CapacityUnit, ' ']);
|
||||
if (RemainingCapacity != undefined) bat_table.fnAddData([genlang(4, true, "BAT"), RemainingCapacity+' '+CapacityUnit, createBar(parseInt(DesignCapacity, 10) != 0 ? round(parseInt(RemainingCapacity, 10) / parseInt(DesignCapacity, 10) * 100, 0) : 0)]);
|
||||
}
|
||||
if (ChargingState != undefined) {
|
||||
bat_table.fnAddData([genlang(9, true, "BAT"), ChargingState, ' ']);
|
||||
}
|
||||
if (DesignVoltage != undefined) {
|
||||
if (DesignVoltageMax != undefined) {
|
||||
bat_table.fnAddData([genlang(5, true, "BAT"), DesignVoltage+' mV', DesignVoltageMax+' mV']);
|
||||
} else {
|
||||
bat_table.fnAddData([genlang(5, true, "BAT"), DesignVoltage+' mV', ' ']);
|
||||
}
|
||||
} else if (DesignVoltageMax != undefined) {
|
||||
bat_table.fnAddData([genlang(5, true, "BAT"), DesignVoltageMax+' mV', ' ']);
|
||||
}
|
||||
if (PresentVoltage != undefined) {
|
||||
bat_table.fnAddData([genlang(6, true, "BAT"), PresentVoltage+' mV', ' ']);
|
||||
}
|
||||
if (BatteryType != undefined) {
|
||||
bat_table.fnAddData([genlang(10, true, "BAT"), BatteryType, ' ']);
|
||||
}
|
||||
if (BatteryTemperature != undefined) {
|
||||
bat_table.fnAddData([genlang(11, true, "BAT"), formatTemp(BatteryTemperature, xml), ' ']);
|
||||
}
|
||||
if (BatteryCondition != undefined) {
|
||||
bat_table.fnAddData([genlang(12, true, "BAT"), BatteryCondition, ' ']);
|
||||
}
|
||||
if (CycleCount != undefined) {
|
||||
bat_table.fnAddData([genlang(13, true, "BAT"), CycleCount, ' ']);
|
||||
}
|
||||
|
||||
bat_show = true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* fill the plugin block with table structure
|
||||
*/
|
||||
function bat_buildTable() {
|
||||
var html = "";
|
||||
|
||||
html += "<table id=\"Plugin_BATTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th>" + genlang(7, true, "BAT") + "</th>\n";
|
||||
html += " <th>" + genlang(8, true, "BAT") + "</th>\n";
|
||||
html += " <th> </th>\n";
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += "</table>\n";
|
||||
|
||||
$("#Plugin_BAT").append(html);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function bat_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=BAT",
|
||||
dataType: "xml",
|
||||
error: function bat_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin BAT!");
|
||||
},
|
||||
success: function bat_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
bat_populate(xml);
|
||||
if (bat_show) {
|
||||
plugin_translate("BAT");
|
||||
$("#Plugin_BAT").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function bat_buildpage() {
|
||||
$("#footer").before(buildBlock("BAT", 1, true));
|
||||
$("#Plugin_BAT").css("width", "451px");
|
||||
|
||||
bat_buildTable();
|
||||
|
||||
bat_table = $("#Plugin_BATTable").dataTable({
|
||||
"bPaginate": false,
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bSort": false,
|
||||
"bInfo": false,
|
||||
"bProcessing": true,
|
||||
"bAutoWidth": false,
|
||||
"bStateSave": true,
|
||||
"aoColumns": [{
|
||||
"sType": 'span-string'
|
||||
}, {
|
||||
"sType": 'span-string'
|
||||
}, {
|
||||
"sType": 'span-string'
|
||||
}]
|
||||
});
|
||||
|
||||
bat_request();
|
||||
|
||||
$("#Reload_BATTable").click(function bat_reload(id) {
|
||||
bat_request();
|
||||
$("#Reload_BATTable").attr("title",datetime());
|
||||
});
|
||||
});
|
70
root/opt/phpsysinfo/plugins/bat/js/bat_bootstrap.js
Normal file
@@ -0,0 +1,70 @@
|
||||
function renderPlugin_bat(data) {
|
||||
|
||||
var directives = {
|
||||
RemainingCapacity: {
|
||||
html: function () {
|
||||
var CapacityUnit = (this["CapacityUnit"] !== undefined) ? this["CapacityUnit"] : 'mWh';
|
||||
if ( CapacityUnit === "%" ) {
|
||||
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width: ' + round(this["RemainingCapacity"],0) + '%;"></div>' +
|
||||
'</div><div class="percent">' + round(this["RemainingCapacity"],0) + '%</div>';
|
||||
} else {
|
||||
return this["RemainingCapacity"] + String.fromCharCode(160) + CapacityUnit;
|
||||
}
|
||||
}
|
||||
},
|
||||
DesignCapacity: {
|
||||
html: function () {
|
||||
var CapacityUnit = (this["CapacityUnit"] !== undefined) ? this["CapacityUnit"] : 'mWh';
|
||||
return this["DesignCapacity"] + String.fromCharCode(160) + CapacityUnit;
|
||||
}
|
||||
},
|
||||
RemainingCapacityBar: {
|
||||
html: function () {
|
||||
var CapacityUnit = (this["CapacityUnit"] !== undefined) ? this["CapacityUnit"] : 'mWh';
|
||||
if (( CapacityUnit !== "%" ) && (this["DesignCapacity"] !== undefined)){
|
||||
var percent = (this["DesignCapacity"] != 0) ? round(100*this["RemainingCapacity"]/this["DesignCapacity"],0) : 0;
|
||||
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width: ' + percent + '%;"></div>' +
|
||||
'</div><div class="percent">' + percent + '%</div>';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
PresentVoltage: {
|
||||
text: function () {
|
||||
return this['PresentVoltage'] + String.fromCharCode(160) + 'mV';
|
||||
}
|
||||
},
|
||||
BatteryTemperature: {
|
||||
text: function () {
|
||||
return formatTemp(this["BatteryTemperature"], data["Options"]["@attributes"]["tempFormat"]);
|
||||
}
|
||||
},
|
||||
DesignVoltage: {
|
||||
text: function () {
|
||||
return this['DesignVoltage']+String.fromCharCode(160) + 'mV';
|
||||
}
|
||||
},
|
||||
DesignVoltageMax: {
|
||||
text: function () {
|
||||
return (this["DesignVoltageMax"] !== undefined) ? this['DesignVoltageMax']+String.fromCharCode(160) + 'mV' : '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if ((data['Plugins']['Plugin_BAT'] !== undefined) && (data['Plugins']['Plugin_BAT']["Bat"] !== undefined) && (data['Plugins']['Plugin_BAT']["Bat"]["@attributes"] !== undefined)){
|
||||
$('#bat').render(data['Plugins']['Plugin_BAT']["Bat"]["@attributes"], directives);
|
||||
var attr = data['Plugins']['Plugin_BAT']["Bat"]["@attributes"];
|
||||
for (bat_param in {DesignCapacity:0,RemainingCapacity:1,ChargingState:2,DesignVoltage:3,PresentVoltage:4,BatteryType:5,BatteryTemperature:6,BatteryCondition:7,CycleCount:8}) {
|
||||
if (attr[bat_param] !== undefined) {
|
||||
$('#bat_' + bat_param).show();
|
||||
}
|
||||
}
|
||||
if (attr["CapacityUnit"] === "%") {
|
||||
$('#bat_DesignCapacity').hide();
|
||||
}
|
||||
$('#block_bat').show();
|
||||
} else {
|
||||
$('#block_bat').hide();
|
||||
}
|
||||
}
|
48
root/opt/phpsysinfo/plugins/bat/lang/cz.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Czech Created by: Tomáš Růžička
|
||||
-->
|
||||
<tns:translationPlugin language="czech" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_bat_001" name="bat_title">
|
||||
<exp>Stav baterie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_002" name="bat_date">
|
||||
<exp>Aktualizováno</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_003" name="bat_design_capacity">
|
||||
<exp>Konstrukční kapacita</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_004" name="bat_remaining_capacity">
|
||||
<exp>Zbývající kapacita</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_005" name="bat_design_voltage">
|
||||
<exp>Konstrukční napětí</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_006" name="bat_present_voltage">
|
||||
<exp>Aktuální napětí</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_007" name="bat_item">
|
||||
<exp>Položky</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_008" name="bat_value">
|
||||
<exp>Hodnoty</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_009" name="bat_charging_state">
|
||||
<exp>Stav nabíjení</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_010" name="bat_battery_type">
|
||||
<exp>Battery Type</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_011" name="bat_battery_temperature">
|
||||
<exp>Battery Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_012" name="bat_battery_condition">
|
||||
<exp>Battery Condition</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_013" name="bat_cycle_count">
|
||||
<exp>Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
48
root/opt/phpsysinfo/plugins/bat/lang/de.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: German Created by: Matthias Freund (MAFLO321)
|
||||
-->
|
||||
<tns:translationPlugin language="german" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_bat_001" name="bat_title">
|
||||
<exp>Akku-Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_002" name="bat_date">
|
||||
<exp>Letzte Aktualisierung</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_003" name="bat_design_capacity">
|
||||
<exp>Bemeskapazität</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_004" name="bat_remaining_capacity">
|
||||
<exp>Übrige Kapazität</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_005" name="bat_design_voltage">
|
||||
<exp>Bemessungsspannung</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_006" name="bat_present_voltage">
|
||||
<exp>Momentane Spannung</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_007" name="bat_item">
|
||||
<exp>Dinge</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_008" name="bat_value">
|
||||
<exp>Werte</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_009" name="bat_charging_state">
|
||||
<exp>Ladezustand</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_010" name="bat_battery_type">
|
||||
<exp>Akku-Typ</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_011" name="bat_battery_temperature">
|
||||
<exp>Akku-Temperatur</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_012" name="bat_battery_condition">
|
||||
<exp>Akku-Zustand</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_013" name="bat_cycle_count">
|
||||
<exp>Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
48
root/opt/phpsysinfo/plugins/bat/lang/en.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Erkan VALENTIN
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_bat_001" name="bat_title">
|
||||
<exp>Battery Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_002" name="bat_date">
|
||||
<exp>Last refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_003" name="bat_design_capacity">
|
||||
<exp>Design capacity</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_004" name="bat_remaining_capacity">
|
||||
<exp>Remaining capacity</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_005" name="bat_design_voltage">
|
||||
<exp>Design voltage</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_006" name="bat_present_voltage">
|
||||
<exp>Present voltage</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_007" name="bat_item">
|
||||
<exp>Items</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_008" name="bat_value">
|
||||
<exp>Values</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_009" name="bat_charging_state">
|
||||
<exp>Charging state</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_010" name="bat_battery_type">
|
||||
<exp>Battery Type</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_011" name="bat_battery_temperature">
|
||||
<exp>Battery Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_012" name="bat_battery_condition">
|
||||
<exp>Battery Condition</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_013" name="bat_cycle_count">
|
||||
<exp>Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
48
root/opt/phpsysinfo/plugins/bat/lang/fr.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: Erkan VALENTIN
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_bat_001" name="bat_title">
|
||||
<exp>Etat des batteries</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_002" name="bat_date">
|
||||
<exp>Dernière actualisation</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_003" name="bat_design_capacity">
|
||||
<exp>Capacité d'origine</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_004" name="bat_remaining_capacity">
|
||||
<exp>Capacité restante</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_005" name="bat_design_voltage">
|
||||
<exp>Tension d'origine</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_006" name="bat_present_voltage">
|
||||
<exp>Tension actuelle</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_007" name="bat_item">
|
||||
<exp>Elements</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_008" name="bat_value">
|
||||
<exp>Valeurs</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_009" name="bat_charging_state">
|
||||
<exp>Etat</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_010" name="bat_battery_type">
|
||||
<exp>Battery Type</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_011" name="bat_battery_temperature">
|
||||
<exp>Battery Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_012" name="bat_battery_condition">
|
||||
<exp>Battery Condition</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_013" name="bat_cycle_count">
|
||||
<exp>Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
48
root/opt/phpsysinfo/plugins/bat/lang/pl.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="polish" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_bat_001" name="bat_title">
|
||||
<exp>Status Baterii</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_002" name="bat_date">
|
||||
<exp>Ostatnie odświeżenie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_003" name="bat_design_capacity">
|
||||
<exp>Pojemność znamionowa</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_004" name="bat_remaining_capacity">
|
||||
<exp>Pojemność aktualna</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_005" name="bat_design_voltage">
|
||||
<exp>Napięcie znamionowe</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_006" name="bat_present_voltage">
|
||||
<exp>Napięcie aktualne</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_007" name="bat_item">
|
||||
<exp>Parametry</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_008" name="bat_value">
|
||||
<exp>Wartości</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_009" name="bat_charging_state">
|
||||
<exp>Stan ładowania</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_010" name="bat_battery_type">
|
||||
<exp>Typ ogniw</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_011" name="bat_battery_temperature">
|
||||
<exp>Temperatura ogniw</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_012" name="bat_battery_condition">
|
||||
<exp>Kondycja ogniw</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_013" name="bat_cycle_count">
|
||||
<exp>Cykli ładowania</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
48
root/opt/phpsysinfo/plugins/bat/lang/ro.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Iulian Alexe
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_bat_001" name="bat_title">
|
||||
<exp>Stare Baterie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_002" name="bat_date">
|
||||
<exp>Ultimul refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_003" name="bat_design_capacity">
|
||||
<exp>Capacitate Design</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_004" name="bat_remaining_capacity">
|
||||
<exp>Capacitate rămasă</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_005" name="bat_design_voltage">
|
||||
<exp>Voltaj design</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_006" name="bat_present_voltage">
|
||||
<exp>Voltaj prezent</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_007" name="bat_item">
|
||||
<exp>Elemente</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_008" name="bat_value">
|
||||
<exp>Valori</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_009" name="bat_charging_state">
|
||||
<exp>Stare de Încărcare</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_010" name="bat_battery_type">
|
||||
<exp>Tip Baterie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_011" name="bat_battery_temperature">
|
||||
<exp>Temperatura Baterie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_012" name="bat_battery_condition">
|
||||
<exp>Condiții Baterie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_013" name="bat_cycle_count">
|
||||
<exp>Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
48
root/opt/phpsysinfo/plugins/bat/lang/ru.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="russian" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_bat_001" name="bat_title">
|
||||
<exp>Состояние батареи</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_002" name="bat_date">
|
||||
<exp>Последние обновление</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_003" name="bat_design_capacity">
|
||||
<exp>Проектная мощность</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_004" name="bat_remaining_capacity">
|
||||
<exp>Оставшийся объем</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_005" name="bat_design_voltage">
|
||||
<exp>Проектное напряжение</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_006" name="bat_present_voltage">
|
||||
<exp>Фактическое напряжение</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_007" name="bat_item">
|
||||
<exp>Элементы</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_008" name="bat_value">
|
||||
<exp>Значение</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_009" name="bat_charging_state">
|
||||
<exp>Состояние зарядки</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_010" name="bat_battery_type">
|
||||
<exp>Тип батареи</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_011" name="bat_battery_temperature">
|
||||
<exp>Температура батареи</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_012" name="bat_battery_condition">
|
||||
<exp>Состояние аккумулятора</exp>
|
||||
</expression>
|
||||
<expression id="plugin_bat_013" name="bat_cycle_count">
|
||||
<exp>Циклы</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
176
root/opt/phpsysinfo/plugins/dmraid/class.dmraid.inc.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
* DMRaid Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_DMRaid
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.dmraid.inc.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* dmraid Plugin, which displays software RAID status
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_DMRaid
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class DMRaid extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = "";
|
||||
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
$buffer = "";
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_DMRAID_ACCESS)) {
|
||||
case 'command':
|
||||
CommonFunctions::executeProgram("dmraid", "-s -vv 2>&1", $buffer);
|
||||
break;
|
||||
case 'data':
|
||||
CommonFunctions::rfts(APP_ROOT."/data/dmraid.txt", $buffer);
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addConfigError("__construct()", "PSI_PLUGIN_DMRAID_ACCESS");
|
||||
break;
|
||||
}
|
||||
if (trim($buffer) != "") {
|
||||
$this->_filecontent = preg_split("/(\r?\n\*\*\* )|(\r?\n--> )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
|
||||
} else {
|
||||
$this->_filecontent = array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array<br>the array is build like a tree,
|
||||
* so that it is possible to get only a specific process with the childs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (empty($this->_filecontent)) {
|
||||
return;
|
||||
}
|
||||
$group = "";
|
||||
foreach ($this->_filecontent as $block) {
|
||||
if (preg_match('/^(NOTICE: )|(ERROR: )/m', $block)) {
|
||||
$group = "";
|
||||
$lines = preg_split("/\r?\n/", $block, -1, PREG_SPLIT_NO_EMPTY);
|
||||
foreach ($lines as $line) {
|
||||
if (preg_match('/^NOTICE: added\s+\/dev\/(.+)\s+to RAID set\s+\"(.+)\"/', $line, $partition)) {
|
||||
$this->_result['devices'][$partition[2]]['partitions'][$partition[1]]['status'] = "";
|
||||
} elseif (preg_match('/^ERROR: .* device\s+\/dev\/(.+)\s+(.+)\s+in RAID set\s+\"(.+)\"/', $line, $partition)) {
|
||||
if ($partition[2]=="broken") {
|
||||
$this->_result['devices'][$partition[3]]['partitions'][$partition[1]]['status'] = 'F';
|
||||
} else {
|
||||
$this->_result['devices'][$partition[3]]['partitions'][$partition[1]]['status'] = 'W';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/^Group superset\s+(.+)/m', $block, $arrname)) {
|
||||
$group = trim($arrname[1]);
|
||||
}
|
||||
if (preg_match('/^name\s*:\s*(.*)/m', $block, $arrname)) {
|
||||
if ($group=="") {
|
||||
$group = trim($arrname[1]);
|
||||
}
|
||||
$this->_result['devices'][$group]['name'] = $arrname[1];
|
||||
if (preg_match('/^size\s*:\s*(.*)/m', $block, $size)) {
|
||||
$this->_result['devices'][$group]['size'] = trim($size[1]);
|
||||
}
|
||||
if (preg_match('/^stride\s*:\s*(.*)/m', $block, $stride)) {
|
||||
$this->_result['devices'][$group]['stride'] = trim($stride[1]);
|
||||
}
|
||||
if (preg_match('/^type\s*:\s*(.*)/m', $block, $type)) {
|
||||
$this->_result['devices'][$group]['type'] = trim($type[1]);
|
||||
}
|
||||
if (preg_match('/^status\s*:\s*(.*)/m', $block, $status)) {
|
||||
$this->_result['devices'][$group]['status'] = trim($status[1]);
|
||||
}
|
||||
if (preg_match('/^subsets\s*:\s*(.*)/m', $block, $subsets)) {
|
||||
$this->_result['devices'][$group]['subsets'] = trim($subsets[1]);
|
||||
}
|
||||
if (preg_match('/^devs\s*:\s*(.*)/m', $block, $devs)) {
|
||||
$this->_result['devices'][$group]['devs'] = trim($devs[1]);
|
||||
}
|
||||
if (preg_match('/^spares\s*:\s*(.*)/m', $block, $spares)) {
|
||||
$this->_result['devices'][$group]['spares'] = trim($spares[1]);
|
||||
}
|
||||
$group = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLObject entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
if (empty($this->_result)) {
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
$hideRaids = array();
|
||||
if (defined('PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES') && is_string(PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES)) {
|
||||
$hideRaids = eval(PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES);
|
||||
} else {
|
||||
$hideRaids = array(PSI_PLUGIN_DMRAID_HIDE_RAID_DEVICES);
|
||||
}
|
||||
}
|
||||
foreach ($this->_result['devices'] as $key=>$device) {
|
||||
if (!in_array($key, $hideRaids, true)) {
|
||||
$dev = $this->xml->addChild("Raid");
|
||||
$dev->addAttribute("Device_Name", $key);
|
||||
$dev->addAttribute("Type", $device["type"]);
|
||||
$dev->addAttribute("Disk_Status", $device["status"]);
|
||||
$dev->addAttribute("Name", $device["name"]);
|
||||
$dev->addAttribute("Size", $device["size"]);
|
||||
$dev->addAttribute("Stride", $device["stride"]);
|
||||
$dev->addAttribute("Subsets", $device["subsets"]);
|
||||
$dev->addAttribute("Devs", $device["devs"]);
|
||||
$dev->addAttribute("Spares", $device["spares"]);
|
||||
$disks = $dev->addChild("Disks");
|
||||
if (isset($device['partitions']) && sizeof($device['partitions']>0)) foreach ($device['partitions'] as $diskkey=>$disk) {
|
||||
$disktemp = $disks->addChild("Disk");
|
||||
$disktemp->addAttribute("Name", $diskkey);
|
||||
if ($device["status"]=='ok') {
|
||||
$disktemp->addAttribute("Status", $disk['status']);
|
||||
} else {
|
||||
$disktemp->addAttribute("Status", 'W');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
}
|
14
root/opt/phpsysinfo/plugins/dmraid/css/dmraid.css
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
$Id: dmraid.css 661 2012-08-27 11:26:39Z namiltd $
|
||||
*/
|
||||
.plugin_dmraid_biun {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 20px;
|
||||
float: left;
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
img.plugin_dmraid_biun {
|
||||
margin: auto;
|
||||
}
|
9
root/opt/phpsysinfo/plugins/dmraid/dmraid_bootstrap.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="col-lg-12" id="block_dmraid" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">RAID Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="dmraid" class="table borderless table-condensed">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/error.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivefail.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddriveok.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivespare.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
root/opt/phpsysinfo/plugins/dmraid/gfx/harddrivewarn.png
Normal file
After Width: | Height: | Size: 11 KiB |
176
root/opt/phpsysinfo/plugins/dmraid/js/dmraid.js
Normal file
@@ -0,0 +1,176 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
//
|
||||
// $Id: dmraid.js 679 2012-09-04 10:10:11Z namiltd $
|
||||
//
|
||||
|
||||
/*global $, jQuery, buildBlock, genlang, createBar, plugin_translate, datetime */
|
||||
|
||||
"use strict";
|
||||
|
||||
var dmraid_show = false;
|
||||
|
||||
/**
|
||||
* get the details of the raid
|
||||
* @param {jQuery} xml part of the plugin-XML
|
||||
* @param {number} id id of the device
|
||||
*/
|
||||
function dmraid_buildinfos(xml, id) {
|
||||
var html = "", devname = "", devstatus = "", devtype = "",devsize = 0, devstride = 0, devsubsets = 0, devdevs = 0, devspares = 0, button = "";
|
||||
|
||||
devname = $(xml).attr("Name");
|
||||
devstatus = $(xml).attr("Disk_Status");
|
||||
devtype = $(xml).attr("Type");
|
||||
devsize = parseInt($(xml).attr("Size"), 10);
|
||||
devstride = parseInt($(xml).attr("Stride"), 10);
|
||||
devsubsets = parseInt($(xml).attr("Subsets"), 10);
|
||||
devdevs = parseInt($(xml).attr("Devs"), 10);
|
||||
devspares = parseInt($(xml).attr("Spares"), 10);
|
||||
html += "<tr><td>" + genlang(4, false, "DMRaid") + "</td><td>" + devname + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(5, false, "DMRaid") + "</td><td>" + devstatus + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(6, false, "DMRaid") + "</td><td>" + devtype + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(7, false, "DMRaid") + "</td><td>" + devsize + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(8, false, "DMRaid") + "</td><td>" + devstride + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(9, false, "DMRaid") + "</td><td>" + devsubsets + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(10, false, "DMRaid") + "</td><td>" + devdevs + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(11, false, "DMRaid") + "</td><td>" + devspares + "</td></tr>";
|
||||
button += "<h3 style=\"cursor: pointer\" id=\"sPlugin_DMRaid_Info" + id + "\"><img src=\"./gfx/bullet_toggle_plus.png\" alt=\"plus\" style=\"vertical-align:middle;\" />" + genlang(3, false, "DMRaid") + "</h3>";
|
||||
button += "<h3 style=\"cursor: pointer; display: none;\" id=\"hPlugin_DMRaid_Info" + id + "\"><img src=\"./gfx/bullet_toggle_minus.png\" alt=\"minus\" style=\"vertical-align:middle;\" />" + genlang(3, false, "DMRaid") + "</h3>";
|
||||
button += "<table id=\"Plugin_DMRaid_InfoTable" + id + "\" style=\"border-spacing:0; display:none;\">" + html + "</table>";
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* choose the right diskdrive icon
|
||||
* @param {jQuery} xml part of the plugin-XML
|
||||
*/
|
||||
function dmraid_diskicon(xml) {
|
||||
var html = "";
|
||||
$("Disks Disk", xml).each(function dmraid_getdisk(id) {
|
||||
var diskstatus = "", diskname = "", img = "", alt = "";
|
||||
html += "<div class=\"plugin_dmraid_biun\">";
|
||||
diskstatus = $(this).attr("Status");
|
||||
diskname = $(this).attr("Name");
|
||||
switch (diskstatus) {
|
||||
case " ":
|
||||
case "":
|
||||
img = "harddriveok.png";
|
||||
alt = "ok";
|
||||
break;
|
||||
case "F":
|
||||
img = "harddrivefail.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
case "S":
|
||||
img = "harddrivespare.png";
|
||||
alt = "spare";
|
||||
break;
|
||||
case "W":
|
||||
img = "harddrivewarn.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
default:
|
||||
alert("--" + diskstatus + "--");
|
||||
img = "error.png";
|
||||
alt = "error";
|
||||
break;
|
||||
}
|
||||
html += "<img class=\"plugin_dmraid_biun\" src=\"./plugins/dmraid/gfx/" + img + "\" alt=\"" + alt + "\" />";
|
||||
html += "<small>" + diskname + "</small>";
|
||||
html += "</div>";
|
||||
});
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* fill the plugin block
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function dmraid_populate(xml) {
|
||||
var htmltypes = "";
|
||||
|
||||
$("#Plugin_DMRaidTable").empty();
|
||||
$("Plugins Plugin_DMRaid Raid", xml).each(function dmraid_getdevice(id) {
|
||||
var htmldisks = "", htmldisklist = "", topic = "", name = "", buildedaction = "";
|
||||
name = $(this).attr("Device_Name");
|
||||
htmldisklist += dmraid_diskicon(this);
|
||||
htmldisks += "<table style=\"width:100%;\">";
|
||||
htmldisks += "<tr><td>" + htmldisklist + "</td></tr>";
|
||||
htmldisks += "<tr><td>" + dmraid_buildinfos($(this), id) + "<td></tr>";
|
||||
htmldisks += "</table>";
|
||||
if (id) {
|
||||
topic = "";
|
||||
}
|
||||
else {
|
||||
topic = genlang(2, false, "DMRaid");
|
||||
}
|
||||
$("#Plugin_DMRaidTable").append("<tr><td>" + topic + "</td><td><div class=\"plugin_dmraid_biun\" style=\"text-align:left;\"><b>" + name + "</b></div>" + htmldisks + "</td></tr>");
|
||||
$("#sPlugin_DMRaid_Info" + id).click(function dmraid_showinfo() {
|
||||
$("#Plugin_DMRaid_InfoTable" + id).slideDown("slow");
|
||||
$("#sPlugin_DMRaid_Info" + id).hide();
|
||||
$("#hPlugin_DMRaid_Info" + id).show();
|
||||
});
|
||||
$("#hPlugin_DMRaid_Info" + id).click(function dmraid_hideinfo() {
|
||||
$("#Plugin_DMRaid_InfoTable" + id).slideUp("slow");
|
||||
$("#hPlugin_DMRaid_Info" + id).hide();
|
||||
$("#sPlugin_DMRaid_Info" + id).show();
|
||||
});
|
||||
dmraid_show = true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function dmraid_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=DMRaid",
|
||||
dataType: "xml",
|
||||
error: function dmraid_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin DMRaid");
|
||||
},
|
||||
success: function dmraid_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
dmraid_populate(xml);
|
||||
if (dmraid_show) {
|
||||
plugin_translate("DMRaid");
|
||||
$("#Plugin_DMRaid").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function dmraid_buildpage() {
|
||||
var html = "";
|
||||
|
||||
$("#footer").before(buildBlock("DMRaid", 1, true));
|
||||
html += " <table id=\"Plugin_DMRaidTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " </table>\n";
|
||||
$("#Plugin_DMRaid").append(html);
|
||||
|
||||
$("#Plugin_DMRaid").css("width", "915px");
|
||||
|
||||
dmraid_request();
|
||||
|
||||
$("#Reload_DMRaidTable").click(function dmraid_reload(id) {
|
||||
dmraid_request();
|
||||
$("#Reload_DMRaidTable").attr("title",datetime());
|
||||
});
|
||||
});
|
95
root/opt/phpsysinfo/plugins/dmraid/js/dmraid_bootstrap.js
Normal file
@@ -0,0 +1,95 @@
|
||||
function renderPlugin_dmraid(data) {
|
||||
|
||||
function raid_diskicon(data) {
|
||||
var html = "";
|
||||
var img = "", alt = "";
|
||||
|
||||
html += "<div style=\"text-align: center; float: left; margin-bottom: 5px; margin-right: 20px; width: 64px;\">";
|
||||
switch (data["Status"]) {
|
||||
case " ":
|
||||
case "":
|
||||
img = "harddriveok.png";
|
||||
alt = "ok";
|
||||
break;
|
||||
case "F":
|
||||
img = "harddrivefail.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
case "S":
|
||||
img = "harddrivespare.png";
|
||||
alt = "spare";
|
||||
break;
|
||||
case "W":
|
||||
img = "harddrivewarn.png";
|
||||
alt = "warning";
|
||||
break;
|
||||
default:
|
||||
alert("--" + data["Status"] + "--");
|
||||
img = "error.png";
|
||||
alt = "error";
|
||||
break;
|
||||
}
|
||||
html += "<img src=\"./plugins/dmraid/gfx/" + img + "\" alt=\"" + alt + "\" />";
|
||||
html += "<small>" + data["Name"] + "</small>";
|
||||
html += "</div>";
|
||||
return html;
|
||||
}
|
||||
|
||||
if (data['Plugins']['Plugin_DMRaid'] !== undefined) {
|
||||
var dmitems = items(data['Plugins']['Plugin_DMRaid']['Raid']);
|
||||
if (dmitems.length > 0) {
|
||||
var html = '';
|
||||
for (i = 0; i < dmitems.length ; i++) {
|
||||
if (i) {
|
||||
html += "<tr><td></td><td>";
|
||||
} else {
|
||||
html += "<tr><th>RAID-Devices</th><td>";
|
||||
}
|
||||
|
||||
if (dmitems[i]['Disks'] !== undefined) {
|
||||
html += "<table style=\"width:100%;\">";
|
||||
html += "<tr><td>";
|
||||
|
||||
var diskitems = items(dmitems[i]['Disks']['Disk']);
|
||||
for (j = 0; j < diskitems.length ; j++) {
|
||||
html += raid_diskicon(diskitems[j]["@attributes"]);
|
||||
}
|
||||
|
||||
html += "</td></tr><tr><td>";
|
||||
html += "<table id=\"dmraid-" + i + "\"class=\"table table-hover table-condensed\">";
|
||||
html += "<tr class=\"treegrid-dmraid-" + i + "\"><td><b>" + dmitems[i]["@attributes"]["Device_Name"] + "</b></td><td></td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Name</td><td>" + dmitems[i]["@attributes"]["Name"] + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Status</th><td>" + dmitems[i]["@attributes"]["Disk_Status"] + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>RAID-Type</th><td>" + dmitems[i]["@attributes"]["Type"] + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Size</th><td>" + parseInt(dmitems[i]["@attributes"]["Size"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Stride</th><td>" + parseInt(dmitems[i]["@attributes"]["Stride"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Subsets</th><td>" + parseInt(dmitems[i]["@attributes"]["Subsets"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Devices</th><td>" + parseInt(dmitems[i]["@attributes"]["Devs"]) + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-dmraid-" + i + "\"><th>Spares</th><td>" + parseInt(dmitems[i]["@attributes"]["Spares"]) + "</td></tr>";
|
||||
html += "</table>";
|
||||
html += "</td></tr>";
|
||||
html += "</table>";
|
||||
}
|
||||
|
||||
html +="</td></tr>";
|
||||
}
|
||||
$('#dmraid').empty().append(html);
|
||||
|
||||
for (i = 0; i < dmitems.length ; i++) {
|
||||
if (dmitems[i]['Disks'] !== undefined) {
|
||||
$('#dmraid-'+i).treegrid({
|
||||
initialState: 'collapsed',
|
||||
expanderExpandedClass: 'normalicon normalicon-down',
|
||||
expanderCollapsedClass: 'normalicon normalicon-right'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$('#block_dmraid').show();
|
||||
} else {
|
||||
$('#block_dmraid').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_dmraid').hide();
|
||||
}
|
||||
}
|
42
root/opt/phpsysinfo/plugins/dmraid/lang/en.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>RAID Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>RAID-Devices</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Additional Information </exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Name</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>RAID-Type</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Size</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Stride</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Subsets</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Devices</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Spares</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
41
root/opt/phpsysinfo/plugins/dmraid/lang/fr.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: phpsysinfo
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>Statut RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>Périphériques RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Informations additionnelles</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Nom</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>Type de RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Taille</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Granularité</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Sous-ensembles</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Périphériques</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Rechanges</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/dmraid/lang/ro.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Iulian Alexe
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>Stare RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>Dispozitive RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Informații Aditionale </exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Nume</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Stare</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>Tip RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Dimensiune</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Pas</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Subseturi</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Dispozitive</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Piese</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
41
root/opt/phpsysinfo/plugins/dmraid/lang/ru.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_dmraid_001" name="dmraid_title">
|
||||
<exp>RAID Статус</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_002" name="dmraid_devices">
|
||||
<exp>RAID-Устройств</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_003" name="dmraid_infos">
|
||||
<exp>Дополнительная Информация</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_004" name="dmraid_name">
|
||||
<exp>Имя</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_005" name="dmraid_status">
|
||||
<exp>Статус</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_006" name="dmraid_type">
|
||||
<exp>RAID-Тип</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_007" name="dmraid_size">
|
||||
<exp>Размер</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_008" name="dmraid_stride">
|
||||
<exp>Шаг</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_009" name="dmraid_subsets">
|
||||
<exp>Подмножество</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_010" name="dmraid_devs">
|
||||
<exp>Устройство</exp>
|
||||
</expression>
|
||||
<expression id="plugin_dmraid_011" name="dmraid_spares">
|
||||
<exp>Резервировано</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
269
root/opt/phpsysinfo/plugins/ipmiinfo/class.ipmiinfo.inc.php
Normal file
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
/**
|
||||
* ipmiinfo Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_ipmiinfo
|
||||
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.ipmiinfo.inc.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* ipmiinfo plugin, which displays all ipmi informations available
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_ipmiinfo
|
||||
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class ipmiinfo extends PSI_Plugin
|
||||
{
|
||||
private $_lines;
|
||||
|
||||
public function __construct($enc)
|
||||
{
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
|
||||
$this->_lines = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* get temperature information
|
||||
*
|
||||
* @return array temperatures in array with label
|
||||
*/
|
||||
private function temperatures()
|
||||
{
|
||||
$result = array();
|
||||
$i = 0;
|
||||
foreach ($this->_lines as $line) {
|
||||
$buffer = preg_split("/\s*\|\s*/", $line);
|
||||
if ($buffer[2] == "degrees C" && $buffer[3] != "na") {
|
||||
$result[$i]['label'] = $buffer[0];
|
||||
$result[$i]['value'] = $buffer[1];
|
||||
$result[$i]['state'] = $buffer[3];
|
||||
if ($buffer[8] != "na") $result[$i]['max'] = $buffer[8];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get voltages information
|
||||
*
|
||||
* @return array voltage in array with label
|
||||
*/
|
||||
private function voltages()
|
||||
{
|
||||
$result = array();
|
||||
$i = 0;
|
||||
foreach ($this->_lines as $line) {
|
||||
$buffer = preg_split("/\s*\|\s*/", $line);
|
||||
if ($buffer[2] == "Volts" && $buffer[3] != "na") {
|
||||
$result[$i]['label'] = $buffer[0];
|
||||
$result[$i]['value'] = $buffer[1];
|
||||
$result[$i]['state'] = $buffer[3];
|
||||
if ($buffer[5] != "na") $result[$i]['min'] = $buffer[5];
|
||||
if ($buffer[8] != "na") $result[$i]['max'] = $buffer[8];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get fans information
|
||||
*
|
||||
* @return array fans in array with label
|
||||
*/
|
||||
private function fans()
|
||||
{
|
||||
$result = array();
|
||||
$i = 0;
|
||||
foreach ($this->_lines as $line) {
|
||||
$buffer = preg_split("/\s*\|\s*/", $line);
|
||||
if ($buffer[2] == "RPM" && $buffer[3] != "na") {
|
||||
$result[$i]['label'] = $buffer[0];
|
||||
$result[$i]['value'] = $buffer[1];
|
||||
$result[$i]['state'] = $buffer[3];
|
||||
if ($buffer[8] != "na") $result[$i]['min'] = $buffer[8];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get powers information
|
||||
*
|
||||
* @return array misc in array with label
|
||||
*/
|
||||
private function powers()
|
||||
{
|
||||
$result = array();
|
||||
$i = 0;
|
||||
foreach ($this->_lines as $line) {
|
||||
$buffer = preg_split("/\s*\|\s*/", $line);
|
||||
if ($buffer[2] == "Watts" && $buffer[3] != "na") {
|
||||
$result[$i]['label'] = $buffer[0];
|
||||
$result[$i]['value'] = $buffer[1];
|
||||
$result[$i]['state'] = $buffer[3];
|
||||
if ($buffer[8] != "na") $result[$i]['max'] = $buffer[8];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get currents information
|
||||
*
|
||||
* @return array misc in array with label
|
||||
*/
|
||||
private function currents()
|
||||
{
|
||||
$result = array();
|
||||
$i = 0;
|
||||
foreach ($this->_lines as $line) {
|
||||
$buffer = preg_split("/\s*\|\s*/", $line);
|
||||
if ($buffer[2] == "Amps" && $buffer[3] != "na") {
|
||||
$result[$i]['label'] = $buffer[0];
|
||||
$result[$i]['value'] = $buffer[1];
|
||||
$result[$i]['state'] = $buffer[3];
|
||||
if ($buffer[8] != "na") $result[$i]['max'] = $buffer[8];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get misc information
|
||||
*
|
||||
* @return array misc in array with label
|
||||
*/
|
||||
private function misc()
|
||||
{
|
||||
$result = array();
|
||||
$i = 0;
|
||||
foreach ($this->_lines as $line) {
|
||||
$buffer = preg_split("/\s*\|\s*/", $line);
|
||||
if ($buffer[2] == "discrete" && $buffer[3] != "na") {
|
||||
$result[$i]['label'] = $buffer[0];
|
||||
$result[$i]['value'] = $buffer[1];
|
||||
$result[$i]['state'] = $buffer[3];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
$this->_lines = array();
|
||||
switch (strtolower(PSI_PLUGIN_IPMIINFO_ACCESS)) {
|
||||
case 'command':
|
||||
$lines = "";
|
||||
if (CommonFunctions::executeProgram('ipmitool', 'sensor', $lines) && !empty($lines))
|
||||
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
|
||||
break;
|
||||
case 'data':
|
||||
if (CommonFunctions::rfts(APP_ROOT."/data/ipmiinfo.txt", $lines) && !empty($lines))
|
||||
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
|
||||
break;
|
||||
default:
|
||||
$this->error->addConfigError('__construct()', 'PSI_PLUGIN_IPMIINFO_ACCESS');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function xml()
|
||||
{
|
||||
if (empty($this->_lines))
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
|
||||
$arrBuff = $this->temperatures();
|
||||
if (sizeof($arrBuff) > 0) {
|
||||
$temp = $this->xml->addChild("Temperatures");
|
||||
foreach ($arrBuff as $arrValue) {
|
||||
$item = $temp->addChild('Item');
|
||||
$item->addAttribute('Label', $arrValue['label']);
|
||||
$item->addAttribute('Value', $arrValue['value']);
|
||||
$item->addAttribute('State', $arrValue['state']);
|
||||
if (isset($arrValue['Max'])) $item->addAttribute('Max', $arrValue['Max']);
|
||||
}
|
||||
}
|
||||
$arrBuff = $this->voltages();
|
||||
if (sizeof($arrBuff) > 0) {
|
||||
$volt = $this->xml->addChild('Voltages');
|
||||
foreach ($arrBuff as $arrValue) {
|
||||
$item = $volt->addChild('Item');
|
||||
$item->addAttribute('Label', $arrValue['label']);
|
||||
$item->addAttribute('Value', $arrValue['value']);
|
||||
$item->addAttribute('State', $arrValue['state']);
|
||||
if (isset($arrValue['Min'])) $item->addAttribute('Min', $arrValue['min']);
|
||||
if (isset($arrValue['Max'])) $item->addAttribute('Max', $arrValue['max']);
|
||||
}
|
||||
}
|
||||
$arrBuff = $this->fans();
|
||||
if (sizeof($arrBuff) > 0) {
|
||||
$fan = $this->xml->addChild('Fans');
|
||||
foreach ($arrBuff as $arrValue) {
|
||||
$item = $fan->addChild('Item');
|
||||
$item->addAttribute('Label', $arrValue['label']);
|
||||
$item->addAttribute('Value', $arrValue['value']);
|
||||
$item->addAttribute('State', $arrValue['state']);
|
||||
if (isset($arrValue['Min'])) $item->addAttribute('Min', $arrValue['min']);
|
||||
}
|
||||
}
|
||||
$arrBuff = $this->powers();
|
||||
if (sizeof($arrBuff) > 0) {
|
||||
$misc = $this->xml->addChild('Powers');
|
||||
foreach ($arrBuff as $arrValue) {
|
||||
$item = $misc->addChild('Item');
|
||||
$item->addAttribute('Label', $arrValue['label']);
|
||||
$item->addAttribute('Value', $arrValue['value']);
|
||||
$item->addAttribute('State', $arrValue['state']);
|
||||
if (isset($arrValue['Max'])) $item->addAttribute('Max', $arrValue['max']);
|
||||
}
|
||||
}
|
||||
$arrBuff = $this->currents();
|
||||
if (sizeof($arrBuff) > 0) {
|
||||
$misc = $this->xml->addChild('Currents');
|
||||
foreach ($arrBuff as $arrValue) {
|
||||
$item = $misc->addChild('Item');
|
||||
$item->addAttribute('Label', $arrValue['label']);
|
||||
$item->addAttribute('Value', $arrValue['value']);
|
||||
$item->addAttribute('State', $arrValue['state']);
|
||||
if (isset($arrValue['Max'])) $item->addAttribute('Max', $arrValue['max']);
|
||||
}
|
||||
}
|
||||
$arrBuff = $this->misc();
|
||||
if (sizeof($arrBuff) > 0) {
|
||||
$misc = $this->xml->addChild('Misc');
|
||||
foreach ($arrBuff as $arrValue) {
|
||||
$item = $misc->addChild('Item');
|
||||
$item->addAttribute('Label', $arrValue['label']);
|
||||
$item->addAttribute('Value', $arrValue['value']);
|
||||
$item->addAttribute('State', $arrValue['state']);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
|
||||
}
|
15
root/opt/phpsysinfo/plugins/ipmiinfo/ipmiinfo_bootstrap.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="col-lg-6" id="block_ipmiinfo" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">IPMI Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="ipmiinfo" class="table table-hover table-condensed">
|
||||
<tbody id="ipmiinfo-data">
|
||||
<tr>
|
||||
<td><span data-bind="Label"></span></td>
|
||||
<td><span data-bind="Value"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
153
root/opt/phpsysinfo/plugins/ipmiinfo/js/ipmiinfo.js
Normal file
@@ -0,0 +1,153 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
//$Id: ipmiinfo.js 661 2012-08-27 11:26:39Z namiltd $
|
||||
|
||||
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar */
|
||||
|
||||
"use strict";
|
||||
|
||||
var ipmiinfo_show = false;
|
||||
/**
|
||||
* insert content into table
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function ipmiinfo_populate(xml) {
|
||||
|
||||
var html = "";
|
||||
$("#Plugin_ipmiinfoTable").html(" ");
|
||||
|
||||
$("Plugins Plugin_ipmiinfo Temperatures Item", xml).each(function ipmiinfo_getitem(idp) {
|
||||
if(idp==0) {
|
||||
html += "<tr><th colspan=\"2\" style=\"font-weight:bold\">" + genlang(3, true, "ipmiinfo") + "</th></tr>\n";
|
||||
}
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Label") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Value") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
ipmiinfo_show = true;
|
||||
});
|
||||
|
||||
$("Plugins Plugin_ipmiinfo Fans Item", xml).each(function ipmiinfo_getitem(idp) {
|
||||
if(idp==0) {
|
||||
html += "<tr><th colspan=\"2\" style=\"font-weight:bold\">" + genlang(4, true, "ipmiinfo") + "</th></tr>\n";
|
||||
}
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Label") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Value") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
ipmiinfo_show = true;
|
||||
});
|
||||
|
||||
$("Plugins Plugin_ipmiinfo Voltages Item", xml).each(function ipmiinfo_getitem(idp) {
|
||||
if(idp==0) {
|
||||
html += "<tr><th colspan=\"2\" style=\"font-weight:bold\">" + genlang(5, true, "ipmiinfo") + "</th></tr>\n";
|
||||
}
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Label") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Value") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
ipmiinfo_show = true;
|
||||
});
|
||||
|
||||
$("Plugins Plugin_ipmiinfo Currents Item", xml).each(function ipmiinfo_getitem(idp) {
|
||||
if(idp==0) {
|
||||
html += "<tr><th colspan=\"2\" style=\"font-weight:bold\">" + genlang(7, true, "ipmiinfo") + "</th></tr>\n";
|
||||
}
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Label") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Value") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
ipmiinfo_show = true;
|
||||
});
|
||||
|
||||
$("Plugins Plugin_ipmiinfo Powers Item", xml).each(function ipmiinfo_getitem(idp) {
|
||||
if(idp==0) {
|
||||
html += "<tr><th colspan=\"2\" style=\"font-weight:bold\">" + genlang(8, true, "ipmiinfo") + "</th></tr>\n";
|
||||
}
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Label") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Value") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
ipmiinfo_show = true;
|
||||
});
|
||||
$("Plugins Plugin_ipmiinfo Misc Item", xml).each(function ipmiinfo_getitem(idp) {
|
||||
if(idp==0) {
|
||||
html += "<tr><th colspan=\"2\" style=\"font-weight:bold\">" + genlang(6, true, "ipmiinfo") + "</th></tr>\n";
|
||||
}
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Label") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Value") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
ipmiinfo_show = true;
|
||||
});
|
||||
|
||||
$("#Plugin_ipmiinfoTable").append(html);
|
||||
$('#Plugin_ipmiinfoTable tr:nth-child(even)').addClass('even');
|
||||
|
||||
}
|
||||
|
||||
function ipmiinfo_buildTable() {
|
||||
var html = "";
|
||||
|
||||
html += "<table id=\"Plugin_ipmiinfoTable\" class=\"stripeMe\" style=\"border-spacing:0;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += "</table>\n";
|
||||
$("#Plugin_ipmiinfo").append(html);
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function ipmiinfo_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=ipmiinfo",
|
||||
dataType: "xml",
|
||||
error: function ipmiinfo_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin ipmiinfo!");
|
||||
},
|
||||
success: function ipmiinfo_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
ipmiinfo_populate(xml);
|
||||
if (ipmiinfo_show) {
|
||||
plugin_translate("ipmiinfo");
|
||||
$("#Plugin_ipmiinfo").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function ipmiinfo_buildpage() {
|
||||
$("#footer").before(buildBlock("ipmiinfo", 1, true));
|
||||
$("#Plugin_ipmiinfo").css("width", "451px");
|
||||
|
||||
ipmiinfo_buildTable();
|
||||
|
||||
ipmiinfo_request();
|
||||
|
||||
$("#Reload_ipmiinfoTable").click(function ipmiinfo_reload(id) {
|
||||
ipmiinfo_request();
|
||||
$("#Reload_ipmiinfoTable").attr("title",datetime());
|
||||
});
|
||||
});
|
@@ -0,0 +1,36 @@
|
||||
function renderPlugin_ipmiinfo(data) {
|
||||
|
||||
var directives = {
|
||||
Label: {
|
||||
html: function () {
|
||||
if (this["Value"] == undefined) {
|
||||
return '<b>' + this["Label"] + '</b>';
|
||||
} else {
|
||||
return this["Label"];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (data['Plugins']['Plugin_ipmiinfo'] !== undefined) {
|
||||
var data_ipmiinfo = [];
|
||||
var valuelist = {Temperatures:"Temperatures [C]", Voltages:"Voltages [V]", Fans:"Fans [RPM]", Powers:"Powers [W]", Currents:"Currents [A]", Misc:"Misc [0/1]"};
|
||||
for (var ipmiinfo_value in valuelist) {
|
||||
if (data['Plugins']['Plugin_ipmiinfo'][ipmiinfo_value] !== undefined) {
|
||||
var datas = items(data['Plugins']['Plugin_ipmiinfo'][ipmiinfo_value]["Item"]);
|
||||
if (datas.length > 0) {
|
||||
data_ipmiinfo.push({Label:valuelist[ipmiinfo_value]});
|
||||
data_ipmiinfo.push_attrs(datas);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data_ipmiinfo.length > 0) {
|
||||
$('#ipmiinfo-data').render(data_ipmiinfo, directives);
|
||||
$('#block_ipmiinfo').show();
|
||||
} else {
|
||||
$('#block_ipmiinfo').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_ipmiinfo').hide();
|
||||
}
|
||||
}
|
33
root/opt/phpsysinfo/plugins/ipmiinfo/lang/cz.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Czech Created by: Tomáš Růžička
|
||||
-->
|
||||
<tns:translationPlugin language="czech" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ipmiinfo_001" name="ipmiinfo_title">
|
||||
<exp>IPMI informace</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_002" name="ipmiinfo_date">
|
||||
<exp>Aktualizováno</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_003" name="ipmiinfo_temperatures">
|
||||
<exp>Teploty [°C]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_004" name="ipmiinfo_fans">
|
||||
<exp>Větráky [RPM]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_005" name="ipmiinfo_voltages">
|
||||
<exp>Napětí [V]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_006" name="ipmiinfo_misc">
|
||||
<exp>Různé [0/1]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_007" name="ipmiinfo_currents">
|
||||
<exp>Currents [A]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_008" name="ipmiinfo_powers">
|
||||
<exp>Powers [W]</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
33
root/opt/phpsysinfo/plugins/ipmiinfo/lang/de.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: German Created by: Matthias Freund (MAFLO321)
|
||||
-->
|
||||
<tns:translationPlugin language="german" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ipmiinfo_001" name="ipmiinfo_title">
|
||||
<exp>IPMI Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_002" name="ipmiinfo_date">
|
||||
<exp>Letzte Aktualisierung</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_003" name="ipmiinfo_temperatures">
|
||||
<exp>Temperaturen [°C]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_004" name="ipmiinfo_fans">
|
||||
<exp>Lüfter [RPM]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_005" name="ipmiinfo_voltages">
|
||||
<exp>Spannungen [V]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_006" name="ipmiinfo_misc">
|
||||
<exp>Misc [0/1]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_007" name="ipmiinfo_currents">
|
||||
<exp>Currents [A]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_008" name="ipmiinfo_powers">
|
||||
<exp>Powers [W]</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
33
root/opt/phpsysinfo/plugins/ipmiinfo/lang/en.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ipmiinfo_001" name="ipmiinfo_title">
|
||||
<exp>IPMI Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_002" name="ipmiinfo_date">
|
||||
<exp>Last refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_003" name="ipmiinfo_temperatures">
|
||||
<exp>Temperatures [°C]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_004" name="ipmiinfo_fans">
|
||||
<exp>Fans [RPM]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_005" name="ipmiinfo_voltages">
|
||||
<exp>Voltages [V]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_006" name="ipmiinfo_misc">
|
||||
<exp>Misc [0/1]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_007" name="ipmiinfo_currents">
|
||||
<exp>Currents [A]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_008" name="ipmiinfo_powers">
|
||||
<exp>Powers [W]</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
33
root/opt/phpsysinfo/plugins/ipmiinfo/lang/fr.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Erkan VALENTIN
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ipmiinfo_001" name="ipmiinfo_title">
|
||||
<exp>Etat IPMI</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_002" name="ipmiinfo_date">
|
||||
<exp>Dernière actualisation</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_003" name="ipmiinfo_temperatures">
|
||||
<exp>Températures [°c]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_004" name="ipmiinfo_fans">
|
||||
<exp>Ventilateurs [RPM]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_005" name="ipmiinfo_voltages">
|
||||
<exp>Tensions [V]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_006" name="ipmiinfo_misc">
|
||||
<exp>Divers [0/1]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_007" name="ipmiinfo_currents">
|
||||
<exp>Currents [A]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_008" name="ipmiinfo_powers">
|
||||
<exp>Powers [W]</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
33
root/opt/phpsysinfo/plugins/ipmiinfo/lang/pl.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="polish" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ipmiinfo_001" name="ipmiinfo_title">
|
||||
<exp>IPMI Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_002" name="ipmiinfo_date">
|
||||
<exp>Ostatnie odświeżenie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_003" name="ipmiinfo_temperatures">
|
||||
<exp>Temperatury [°C]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_004" name="ipmiinfo_fans">
|
||||
<exp>Wentylatory [RPM]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_005" name="ipmiinfo_voltages">
|
||||
<exp>Napięcia [V]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_006" name="ipmiinfo_misc">
|
||||
<exp>Różne [0/1]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_007" name="ipmiinfo_currents">
|
||||
<exp>Prądy [A]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_008" name="ipmiinfo_powers">
|
||||
<exp>Moce [W]</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
33
root/opt/phpsysinfo/plugins/ipmiinfo/lang/ro.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ipmiinfo_001" name="ipmiinfo_title">
|
||||
<exp>Stare IPMI</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_002" name="ipmiinfo_date">
|
||||
<exp>Ultimul refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_003" name="ipmiinfo_temperatures">
|
||||
<exp>Temperaturi [°C]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_004" name="ipmiinfo_fans">
|
||||
<exp>Ventilatoare [RPM]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_005" name="ipmiinfo_voltages">
|
||||
<exp>Tensiuni [V]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_006" name="ipmiinfo_misc">
|
||||
<exp>Diverse [0/1]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_007" name="ipmiinfo_currents">
|
||||
<exp>Amperi [A]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_008" name="ipmiinfo_powers">
|
||||
<exp>Wați [W]</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
33
root/opt/phpsysinfo/plugins/ipmiinfo/lang/ru.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="russian" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ipmiinfo_001" name="ipmiinfo_title">
|
||||
<exp>IPMI Статус</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_002" name="ipmiinfo_date">
|
||||
<exp>Последнее обновление</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_003" name="ipmiinfo_temperatures">
|
||||
<exp>Температура [°C]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_004" name="ipmiinfo_fans">
|
||||
<exp>Вентиляторы [ОБ/мин]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_005" name="ipmiinfo_voltages">
|
||||
<exp>Напряжение [V]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_006" name="ipmiinfo_misc">
|
||||
<exp>Разное [0/1]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_007" name="ipmiinfo_currents">
|
||||
<exp>Ток [A]</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ipmiinfo_008" name="ipmiinfo_powers">
|
||||
<exp>Напряжение [W]</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
236
root/opt/phpsysinfo/plugins/mdstatus/class.mdstatus.inc.php
Normal file
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
/**
|
||||
* MDStatus Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_MDStatus
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.mdstatus.inc.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* mdstatus Plugin, which displays a snapshot of the kernel's RAID/md state
|
||||
* a simple view which shows supported types and RAID-Devices which are determined by
|
||||
* parsing the "/proc/mdstat" file, another way is to provide
|
||||
* a file with the output of the /proc/mdstat file, so there is no need to run a execute by the
|
||||
* webserver, the format of the command is written down in the phpsysinfo.ini file, where also
|
||||
* the method of getting the information is configured
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_MDStatus
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class MDStatus extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = "";
|
||||
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
$buffer = "";
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_MDSTATUS_ACCESS)) {
|
||||
case 'file':
|
||||
CommonFunctions::rfts("/proc/mdstat", $buffer);
|
||||
break;
|
||||
case 'data':
|
||||
CommonFunctions::rfts(APP_ROOT."/data/mdstat.txt", $buffer);
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addConfigError("__construct()", "PSI_PLUGIN_MDSTATUS_ACCESS");
|
||||
break;
|
||||
}
|
||||
if (trim($buffer) != "") {
|
||||
$this->_filecontent = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
|
||||
} else {
|
||||
$this->_filecontent = array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array<br>the array is build like a tree,
|
||||
* so that it is possible to get only a specific process with the childs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (empty($this->_filecontent)) {
|
||||
return;
|
||||
}
|
||||
// get the supported types
|
||||
if (preg_match('/[a-zA-Z]* : (\[([a-z0-9])*\]([ \n]))+/', $this->_filecontent[0], $res)) {
|
||||
$parts = preg_split("/ : /", $res[0]);
|
||||
$parts = preg_split("/ /", $parts[1]);
|
||||
$count = 0;
|
||||
foreach ($parts as $types) {
|
||||
if (trim($types) != "") {
|
||||
$this->_result['supported_types'][$count++] = substr(trim($types), 1, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// get disks
|
||||
if (preg_match("/^read_ahead/", $this->_filecontent[1])) {
|
||||
$count = 2;
|
||||
} else {
|
||||
$count = 1;
|
||||
}
|
||||
$cnt_filecontent = count($this->_filecontent);
|
||||
do {
|
||||
$parts = preg_split("/ : /", $this->_filecontent[$count]);
|
||||
$dev = trim($parts[0]);
|
||||
if (count($parts) == 2) {
|
||||
$details = preg_split('/ /', $parts[1]);
|
||||
if (!strstr($details[0], 'inactive')) {
|
||||
$this->_result['devices'][$dev]['level'] = $details[1];
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['level'] = "none";
|
||||
}
|
||||
$this->_result['devices'][$dev]['status'] = $details[0];
|
||||
for ($i = 2, $cnt_details = count($details); $i < $cnt_details; $i++) {
|
||||
preg_match('/(([a-z0-9])+)(\[([0-9]+)\])(\([SF ]\))?/', trim($details[$i]), $partition);
|
||||
if (count($partition) == 5 || count($partition) == 6) {
|
||||
$this->_result['devices'][$dev]['partitions'][$partition[1]]['raid_index'] = substr(trim($partition[3]), 1, -1);
|
||||
if (isset($partition[5])) {
|
||||
$search = array("(", ")");
|
||||
$replace = array("", "");
|
||||
$this->_result['devices'][$dev]['partitions'][$partition[1]]['status'] = str_replace($search, $replace, trim($partition[5]));
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['partitions'][$partition[1]]['status'] = " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
$count++;
|
||||
$optionline = $this->_filecontent[$count - 1].$this->_filecontent[$count];
|
||||
if (preg_match('/([^\sk]*)k chunk/', $optionline, $chunksize)) {
|
||||
$this->_result['devices'][$dev]['chunk_size'] = $chunksize[1];
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['chunk_size'] = -1;
|
||||
}
|
||||
if ($pos = strpos($optionline, "super non-persistent")) {
|
||||
$this->_result['devices'][$dev]['pers_superblock'] = 0;
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['pers_superblock'] = 1;
|
||||
}
|
||||
if ($pos = strpos($optionline, "algorithm")) {
|
||||
$this->_result['devices'][$dev]['algorithm'] = trim(substr($optionline, $pos + 9, 2));
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['algorithm'] = -1;
|
||||
}
|
||||
if (preg_match('/(\[[0-9]?\/[0-9]\])/', $optionline, $res)) {
|
||||
$slashpos = strpos($res[0], '/');
|
||||
$this->_result['devices'][$dev]['registered'] = substr($res[0], 1, $slashpos - 1);
|
||||
$this->_result['devices'][$dev]['active'] = substr($res[0], $slashpos + 1, strlen($res[0]) - $slashpos - 2);
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['registered'] = -1;
|
||||
$this->_result['devices'][$dev]['active'] = -1;
|
||||
}
|
||||
if (preg_match(('/([a-z]+)( *)=( *)([0-9\.]+)%/'), $this->_filecontent[$count + 1], $res) || (preg_match(('/([a-z]+)( *)=( *)([0-9\.]+)/'), $optionline, $res))) {
|
||||
list($this->_result['devices'][$dev]['action']['name'], $this->_result['devices'][$dev]['action']['percent']) = preg_split("/=/", str_replace("%", "", $res[0]));
|
||||
if (preg_match(('/([a-z]*=[0-9\.]+[a-z]+)/'), $this->_filecontent[$count + 1], $res)) {
|
||||
$time = preg_split("/=/", $res[0]);
|
||||
list($this->_result['devices'][$dev]['action']['finish_time'], $this->_result['devices'][$dev]['action']['finish_unit']) = sscanf($time[1], '%f%s');
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['action']['finish_time'] = -1;
|
||||
$this->_result['devices'][$dev]['action']['finish_unit'] = -1;
|
||||
}
|
||||
} else {
|
||||
$this->_result['devices'][$dev]['action']['name'] = -1;
|
||||
$this->_result['devices'][$dev]['action']['percent'] = -1;
|
||||
$this->_result['devices'][$dev]['action']['finish_time'] = -1;
|
||||
$this->_result['devices'][$dev]['action']['finish_unit'] = -1;
|
||||
}
|
||||
} else {
|
||||
$count++;
|
||||
}
|
||||
} while ($cnt_filecontent > $count);
|
||||
$lastline = $this->_filecontent[$cnt_filecontent - 2];
|
||||
if (strpos($lastline, "unused devices") !== false) {
|
||||
$parts = preg_split("/:/", $lastline);
|
||||
$search = array("<", ">");
|
||||
$replace = array("", "");
|
||||
$this->_result['unused_devs'] = trim(str_replace($search, $replace, $parts[1]));
|
||||
} else {
|
||||
$this->_result['unused_devs'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLObject entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
if (empty($this->_result)) {
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
$hideRaids = array();
|
||||
if (defined('PSI_PLUGIN_MDSTATUS_HIDE_RAID_DEVICES') && is_string(PSI_PLUGIN_MDSTATUS_HIDE_RAID_DEVICES)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_MDSTATUS_HIDE_RAID_DEVICES)) {
|
||||
$hideRaids = eval(PSI_PLUGIN_MDSTATUS_HIDE_RAID_DEVICES);
|
||||
} else {
|
||||
$hideRaids = array(PSI_PLUGIN_MDSTATUS_HIDE_RAID_DEVICES);
|
||||
}
|
||||
}
|
||||
$sup = $this->xml->addChild("Supported_Types");
|
||||
foreach ($this->_result['supported_types'] as $type) {
|
||||
$typ = $sup->addChild("Type");
|
||||
$typ->addAttribute("Name", $type);
|
||||
}
|
||||
if (isset($this->_result['devices'])) foreach ($this->_result['devices'] as $key=>$device) {
|
||||
if (!in_array($key, $hideRaids, true)) {
|
||||
$dev = $this->xml->addChild("Raid");
|
||||
$dev->addAttribute("Device_Name", $key);
|
||||
$dev->addAttribute("Level", $device["level"]);
|
||||
$dev->addAttribute("Disk_Status", $device["status"]);
|
||||
$dev->addAttribute("Chunk_Size", $device["chunk_size"]);
|
||||
$dev->addAttribute("Persistend_Superblock", $device["pers_superblock"]);
|
||||
$dev->addAttribute("Algorithm", $device["algorithm"]);
|
||||
$dev->addAttribute("Disks_Registered", $device["registered"]);
|
||||
$dev->addAttribute("Disks_Active", $device["active"]);
|
||||
$action = $dev->addChild("Action");
|
||||
$action->addAttribute("Percent", $device['action']['percent']);
|
||||
$action->addAttribute("Name", $device['action']['name']);
|
||||
$action->addAttribute("Time_To_Finish", $device['action']['finish_time']);
|
||||
$action->addAttribute("Time_Unit", $device['action']['finish_unit']);
|
||||
$disks = $dev->addChild("Disks");
|
||||
foreach ($device['partitions'] as $diskkey=>$disk) {
|
||||
$disktemp = $disks->addChild("Disk");
|
||||
$disktemp->addAttribute("Name", $diskkey);
|
||||
$disktemp->addAttribute("Status", $disk['status']);
|
||||
$disktemp->addAttribute("Index", $disk['raid_index']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($this->_result['unused_devs'] !== - 1) {
|
||||
$unDev = $this->xml->addChild("Unused_Devices");
|
||||
$unDev->addAttribute("Devices", $this->_result['unused_devs']);
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
}
|
14
root/opt/phpsysinfo/plugins/mdstatus/css/mdstatus.css
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
$Id: mdstatus.css 661 2012-08-27 11:26:39Z namiltd $
|
||||
*/
|
||||
.plugin_mdstatus_biun {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 20px;
|
||||
float: left;
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
img.plugin_mdstatus_biun {
|
||||
margin: auto;
|
||||
}
|
BIN
root/opt/phpsysinfo/plugins/mdstatus/gfx/error.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
root/opt/phpsysinfo/plugins/mdstatus/gfx/harddrivefail.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
root/opt/phpsysinfo/plugins/mdstatus/gfx/harddriveok.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
root/opt/phpsysinfo/plugins/mdstatus/gfx/harddrivespare.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
225
root/opt/phpsysinfo/plugins/mdstatus/js/mdstatus.js
Normal file
@@ -0,0 +1,225 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
//
|
||||
// $Id: mdstatus.js 679 2012-09-04 10:10:11Z namiltd $
|
||||
//
|
||||
|
||||
/*global $, jQuery, buildBlock, genlang, createBar, plugin_translate, datetime */
|
||||
|
||||
"use strict";
|
||||
|
||||
//appendcss("./plugins/MDStatus/css/MDStatus.css");
|
||||
|
||||
var mdstatus_show = false;
|
||||
|
||||
/**
|
||||
* get the details of the raid
|
||||
* @param {jQuery} xml part of the plugin-XML
|
||||
* @param {number} id id of the device
|
||||
*/
|
||||
function mdstatus_buildinfos(xml, id) {
|
||||
var html = "", devstatus = "", devlevel = "", devchunk = 0, devsuper = 0, devalgo = 0, devactive = 0, devregis = 0, button = "";
|
||||
|
||||
devstatus = $(xml).attr("Disk_Status");
|
||||
devlevel = $(xml).attr("Level");
|
||||
devchunk = parseInt($(xml).attr("Chunk_Size"), 10);
|
||||
devsuper = parseInt($(xml).attr("Persistent_Superblock"), 10);
|
||||
devalgo = parseInt($(xml).attr("Algorithm"), 10);
|
||||
devactive = parseInt($(xml).attr("Disks_Active"), 10);
|
||||
devregis = parseInt($(xml).attr("Disks_Registered"), 10);
|
||||
html += "<tr><td>" + genlang(5, false, "MDStatus") + "</td><td>" + devstatus + "</td></tr>";
|
||||
html += "<tr><td>" + genlang(6, false, "MDStatus") + "</td><td>" + devlevel + "</td></tr>";
|
||||
if (devchunk !== -1) {
|
||||
html += "<tr><td>" + genlang(7, false, "MDStatus") + "</td><td>" + devchunk + "K</td></tr>";
|
||||
}
|
||||
if (devalgo !== -1) {
|
||||
html += "<tr><td>" + genlang(8, false, "MDStatus") + "</td><td>" + devalgo + "</td></tr>";
|
||||
}
|
||||
if (devsuper !== -1) {
|
||||
html += "<tr><td>" + genlang(9, false, "MDStatus") + "</td><td>" + genlang(10, false, "MDStatus") + "</td></tr>";
|
||||
}
|
||||
else {
|
||||
html += "<tr><td>" + genlang(9, false, "MDStatus") + "</td><td>" + genlang(11, false, "MDStatus") + "</td></tr>";
|
||||
}
|
||||
if (devactive !== -1 && devregis !== -1) {
|
||||
html += "<tr><td>" + genlang(12, false, "MDStatus") + "</td><td>" + devregis + "/" + devactive + "</td></tr>";
|
||||
}
|
||||
button += "<h3 style=\"cursor: pointer\" id=\"sPlugin_MDStatus_Info" + id + "\"><img src=\"./gfx/bullet_toggle_plus.png\" alt=\"plus\" style=\"vertical-align:middle;\" />" + genlang(4, false, "MDStatus") + "</h3>";
|
||||
button += "<h3 style=\"cursor: pointer; display: none;\" id=\"hPlugin_MDStatus_Info" + id + "\"><img src=\"./gfx/bullet_toggle_minus.png\" alt=\"minus\" style=\"vertical-align:middle;\" />" + genlang(4, false, "MDStatus") + "</h3>";
|
||||
button += "<table id=\"Plugin_MDStatus_InfoTable" + id + "\" style=\"border-spacing:0; display:none;\">" + html + "</table>";
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* generate a html string with the current action on the disks
|
||||
* @param {jQuery} xml part of the plugin-XML
|
||||
*/
|
||||
function mdstatus_buildaction(xml) {
|
||||
var html = "", name = "", time = "", tunit = "", percent = 0;
|
||||
$("Action", xml).each(function mdstatus_getaction(id) {
|
||||
name = $(this).attr("Name");
|
||||
if (parseInt(name, 10) !== -1) {
|
||||
time = $(this).attr("Time_To_Finish");
|
||||
tunit = $(this).attr("Time_Unit");
|
||||
percent = parseFloat($(this).attr("Percent"));
|
||||
html += "<div style=\"padding-left:10px;\">";
|
||||
html += genlang(13, false, "MDStatus") + ": " + name + "<br/>";
|
||||
html += createBar(percent);
|
||||
html += "<br/>";
|
||||
html += genlang(14, false, "MDStatus") + " " + time + " " + tunit;
|
||||
html += "</div>";
|
||||
}
|
||||
});
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* choose the right diskdrive icon
|
||||
* @param {jQuery} xml part of the plugin-XML
|
||||
*/
|
||||
function mdstatus_diskicon(xml) {
|
||||
var html = "";
|
||||
$("Disks Disk", xml).each(function mdstatus_getdisk(id) {
|
||||
var diskstatus = "", diskname = "", img = "", alt = "";
|
||||
html += "<div class=\"plugin_mdstatus_biun\">";
|
||||
diskstatus = $(this).attr("Status");
|
||||
diskname = $(this).attr("Name");
|
||||
switch (diskstatus) {
|
||||
case " ":
|
||||
case "":
|
||||
img = "harddriveok.png";
|
||||
alt = "ok";
|
||||
break;
|
||||
case "F":
|
||||
img = "harddrivefail.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
case "S":
|
||||
img = "harddrivespare.png";
|
||||
alt = "spare";
|
||||
break;
|
||||
default:
|
||||
alert("--" + diskstatus + "--");
|
||||
img = "error.png";
|
||||
alt = "error";
|
||||
break;
|
||||
}
|
||||
html += "<img class=\"plugin_mdstatus_biun\" src=\"./plugins/mdstatus/gfx/" + img + "\" alt=\"" + alt + "\" />";
|
||||
html += "<small>" + diskname + "</small>";
|
||||
html += "</div>";
|
||||
});
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* fill the plugin block
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function mdstatus_populate(xml) {
|
||||
var htmltypes = "";
|
||||
|
||||
$("#Plugin_MDStatusTable").empty();
|
||||
|
||||
$("Plugins Plugin_MDStatus Supported_Types Type", xml).each(function mdstatus_getsupportedtypes(id) {
|
||||
// htmltypes += "<li>" + $(this).attr("Name") + "</li>";
|
||||
htmltypes += "<b>" + $(this).attr("Name") + " </b>";
|
||||
});
|
||||
if (htmltypes.length > 0) {
|
||||
htmltypes = "<ul>" + htmltypes + "</ul>";
|
||||
$("#Plugin_MDStatusTable").append("<tr><td style=\"width:160px;\">" + genlang(2, false, "MDStatus") + "</td><td>" + htmltypes + "</td></tr>");
|
||||
mdstatus_show = true;
|
||||
}
|
||||
|
||||
$("Plugins Plugin_MDStatus Raid", xml).each(function mdstatus_getdevice(id) {
|
||||
var htmldisks = "", htmldisklist = "", topic = "", name = "", buildedaction = "";
|
||||
name = $(this).attr("Device_Name");
|
||||
htmldisklist += mdstatus_diskicon(this);
|
||||
htmldisks += "<table style=\"width:100%;\">";
|
||||
htmldisks += "<tr><td>" + htmldisklist + "</td></tr>";
|
||||
buildedaction = mdstatus_buildaction($(this));
|
||||
if (buildedaction) {
|
||||
htmldisks += "<tr><td>" + buildedaction + "</td></tr>";
|
||||
}
|
||||
htmldisks += "<tr><td>" + mdstatus_buildinfos($(this), id) + "<td></tr>";
|
||||
htmldisks += "</table>";
|
||||
if (id) {
|
||||
topic = "";
|
||||
}
|
||||
else {
|
||||
topic = genlang(3, false, "MDStatus");
|
||||
}
|
||||
$("#Plugin_MDStatusTable").append("<tr><td>" + topic + "</td><td><div class=\"plugin_mdstatus_biun\" style=\"text-align:left;\"><b>" + name + "</b></div>" + htmldisks + "</td></tr>");
|
||||
$("#sPlugin_MDStatus_Info" + id).click(function mdstatus_showinfo() {
|
||||
$("#Plugin_MDStatus_InfoTable" + id).slideDown("slow");
|
||||
$("#sPlugin_MDStatus_Info" + id).hide();
|
||||
$("#hPlugin_MDStatus_Info" + id).show();
|
||||
});
|
||||
$("#hPlugin_MDStatus_Info" + id).click(function mdstatus_hideinfo() {
|
||||
$("#Plugin_MDStatus_InfoTable" + id).slideUp("slow");
|
||||
$("#hPlugin_MDStatus_Info" + id).hide();
|
||||
$("#sPlugin_MDStatus_Info" + id).show();
|
||||
});
|
||||
mdstatus_show = true;
|
||||
});
|
||||
|
||||
if ($("Plugins Plugin_MDStatus Unused_Devices", xml).length > 0) {
|
||||
$("#Plugin_MDStatusTable").append("<tr><td>" + genlang(15, false, "MDStatus") + "</td><td>" + $(this).attr("Devices") + "</td></tr>");
|
||||
mdstatus_show = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function mdstatus_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=MDStatus",
|
||||
dataType: "xml",
|
||||
error: function mdstatus_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin MDStatus");
|
||||
},
|
||||
success: function mdstatus_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
mdstatus_populate(xml);
|
||||
if (mdstatus_show) {
|
||||
plugin_translate("MDStatus");
|
||||
$("#Plugin_MDStatus").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function mdstatus_buildpage() {
|
||||
var html = "";
|
||||
|
||||
$("#footer").before(buildBlock("MDStatus", 1, true));
|
||||
html += " <table id=\"Plugin_MDStatusTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " </table>\n";
|
||||
$("#Plugin_MDStatus").append(html);
|
||||
|
||||
$("#Plugin_MDStatus").css("width", "915px");
|
||||
|
||||
mdstatus_request();
|
||||
|
||||
$("#Reload_MDStatusTable").click(function mdstatus_reload(id) {
|
||||
mdstatus_request();
|
||||
$("#Reload_MDStatusTable").attr("title",datetime());
|
||||
});
|
||||
});
|
146
root/opt/phpsysinfo/plugins/mdstatus/js/mdstatus_bootstrap.js
Normal file
@@ -0,0 +1,146 @@
|
||||
function renderPlugin_mdstatus(data) {
|
||||
|
||||
function raid_buildaction(data) {
|
||||
var html = "", name = "", percent = 0;
|
||||
if (data !== undefined) {
|
||||
name = data['Name'];
|
||||
if ((name !== undefined) && (parseInt(name) !== -1)) {
|
||||
percent = Math.round(parseFloat(data['Percent']));
|
||||
html += "<div>Current Action:" + String.fromCharCode(160) + name + "<br/>";
|
||||
html += '<table width=100%><tr><td width=50%><div class="progress">' +
|
||||
'<div class="progress-bar progress-bar-info" style="width: ' + percent + '%;"></div>' +
|
||||
'</div><div class="percent">' + percent + '%</div></td><td></td></tr></table>';
|
||||
html += "Finishing in:" + String.fromCharCode(160) + data['Time_To_Finish'] + String.fromCharCode(160) + data['Time_Unit'];
|
||||
html += "</div>";
|
||||
}
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
function raid_diskicon(data) {
|
||||
var html = "";
|
||||
var img = "", alt = "";
|
||||
|
||||
html += "<div style=\"text-align: center; float: left; margin-bottom: 5px; margin-right: 20px; width: 64px;\">";
|
||||
switch (data["Status"]) {
|
||||
case " ":
|
||||
case "":
|
||||
img = "harddriveok.png";
|
||||
alt = "ok";
|
||||
break;
|
||||
case "F":
|
||||
img = "harddrivefail.png";
|
||||
alt = "fail";
|
||||
break;
|
||||
case "S":
|
||||
img = "harddrivespare.png";
|
||||
alt = "spare";
|
||||
break;
|
||||
case "W":
|
||||
img = "harddrivewarn.png";
|
||||
alt = "warning";
|
||||
break;
|
||||
default:
|
||||
alert("--" + data["Status"] + "--");
|
||||
img = "error.png";
|
||||
alt = "error";
|
||||
break;
|
||||
}
|
||||
html += "<img src=\"./plugins/dmraid/gfx/" + img + "\" alt=\"" + alt + "\" />";
|
||||
html += "<small>" + data["Name"] + "</small>";
|
||||
html += "</div>";
|
||||
return html;
|
||||
}
|
||||
|
||||
if (data['Plugins']['Plugin_MDStatus'] !== undefined) {
|
||||
$('#mdstatus').empty();
|
||||
if (data['Plugins']['Plugin_MDStatus']['Supported_Types'] !== undefined) {
|
||||
var stitems = items(data['Plugins']['Plugin_MDStatus']['Supported_Types']['Type']);
|
||||
if (stitems.length > 0) {
|
||||
var htmltypes = "<tr><th>Supported RAID-Types</th><th>";
|
||||
for (i = 0; i < stitems.length ; i++) {
|
||||
htmltypes += stitems[i]["@attributes"]["Name"] + " ";
|
||||
}
|
||||
htmltypes += "</th><tr>";
|
||||
$('#mdstatus').append(htmltypes);
|
||||
$('#block_mdstatus').show();
|
||||
} else {
|
||||
$('#block_mdstatus').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_mdstatus').hide();
|
||||
}
|
||||
var mditems = items(data['Plugins']['Plugin_MDStatus']['Raid']);
|
||||
if (mditems.length > 0) {
|
||||
var html = '';
|
||||
for (i = 0; i < mditems.length ; i++) {
|
||||
if (i) {
|
||||
html += "<tr><td></td><td>";
|
||||
} else {
|
||||
html += "<tr><th>RAID-Devices</th><td>";
|
||||
}
|
||||
|
||||
if (mditems[i]['Disks'] !== undefined) {
|
||||
var devchunk = parseInt(mditems[i]["@attributes"]["Chunk_Size"]);
|
||||
var devsuper = parseInt(mditems[i]["@attributes"]["Persistent_Superblock"]);
|
||||
var devalgo = parseInt(mditems[i]["@attributes"]["Algorithm"]);
|
||||
var devactive = parseInt(mditems[i]["@attributes"]["Disks_Active"]);
|
||||
var devregis = parseInt(mditems[i]["@attributes"]["Disks_Registered"]);
|
||||
|
||||
html += "<table style=\"width:100%;\">";
|
||||
html += "<tr><td>";
|
||||
|
||||
var diskitems = items(mditems[i]['Disks']['Disk']);
|
||||
for (j = 0; j < diskitems.length ; j++) {
|
||||
html += raid_diskicon(diskitems[j]["@attributes"]);
|
||||
}
|
||||
|
||||
html += "</td></tr><tr><td>";
|
||||
if (mditems[i]['Action'] !== undefined) {
|
||||
var buildedaction = raid_buildaction(mditems[i]['Action']['@attributes']);
|
||||
if (buildedaction) {
|
||||
html += "<tr><td>" + buildedaction + "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
html += "<table id=\"mdstatus-" + i + "\"class=\"table table-hover table-condensed\">";
|
||||
html += "<tr class=\"treegrid-mdstatus-" + i + "\"><td><b>" + mditems[i]["@attributes"]["Device_Name"] + "</b></td><td></td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-mdstatus-" + i + "\"><th>Status</th><td>" + mditems[i]["@attributes"]["Disk_Status"] + "</td></tr>";
|
||||
html += "<tr class=\"treegrid-parent-mdstatus-" + i + "\"><th>RAID-Level</th><td>" + mditems[i]["@attributes"]["Level"] + "</td></tr>";
|
||||
if (devchunk !== -1) {
|
||||
html += "<tr class=\"treegrid-parent-mdstatus-" + i + "\"><th>Chunk Size</th><td>" + devchunk + "K</td></tr>";
|
||||
}
|
||||
if (devalgo !== -1) {
|
||||
html += "<tr class=\"treegrid-parent-mdstatus-" + i + "\"><th>Algorithm</th><td>" + devalgo + "</td></tr>";
|
||||
}
|
||||
if (devsuper !== -1) {
|
||||
html += "<tr class=\"treegrid-parent-mdstatus-" + i + "\"><th>Persistent Superblock</th><td>available</td></tr>";
|
||||
} else {
|
||||
html += "<tr class=\"treegrid-parent-mdstatus-" + i + "\"><th>Persistent Superblock</th><td>not available</td></tr>";
|
||||
}
|
||||
if (devactive !== -1 && devregis !== -1) {
|
||||
html += "<tr class=\"treegrid-parent-mdstatus-" + i + "\"><th>Registered/" + String.fromCharCode(8203) + "Active Disks</th><td>" + devregis + "/" + String.fromCharCode(8203) + devactive + "</td></tr>";
|
||||
}
|
||||
html += "</table>";
|
||||
html += "</td></tr>";
|
||||
html += "</table>";
|
||||
}
|
||||
|
||||
html +="</td></tr>";
|
||||
}
|
||||
$('#mdstatus').append(html);
|
||||
|
||||
for (i = 0; i < mditems.length ; i++) {
|
||||
if (mditems[i]['Disks'] !== undefined) {
|
||||
$('#mdstatus-'+i).treegrid({
|
||||
initialState: 'collapsed',
|
||||
expanderExpandedClass: 'normalicon normalicon-down',
|
||||
expanderCollapsedClass: 'normalicon normalicon-right'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$('#block_mdstatus').hide();
|
||||
}
|
||||
}
|
57
root/opt/phpsysinfo/plugins/mdstatus/lang/cz.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Czech Created by: Tomáš Růžička
|
||||
-->
|
||||
<tns:translationPlugin language="czech" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_mdstatus_001" name="mdstatus_title">
|
||||
<exp>Stav RAIDu</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_002" name="mdstatus_support">
|
||||
<exp>Poodporované typy RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_003" name="mdstatus_devices">
|
||||
<exp>RAID-zařízení</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_004" name="mdstatus_infos">
|
||||
<exp>Dodatečné informace</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_005" name="mdstatus_status">
|
||||
<exp>Stav</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_006" name="mdstatus_level">
|
||||
<exp>Úroveň RAIDu</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_007" name="mdstatus_chunk">
|
||||
<exp>Velikost proužku</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_008" name="mdstatus_algo">
|
||||
<exp>Algoritmus</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_009" name="mdstatus_superb">
|
||||
<exp>Persistentní Superblock</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_010" name="mdstatus_avail">
|
||||
<exp>dostupný</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_011" name="mdstatus_navail">
|
||||
<exp>nedostupný</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_012" name="mdstatus_regact">
|
||||
<exp>Registrovné/aktivní disky</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_013" name="mdstatus_curact">
|
||||
<exp>Aktuální činnost</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_014" name="mdstatus_finishin">
|
||||
<exp>Čas dokončení</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_015" name="mdstatus_unused">
|
||||
<exp>Nevyužité disky</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_016" name="mdstatus_refresh">
|
||||
<exp>Aktualizováno</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
57
root/opt/phpsysinfo/plugins/mdstatus/lang/de.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: German Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="german" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_mdstatus_001" name="mdstatus_title">
|
||||
<exp>RAID Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_002" name="mdstatus_support">
|
||||
<exp>Unterstützte RAID-Typen</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_003" name="mdstatus_devices">
|
||||
<exp>RAID-Geräte</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_004" name="mdstatus_infos">
|
||||
<exp>Zusätzliche Informationen</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_005" name="mdstatus_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_006" name="mdstatus_level">
|
||||
<exp>RAID-Level</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_007" name="mdstatus_chunk">
|
||||
<exp>Blockgröße</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_008" name="mdstatus_algo">
|
||||
<exp>Algorithmus</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_009" name="mdstatus_superb">
|
||||
<exp>Persistenter Superblock</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_010" name="mdstatus_avail">
|
||||
<exp>verfügbar</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_011" name="mdstatus_navail">
|
||||
<exp>nicht verfügbar</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_012" name="mdstatus_regact">
|
||||
<exp>Registrierte/Aktive Platten</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_013" name="mdstatus_curact">
|
||||
<exp>Aktuelle Aktion</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_014" name="mdstatus_finishin">
|
||||
<exp>Fertig in</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_015" name="mdstatus_unused">
|
||||
<exp>Unbenutzte Platten</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_016" name="mdstatus_refresh">
|
||||
<exp>Zuletzt aktualisiert</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
57
root/opt/phpsysinfo/plugins/mdstatus/lang/en.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_mdstatus_001" name="mdstatus_title">
|
||||
<exp>RAID Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_002" name="mdstatus_support">
|
||||
<exp>Supported RAID-Types</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_003" name="mdstatus_devices">
|
||||
<exp>RAID-Devices</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_004" name="mdstatus_infos">
|
||||
<exp>Additional Information</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_005" name="mdstatus_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_006" name="mdstatus_level">
|
||||
<exp>RAID-Level</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_007" name="mdstatus_chunk">
|
||||
<exp>Chunk Size</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_008" name="mdstatus_algo">
|
||||
<exp>Algorithm</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_009" name="mdstatus_superb">
|
||||
<exp>Persistent Superblock</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_010" name="mdstatus_avail">
|
||||
<exp>available</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_011" name="mdstatus_navail">
|
||||
<exp>not available</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_012" name="mdstatus_regact">
|
||||
<exp>Registered/Active Disks</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_013" name="mdstatus_curact">
|
||||
<exp>Current Action</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_014" name="mdstatus_finishin">
|
||||
<exp>Finishing in</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_015" name="mdstatus_unused">
|
||||
<exp>Unused Disks</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_016" name="mdstatus_refresh">
|
||||
<exp>Last refresh</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
57
root/opt/phpsysinfo/plugins/mdstatus/lang/fr.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: Erkan VALENTIN
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_mdstatus_001" name="mdstatus_title">
|
||||
<exp>Statut RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_002" name="mdstatus_support">
|
||||
<exp>Type de RAID supporté</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_003" name="mdstatus_devices">
|
||||
<exp>Périphériques RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_004" name="mdstatus_infos">
|
||||
<exp>Informations additionnelles</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_005" name="mdstatus_status">
|
||||
<exp>Statut</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_006" name="mdstatus_level">
|
||||
<exp>Type de RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_007" name="mdstatus_chunk">
|
||||
<exp>Granularité</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_008" name="mdstatus_algo">
|
||||
<exp>Algorithme</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_009" name="mdstatus_superb">
|
||||
<exp>Superblocs persistants</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_010" name="mdstatus_avail">
|
||||
<exp>disponible</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_011" name="mdstatus_navail">
|
||||
<exp>non disponible</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_012" name="mdstatus_regact">
|
||||
<exp>Disques Enregistrés/Actives</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_013" name="mdstatus_curact">
|
||||
<exp>Action courante</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_014" name="mdstatus_finishin">
|
||||
<exp>Temps restant</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_015" name="mdstatus_unused">
|
||||
<exp>Disques inutilisés</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_016" name="mdstatus_refresh">
|
||||
<exp>Dernière actualisation</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
57
root/opt/phpsysinfo/plugins/mdstatus/lang/gr.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: gr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Greek Created by: mojiro
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_mdstatus_001" name="mdstatus_title">
|
||||
<exp>Κατάσταση RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_002" name="mdstatus_support">
|
||||
<exp>Υποστηριζόμενοι τύποι RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_003" name="mdstatus_devices">
|
||||
<exp>Αλυσίδες RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_004" name="mdstatus_infos">
|
||||
<exp>Πρόσθετες πληροφορίες</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_005" name="mdstatus_status">
|
||||
<exp>Κατάσταση</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_006" name="mdstatus_level">
|
||||
<exp>Τύπος RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_007" name="mdstatus_chunk">
|
||||
<exp>Μέγεθος Chunk</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_008" name="mdstatus_algo">
|
||||
<exp>Αλγόριθμος</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_009" name="mdstatus_superb">
|
||||
<exp>Μόνιμο Superblock</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_010" name="mdstatus_avail">
|
||||
<exp>διαθέσιμο</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_011" name="mdstatus_navail">
|
||||
<exp>μη διαθέσιμο</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_012" name="mdstatus_regact">
|
||||
<exp>Δηλωμένοι/Ενεργοί Δίσκοι</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_013" name="mdstatus_curact">
|
||||
<exp>Τρέχουσα ενέργεια</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_014" name="mdstatus_finishin">
|
||||
<exp>Ολοκληρώνεται σε</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_015" name="mdstatus_unused">
|
||||
<exp>Αχρησιμοποίητοι Δίσκοι</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_016" name="mdstatus_refresh">
|
||||
<exp>Ενημέρωση</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
57
root/opt/phpsysinfo/plugins/mdstatus/lang/ro.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Iulian Alexe
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_mdstatus_001" name="mdstatus_title">
|
||||
<exp>Stare RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_002" name="mdstatus_support">
|
||||
<exp>Tipuri de RAID suportate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_003" name="mdstatus_devices">
|
||||
<exp>Dispozitive RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_004" name="mdstatus_infos">
|
||||
<exp>Informații Aditionale</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_005" name="mdstatus_status">
|
||||
<exp>Stare</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_006" name="mdstatus_level">
|
||||
<exp>Nivele RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_007" name="mdstatus_chunk">
|
||||
<exp>Chunk Size</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_008" name="mdstatus_algo">
|
||||
<exp>Algoritm</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_009" name="mdstatus_superb">
|
||||
<exp>Superblock persistente</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_010" name="mdstatus_avail">
|
||||
<exp>disponibil</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_011" name="mdstatus_navail">
|
||||
<exp>indisponibil</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_012" name="mdstatus_regact">
|
||||
<exp>Înregistrate/Discuri Active</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_013" name="mdstatus_curact">
|
||||
<exp>Acțiune curentă</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_014" name="mdstatus_finishin">
|
||||
<exp>finisare în</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_015" name="mdstatus_unused">
|
||||
<exp>Discuri defolosite</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_016" name="mdstatus_refresh">
|
||||
<exp>Ultimul refresh</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
57
root/opt/phpsysinfo/plugins/mdstatus/lang/ru.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="russian" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_mdstatus_001" name="mdstatus_title">
|
||||
<exp>RAID Статус</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_002" name="mdstatus_support">
|
||||
<exp>Поддерживаются типы RAID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_003" name="mdstatus_devices">
|
||||
<exp>RAID-Устройства</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_004" name="mdstatus_infos">
|
||||
<exp>Дополнительные сведения</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_005" name="mdstatus_status">
|
||||
<exp>Статус</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_006" name="mdstatus_level">
|
||||
<exp>RAID-Уровень</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_007" name="mdstatus_chunk">
|
||||
<exp>Размер блока</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_008" name="mdstatus_algo">
|
||||
<exp>Алгоритм</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_009" name="mdstatus_superb">
|
||||
<exp>Постоянный суперблок</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_010" name="mdstatus_avail">
|
||||
<exp>доступен</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_011" name="mdstatus_navail">
|
||||
<exp>не доступен</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_012" name="mdstatus_regact">
|
||||
<exp>Зарегистрировано/Активных Дисков</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_013" name="mdstatus_curact">
|
||||
<exp>Текущее действие</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_014" name="mdstatus_finishin">
|
||||
<exp>Окончание в</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_015" name="mdstatus_unused">
|
||||
<exp>Неиспользуемые диски</exp>
|
||||
</expression>
|
||||
<expression id="plugin_mdstatus_016" name="mdstatus_refresh">
|
||||
<exp>Последнее обновление</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
@@ -0,0 +1,9 @@
|
||||
<div class="col-lg-12" id="block_mdstatus" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">RAID Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="mdstatus" class="table borderless table-condensed">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
254
root/opt/phpsysinfo/plugins/ps/class.ps.inc.php
Normal file
@@ -0,0 +1,254 @@
|
||||
<?php
|
||||
/**
|
||||
* PS Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_PS
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.ps.inc.php 692 2012-09-08 17:12:08Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* process Plugin, which displays all running processes
|
||||
* a simple tree view which is filled with the running processes which are determined by
|
||||
* calling the "ps" command line utility, another way is to provide
|
||||
* a file with the output of the ps utility, so there is no need to run a execute by the
|
||||
* webserver, the format of the command is written down in the phpsysinfo.ini file, where also
|
||||
* the method of getting the information is configured
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_PS
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class PS extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = array();
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_PS_ACCESS)) {
|
||||
case 'command':
|
||||
if (PSI_OS == 'WINNT') {
|
||||
try {
|
||||
$objLocator = new COM("WbemScripting.SWbemLocator");
|
||||
$wmi = $objLocator->ConnectServer();
|
||||
$os_wmi = $wmi->InstancesOf('Win32_OperatingSystem');
|
||||
foreach ($os_wmi as $os) {
|
||||
$memtotal = $os->TotalVisibleMemorySize * 1024;
|
||||
}
|
||||
$process_wmi = $wmi->InstancesOf('Win32_Process');
|
||||
foreach ($process_wmi as $process) {
|
||||
if (strlen(trim($process->CommandLine)) > 0) {
|
||||
$ps = trim($process->CommandLine);
|
||||
} else {
|
||||
$ps = trim($process->Caption);
|
||||
}
|
||||
if (trim($process->ProcessId) != 0) {
|
||||
$memusage = round(trim($process->WorkingSetSize) * 100 / $memtotal, 1);
|
||||
//ParentProcessId
|
||||
//Unique identifier of the process that creates a process. Process identifier numbers are reused, so they
|
||||
//only identify a process for the lifetime of that process. It is possible that the process identified by
|
||||
//ParentProcessId is terminated, so ParentProcessId may not refer to a running process. It is also
|
||||
//possible that ParentProcessId incorrectly refers to a process that reuses a process identifier. You can
|
||||
//use the CreationDate property to determine whether the specified parent was created after the process
|
||||
//represented by this Win32_Process instance was created.
|
||||
//=> subtrees of processes may be missing (WHAT TODO?!?)
|
||||
$this->_filecontent[] = trim($process->ProcessId)." ".trim($process->ParentProcessId)." ".$memusage." ".$ps;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
} else {
|
||||
CommonFunctions::executeProgram("ps", "axo pid,ppid,pmem,args", $buffer, PSI_DEBUG);
|
||||
if (((PSI_OS == 'Linux') || (PSI_OS == 'Android')) && (!preg_match("/^[^\n]+\n.+/", $buffer))) { //alternative method if no data
|
||||
if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
|
||||
$bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$totalmem = 0;
|
||||
foreach ($bufe as $buf) {
|
||||
if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
|
||||
$totalmem = $ar_buf[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$buffer = " PID PPID %MEM COMMAND\n";
|
||||
|
||||
$processlist = glob('/proc/*/status', GLOB_NOSORT);
|
||||
if (($total = count($processlist)) > 0) {
|
||||
natsort($processlist); //first sort
|
||||
$prosess = array();
|
||||
foreach ($processlist as $processitem) { //second sort
|
||||
$process[] = $processitem;
|
||||
}
|
||||
|
||||
$buf = "";
|
||||
for ($i = 0; $i < $total; $i++) {
|
||||
if (CommonFunctions::rfts($process[$i], $buf, 0, 4096, false)) {
|
||||
|
||||
if (($totalmem != 0) && (preg_match('/^VmRSS:\s+(\d+)\s+kB/m', $buf, $tmppmem))) {
|
||||
$pmem = round(100 * $tmppmem[1] / $totalmem, 1);
|
||||
} else {
|
||||
$pmem = 0;
|
||||
}
|
||||
|
||||
$name = null;
|
||||
if (CommonFunctions::rfts(substr($process[$i], 0, strlen($process[$i])-6)."cmdline", $namebuf, 0, 4096, false)) {
|
||||
$name = str_replace(chr(0), ' ', trim($namebuf));
|
||||
}
|
||||
if (preg_match('/^Pid:\s+(\d+)/m', $buf, $tmppid) &&
|
||||
preg_match('/^PPid:\s+(\d+)/m', $buf, $tmpppid) &&
|
||||
preg_match('/^Name:\s+(.+)/m', $buf, $tmpargs)) {
|
||||
$pid = $tmppid[1];
|
||||
$ppid = $tmpppid[1];
|
||||
$args = $tmpargs[1];
|
||||
if ($name !== null) {
|
||||
if ($name !== "") {
|
||||
$args = $name;
|
||||
} else {
|
||||
$args = "[".$args."]";
|
||||
}
|
||||
}
|
||||
$buffer .= $pid." ".$ppid." ".$pmem." ".$args."\n";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'data':
|
||||
CommonFunctions::rfts(APP_ROOT."/data/ps.txt", $buffer);
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addConfigError("__construct()", "PSI_PLUGIN_PS_ACCESS");
|
||||
break;
|
||||
}
|
||||
if (PSI_OS != 'WINNT') {
|
||||
if (trim($buffer) != "") {
|
||||
$this->_filecontent = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
|
||||
unset($this->_filecontent[0]);
|
||||
} else {
|
||||
$this->_filecontent = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array<br>the array is build like a tree,
|
||||
* so that it is possible to get only a specific process with the childs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (empty($this->_filecontent)) {
|
||||
return;
|
||||
}
|
||||
foreach ($this->_filecontent as $roworig) {
|
||||
$row = preg_split("/[\s]+/", trim($roworig), 4);
|
||||
if (count($row) != 4) {
|
||||
break;
|
||||
}
|
||||
foreach ($row as $key=>$val) {
|
||||
$items[$row[0]][$key] = $val;
|
||||
}
|
||||
if ($row[1] !== $row[0]) {
|
||||
$items[$row[1]]['childs'][$row[0]] = &$items[$row[0]];
|
||||
}
|
||||
}
|
||||
foreach ($items as $item) { //find zombie
|
||||
if (!isset($item[0])) {
|
||||
foreach ($item["childs"] as $subitem) {
|
||||
$zombie = $subitem[1];
|
||||
if ($zombie != 0) {
|
||||
$items[$zombie]["0"] = $zombie;
|
||||
$items[$zombie]["1"] = "0";
|
||||
$items[$zombie]["2"] = "0";
|
||||
$items[$zombie]["3"] = "unknown";
|
||||
$items[0]['childs'][$zombie] = &$items[$zombie];
|
||||
}
|
||||
break; //first is sufficient
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($items[0])) {
|
||||
$this->_result = $items[0];
|
||||
} else {
|
||||
$_result = array();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLElement entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
if ($this->_result) {
|
||||
$positions = array(0=>0);
|
||||
$this->_addchild($this->_result['childs'], $this->xml, $positions);
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
/**
|
||||
* recursive function to allow appending child processes to a parent process
|
||||
*
|
||||
* @param Array $child part of the array which should be appended to the XML
|
||||
* @param SimpleXMLExtended $xml XML-Object to which the array content is appended
|
||||
* @param Array &$positions array with parent positions in xml structure
|
||||
*
|
||||
* @return SimpleXMLExtended Object with the appended array content
|
||||
*/
|
||||
private function _addchild($child, SimpleXMLExtended $xml, &$positions)
|
||||
{
|
||||
foreach ($child as $key=>$value) {
|
||||
$xmlnode = $xml->addChild("Process");
|
||||
if (isset($value[0])) {
|
||||
array_push($positions, $value[0]);
|
||||
$xmlnode->addAttribute('PID', $value[0]);
|
||||
$parentid = array_search($value[1], $positions);
|
||||
$xmlnode->addAttribute('ParentID', $parentid);
|
||||
$xmlnode->addAttribute('PPID', $value[1]);
|
||||
$xmlnode->addAttribute('MemoryUsage', $value[2]);
|
||||
$xmlnode->addAttribute('Name', str_replace("...","",$value[3]));
|
||||
if (PSI_OS !== 'WINNT') {
|
||||
if ($parentid === 1){
|
||||
$xmlnode->addAttribute('Expanded', 0);
|
||||
}
|
||||
if (defined('PSI_PLUGIN_PS_SHOW_KTHREADD_EXPANDED') && (PSI_PLUGIN_PS_SHOW_KTHREADD_EXPANDED === false) && ($value[3] === "[kthreadd]")) {
|
||||
$xmlnode->addAttribute('Expanded', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($value['childs'])) {
|
||||
$this->_addChild($value['childs'], $xml, $positions);
|
||||
}
|
||||
}
|
||||
|
||||
return $xml;
|
||||
}
|
||||
}
|
120
root/opt/phpsysinfo/plugins/ps/js/ps.js
Normal file
@@ -0,0 +1,120 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
//
|
||||
// $Id: ps.js 661 2012-08-27 11:26:39Z namiltd $
|
||||
//
|
||||
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, createBar, genlang */
|
||||
|
||||
"use strict";
|
||||
|
||||
var ps_show = false;
|
||||
|
||||
/**
|
||||
* build the table where content is inserted
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function ps_buildTable(xml) {
|
||||
var html = "", tree = [], closed = [2];
|
||||
|
||||
$("#Plugin_PS #Plugin_PSTable").remove();
|
||||
|
||||
html += " <table id=\"Plugin_PSTable\" class=\"tablemain\" style=\"width:100%;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th>" + genlang(3, false, "PS") + "</th>\n";
|
||||
html += " <th style=\"width:80px;\">" + genlang(4, false, "PS") + "</th>\n";
|
||||
html += " <th style=\"width:80px;\">" + genlang(5, false, "PS") + "</th>\n";
|
||||
html += " <th style=\"width:110px;\">" + genlang(6, false, "PS") + "</th>\n";
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody class=\"tree\">\n";
|
||||
|
||||
$("Plugins Plugin_PS Process", xml).each(function ps_getprocess(id) {
|
||||
var close = 0, pid = 0, ppid = 0, name = "", percent = 0, parentId = 0, expanded = 0;
|
||||
name = $(this).attr("Name");
|
||||
parentId = parseInt($(this).attr("ParentID"), 10);
|
||||
pid = parseInt($(this).attr("PID"), 10);
|
||||
ppid = parseInt($(this).attr("PPID"), 10);
|
||||
percent = parseInt($(this).attr("MemoryUsage"), 10);
|
||||
expanded = parseInt($(this).attr("Expanded"), 10);
|
||||
|
||||
html += " <tr><td>" + name + "</td><td>" + pid + "</td><td>" + ppid + "</td><td>" + createBar(percent) + "</td></tr>\n";
|
||||
close = tree.push(parentId);
|
||||
if (!isNaN(expanded) && (expanded === 0)) {
|
||||
closed.push(close);
|
||||
}
|
||||
ps_show = true;
|
||||
});
|
||||
|
||||
html += " </tbody>\n";
|
||||
html += " </table>\n";
|
||||
|
||||
$("#Plugin_PS").append(html);
|
||||
|
||||
$("#Plugin_PSTable").jqTreeTable(tree, {
|
||||
openImg: "./gfx/treeTable/tv-collapsable.gif",
|
||||
shutImg: "./gfx/treeTable/tv-expandable.gif",
|
||||
leafImg: "./gfx/treeTable/tv-item.gif",
|
||||
lastOpenImg: "./gfx/treeTable/tv-collapsable-last.gif",
|
||||
lastShutImg: "./gfx/treeTable/tv-expandable-last.gif",
|
||||
lastLeafImg: "./gfx/treeTable/tv-item-last.gif",
|
||||
vertLineImg: "./gfx/treeTable/vertline.gif",
|
||||
blankImg: "./gfx/treeTable/blank.gif",
|
||||
collapse: closed,
|
||||
column: 0,
|
||||
striped: true,
|
||||
highlight: false,
|
||||
state: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function ps_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=PS",
|
||||
dataType: "xml",
|
||||
error: function ps_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin PS!");
|
||||
},
|
||||
success: function ps_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
ps_buildTable(xml);
|
||||
if (ps_show) {
|
||||
plugin_translate("PS");
|
||||
$("#Plugin_PS").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function ps_buildpage() {
|
||||
$("#footer").before(buildBlock("PS", 1, true));
|
||||
$("#Plugin_PS").css("width", "915px");
|
||||
|
||||
ps_request();
|
||||
|
||||
$("#Reload_PSTable").click(function ps_reload(id) {
|
||||
ps_request();
|
||||
$("#Reload_PSTable").attr("title",datetime());
|
||||
});
|
||||
});
|
38
root/opt/phpsysinfo/plugins/ps/js/ps_bootstrap.js
Normal file
@@ -0,0 +1,38 @@
|
||||
function renderPlugin_ps(data) {
|
||||
|
||||
var directives = {
|
||||
MemoryUsage: {
|
||||
html: function () {
|
||||
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width: ' + this["MemoryUsage"] + '%;"></div>' +
|
||||
'</div><div class="percent">' + this["MemoryUsage"] + '%</div>';
|
||||
}
|
||||
},
|
||||
Name: {
|
||||
html: function () {
|
||||
return this["Name"];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (data['Plugins']['Plugin_PS'] !== undefined) {
|
||||
var psitems = items(data['Plugins']['Plugin_PS']['Process']);
|
||||
if (psitems.length > 0) {
|
||||
var ps_memory = [];
|
||||
var ps_item = [];
|
||||
for (i = 0; i < psitems.length ; i++) {
|
||||
ps_item = psitems[i]["@attributes"];
|
||||
ps_item["number"] = i + 1;
|
||||
ps_memory.push(ps_item);
|
||||
}
|
||||
$('#ps-data').render(ps_memory, directives);
|
||||
$('#ps_number').removeClass("sorttable_sorted"); // reset sort order
|
||||
sorttable.innerSortFunction.apply($('#ps_number')[0], []);
|
||||
|
||||
$('#block_ps').show();
|
||||
} else {
|
||||
$('#block_ps').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_ps').hide();
|
||||
}
|
||||
}
|
27
root/opt/phpsysinfo/plugins/ps/lang/cz.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Czech Created by: Tomáš Růžička
|
||||
-->
|
||||
<tns:translationPlugin language="czech" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Procesy</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Aktualizováno</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Příkaz</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>PID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>Rodičovský PID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Spotřeba paměti</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/lang/de.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: German Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="german" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Prozess Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Letzte Aktualisierung</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Befehl</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>Prozess ID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>Eltern ID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Speichernutzung</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/lang/en.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Process Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Last refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Command</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>Process ID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>Parent ID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Memory Usage</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/lang/fr.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: Erkan VALENTIN
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Etat des processus</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Dernière actualisation</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Commande</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>ID processus</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>ID processus père</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Utilisation mémoire</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/lang/gr.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: gr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Greek Created by: mojiro
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Διεργασίες Συστήματος</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Ενημέρωση</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Εντολή</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>ID Διεργασίας</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>ID Κύριας Διεργασίας</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Χρήση Μνήμης</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/lang/pl.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="polish" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Status Procesów</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Ostatnie odświeżenie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Polecenie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>PID</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>PID rodzica</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Wykorzystanie pamięci</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/lang/ro.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Iulian Alexe
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Stare proces</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Ultimul refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Comanda</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>ID Proces</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>ID Parinte</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Utilizare Memorie</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/lang/ru.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="russian" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_ps_001" name="ps_title">
|
||||
<exp>Статус процессов</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_002" name="ps_date">
|
||||
<exp>Последнее обновление</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_003" name="ps_command">
|
||||
<exp>Команда</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_004" name="ps_pid">
|
||||
<exp>ID процесса</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_005" name="ps_ppid">
|
||||
<exp>ID родителя</exp>
|
||||
</expression>
|
||||
<expression id="plugin_ps_006" name="ps_mem">
|
||||
<exp>Использовано памяти</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
27
root/opt/phpsysinfo/plugins/ps/ps_bootstrap.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<div class="col-lg-12" id="block_ps" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">Processes Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="ps" class="table table-hover table-condensed sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th id="ps_number" class="sorttable_numeric">#</th>
|
||||
<th>Command</th>
|
||||
<th class="rightCell sorttable_numeric">Process ID</th>
|
||||
<th class="rightCell sorttable_numeric">Parent ID</th>
|
||||
<th class="rightCell sorttable_numeric">Memory Usage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="ps-data">
|
||||
<tr>
|
||||
<th><span data-bind="number"></span></th>
|
||||
<td><span data-bind="Name"></span></td>
|
||||
<td class="rightCell"><span data-bind="PID"></span></td>
|
||||
<td class="rightCell"><span data-bind="PPID"></span></td>
|
||||
<td class="rightCell"><span data-bind="MemoryUsage"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
179
root/opt/phpsysinfo/plugins/psstatus/class.psstatus.inc.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
/**
|
||||
* PSStatus Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_PSStatus
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.psstatus.inc.php 692 2012-09-08 17:12:08Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* process Plugin, which displays the status of configured processes
|
||||
* a simple view which shows a process name and the status
|
||||
* status determined by calling the "pidof" command line utility, another way is to provide
|
||||
* a file with the output of the pidof utility, so there is no need to run a executeable by the
|
||||
* webserver, the format of the command is written down in the phpsysinfo.ini file, where also
|
||||
* the method of getting the information is configured
|
||||
* processes that should be checked are also defined in phpsysinfo.ini
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_PSStatus
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class PSStatus extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = array();
|
||||
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc target encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_PSSTATUS_ACCESS)) {
|
||||
case 'command':
|
||||
if (PSI_OS == 'WINNT') {
|
||||
try {
|
||||
$objLocator = new COM("WbemScripting.SWbemLocator");
|
||||
$wmi = $objLocator->ConnectServer();
|
||||
$process_wmi = $wmi->InstancesOf('Win32_Process');
|
||||
foreach ($process_wmi as $process) {
|
||||
$this->_filecontent[] = array(strtolower(trim($process->Caption)), trim($process->ProcessId));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
} else {
|
||||
if (defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_PSSTATUS_PROCESSES)) {
|
||||
$processes = eval(PSI_PLUGIN_PSSTATUS_PROCESSES);
|
||||
} else {
|
||||
$processes = array(PSI_PLUGIN_PSSTATUS_PROCESSES);
|
||||
}
|
||||
if (defined('PSI_PLUGIN_PSSTATUS_USE_REGEX') && PSI_PLUGIN_PSSTATUS_USE_REGEX === true) {
|
||||
foreach ($processes as $process) {
|
||||
CommonFunctions::executeProgram("pgrep", "-n -x ".$process, $buffer, PSI_DEBUG);
|
||||
if (strlen(trim($buffer)) > 0) {
|
||||
$this->_filecontent[] = array($process, trim($buffer));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($processes as $process) {
|
||||
CommonFunctions::executeProgram("pidof", "-s ".$process, $buffer, PSI_DEBUG);
|
||||
if (strlen(trim($buffer)) > 0) {
|
||||
$this->_filecontent[] = array($process, trim($buffer));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'data':
|
||||
CommonFunctions::rfts(APP_ROOT."/data/psstatus.txt", $buffer);
|
||||
$processes = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
|
||||
foreach ($processes as $process) {
|
||||
$ps = preg_split("/[\s]?\|[\s]?/", $process, -1, PREG_SPLIT_NO_EMPTY);
|
||||
if (count($ps) == 2) {
|
||||
$this->_filecontent[] = array(trim($ps[0]), trim($ps[1]));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addError("switch(PSI_PLUGIN_PSSTATUS_ACCESS)", "Bad psstatus configuration in phpsysinfo.ini");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array<br>the array is build like a tree,
|
||||
* so that it is possible to get only a specific process with the childs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (empty($this->_filecontent)) {
|
||||
return;
|
||||
}
|
||||
if (defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_PSSTATUS_PROCESSES)) {
|
||||
$processes = eval(PSI_PLUGIN_PSSTATUS_PROCESSES);
|
||||
} else {
|
||||
$processes = array(PSI_PLUGIN_PSSTATUS_PROCESSES);
|
||||
}
|
||||
if ((PSI_OS == 'WINNT') && (strtolower(PSI_PLUGIN_PSSTATUS_ACCESS) == 'command')) {
|
||||
foreach ($processes as $process) {
|
||||
if ($this->_recursiveinarray(strtolower($process), $this->_filecontent)) {
|
||||
$this->_result[] = array($process, true);
|
||||
} else {
|
||||
$this->_result[] = array($process, false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($processes as $process) {
|
||||
if ($this->_recursiveinarray($process, $this->_filecontent)) {
|
||||
$this->_result[] = array($process, true);
|
||||
} else {
|
||||
$this->_result[] = array($process, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLElement entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
foreach ($this->_result as $ps) {
|
||||
$xmlps = $this->xml->addChild("Process");
|
||||
$xmlps->addAttribute("Name", $ps[0]);
|
||||
$xmlps->addAttribute("Status", $ps[1] ? 1 : 0);
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* checks an array recursive if an value is in, extended version of in_array()
|
||||
*
|
||||
* @param mixed $needle what to find
|
||||
* @param array $haystack where to find
|
||||
*
|
||||
* @return boolean true - found<br>false - not found
|
||||
*/
|
||||
private function _recursiveinarray($needle, $haystack)
|
||||
{
|
||||
foreach ($haystack as $stalk) {
|
||||
if ($needle == $stalk || (is_array($stalk) && $this->_recursiveinarray($needle, $stalk))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
6
root/opt/phpsysinfo/plugins/psstatus/css/psstatus.css
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
$Id: psstatus.css 661 2012-08-27 11:26:39Z namiltd $
|
||||
*/
|
||||
#plugin_psstatusTable thead tr .header {
|
||||
cursor: pointer;
|
||||
}
|
BIN
root/opt/phpsysinfo/plugins/psstatus/gfx/offline.png
Normal file
After Width: | Height: | Size: 993 B |
BIN
root/opt/phpsysinfo/plugins/psstatus/gfx/online.png
Normal file
After Width: | Height: | Size: 755 B |
124
root/opt/phpsysinfo/plugins/psstatus/js/psstatus.js
Normal file
@@ -0,0 +1,124 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
//
|
||||
// $Id: psstatus.js 679 2012-09-04 10:10:11Z namiltd $
|
||||
//
|
||||
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang */
|
||||
|
||||
"use strict";
|
||||
|
||||
var psstatus_show = false, psstatus_table;
|
||||
|
||||
//appendcss("./plugins/PSStatus/css/PSStatus.css");
|
||||
|
||||
/**
|
||||
* insert content into table
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function psstatus_populate(xml) {
|
||||
var name = "", status = 0, state = "";
|
||||
|
||||
psstatus_table.fnClearTable();
|
||||
|
||||
$("Plugins Plugin_PSStatus Process", xml).each(function psstatus_getprocess(idp) {
|
||||
name = $(this).attr("Name");
|
||||
status = parseInt($(this).attr("Status"), 10);
|
||||
if (!isNaN(status) && (status === 1)) {
|
||||
state = "<span style=\"display:none;\">" + status.toString() + "</span><img src=\"./plugins/psstatus/gfx/online.png\" alt=\"online\" />";
|
||||
}
|
||||
else {
|
||||
state = "<span style=\"display:none;\">" + status.toString() + "</span><img src=\"./plugins/psstatus/gfx/offline.png\" alt=\"offline\" />";
|
||||
}
|
||||
psstatus_table.fnAddData(["<span style=\"display:none;\">" + name + "</span>" + name, state]);
|
||||
psstatus_show = true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* fill the plugin block with table structure
|
||||
*/
|
||||
function psstatus_buildTable() {
|
||||
var html = "";
|
||||
|
||||
html += "<table id=\"Plugin_PSStatusTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th>" + genlang(3, false, "PSStatus") + "</th>\n";
|
||||
html += " <th>" + genlang(4, false, "PSStatus") + "</th>\n";
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += "</table>\n";
|
||||
|
||||
$("#Plugin_PSStatus").append(html);
|
||||
|
||||
psstatus_table = $("#Plugin_PSStatusTable").dataTable({
|
||||
"bPaginate": false,
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bProcessing": true,
|
||||
"bAutoWidth": false,
|
||||
"bStateSave": true,
|
||||
"aoColumns": [{
|
||||
"sType": 'span-string'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function psstatus_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=PSStatus",
|
||||
dataType: "xml",
|
||||
error: function psstatus_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin PSStatus!");
|
||||
},
|
||||
success: function psstatus_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
psstatus_populate(xml);
|
||||
if (psstatus_show) {
|
||||
plugin_translate("PSStatus");
|
||||
$("#Plugin_PSStatus").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function psstatus_buildpage() {
|
||||
$("#footer").before(buildBlock("PSStatus", 1, true));
|
||||
$("#Plugin_PSStatus").css("width", "451px");
|
||||
|
||||
psstatus_buildTable();
|
||||
|
||||
psstatus_request();
|
||||
|
||||
$("#Reload_PSStatusTable").click(function psstatus_reload(id) {
|
||||
psstatus_request();
|
||||
$("#Reload_PSStatusTable").attr("title",datetime());
|
||||
});
|
||||
});
|
@@ -0,0 +1,27 @@
|
||||
function renderPlugin_psstatus(data) {
|
||||
|
||||
var directives = {
|
||||
Status: {
|
||||
text: function () {
|
||||
return (this['Status'] === "1") ? "ON" : "OFF";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (data['Plugins']['Plugin_PSStatus'] !== undefined) {
|
||||
var psitems = items(data['Plugins']['Plugin_PSStatus']['Process']);
|
||||
if (psitems.length > 0) {
|
||||
var ps_memory = [];
|
||||
ps_memory.push_attrs(psitems);
|
||||
$('#psstatus-data').render(ps_memory, directives);
|
||||
$('#psstatus_Name').removeClass("sorttable_sorted"); // reset sort order
|
||||
sorttable.innerSortFunction.apply($('#psstatus_Name')[0], []);
|
||||
|
||||
$('#block_psstatus').show();
|
||||
} else {
|
||||
$('#block_psstatus').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_psstatus').hide();
|
||||
}
|
||||
}
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/cz.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Czech Created by: Tomáš Růžička
|
||||
-->
|
||||
<tns:translationPlugin language="czech" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Stav procesů</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Aktualizováno</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Název</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Stav</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/de.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: German Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="german" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Prozess Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Letzte Aktualisierung</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Name</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/en.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Process Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Last refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Name</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/fr.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: Erkan VALENTIN
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Etat des processus</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Dernière actualisation</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Nom</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Etat</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/gr.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: gr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Greek Created by: mojiro
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Κατάσταση Κρίσιμων Διεργασιών</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Ενημέρωση</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Διεργασία</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Κατάσταση</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/pl.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="polish" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Status Procesów</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Ostatnie odświeżenie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Nazwa</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Status</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/ro.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Iulian Alexe
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Stare proces</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Ultimul refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Nume</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Stare</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/lang/ru.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="russian" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_psstatus_001" name="ps_title">
|
||||
<exp>Статус служб</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_002" name="ps_date">
|
||||
<exp>Последнее обновление</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_003" name="ps_name">
|
||||
<exp>Имя службы</exp>
|
||||
</expression>
|
||||
<expression id="plugin_psstatus_004" name="ps_status">
|
||||
<exp>Статус</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
21
root/opt/phpsysinfo/plugins/psstatus/psstatus_bootstrap.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<div class="col-lg-6" id="block_psstatus" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">Processes Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="psstatus" class="table table-hover table-condensed sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th id="psstatus_Name">Name</th>
|
||||
<th class="rightCell">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="psstatus-data">
|
||||
<tr>
|
||||
<th><span data-bind="Name"></span></th>
|
||||
<td class="rightCell"><span class="badge" data-bind="Status"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
132
root/opt/phpsysinfo/plugins/quotas/class.quotas.inc.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* Quotas Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_Quotas
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.quotas.inc.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* Quotas Plugin, which displays all quotas on the machine
|
||||
* display all quotas in a sortable table with the current values which are determined by
|
||||
* calling the "repquota" command line utility, another way is to provide
|
||||
* a file with the output of the repquota utility, so there is no need to run a execute by the
|
||||
* webserver, the format of the command is written down in the phpsysinfo.ini file, where also
|
||||
* the method of getting the information is configured
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_Quotas
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class Quotas extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = array();
|
||||
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc target encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_QUOTAS_ACCESS)) {
|
||||
case 'command':
|
||||
CommonFunctions::executeProgram("repquota", "-au", $buffer, PSI_DEBUG);
|
||||
break;
|
||||
case 'data':
|
||||
CommonFunctions::rfts(APP_ROOT."/data/quotas.txt", $buffer);
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addConfigError("__construct()", "PSI_PLUGIN_QUOTAS_ACCESS");
|
||||
break;
|
||||
}
|
||||
if (trim($buffer) != "") {
|
||||
$this->_filecontent = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
|
||||
unset($this->_filecontent[0]);
|
||||
} else {
|
||||
$this->_filecontent = array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array<br>the array is build like a tree,
|
||||
* so that it is possible to get only a specific process with the childs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$i = 0;
|
||||
$quotas = array();
|
||||
foreach ($this->_filecontent as $thisline) {
|
||||
$thisline = preg_replace("/([\s]--)/", "", $thisline);
|
||||
$thisline = preg_split("/(\s)/e", $thisline, -1, PREG_SPLIT_NO_EMPTY);
|
||||
if (count($thisline) == 7) {
|
||||
$quotas[$i]['user'] = str_replace("--", "", $thisline[0]);
|
||||
$quotas[$i]['byte_used'] = $thisline[1] * 1024;
|
||||
$quotas[$i]['byte_soft'] = $thisline[2] * 1024;
|
||||
$quotas[$i]['byte_hard'] = $thisline[3] * 1024;
|
||||
if ($thisline[3] != 0) {
|
||||
$quotas[$i]['byte_percent_used'] = round((($quotas[$i]['byte_used'] / $quotas[$i]['byte_hard']) * 100), 1);
|
||||
} else {
|
||||
$quotas[$i]['byte_percent_used'] = 0;
|
||||
}
|
||||
$quotas[$i]['file_used'] = $thisline[4];
|
||||
$quotas[$i]['file_soft'] = $thisline[5];
|
||||
$quotas[$i]['file_hard'] = $thisline[6];
|
||||
if ($thisline[6] != 0) {
|
||||
$quotas[$i]['file_percent_used'] = round((($quotas[$i]['file_used'] / $quotas[$i]['file_hard']) * 100), 1);
|
||||
} else {
|
||||
$quotas[$i]['file_percent_used'] = 0;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$this->_result = $quotas;
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLElement entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
foreach ($this->_result as $quota) {
|
||||
$quotaChild = $this->xml->addChild("Quota");
|
||||
$quotaChild->addAttribute("User", $quota['user']);
|
||||
$quotaChild->addAttribute("ByteUsed", $quota['byte_used']);
|
||||
$quotaChild->addAttribute("ByteSoft", $quota['byte_soft']);
|
||||
$quotaChild->addAttribute("ByteHard", $quota['byte_hard']);
|
||||
$quotaChild->addAttribute("BytePercentUsed", $quota['byte_percent_used']);
|
||||
$quotaChild->addAttribute("FileUsed", $quota['file_used']);
|
||||
$quotaChild->addAttribute("FileSoft", $quota['file_soft']);
|
||||
$quotaChild->addAttribute("FileHard", $quota['file_hard']);
|
||||
$quotaChild->addAttribute("FilePercentUsed", $quota['file_percent_used']);
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
}
|
7
root/opt/phpsysinfo/plugins/quotas/css/quotas.css
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
$Id: quotas.css 661 2012-08-27 11:26:39Z namiltd $
|
||||
*/
|
||||
#plugin_quotasTable thead tr .header {
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
146
root/opt/phpsysinfo/plugins/quotas/js/quotas.js
Normal file
@@ -0,0 +1,146 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
//
|
||||
// $Id: quotas.js 661 2012-08-27 11:26:39Z namiltd $
|
||||
//
|
||||
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, formatBytes, createBar */
|
||||
|
||||
"use strict";
|
||||
|
||||
var quotas_show = false, quotas_table;
|
||||
|
||||
//appendcss("./plugins/Quotas/css/Quotas.css");
|
||||
|
||||
/**
|
||||
* insert content into table
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function quotas_populate(xml) {
|
||||
quotas_table.fnClearTable();
|
||||
|
||||
$("Plugins Plugin_Quotas Quota", xml).each(function quotas_getquota(id) {
|
||||
var user = "", bused = 0, bsoft = 0, bhard = 0, bpuse = 0, fpuse = 0, fused = 0, fsoft = 0, fhard = 0;
|
||||
user = $(this).attr("User");
|
||||
bused = parseInt($(this).attr("ByteUsed"), 10);
|
||||
bsoft = parseInt($(this).attr("ByteSoft"), 10);
|
||||
bhard = parseInt($(this).attr("ByteHard"), 10);
|
||||
bpuse = parseInt($(this).attr("BytePercentUsed"), 10);
|
||||
fused = parseInt($(this).attr("FileUsed"), 10);
|
||||
fsoft = parseInt($(this).attr("FileSoft"), 10);
|
||||
fhard = parseInt($(this).attr("FileHard"), 10);
|
||||
fpuse = parseInt($(this).attr("FilePercentUsed"), 10);
|
||||
|
||||
quotas_table.fnAddData(["<span style=\"display:none;\">" + user + "</span>" + user, "<span style=\"display:none;\">" + bused + "</span>" + formatBytes(bused, xml), "<span style=\"display:none;\">" + bsoft + "</span>" + formatBytes(bsoft, xml), "<span style=\"display:none;\">" + bhard + "</span>" + formatBytes(bhard, xml), "<span style=\"display:none;\">" + bpuse + "</span>" + createBar(bpuse), "<span style=\"display:none;\">" + fused + "</span>" + fused, "<span style=\"display:none;\">" + fsoft + "</span>" + fsoft, "<span style=\"display:none;\">" + fhard + "</span>" + fhard, "<span style=\"display:none;\">" + fpuse + "</span>" + createBar(fpuse)]);
|
||||
quotas_show = true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* fill the plugin block with table structure
|
||||
*/
|
||||
function quotas_buildTable() {
|
||||
var html = "";
|
||||
|
||||
html += "<table id=\"Plugin_QuotasTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th>" + genlang(3, false, "Quotas") + "</th>\n";
|
||||
html += " <th class=\"right\">" + genlang(4, false, "Quotas") + "</th>\n";
|
||||
html += " <th class=\"right\">" + genlang(5, false, "Quotas") + "</th>\n";
|
||||
html += " <th class=\"right\">" + genlang(6, false, "Quotas") + "</th>\n";
|
||||
html += " <th>" + genlang(7, false, "Quotas") + "</th>\n";
|
||||
html += " <th class=\"right\">" + genlang(8, false, "Quotas") + "</th>\n";
|
||||
html += " <th class=\"right\">" + genlang(9, false, "Quotas") + "</th>\n";
|
||||
html += " <th class=\"right\">" + genlang(10, false, "Quotas") + "</th>\n";
|
||||
html += " <th>" + genlang(11, false, "Quotas") + "</th>\n";
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += "</table>\n";
|
||||
|
||||
$("#Plugin_Quotas").append(html);
|
||||
|
||||
quotas_table = $("#Plugin_QuotasTable").dataTable({
|
||||
"bPaginate": false,
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bProcessing": true,
|
||||
"bAutoWidth": false,
|
||||
"bStateSave": true,
|
||||
"aoColumns": [{
|
||||
"sType": 'span-string'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}, {
|
||||
"sType": 'span-number'
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function quotas_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=Quotas",
|
||||
dataType: "xml",
|
||||
error: function quotas_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin quotas!");
|
||||
},
|
||||
success: function quotas_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
quotas_populate(xml);
|
||||
if (quotas_show) {
|
||||
plugin_translate("Quotas");
|
||||
$("#Plugin_Quotas").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function quotas_buildpage() {
|
||||
$("#footer").before(buildBlock("Quotas", 1, true));
|
||||
$("#Plugin_Quotas").css("width", "915px");
|
||||
|
||||
quotas_buildTable();
|
||||
|
||||
quotas_request();
|
||||
|
||||
$("#Reload_QuotasTable").click(function quotas_reload(id) {
|
||||
quotas_request();
|
||||
$("#Reload_QuotasTable").attr("title",datetime());
|
||||
});
|
||||
});
|
50
root/opt/phpsysinfo/plugins/quotas/js/quotas_bootstrap.js
Normal file
@@ -0,0 +1,50 @@
|
||||
function renderPlugin_quotas(data) {
|
||||
|
||||
var directives = {
|
||||
|
||||
ByteUsed: {
|
||||
text: function () {
|
||||
return formatBytes(this["ByteUsed"], data["Options"]["@attributes"]["byteFormat"]);
|
||||
}
|
||||
},
|
||||
ByteSoft: {
|
||||
text: function () {
|
||||
return formatBytes(this["ByteSoft"], data["Options"]["@attributes"]["byteFormat"]);
|
||||
}
|
||||
},
|
||||
ByteHard: {
|
||||
text: function () {
|
||||
return formatBytes(this["ByteHard"], data["Options"]["@attributes"]["byteFormat"]);
|
||||
}
|
||||
},
|
||||
BytePercentUsed: {
|
||||
html: function () {
|
||||
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width: ' + this["BytePercentUsed"] + '%;"></div>' +
|
||||
'</div><div class="percent">' + this["BytePercentUsed"] + '%</div>';
|
||||
}
|
||||
},
|
||||
FilePercentUsed: {
|
||||
html: function () {
|
||||
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width: ' + this["FilePercentUsed"] + '%;"></div>' +
|
||||
'</div><div class="percent">' + this["FilePercentUsed"] + '%</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (data['Plugins']['Plugin_Quotas'] !== undefined) {
|
||||
var qtitems = items(data['Plugins']['Plugin_Quotas']['Quota']);
|
||||
if (qtitems.length > 0) {
|
||||
var qt_memory = [];
|
||||
qt_memory.push_attrs(qtitems);
|
||||
$('#quotas-data').render(qt_memory, directives);
|
||||
$('#quotas_User').removeClass("sorttable_sorted"); // reset sort order
|
||||
sorttable.innerSortFunction.apply($('#quotas_User')[0], []);
|
||||
|
||||
$('#block_quotas').show();
|
||||
} else {
|
||||
$('#block_quotas').hide();
|
||||
}
|
||||
} else {
|
||||
$('#block_quotas').hide();
|
||||
}
|
||||
}
|
42
root/opt/phpsysinfo/plugins/quotas/lang/cz.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Czech Created by: Tomáš Růžička
|
||||
-->
|
||||
<tns:translationPlugin language="czech" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_quotas_001" name="ps_title">
|
||||
<exp>Stav kvót</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_002" name="quotas_date">
|
||||
<exp>aktualizováno</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_003" name="quotas_user">
|
||||
<exp>Uživatel</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_004" name="quotas_bused">
|
||||
<exp>Využité místo</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_005" name="quotas_bsoft">
|
||||
<exp>Měkký limit</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_006" name="quotas_bhard">
|
||||
<exp>Tvrdý limit</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_007" name="quotas_bpuse">
|
||||
<exp>Procento využití</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_008" name="quotas_fused">
|
||||
<exp>Počet soouborů</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_009" name="quotas_fsoft">
|
||||
<exp>Měkký souborový limit</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_010" name="quotas_fhard">
|
||||
<exp>Tvrdý souborový limit</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_011" name="quotas_fpuse">
|
||||
<exp>Procento využití souborů</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/quotas/lang/de.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: de.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: German Created by: Matthias Freund (MAFLO321)
|
||||
-->
|
||||
<tns:translationPlugin language="german" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_quotas_001" name="ps_title">
|
||||
<exp>Quota Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_002" name="quotas_date">
|
||||
<exp>Letze Aktualisierung</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_003" name="quotas_user">
|
||||
<exp>Benutzer</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_004" name="quotas_bused">
|
||||
<exp>Bytes (Belegt)</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_005" name="quotas_bsoft">
|
||||
<exp>Bytes (Soft Limit)</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_006" name="quotas_bhard">
|
||||
<exp>Bytes (Hard Limit)</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_007" name="quotas_bpuse">
|
||||
<exp>Bytes (Belegt Prozent)</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_008" name="quotas_fused">
|
||||
<exp>Dateien (Benutzt)</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_009" name="quotas_fsoft">
|
||||
<exp>Dateien (Soft Limit)</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_010" name="quotas_fhard">
|
||||
<exp>Dateien (Hard Limit)</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_011" name="quotas_fpuse">
|
||||
<exp>Dateien (Benutzt Prozent)</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/quotas/lang/en.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Michael Cramer
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_quotas_001" name="ps_title">
|
||||
<exp>Quota Status</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_002" name="quotas_date">
|
||||
<exp>Last Refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_003" name="quotas_user">
|
||||
<exp>User</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_004" name="quotas_bused">
|
||||
<exp>Bytes Used</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_005" name="quotas_bsoft">
|
||||
<exp>Bytes Soft</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_006" name="quotas_bhard">
|
||||
<exp>Bytes Hard</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_007" name="quotas_bpuse">
|
||||
<exp>Bytes Used Percent</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_008" name="quotas_fused">
|
||||
<exp>Files Used</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_009" name="quotas_fsoft">
|
||||
<exp>Files Soft</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_010" name="quotas_fhard">
|
||||
<exp>Files Hard</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_011" name="quotas_fpuse">
|
||||
<exp>Files Used Percent</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/quotas/lang/fr.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: Erkan VALENTIN
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_quotas_001" name="ps_title">
|
||||
<exp>Etat des quotas</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_002" name="quotas_date">
|
||||
<exp>Dernière actualisation</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_003" name="quotas_user">
|
||||
<exp>Utilisateurs</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_004" name="quotas_bused">
|
||||
<exp>Espace utilisés</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_005" name="quotas_bsoft">
|
||||
<exp>Espace limite souple</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_006" name="quotas_bhard">
|
||||
<exp>Espace limite stricte</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_007" name="quotas_bpuse">
|
||||
<exp>Pourcentage espace utilisés</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_008" name="quotas_fused">
|
||||
<exp>Inodes utilisés</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_009" name="quotas_fsoft">
|
||||
<exp>Inodes limite souple</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_010" name="quotas_fhard">
|
||||
<exp>Inodes limite stricte</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_011" name="quotas_fpuse">
|
||||
<exp>Pourcentage inodes utilisés</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/quotas/lang/pl.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="polish" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_quotas_001" name="ps_title">
|
||||
<exp>Status Quoty</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_002" name="quotas_date">
|
||||
<exp>Ostatnie odświeżenie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_003" name="quotas_user">
|
||||
<exp>Użytkownik</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_004" name="quotas_bused">
|
||||
<exp>Bajtów wykorzystanych</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_005" name="quotas_bsoft">
|
||||
<exp>Miękki limit bajtów</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_006" name="quotas_bhard">
|
||||
<exp>Twardy limit bajtów</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_007" name="quotas_bpuse">
|
||||
<exp>Procentowo bajtów</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_008" name="quotas_fused">
|
||||
<exp>Plików wykorzystanych</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_009" name="quotas_fsoft">
|
||||
<exp>Miękki limit plików</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_010" name="quotas_fhard">
|
||||
<exp>Twardy limit plików</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_011" name="quotas_fpuse">
|
||||
<exp>Procentowo plików</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/quotas/lang/ro.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: ro.xml 661 2014-05-02 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Romană Created by: Iulian Alexe
|
||||
-->
|
||||
<tns:translationPlugin language="romana" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_quotas_001" name="ps_title">
|
||||
<exp>Stare Quota</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_002" name="quotas_date">
|
||||
<exp>Ultimul refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_003" name="quotas_user">
|
||||
<exp>Utilizator</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_004" name="quotas_bused">
|
||||
<exp>Bytes Folositi</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_005" name="quotas_bsoft">
|
||||
<exp>Bytes Soft</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_006" name="quotas_bhard">
|
||||
<exp>Bytes Hard</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_007" name="quotas_bpuse">
|
||||
<exp>Bytes Percent Folosiți</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_008" name="quotas_fused">
|
||||
<exp>Fișiere Folosite</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_009" name="quotas_fsoft">
|
||||
<exp>Fișiere Soft</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_010" name="quotas_fhard">
|
||||
<exp>Fișiere Hard</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_011" name="quotas_fpuse">
|
||||
<exp>Fișiere Percent Folosite</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
42
root/opt/phpsysinfo/plugins/quotas/lang/ru.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Russian Created by: Denis Sevostyanov (den007)
|
||||
-->
|
||||
<tns:translationPlugin language="russian" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_quotas_001" name="ps_title">
|
||||
<exp>Состояние Квоты</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_002" name="quotas_date">
|
||||
<exp>Последнее обновление</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_003" name="quotas_user">
|
||||
<exp>Пользователь</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_004" name="quotas_bused">
|
||||
<exp>Используется</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_005" name="quotas_bsoft">
|
||||
<exp>Программы</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_006" name="quotas_bhard">
|
||||
<exp>Жесткий диск</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_007" name="quotas_bpuse">
|
||||
<exp>Процентов</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_008" name="quotas_fused">
|
||||
<exp>Файлы Используется</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_009" name="quotas_fsoft">
|
||||
<exp>Файлов программ</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_010" name="quotas_fhard">
|
||||
<exp>Файлы на жестком диске</exp>
|
||||
</expression>
|
||||
<expression id="plugin_quotas_011" name="quotas_fpuse">
|
||||
<exp>Проценты файлов</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
35
root/opt/phpsysinfo/plugins/quotas/quotas_bootstrap.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="col-lg-12" id="block_quotas" style="display:none">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">Quota Status</div>
|
||||
<div class="panel-body">
|
||||
<table id="quotas" class="table table-hover table-condensed sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th id="quotas_User">User</th>
|
||||
<th class="rightCell sorttable_numeric">Bytes Used</th>
|
||||
<th class="rightCell sorttable_numeric">Bytes Soft</th>
|
||||
<th class="rightCell sorttable_numeric">Bytes Hard</th>
|
||||
<th class="rightCell sorttable_numeric">Bytes Used Percent</th>
|
||||
<th class="rightCell sorttable_numeric">Files Used</th>
|
||||
<th class="rightCell sorttable_numeric">Files Soft</th>
|
||||
<th class="rightCell sorttable_numeric">Files Hard</th>
|
||||
<th class="rightCell sorttable_numeric">Files Used Percent</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="quotas-data">
|
||||
<tr>
|
||||
<th><span data-bind="User"></span></th>
|
||||
<td class="rightCell"><span data-bind="ByteUsed"></span></td>
|
||||
<td class="rightCell"><span data-bind="ByteSoft"></span></td>
|
||||
<td class="rightCell"><span data-bind="ByteHard"></span></td>
|
||||
<td class="rightCell"><span data-bind="BytePercentUsed"></span></td>
|
||||
<td class="rightCell"><span data-bind="FileUsed"></span></td>
|
||||
<td class="rightCell"><span data-bind="FileSoft"></span></td>
|
||||
<td class="rightCell"><span data-bind="FileHard"></span></td>
|
||||
<td class="rightCell"><span data-bind="FilePercentUsed"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
302
root/opt/phpsysinfo/plugins/smart/class.smart.inc.php
Normal file
@@ -0,0 +1,302 @@
|
||||
<?php
|
||||
/**
|
||||
* SMART Plugin
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_SMART
|
||||
* @author Antoine Bertin <diaoulael@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version SVN: $Id: class.smart.inc.php 707 2012-11-28 10:20:49Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
/**
|
||||
* SMART plugin, which displays all SMART informations available
|
||||
*
|
||||
* @category PHP
|
||||
* @package PSI_Plugin_SMART
|
||||
* @author Antoine Bertin <diaoulael@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @version Release: 3.0
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
class SMART extends PSI_Plugin
|
||||
{
|
||||
/**
|
||||
* variable, which holds the content of the command
|
||||
* @var array
|
||||
*/
|
||||
private $_filecontent = array();
|
||||
|
||||
/**
|
||||
* variable, which holds the result before the xml is generated out of this array
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* variable, which holds PSI_PLUGIN_SMART_IDS well formated datas
|
||||
* @var array
|
||||
*/
|
||||
private $_ids = array();
|
||||
|
||||
/**
|
||||
* read the data into an internal array and also call the parent constructor
|
||||
*
|
||||
* @param String $enc target encoding
|
||||
*/
|
||||
public function __construct($enc)
|
||||
{
|
||||
parent::__construct(__CLASS__, $enc);
|
||||
switch (strtolower(PSI_PLUGIN_SMART_ACCESS)) {
|
||||
case 'command':
|
||||
if (defined('PSI_PLUGIN_SMART_DEVICES') && is_string(PSI_PLUGIN_SMART_DEVICES)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_DEVICES)) {
|
||||
$disks = eval(PSI_PLUGIN_SMART_DEVICES);
|
||||
} else {
|
||||
$disks = array(PSI_PLUGIN_SMART_DEVICES);
|
||||
}
|
||||
foreach ($disks as $disk) {
|
||||
if (trim($disk) != "") {
|
||||
$diskdev = "";
|
||||
if (preg_match("/\s*\(([^\(\(]*)\)\s*(.*)/", $disk, $devdisk)) {
|
||||
$diskname = trim($devdisk[2]);
|
||||
if (trim($devdisk[1]) != "") {
|
||||
$diskdev = "--device ".preg_replace('/\./', ',', trim($devdisk[1]));
|
||||
}
|
||||
} else {
|
||||
$diskname = trim($disk);
|
||||
}
|
||||
$buffer = "";
|
||||
if (trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {
|
||||
$this->_filecontent[trim($disk)] = $buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (defined('PSI_PLUGIN_SMART_IDS') && is_string(PSI_PLUGIN_SMART_IDS)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_IDS)) {
|
||||
$fullIds = eval(PSI_PLUGIN_SMART_IDS);
|
||||
} else {
|
||||
$fullIds = array(PSI_PLUGIN_SMART_IDS);
|
||||
}
|
||||
foreach ($fullIds as $fullId) {
|
||||
$arrFullId = preg_split('/-/', $fullId);
|
||||
$this->_ids[intval($arrFullId[0])] = strtolower($arrFullId[1]);
|
||||
if (!empty($arrFullId[2]))
|
||||
$this->_ids[intval($arrFullId[2])] = "#replace-".intval($arrFullId[0]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'data':
|
||||
if (defined('PSI_PLUGIN_SMART_DEVICES') && is_string(PSI_PLUGIN_SMART_DEVICES)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_DEVICES)) {
|
||||
$disks = eval(PSI_PLUGIN_SMART_DEVICES);
|
||||
} else {
|
||||
$disks = array(PSI_PLUGIN_SMART_DEVICES);
|
||||
}
|
||||
$dn=0;
|
||||
foreach ($disks as $disk) {
|
||||
$buffer="";
|
||||
if (CommonFunctions::rfts(APP_ROOT."/data/smart{$dn}.txt", $buffer) && !empty($buffer)) {
|
||||
$this->_filecontent[$disk] = $buffer;
|
||||
}
|
||||
$dn++;
|
||||
}
|
||||
}
|
||||
if (defined('PSI_PLUGIN_SMART_IDS') && is_string(PSI_PLUGIN_SMART_IDS)) {
|
||||
if (preg_match(ARRAY_EXP, PSI_PLUGIN_SMART_IDS)) {
|
||||
$fullIds = eval(PSI_PLUGIN_SMART_IDS);
|
||||
} else {
|
||||
$fullIds = array(PSI_PLUGIN_SMART_IDS);
|
||||
}
|
||||
foreach ($fullIds as $fullId) {
|
||||
$arrFullId = preg_split('/-/', $fullId);
|
||||
$this->_ids[intval($arrFullId[0])] = strtolower($arrFullId[1]);
|
||||
if (!empty($arrFullId[2]))
|
||||
$this->_ids[intval($arrFullId[2])] = "#replace-".intval($arrFullId[0]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->global_error->addError("switch(PSI_PLUGIN_SMART_ACCESS)", "Bad SMART configuration in phpsysinfo.ini");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* doing all tasks to get the required informations that the plugin needs
|
||||
* result is stored in an internal array
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if (empty($this->_filecontent) || empty($this->_ids)) {
|
||||
return;
|
||||
}
|
||||
foreach ($this->_filecontent as $disk=>$result) {
|
||||
// set the start and end offset in the result string at the beginning and end respectively
|
||||
// just in case we don't find the two strings, so that it still works as expected.
|
||||
$startIndex = 0;
|
||||
$endIndex = 0;
|
||||
$vendorInfos = "";
|
||||
|
||||
// locate the beginning string offset for the attributes
|
||||
if (preg_match('/(Vendor Specific SMART Attributes with Thresholds)/', $result, $matches, PREG_OFFSET_CAPTURE))
|
||||
$startIndex = $matches[0][1];
|
||||
|
||||
// locate the end string offset for the attributes, this is usually right before string "SMART Error Log Version" or "SMART Error Log not supported" or "Error SMART Error Log Read failed" (hopefully every output has it!)
|
||||
if (preg_match('/(SMART Error Log Version)|(SMART Error Log not supported)|(Error SMART Error Log Read failed)/', $result, $matches, PREG_OFFSET_CAPTURE))
|
||||
$endIndex = $matches[0][1];
|
||||
|
||||
if ($startIndex && $endIndex && ($endIndex>$startIndex))
|
||||
$vendorInfos = preg_split("/\n/", substr($result, $startIndex, $endIndex - $startIndex));
|
||||
|
||||
if (!empty($vendorInfos)) {
|
||||
$labels = preg_split('/\s+/', $vendorInfos[1]);
|
||||
foreach ($labels as $k=>$v) {
|
||||
$labels[$k] = str_replace('#', '', strtolower($v));
|
||||
}
|
||||
$i = 0; // Line number
|
||||
foreach ($vendorInfos as $line) {
|
||||
$line = preg_replace('/^\s+/', '', $line);
|
||||
$values = preg_split('/\s+/', $line);
|
||||
if (count($values) > count($labels)) {
|
||||
$values = array_slice($values, 0, count($labels), true);
|
||||
}
|
||||
$j = 0;
|
||||
$found = false;
|
||||
foreach ($values as $value) {
|
||||
if ((in_array($value, array_keys($this->_ids)) && $labels[$j] == 'id')) {
|
||||
$arrFullVa = preg_split('/-/', $this->_ids[$value]);
|
||||
if (($arrFullVa[0]=="#replace") && !empty($arrFullVa[1]))
|
||||
$value=$arrFullVa[1];
|
||||
}
|
||||
if (((in_array($value, array_keys($this->_ids)) && $labels[$j] == 'id') || ($found && (in_array($labels[$j], array_values($this->_ids)))) || ($found && $labels[$j] == 'attribute_name'))) {
|
||||
$this->_result[$disk][$i][$labels[$j]] = $value;
|
||||
$found = true;
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
//SCSI devices
|
||||
if (!empty($this->_ids[1]) && ($this->_ids[1]=="raw_value")) {
|
||||
preg_match('/read\: (.*)\n/', $result, $lines);
|
||||
if (!empty($lines) && !empty($lines[0])) {
|
||||
$values=preg_split('/\s+/', $lines[0]);
|
||||
if (!empty($values) && ($values[7]!=null)) {
|
||||
$vals=preg_split('/[,\.]/', $values[7]);
|
||||
$this->_result[$disk][0]['id'] = 1;
|
||||
$this->_result[$disk][0]['attribute_name'] = "Raw_Read_Error_Rate";
|
||||
$this->_result[$disk][0]['raw_value'] = $vals[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($this->_ids[5]) && ($this->_ids[5]=="raw_value")) {
|
||||
preg_match('/Elements in grown defect list\: (.*)\n/', $result, $lines);
|
||||
if (!empty($lines) && !empty($lines[0])) {
|
||||
$values=preg_split('/\s+/', $lines[0]);
|
||||
if (!empty($values) && ($values[5]!=null)) {
|
||||
$vals=preg_split('/[,\.]/', $values[5]);
|
||||
$this->_result[$disk][1]['id'] = 5;
|
||||
$this->_result[$disk][1]['attribute_name'] = "Reallocated_Sector_Ct";
|
||||
$this->_result[$disk][1]['raw_value'] = $vals[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($this->_ids[9]) && ($this->_ids[9]=="raw_value")) {
|
||||
preg_match('/ number of hours powered up = (.*)\n/', $result, $lines);
|
||||
if (!empty($lines) && !empty($lines[0])) {
|
||||
$values=preg_split('/\s+/', $lines[0]);
|
||||
if (!empty($values) && ($values[7]!=null)) {
|
||||
$vals=preg_split('/[,\.]/', $values[7]);
|
||||
$this->_result[$disk][2]['id'] = 9;
|
||||
$this->_result[$disk][2]['attribute_name'] = "Power_On_Hours";
|
||||
$this->_result[$disk][2]['raw_value'] = $vals[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($this->_ids[194]) && ($this->_ids[194]=="raw_value")) {
|
||||
preg_match('/Current Drive Temperature\: (.*)\n/', $result, $lines);
|
||||
if (!empty($lines) && !empty($lines[0])) {
|
||||
$values=preg_split('/\s+/', $lines[0]);
|
||||
if (!empty($values) && ($values[3]!=null)) {
|
||||
$vals=preg_split('/[,\.]/', $values[3]);
|
||||
$this->_result[$disk][3]['id'] = 194;
|
||||
$this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius";
|
||||
$this->_result[$disk][3]['raw_value'] = $vals[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Usage test
|
||||
$newIds = array();
|
||||
foreach ($this->_ids as $id=>$column_name) {
|
||||
$found = 0;
|
||||
foreach ($this->_result as $diskName=>$diskInfos) {
|
||||
if ($found!=2) foreach ($diskInfos as $lineInfos) {
|
||||
if ($found!=2) {
|
||||
$found = 0;
|
||||
foreach ($lineInfos as $label=>$value) {
|
||||
if (($found==0) && ($label=="id") && ($value==$id))
|
||||
$found = 1;
|
||||
if (($found==1) && ($label==$column_name))
|
||||
$found = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($found==2) $newIds[$id] = $this->_ids[$id];
|
||||
}
|
||||
$this->_ids = $newIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the XML content for the plugin
|
||||
*
|
||||
* @return SimpleXMLObject entire XML content for the plugin
|
||||
*/
|
||||
public function xml()
|
||||
{
|
||||
if (empty($this->_result) || empty($this->_ids)) {
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
|
||||
$columnsChild = $this->xml->addChild('columns');
|
||||
// Fill the xml with preferences
|
||||
foreach ($this->_ids as $id=>$column_name) {
|
||||
$columnChild = $columnsChild->addChild('column');
|
||||
$columnChild->addAttribute('id', $id);
|
||||
$columnChild->addAttribute('name', $column_name);
|
||||
}
|
||||
|
||||
$disksChild = $this->xml->addChild('disks');
|
||||
// Now fill the xml with S.M.A.R.T datas
|
||||
foreach ($this->_result as $diskName=>$diskInfos) {
|
||||
$diskChild = $disksChild->addChild('disk');
|
||||
$diskChild->addAttribute('name', $diskName);
|
||||
foreach ($diskInfos as $lineInfos) {
|
||||
$lineChild = $diskChild->addChild('attribute');
|
||||
|
||||
if (($lineInfos['id'] == 9) && ($lineInfos['attribute_name'] == "Power_On_Hours_and_Msec")) {
|
||||
$lineInfos['attribute_name'] = "Power_On_Hours";
|
||||
$raw_value = preg_split("/h/", $lineInfos['raw_value'], -1, PREG_SPLIT_NO_EMPTY);
|
||||
$lineInfos['raw_value'] = $raw_value[0];
|
||||
}
|
||||
|
||||
foreach ($lineInfos as $label=>$value) {
|
||||
$lineChild->addAttribute($label, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->xml->getSimpleXmlElement();
|
||||
}
|
||||
}
|
6
root/opt/phpsysinfo/plugins/smart/css/smart.css
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
$Id: smart.css 661 2012-08-27 11:26:39Z namiltd $
|
||||
*/
|
||||
#Plugin_SMARTTable tbody tr td {
|
||||
text-align: right;
|
||||
}
|
166
root/opt/phpsysinfo/plugins/smart/js/smart.js
Normal file
@@ -0,0 +1,166 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by phpSysInfo - A PHP System Information Script *
|
||||
* http://phpsysinfo.sourceforge.net/ *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
//$Id: smart.js 707 2012-11-28 10:20:49Z namiltd $
|
||||
|
||||
|
||||
/*global $, jQuery, genlang, formatTemp, plugin_translate, buildBlock, datetime */
|
||||
|
||||
"use strict";
|
||||
|
||||
var smart_show = false, smart_table;
|
||||
|
||||
//appendcss("./plugins/SMART/css/SMART.css");
|
||||
|
||||
/**
|
||||
* fill the plugin block with table structure
|
||||
*/
|
||||
function smart_buildTable(xml) {
|
||||
var html = "";
|
||||
|
||||
html += "<table id=\"Plugin_SMARTTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th class=\"right\">" + genlang(3, false, "SMART") + "</th>\n";
|
||||
$("Plugins Plugin_SMART columns column", xml).each(function smart_table_header() {
|
||||
html += " <th class=\"right\">" + genlang(100 + parseInt($(this).attr("id"), 10), false, "SMART") + "</th>\n";
|
||||
});
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += "</table>\n";
|
||||
|
||||
$("#Plugin_SMART").append(html);
|
||||
|
||||
smart_table = $("#Plugin_SMARTTable").dataTable({
|
||||
"bPaginate": false,
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bProcessing": true,
|
||||
"bAutoWidth": false,
|
||||
"bStateSave": true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* insert content into table
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function smart_populate(xml) {
|
||||
var name = "", columns = [];
|
||||
smart_table.fnClearTable();
|
||||
|
||||
// Get datas that the user want to be displayed
|
||||
$("Plugins Plugin_SMART columns column", xml).each(function smart_find_columns() {
|
||||
columns[parseInt($(this).attr("id"), 10)] = $(this).attr("name");
|
||||
});
|
||||
|
||||
// Now we add selected datas in the table
|
||||
$("Plugins Plugin_SMART disks disk", xml).each(function smart_fill_table() {
|
||||
var values = [], display = [], i;
|
||||
name = $(this).attr("name");
|
||||
$(this).find("attribute").each(function smart_fill_data() {
|
||||
if (columns[parseInt($(this).attr("id"), 10)] && columns[parseInt($(this).attr("id"), 10)] !== "") {
|
||||
values[parseInt($(this).attr("id"), 10)] = $(this).attr(columns[parseInt($(this).attr("id"), 10)]);
|
||||
}
|
||||
});
|
||||
|
||||
display.push("<span style=\"display:none;\">" + name + "</span>" + name);
|
||||
|
||||
// On "columns" so we get the right order
|
||||
// fixed for Firefox (fix wrong order)
|
||||
// for (i in columns) {
|
||||
$("Plugins Plugin_SMART columns column", xml).each(function smart_find_columns() {
|
||||
i = parseInt($(this).attr("id"), 10);
|
||||
if (typeof(values[i])==='undefined') {
|
||||
// values[i] = "";
|
||||
display.push("<span style=\"display:none;\"></span>");
|
||||
}
|
||||
else if (i === 194) {
|
||||
display.push("<span style=\"display:none;\">" + values[i] + "</span>" + formatTemp(values[i], xml));
|
||||
}
|
||||
else {
|
||||
display.push("<span style=\"display:none;\">" + values[i] + "</span>" + values[i]);
|
||||
}
|
||||
// }
|
||||
});
|
||||
smart_table.fnAddData(display);
|
||||
});
|
||||
smart_show = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function smart_initTable() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=SMART",
|
||||
dataType: "xml",
|
||||
error: function smart_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin SMART");
|
||||
},
|
||||
success: function smart_initBlock(xml) {
|
||||
smart_buildTable(xml);
|
||||
smart_populate(xml);
|
||||
if (smart_show) {
|
||||
plugin_translate("SMART");
|
||||
$("#Plugin_SMART").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function smart_request() {
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=SMART",
|
||||
dataType: "xml",
|
||||
error: function smart_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin SMART");
|
||||
},
|
||||
success: function smart_buildBlock(xml) {
|
||||
populateErrors(xml);
|
||||
smart_populate(xml);
|
||||
if (smart_show) {
|
||||
plugin_translate("SMART");
|
||||
$("#Plugin_SMART").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function smart_buildpage() {
|
||||
var html = "";
|
||||
|
||||
$("#footer").before(buildBlock("SMART", 1, true));
|
||||
$("#Plugin_SMART").css("width", "915px");
|
||||
|
||||
smart_initTable();
|
||||
|
||||
$("#Reload_SMARTTable").click(function smart_reload(id) {
|
||||
smart_request();
|
||||
$("#Reload_SMARTTable").attr("title",datetime());
|
||||
});
|
||||
});
|
84
root/opt/phpsysinfo/plugins/smart/js/smart_bootstrap.js
Normal file
@@ -0,0 +1,84 @@
|
||||
function renderPlugin_smart(data) {
|
||||
|
||||
if ((data['Plugins']['Plugin_SMART'] !== undefined) && (data['Plugins']['Plugin_SMART']["columns"] !== undefined) && (items(data['Plugins']['Plugin_SMART']["columns"]["column"]).length > 0)
|
||||
&& (data['Plugins']['Plugin_SMART']["disks"] !== undefined) && (items(data['Plugins']['Plugin_SMART']["disks"]["disk"]).length > 0)) {
|
||||
var smartitems = items(data['Plugins']['Plugin_SMART']["columns"]["column"]);
|
||||
var smartnames = {
|
||||
1:"Raw Read Error Rate",
|
||||
2:"Throughput Performance",
|
||||
3:"Spin Up Time",
|
||||
4:"Start Stop Count",
|
||||
5:"Reallocated Sector Ct",
|
||||
7:"Seek Error Rate",
|
||||
8:"Seek Time Performance",
|
||||
9:"Power On Hours",
|
||||
10:"Spin Retry Count",
|
||||
11:"Calibration Retry Count",
|
||||
12:"Power Cycle Count",
|
||||
190:"Airflow Temperature",
|
||||
191:"G-sense Error Rate",
|
||||
192:"Power-Off Retract Count",
|
||||
193:"Load Cycle Count",
|
||||
194:"Temperature",
|
||||
195:"Hardware ECC Recovered",
|
||||
196:"Reallocated Event Count",
|
||||
197:"Current Pending Sector",
|
||||
198:"Offline Uncorr.",
|
||||
199:"UDMA CRC Error Count",
|
||||
200:"Multi Zone Error Rate",
|
||||
201:"Soft Read Error Rate",
|
||||
202:"Data Address Mark Errors",
|
||||
223:"Load Retry Count",
|
||||
225:"Load Cycle Count"};
|
||||
|
||||
var html = '';
|
||||
|
||||
html+="<thead>";
|
||||
html+="<tr>";
|
||||
html+="<th id=\"smart_name\" class=\"rightCell\">Name</th>";
|
||||
for (i = 0; i < smartitems.length ; i++) {
|
||||
smartid = smartitems[i]["@attributes"]["id"];
|
||||
if (smartnames[smartid] !== undefined) {
|
||||
html+="<th class=\"sorttable_numeric rightCell\">"+ smartnames[smartid] + "</th>";
|
||||
} else {
|
||||
html+="<th class=\"sorttable_numeric rightCell\">"+ smartid + "</th>";
|
||||
}
|
||||
}
|
||||
html+="</tr>";
|
||||
html+="</thead>";
|
||||
|
||||
var diskitems = items(data['Plugins']['Plugin_SMART']["disks"]["disk"]);
|
||||
html += '<tbody>';
|
||||
for (i = 0; i < diskitems.length; i++) {
|
||||
html += '<tr>';
|
||||
html += '<th class="rightCell">'+ diskitems[i]["@attributes"]["name"] + '</th>';
|
||||
attribitems = items(diskitems[i]["attribute"]);
|
||||
var valarray = [];
|
||||
for (j = 0;j < attribitems.length; j++) {
|
||||
valarray[attribitems[j]["@attributes"]["id"]] = attribitems[j]["@attributes"]["raw_value"];
|
||||
}
|
||||
for (j = 0; j < smartitems.length; j++) {
|
||||
var smartid = smartitems[j]["@attributes"]["id"];
|
||||
var itemvalue = valarray[smartid];
|
||||
if ((itemvalue !== undefined) && (itemvalue !== '' )) {
|
||||
if (smartid === "194") {
|
||||
html += '<td class="rightCell">' + formatTemp(itemvalue, data["Options"]["@attributes"]["tempFormat"]) + '</td>';
|
||||
} else {
|
||||
html += '<td class="rightCell">' + itemvalue + '</td>';
|
||||
}
|
||||
} else {
|
||||
html += '<td></td>';
|
||||
}
|
||||
}
|
||||
html += '</tr>';
|
||||
}
|
||||
html += '</tbody>';
|
||||
$('#smart').empty().append(html);
|
||||
$('#smart').addClass("sortable");
|
||||
sorttable.makeSortable($('#smart')[0]);
|
||||
sorttable.innerSortFunction.apply($('#smart_name')[0], []);
|
||||
$('#block_smart').show();
|
||||
} else {
|
||||
$('#block_smart').hide();
|
||||
}
|
||||
}
|
97
root/opt/phpsysinfo/plugins/smart/lang/cz.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: cz.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Czech Created by: Tomáš Růžička
|
||||
-->
|
||||
<tns:translationPlugin language="czech" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_smart_001" name="smart_title">
|
||||
<exp>S.M.A.R.T Informace</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_002" name="smart_date">
|
||||
<exp>Aktualizováno</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_003" name="smart_name">
|
||||
<exp>Název</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_101" name="smart_raw_read_error_rate">
|
||||
<exp>Raw Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_102" name="smart_throughput_performance">
|
||||
<exp>Throughput Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_103" name="smart_spin_up_time">
|
||||
<exp>Spin Up Time</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_104" name="smart_start_stop_count">
|
||||
<exp>Start Stop Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_105" name="smart_reallocated_sector_ct">
|
||||
<exp>Reallocated Sector Ct</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_107" name="smart_seek_error_rate">
|
||||
<exp>Seek Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_108" name="smart_seek_time_performance">
|
||||
<exp>Seek Time Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_109" name="smart_power_on_hours">
|
||||
<exp>Power On Hours</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_110" name="smart_spin_retry_count">
|
||||
<exp>Spin Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_111" name="smart_calibration_retry_count">
|
||||
<exp>Calibration Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_112" name="smart_power_cycle_count">
|
||||
<exp>Power Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_290" name="smart_airflow_temperature_cel">
|
||||
<exp>Airflow Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_291" name="smart_g_sense_error_rate">
|
||||
<exp>G-sense Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_292" name="smart_power_off_retry_count">
|
||||
<exp>Power-Off Retract Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_293" name="smart_load_cycle_count">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_294" name="smart_temperature">
|
||||
<exp>Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_295" name="smart_hardware_ecc_recovered">
|
||||
<exp>Hardware ECC Recovered</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_296" name="smart_reallocated_event_count">
|
||||
<exp>Reallocated Event Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_297" name="smart_current_pending_sector">
|
||||
<exp>Current Pending Sector</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_298" name="smart_offline_uncorrectable">
|
||||
<exp>Offline Uncorr.</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_299" name="smart_udma_crc_error_count">
|
||||
<exp>UDMA CRC Error Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_300" name="smart_multi_zone_error_rate">
|
||||
<exp>Multi Zone Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_301" name="smart_soft_read_error_rate">
|
||||
<exp>Soft Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_302" name="smart_data_address_mark_errs">
|
||||
<exp>Data Address Mark Errors</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_323" name="smart_load_retry_count">
|
||||
<exp>Load Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_325" name="smart_load_cycle_count_alt">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
97
root/opt/phpsysinfo/plugins/smart/lang/en.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: en.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: English Created by: Antoine Bertin
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_smart_001" name="smart_title">
|
||||
<exp>S.M.A.R.T Informations</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_002" name="smart_date">
|
||||
<exp>Last refresh</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_003" name="smart_name">
|
||||
<exp>Name</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_101" name="smart_raw_read_error_rate">
|
||||
<exp>Raw Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_102" name="smart_throughput_performance">
|
||||
<exp>Throughput Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_103" name="smart_spin_up_time">
|
||||
<exp>Spin Up Time</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_104" name="smart_start_stop_count">
|
||||
<exp>Start Stop Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_105" name="smart_reallocated_sector_ct">
|
||||
<exp>Reallocated Sector Ct</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_107" name="smart_seek_error_rate">
|
||||
<exp>Seek Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_108" name="smart_seek_time_performance">
|
||||
<exp>Seek Time Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_109" name="smart_power_on_hours">
|
||||
<exp>Power On Hours</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_110" name="smart_spin_retry_count">
|
||||
<exp>Spin Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_111" name="smart_calibration_retry_count">
|
||||
<exp>Calibration Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_112" name="smart_power_cycle_count">
|
||||
<exp>Power Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_290" name="smart_airflow_temperature_cel">
|
||||
<exp>Airflow Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_291" name="smart_g_sense_error_rate">
|
||||
<exp>G-sense Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_292" name="smart_power_off_retry_count">
|
||||
<exp>Power-Off Retract Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_293" name="smart_load_cycle_count">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_294" name="smart_temperature">
|
||||
<exp>Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_295" name="smart_hardware_ecc_recovered">
|
||||
<exp>Hardware ECC Recovered</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_296" name="smart_reallocated_event_count">
|
||||
<exp>Reallocated Event Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_297" name="smart_current_pending_sector">
|
||||
<exp>Current Pending Sector</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_298" name="smart_offline_uncorrectable">
|
||||
<exp>Offline Uncorr.</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_299" name="smart_udma_crc_error_count">
|
||||
<exp>UDMA CRC Error Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_300" name="smart_multi_zone_error_rate">
|
||||
<exp>Multi Zone Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_301" name="smart_soft_read_error_rate">
|
||||
<exp>Soft Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_302" name="smart_data_address_mark_errs">
|
||||
<exp>Data Address Mark Errors</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_323" name="smart_load_retry_count">
|
||||
<exp>Load Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_325" name="smart_load_cycle_count_alt">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
97
root/opt/phpsysinfo/plugins/smart/lang/fr.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: fr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: French Created by: Antoine Bertin
|
||||
-->
|
||||
<tns:translationPlugin language="french" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_smart_001" name="smart_title">
|
||||
<exp>Informations S.M.A.R.T</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_002" name="smart_date">
|
||||
<exp>Dernière actualisation:</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_003" name="smart_name">
|
||||
<exp>Nom</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_101" name="smart_raw_read_error_rate">
|
||||
<exp>Raw Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_102" name="smart_throughput_performance">
|
||||
<exp>Throughput Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_103" name="smart_spin_up_time">
|
||||
<exp>Spin Up Time</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_104" name="smart_start_stop_count">
|
||||
<exp>Start Stop Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_105" name="smart_reallocated_sector_ct">
|
||||
<exp>Reallocated Sector Ct</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_107" name="smart_seek_error_rate">
|
||||
<exp>Seek Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_108" name="smart_seek_time_performance">
|
||||
<exp>Seek Time Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_109" name="smart_power_on_hours">
|
||||
<exp>Power On Hours</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_110" name="smart_spin_retry_count">
|
||||
<exp>Spin Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_111" name="smart_calibration_retry_count">
|
||||
<exp>Calibration Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_112" name="smart_power_cycle_count">
|
||||
<exp>Power Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_290" name="smart_airflow_temperature_cel">
|
||||
<exp>Airflow Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_291" name="smart_g_sense_error_rate">
|
||||
<exp>G-sense Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_292" name="smart_power_off_retry_count">
|
||||
<exp>Power-Off Retract Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_293" name="smart_load_cycle_count">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_294" name="smart_temperature">
|
||||
<exp>Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_295" name="smart_hardware_ecc_recovered">
|
||||
<exp>Hardware ECC Recovered</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_296" name="smart_reallocated_event_count">
|
||||
<exp>Reallocated Event Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_297" name="smart_current_pending_sector">
|
||||
<exp>Current Pending Sector</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_298" name="smart_offline_uncorrectable">
|
||||
<exp>Offline Uncorr.</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_299" name="smart_udma_crc_error_count">
|
||||
<exp>UDMA CRC Error Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_300" name="smart_multi_zone_error_rate">
|
||||
<exp>Multi Zone Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_301" name="smart_soft_read_error_rate">
|
||||
<exp>Soft Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_302" name="smart_data_address_mark_errs">
|
||||
<exp>Data Address Mark Errors</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_323" name="smart_load_retry_count">
|
||||
<exp>Load Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_325" name="smart_load_cycle_count_alt">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
97
root/opt/phpsysinfo/plugins/smart/lang/gr.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: gr.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Greek Created by: mojiro
|
||||
-->
|
||||
<tns:translationPlugin language="english" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_smart_001" name="smart_title">
|
||||
<exp>Πληροφορίες S.M.A.R.T</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_002" name="smart_date">
|
||||
<exp>Ενημέρωση</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_003" name="smart_name">
|
||||
<exp>Συσκευή</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_101" name="smart_raw_read_error_rate">
|
||||
<exp>Raw Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_102" name="smart_throughput_performance">
|
||||
<exp>Throughput Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_103" name="smart_spin_up_time">
|
||||
<exp>Spin Up Time</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_104" name="smart_start_stop_count">
|
||||
<exp>Start Stop Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_105" name="smart_reallocated_sector_ct">
|
||||
<exp>Ανακτημένοι Τομείς</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_107" name="smart_seek_error_rate">
|
||||
<exp>Seek Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_108" name="smart_seek_time_performance">
|
||||
<exp>Seek Time Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_109" name="smart_power_on_hours">
|
||||
<exp>Ώρες λειτουργίας</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_110" name="smart_spin_retry_count">
|
||||
<exp>Spin Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_111" name="smart_calibration_retry_count">
|
||||
<exp>Calibration Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_112" name="smart_power_cycle_count">
|
||||
<exp>Power Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_290" name="smart_airflow_temperature_cel">
|
||||
<exp>Θερμοκρασία Αέρος</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_291" name="smart_g_sense_error_rate">
|
||||
<exp>G-sense Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_292" name="smart_power_off_retry_count">
|
||||
<exp>Power-Off Retract Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_293" name="smart_load_cycle_count">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_294" name="smart_temperature">
|
||||
<exp>Θερμοκρασία</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_295" name="smart_hardware_ecc_recovered">
|
||||
<exp>Hardware ECC Recovered</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_296" name="smart_reallocated_event_count">
|
||||
<exp>Reallocated Event Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_297" name="smart_current_pending_sector">
|
||||
<exp>Current Pending Sector</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_298" name="smart_offline_uncorrectable">
|
||||
<exp>Offline Uncorr.</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_299" name="smart_udma_crc_error_count">
|
||||
<exp>UDMA CRC Error Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_300" name="smart_multi_zone_error_rate">
|
||||
<exp>Multi Zone Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_301" name="smart_soft_read_error_rate">
|
||||
<exp>Soft Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_302" name="smart_data_address_mark_errs">
|
||||
<exp>Data Address Mark Errors</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_323" name="smart_load_retry_count">
|
||||
<exp>Load Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_325" name="smart_load_cycle_count_alt">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|
97
root/opt/phpsysinfo/plugins/smart/lang/pl.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Id: pl.xml 661 2012-08-27 11:26:39Z namiltd $ -->
|
||||
<!--
|
||||
phpSysInfo language file Language: Polish Created by: Mieczyslaw Nalewaj
|
||||
-->
|
||||
<tns:translationPlugin language="polish" charset="utf-8"
|
||||
xmlns:tns="http://phpsysinfo.sourceforge.net/translation-plugin"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://phpsysinfo.sourceforge.net/translation-plugin ../../../language/translation-plugin.xsd">
|
||||
<expression id="plugin_smart_001" name="smart_title">
|
||||
<exp>Informacje S.M.A.R.T</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_002" name="smart_date">
|
||||
<exp>Ostatnie odświeżenie</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_003" name="smart_name">
|
||||
<exp>Nazwa</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_101" name="smart_raw_read_error_rate">
|
||||
<exp>Raw Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_102" name="smart_throughput_performance">
|
||||
<exp>Throughput Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_103" name="smart_spin_up_time">
|
||||
<exp>Spin Up Time</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_104" name="smart_start_stop_count">
|
||||
<exp>Start Stop Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_105" name="smart_reallocated_sector_ct">
|
||||
<exp>Reallocated Sector Ct</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_107" name="smart_seek_error_rate">
|
||||
<exp>Seek Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_108" name="smart_seek_time_performance">
|
||||
<exp>Seek Time Performance</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_109" name="smart_power_on_hours">
|
||||
<exp>Power On Hours</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_110" name="smart_spin_retry_count">
|
||||
<exp>Spin Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_111" name="smart_calibration_retry_count">
|
||||
<exp>Calibration Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_112" name="smart_power_cycle_count">
|
||||
<exp>Power Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_290" name="smart_airflow_temperature_cel">
|
||||
<exp>Airflow Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_291" name="smart_g_sense_error_rate">
|
||||
<exp>G-sense Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_292" name="smart_power_off_retry_count">
|
||||
<exp>Power-Off Retract Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_293" name="smart_load_cycle_count">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_294" name="smart_temperature">
|
||||
<exp>Temperature</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_295" name="smart_hardware_ecc_recovered">
|
||||
<exp>Hardware ECC Recovered</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_296" name="smart_reallocated_event_count">
|
||||
<exp>Reallocated Event Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_297" name="smart_current_pending_sector">
|
||||
<exp>Current Pending Sector</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_298" name="smart_offline_uncorrectable">
|
||||
<exp>Offline Uncorr.</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_299" name="smart_udma_crc_error_count">
|
||||
<exp>UDMA CRC Error Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_300" name="smart_multi_zone_error_rate">
|
||||
<exp>Multi Zone Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_301" name="smart_soft_read_error_rate">
|
||||
<exp>Soft Read Error Rate</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_302" name="smart_data_address_mark_errs">
|
||||
<exp>Data Address Mark Errors</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_323" name="smart_load_retry_count">
|
||||
<exp>Load Retry Count</exp>
|
||||
</expression>
|
||||
<expression id="plugin_smart_325" name="smart_load_cycle_count_alt">
|
||||
<exp>Load Cycle Count</exp>
|
||||
</expression>
|
||||
</tns:translationPlugin>
|