Skip to content

Commit

Permalink
Active Operations
Browse files Browse the repository at this point in the history
  • Loading branch information
namiltd committed Dec 24, 2022
1 parent 99bfefa commit f37f671
Show file tree
Hide file tree
Showing 3 changed files with 534 additions and 4 deletions.
4 changes: 2 additions & 2 deletions phpsysinfo.ini.new
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ SHOW_SERIAL=false
; downloaded from http://hwraid.le-vert.net or https://github.com/eLvErDe/hwraid or https://github.com/ElCoyote27/hwraid
; - graid: command "graid list" is run (on FreeBSD only)
; - zpool: command "zpool status" is run
; - storcli: command "storcli64 /call show all" or "storcli /call show all" is run
; - perccli: command "perccli64 /call show all" or "perccli /call show all" is run
; - storcli: command "storcli64 /call show all; storcli64 /call /vall show all" or "storcli /call show all; storcli /call /vall show all" is run
; - perccli: command "perccli64 /call show all; perccli64 /call /vall show all" or "perccli /call show all; perccli /call /vall show all" is run
; - idrac: command "snmpwalk -Ona -c public -v 1 -r 0 -t 3 {device} .1.3.6.1.4.1.674.10892.5.5.1.20" is run
; - "php-snmp"- idrac: execute php snmprealwalk function (php-snmp module must be installed)
; - for others the option is inactive (uses "command" instead)
Expand Down
30 changes: 28 additions & 2 deletions plugins/raid/class.raid.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,32 @@ private function execute_storcli($buffer, $_perccli = false)
if ($topol["DG"] != $dg) {
$dg = $topol["DG"];
$uname = 'c'.$cnr.'u'.$dg;
if (isset($controller["VD".$dg." Properties"]["Strip Size"]) && preg_match("/^(\d+)\s*(\S+)$/", $controller["VD".$dg." Properties"]["Strip Size"], $value)) {
switch ($value[2]) {
case 'B':
$this->_result[$prog][$uname]['stripe_size'] = $value[1];
break;
case 'KB':
$this->_result[$prog][$uname]['stripe_size'] = 1024*$value[1];
break;
case 'MB':
$this->_result[$prog][$uname]['stripe_size'] = 1024*1024*$value[1];
break;
case 'GB':
$this->_result[$prog][$uname]['stripe_size'] = 1024*1024*1024*$value[1];
break;
case 'TB':
$this->_result[$prog][$uname]['stripe_size'] = 1024*1024*1024*1024*$value[1];
break;
case 'PB':
$this->_result[$prog][$uname]['stripe_size'] = 1024*1024*1024*1024*1024*$value[1];
}
}
if (isset($controller["VD".$dg." Properties"]["Active Operations"]) && preg_match("/^(.+) \((\d+)%\)/", $controller["VD".$dg." Properties"]["Active Operations"], $progarr)) {
//$this->_result[$prog][$uname]['items'][$pname]['status'] = "W";
$this->_result[$prog][$uname]['action']['name'] = trim($progarr[1]);
$this->_result[$prog][$uname]['action']['percent'] = trim($progarr[2]);
}
if (isset($controller["Basics"]["Model"])) $this->_result[$prog][$uname]['controller'] = $controller["Basics"]["Model"];
if (isset($controller["Version"]["Firmware Package Build"])) $this->_result[$prog][$uname]['firmware'] = $controller["Version"]["Firmware Package Build"];
if (isset($controller["Status"]["Controller Status"])) {
Expand Down Expand Up @@ -1931,7 +1957,7 @@ private function execute_storcli($buffer, $_perccli = false)
}
if (isset($controller["Capabilities"]["RAID Level Supported"])) $this->_result[$prog][$uname]['supported'] = $controller["Capabilities"]["RAID Level Supported"];
if (isset($controller["HwCfg"]["ROC temperature(Degree Celsius)"])) $this->_result[$prog][$uname]['temperature'] = $controller["HwCfg"]["ROC temperature(Degree Celsius)"];
if (isset($controller["HwCfg"]["On Board Memory Size"]) && preg_match("/^(\d+)(\S+)$/", $controller["HwCfg"]["On Board Memory Size"], $value)) {
if (isset($controller["HwCfg"]["On Board Memory Size"]) && preg_match("/^(\d+)\s*(\S+)$/", $controller["HwCfg"]["On Board Memory Size"], $value)) {
switch ($value[2]) {
case 'B':
$this->_result[$prog][$uname]['cache_size'] = $value[1];
Expand Down Expand Up @@ -2279,7 +2305,7 @@ private function execute_storcli($buffer, $_perccli = false)
}
}
if (isset($controller["Capabilities"]["RAID Level Supported"])) $this->_result[$prog][$cname]['supported'] = $controller["Capabilities"]["RAID Level Supported"];
if (isset($controller["HwCfg"]["On Board Memory Size"]) && preg_match("/^(\d+)(\S+)$/", $controller["HwCfg"]["On Board Memory Size"], $value)) {
if (isset($controller["HwCfg"]["On Board Memory Size"]) && preg_match("/^(\d+)\s*(\S+)$/", $controller["HwCfg"]["On Board Memory Size"], $value)) {
switch ($value[2]) {
case 'B':
$this->_result[$prog][$cname]['cache_size'] = $value[1];
Expand Down

0 comments on commit f37f671

Please sign in to comment.