Subversion Repositories ALCASAR

Compare Revisions

No changes between revisions

Ignore whitespace Rev 2803 → Rev 2802

/web/acc/phpsysinfo/plugins/ps/js/ps.js
0,0 → 1,142
/***************************************************************************
* 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 = [], memwas = false, cpuwas = false;
 
$("#Plugin_PS #Plugin_PSTable").remove();
 
html += " <div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_PSTable\" class=\"tablemain\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th>" + genlang(2, "PS") + "</th>\n";
html += " <th style=\"width:40px;\">" + genlang(3, "PS") + "</th>\n";
html += " <th style=\"width:40px;\">" + genlang(4, "PS") + "</th>\n";
html += " <th style=\"width:120px;\">" + genlang(5, "PS") + "</th>\n";
html += " <th style=\"width:120px;\">" + genlang(6, "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, cpu = 0;
name = $(this).attr("Name").replace(/,/g, ",<wbr>").replace(/\s/g, " <wbr>").replace(/\./g, ".<wbr>").replace(/-/g, "<wbr>-").replace(/\//g, "<wbr>/"); /* split long 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);
cpu = parseInt($(this).attr("CPUUsage"), 10);
expanded = parseInt($(this).attr("Expanded"), 10);
 
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + name + "</div></span></td><td>" + pid + "</td><td>" + ppid + "</td><td>" + createBar(percent) + "</td><td>" + createBar(cpu) + "</td></tr>\n";
close = tree.push(parentId);
if (!isNaN(expanded) && (expanded === 0)) {
closed.push(close);
}
if (!memwas && !isNaN(percent)) {
memwas = true;
}
if (!cpuwas && !isNaN(cpu)) {
cpuwas = true;
}
ps_show = true;
});
 
html += " </tbody>\n";
html += " </table>\n";
html += " </div>\n";
 
$("#Plugin_PS").append(html);
 
if (memwas) {
$('#Plugin_PSTable td:nth-child(4),#Plugin_PSTable th:nth-child(4)').show();
} else {
$('#Plugin_PSTable td:nth-child(4),#Plugin_PSTable th:nth-child(4)').hide();
}
if (cpuwas) {
$('#Plugin_PSTable td:nth-child(5),#Plugin_PSTable th:nth-child(5)').show();
} else {
$('#Plugin_PSTable td:nth-child(5),#Plugin_PSTable th:nth-child(5)').hide();
}
 
$("#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() {
$("#Reload_PSTable").attr("title", "reload");
$.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();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/ps/js/ps_bootstrap.js
0,0 → 1,85
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>';
}
},
CPUUsage: {
html: function () {
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width:' + this.CPUUsage + '%;"></div>' +
'</div><div class="percent">' + this.CPUUsage + '%</div>';
}
},
Name: {
html: function () {
return this.Name.replace(/,/g, ",<wbr>").replace(/\s/g, " <wbr>").replace(/\./g, ".<wbr>").replace(/-/g, "<wbr>-").replace(/\//g, "<wbr>/"); /* split long name */
}
}
};
 
if (data.Plugins.Plugin_PS !== undefined) {
var psitems = items(data.Plugins.Plugin_PS.Process);
if (psitems.length > 0) {
 
var html = "", ps_item = [], expanded = 0, memwas = false, cpuwas = false;
for (var i = 0; i < psitems.length ; i++) {
ps_item = psitems[i]["@attributes"];
 
if (ps_item.ParentID === "0") {
html+="<tr id=\"ps-" + (i+1) + "\" class=\"treegrid-ps-" + (i+1) + "\" style=\"display:none;\" >";
} else {
html+="<tr id=\"ps-" + (i+1) + "\" class=\"treegrid-ps-" + (i+1) + " treegrid-parent-ps-" + ps_item.ParentID + "\" style=\"display:none;\" >";
}
html+="<td><span class=\"treegrid-span\" data-bind=\"Name\"></span></td>";
html+="<td><span data-bind=\"PID\"></span></td>";
html+="<td><span data-bind=\"PPID\"></span></td>";
html+="<td style=\"width:10%;\"><span data-bind=\"MemoryUsage\"></span></td>";
html+="<td style=\"width:10%;\"><span data-bind=\"CPUUsage\"></span></td>";
html+="</tr>";
}
 
$("#ps-data").empty().append(html);
 
$('#ps').treegrid({
initialState: 'expanded',
expanderExpandedClass: 'normalicon normalicon-down',
expanderCollapsedClass: 'normalicon normalicon-right'
});
 
for (var j = 0; j < psitems.length ; j++) {
ps_item = psitems[j]["@attributes"];
$('#ps-'+(j+1)).render(ps_item, directives);
if (!memwas && (ps_item.MemoryUsage !== undefined)) {
memwas = true;
}
if (!cpuwas && (ps_item.CPUUsage !== undefined)) {
cpuwas = true;
}
expanded = ps_item.Expanded;
if ((expanded !== undefined) && (expanded === "0")) {
$('#ps-'+(j+1)).treegrid('collapse');
}
}
 
if (memwas) {
$('#ps td:nth-child(4),#ps th:nth-child(4)').show();
} else {
$('#ps td:nth-child(4),#ps th:nth-child(4)').hide();
}
if (cpuwas) {
$('#ps td:nth-child(5),#ps th:nth-child(5)').show();
} else {
$('#ps td:nth-child(5),#ps th:nth-child(5)').hide();
}
 
$('#block_ps').show();
} else {
$('#block_ps').hide();
}
} else {
$('#block_ps').hide();
}
}
/web/acc/phpsysinfo/plugins/ps/lang/cz.xml
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_command">
<exp>Příkaz</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>PID</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>Rodičovský PID</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Spotřeba paměti</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>CPU Usage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/de.xml
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_command">
<exp>Befehl</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>Prozess ID</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>Eltern ID</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Speichernutzung</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>CPU Usage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/en.xml
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_command">
<exp>Command</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>Process ID</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>Parent ID</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Memory Usage</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>CPU Usage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/fr.xml
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_command">
<exp>Commande</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>ID processus</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>ID processus père</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Utilisation mémoire</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>CPU Usage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/gr.xml
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="greek" 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_command">
<exp>Εντολή</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>ID Διεργασίας</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>ID Κύριας Διεργασίας</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Χρήση Μνήμης</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>Χρήση Επεξεργαστή</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/pl.xml
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_command">
<exp>Polecenie</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>PID</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>PID rodzica</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Wykorzystanie pamięci</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>Wykorzystanie procesora</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/ro.xml
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_command">
<exp>Comanda</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>ID Proces</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>ID Parinte</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Utilizare Memorie</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>CPU Usage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/ru.xml
0,0 → 1,27
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: ru.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_command">
<exp>Команда</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>ID процесса</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>ID родителя</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Использовано памяти</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>CPU Usage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/lang/uk.xml
0,0 → 1,27
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: uk.xml 661 2017-06-03 16:32:39Z namiltd $ -->
<!--
phpSysInfo language file Language: Ukrainian Created by: Rostyslav Gaitkulov (nightfly)
-->
<tns:translationPlugin language="ukrainian" 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_command">
<exp>Команда</exp>
</expression>
<expression id="plugin_ps_003" name="ps_pid">
<exp>ID процесу</exp>
</expression>
<expression id="plugin_ps_004" name="ps_ppid">
<exp>ID батьківський</exp>
</expression>
<expression id="plugin_ps_005" name="ps_mem">
<exp>Використано пам`яті</exp>
</expression>
<expression id="plugin_ps_006" name="ps_cpu">
<exp>CPU Usage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/ps/class.ps.inc.php
0,0 → 1,259
<?php
/**
* PS 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 2, or (at your option) any later version
* @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('', 'root\CIMv2');
$os_wmi = CommonFunctions::getWMI($wmi, 'Win32_OperatingSystem', array('TotalVisibleMemorySize'));
$memtotal = 0;
foreach ($os_wmi as $os) {
$memtotal = $os['TotalVisibleMemorySize'] * 1024;
break;
}
 
$perf_wmi = CommonFunctions::getWMI($wmi, 'Win32_PerfFormattedData_PerfProc_Process', array('IDProcess', 'CreatingProcessID', 'PercentProcessorTime'));
$proccpu = array();
foreach ($perf_wmi as $perf) {
$proccpu[trim($perf['IDProcess'])] = array('ParentProcessId'=>trim($perf['CreatingProcessID']), 'PercentProcessorTime'=>trim($perf['PercentProcessorTime']));
}
 
$process_wmi = CommonFunctions::getWMI($wmi, 'Win32_Process', array('Caption', 'CommandLine', 'ProcessId', 'ParentProcessId', 'WorkingSetSize'));
foreach ($process_wmi as $process) {
if (strlen(trim($process['CommandLine'])) > 0) {
$ps = trim($process['CommandLine']);
} else {
$ps = trim($process['Caption']);
}
if (($procid = trim($process['ProcessId'])) != 0) {
$memusage = round(trim($process['WorkingSetSize']) * 100 / $memtotal, 1);
$parentid = trim($process['ParentProcessId']);
$cpu = 0;
if (isset($proccpu[$procid]) && ($proccpu[$procid]['ParentProcessId'] == $parentid)) {
$cpu = $proccpu[$procid]['PercentProcessorTime'];
}
//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[] = $procid." ".$parentid." ".$memusage." ".$cpu." ".$ps;
}
}
} catch (Exception $e) {
}
} else {
CommonFunctions::executeProgram("ps", "axo pid,ppid,pmem,pcpu,args", $buffer, PSI_DEBUG);
if (((PSI_OS == 'Linux') || (PSI_OS == 'Android')) && (!preg_match("/^[^\n]+\n\s*\d+\s+\d+\s+[\d\.]+\s+[\d\.]+\s+.+/", $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+(\d+)\s*kB/i', $buf, $ar_buf)) {
$totalmem = $ar_buf[1];
break;
}
}
$buffer = " PID PPID %MEM %CPU COMMAND\n";
 
$processlist = glob('/proc/*/status', GLOB_NOSORT);
if (is_array($processlist) && (($total = count($processlist)) > 0)) {
natsort($processlist); //first sort
$process = 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." 0.0 ".$args."\n";
}
 
}
}
}
}
}
}
break;
case 'data':
CommonFunctions::rfts(PSI_APP_ROOT."/data/ps.txt", $buffer);
break;
default:
$this->global_error->addConfigError("__construct()", "[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;
}
$items = array();
foreach ($this->_filecontent as $roworig) {
$row = preg_split("/[\s]+/", trim($roworig), 5);
if (count($row) != 5) {
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"] = "0";
$items[$zombie]["4"] = "unknown";
$items[0]['childs'][$zombie] = &$items[$zombie];
}
break; //first is sufficient
}
}
}
if (isset($items[0])) {
$this->_result = $items[0];
} else {
$this->_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]);
if (!defined('PSI_PLUGIN_PS_MEMORY_USAGE') || (PSI_PLUGIN_PS_MEMORY_USAGE !== false)) {
$xmlnode->addAttribute('MemoryUsage', $value[2]);
}
if (!defined('PSI_PLUGIN_PS_CPU_USAGE') || (PSI_PLUGIN_PS_CPU_USAGE !== false)) {
$xmlnode->addAttribute('CPUUsage', $value[3]);
}
$xmlnode->addAttribute('Name', $value[4]);
if ((PSI_OS !== 'WINNT') &&
((($parentid === 1) && (!defined('PSI_PLUGIN_PS_SHOW_PID1CHILD_EXPANDED') || (PSI_PLUGIN_PS_SHOW_PID1CHILD_EXPANDED === false)))
|| ((!defined('PSI_PLUGIN_PS_SHOW_KTHREADD_EXPANDED') || (PSI_PLUGIN_PS_SHOW_KTHREADD_EXPANDED === false)) && ($value[4] === "[kthreadd]")))) {
$xmlnode->addAttribute('Expanded', 0);
}
}
if (isset($value['childs'])) {
$this->_addChild($value['childs'], $xml, $positions);
}
}
 
return $xml;
}
}
/web/acc/phpsysinfo/plugins/ps/ps_bootstrap.html
0,0 → 1,24
<div class="col-lg-12" id="block_ps" style="display:none;">
<div class="card" id="panel_ps" style="display:none;">
<div class="card-header"><span class="lang_plugin_ps_001">Processes Status</span>
<div id="reload_ps" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="ps" class="table table-hover table-sm">
<thead>
<tr>
<th><span class="lang_plugin_ps_002">Command</span></th>
<th><span class="lang_plugin_ps_003">Process ID</span></th>
<th><span class="lang_plugin_ps_004">Parent ID</span></th>
<th><span class="lang_plugin_ps_005">Memory Usage</span></th>
<th><span class="lang_plugin_ps_006">CPU Usage</span></th>
</tr>
</thead>
<tbody id="ps-data">
</tbody>
</table>
</div>
</div>
</div>
</div>
/web/acc/phpsysinfo/plugins/psstatus/css/psstatus.css
0,0 → 1,6
/*
$Id: psstatus.css 661 2012-08-27 11:26:39Z namiltd $
*/
#Plugin_PSStatusTable thead tr th {
cursor: pointer;
}
/web/acc/phpsysinfo/plugins/psstatus/gfx/offline.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/acc/phpsysinfo/plugins/psstatus/gfx/online.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/acc/phpsysinfo/plugins/psstatus/js/psstatus.js
0,0 → 1,127
/***************************************************************************
* 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.gif\" alt=\"online\" title=\"\" style=\"width:18px;\" />";
}
else {
state = "<span style=\"display:none;\">" + status.toString() + "</span><img src=\"./plugins/psstatus/gfx/offline.gif\" alt=\"offline\" title=\"\" style=\"width:18px;\" />";
}
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 += "<div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_PSStatusTable\" style=\"border-collapse:collapse;\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th>" + genlang(2, "PSStatus") + "</th>\n";
html += " <th>" + genlang(3, "PSStatus") + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody>\n";
html += " </tbody>\n";
html += " </table>\n";
html += "</div>\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() {
$("#Reload_PSStatusTable").attr("title", "reload");
$.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();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/psstatus/js/psstatus_bootstrap.js
0,0 → 1,32
function renderPlugin_psstatus(data) {
 
var directives = {
Status1: {
text: function () {
return (this.Status === "1") ? "ON" : "";
}
},
Status0: {
text: function () {
return (this.Status === "1") ? "" : "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();
}
}
/web/acc/phpsysinfo/plugins/psstatus/lang/cz.xml
0,0 → 1,18
<?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="psstatus_title">
<exp>Stav procesů</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Název</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Stav</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/de.xml
0,0 → 1,18
<?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="psstatus_title">
<exp>Prozess Status</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Name</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Status</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/en.xml
0,0 → 1,18
<?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="psstatus_title">
<exp>Process Status</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Name</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Status</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/fr.xml
0,0 → 1,18
<?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="psstatus_title">
<exp>Etat des processus</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Nom</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Etat</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/gr.xml
0,0 → 1,18
<?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="greek" 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="psstatus_title">
<exp>Κατάσταση Κρίσιμων Διεργασιών</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Διεργασία</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Κατάσταση</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/pl.xml
0,0 → 1,18
<?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="psstatus_title">
<exp>Status Procesów</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Nazwa</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Status</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/ro.xml
0,0 → 1,18
<?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="psstatus_title">
<exp>Stare proces</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Nume</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Stare</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/ru.xml
0,0 → 1,18
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: ru.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="psstatus_title">
<exp>Статус служб</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Имя службы</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Статус</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/lang/uk.xml
0,0 → 1,18
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: uk.xml 661 2017-06-03 16:48:39Z namiltd $ -->
<!--
phpSysInfo language file Language: Ukrainian Created by: Rostyslav Gaitkulov (nightfly)
-->
<tns:translationPlugin language="ukrainian" 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="psstatus_title">
<exp>Стан процесів</exp>
</expression>
<expression id="plugin_psstatus_002" name="psstatus_name">
<exp>Ім`я процесу</exp>
</expression>
<expression id="plugin_psstatus_003" name="psstatus_status">
<exp>Стан</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/psstatus/class.psstatus.inc.php
0,0 → 1,155
<?php
/**
* PSStatus 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 2, or (at your option) any later version
* @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);
if (defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES)) {
switch (strtolower(PSI_PLUGIN_PSSTATUS_ACCESS)) {
case 'command':
if (PSI_OS == 'WINNT') {
try {
$objLocator = new COM('WbemScripting.SWbemLocator');
$wmi = $objLocator->ConnectServer('', 'root\CIMv2');
$process_wmi = CommonFunctions::getWMI($wmi, 'Win32_Process', array('Caption', 'ProcessId'));
foreach ($process_wmi as $process) {
$this->_filecontent[] = array(strtolower(trim($process['Caption'])), trim($process['ProcessId']));
}
} catch (Exception $e) {
}
} else {
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($buffer) > 0) {
$this->_filecontent[] = array($process, $buffer);
}
}
} else {
foreach ($processes as $process) {
CommonFunctions::executeProgram("pidof", "-s -x \"".$process."\"", $buffer, PSI_DEBUG);
if (strlen($buffer) > 0) {
$this->_filecontent[] = array($process, $buffer);
}
}
}
}
break;
case 'data':
CommonFunctions::rfts(PSI_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->addConfigError("__construct()", "[psstatus] ACCESS");
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 (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) {
$this->_result[] = array($process, $this->process_inarray(strtolower($process), $this->_filecontent));
}
} else {
foreach ($processes as $process) {
$this->_result[] = array($process, $this->process_inarray($process, $this->_filecontent));
}
}
}
}
 
/**
* 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 if process name is in
*
* @param mixed $needle what to find
* @param array $haystack where to find
*
* @return boolean true - found<br>false - not found
*/
private function process_inarray($needle, $haystack)
{
foreach ($haystack as $stalk) {
if ($needle === $stalk[0]) {
return true;
}
}
 
return false;
}
}
/web/acc/phpsysinfo/plugins/psstatus/psstatus_bootstrap.html
0,0 → 1,25
<div class="col-lg-6" id="block_psstatus" style="display:none;">
<div class="card" id="panel_psstatus" style="display:none;">
<div class="card-header"><span class="lang_plugin_psstatus_001">Processes Status</span>
<div id="reload_psstatus" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="psstatus" class="table table-hover table-sm sortable">
<thead>
<tr>
<th id="psstatus_Name"><span class="lang_plugin_psstatus_002">Name</span></th>
<th class="rightCell"><span class="lang_plugin_psstatus_003">Status</span></th>
</tr>
</thead>
<tbody id="psstatus-data">
<tr>
<th><span data-bind="Name"></span></th>
<td class="rightCell"><span class="badge badge-success" data-bind="Status1"></span><span class="badge badge-danger" data-bind="Status0"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
/web/acc/phpsysinfo/plugins/quotas/css/quotas.css
0,0 → 1,7
/*
$Id: quotas.css 661 2012-08-27 11:26:39Z namiltd $
*/
#Plugin_QuotasTable thead tr th {
cursor: pointer;
text-align: center;
}
/web/acc/phpsysinfo/plugins/quotas/js/quotas.js
0,0 → 1,149
/***************************************************************************
* 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 += "<div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_QuotasTable\" style=\"border-collapse:collapse;\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th>" + genlang(2, "Quotas") + "</th>\n";
html += " <th class=\"right\">" + genlang(3, "Quotas") + "</th>\n";
html += " <th class=\"right\">" + genlang(4, "Quotas") + "</th>\n";
html += " <th class=\"right\">" + genlang(5, "Quotas") + "</th>\n";
html += " <th>" + genlang(6, "Quotas") + "</th>\n";
html += " <th class=\"right\">" + genlang(7, "Quotas") + "</th>\n";
html += " <th class=\"right\">" + genlang(8, "Quotas") + "</th>\n";
html += " <th class=\"right\">" + genlang(9, "Quotas") + "</th>\n";
html += " <th>" + genlang(10, "Quotas") + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody>\n";
html += " </tbody>\n";
html += " </table>\n";
html += "</div>\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() {
$("#Reload_QuotasTable").attr("title", "reload");
$.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();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/quotas/js/quotas_bootstrap.js
0,0 → 1,50
function renderPlugin_quotas(data) {
 
var directives = {
 
ByteUsed: {
html: function () {
return formatBytes(this.ByteUsed, data.Options["@attributes"].byteFormat);
}
},
ByteSoft: {
html: function () {
return formatBytes(this.ByteSoft, data.Options["@attributes"].byteFormat);
}
},
ByteHard: {
html: 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();
}
}
/web/acc/phpsysinfo/plugins/quotas/lang/cz.xml
0,0 → 1,39
<?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="quotas_title">
<exp>Stav kvót</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>Uživatel</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Využité místo</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Měkký limit</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Tvrdý limit</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Procento využití</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Počet soouborů</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Měkký souborový limit</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Tvrdý souborový limit</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Procento využití souborů</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/lang/de.xml
0,0 → 1,39
<?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="quotas_title">
<exp>Quota Status</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>Benutzer</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Bytes (Belegt)</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Bytes (Soft Limit)</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Bytes (Hard Limit)</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Bytes (Belegt Prozent)</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Dateien (Benutzt)</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Dateien (Soft Limit)</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Dateien (Hard Limit)</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Dateien (Benutzt Prozent)</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/lang/en.xml
0,0 → 1,39
<?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="quotas_title">
<exp>Quota Status</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>User</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Bytes Used</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Bytes Soft</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Bytes Hard</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Bytes Used Percent</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Files Used</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Files Soft</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Files Hard</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Files Used Percent</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/lang/fr.xml
0,0 → 1,39
<?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="quotas_title">
<exp>Etat des quotas</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>Utilisateurs</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Espace utilisés</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Espace limite souple</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Espace limite stricte</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Pourcentage espace utilisés</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Inodes utilisés</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Inodes limite souple</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Inodes limite stricte</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Pourcentage inodes utilisés</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/lang/gr.xml
0,0 → 1,39
<?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: ChriZathens
-->
<tns:translationPlugin language="greek" 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="quotas_title">
<exp>Κατάσταση Quota</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>Χρήστης</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Bytes σε Χρήση</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Bytes Soft</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Bytes Hard</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Ποσοστό Χρήσης Bytes</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Αρχεία σε χρήση</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Αρχεία Soft</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Αρχεία Hard</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Ποσοστό Χρήσης Αρχείων</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/lang/pl.xml
0,0 → 1,39
<?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="quotas_title">
<exp>Status Quoty</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>Użytkownik</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Bajtów wykorzystanych</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Miękki limit bajtów</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Twardy limit bajtów</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Procentowo bajtów</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Plików wykorzystanych</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Miękki limit plików</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Twardy limit plików</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Procentowo plików</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/lang/ro.xml
0,0 → 1,39
<?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="quotas_title">
<exp>Stare Quota</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>Utilizator</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Bytes Folositi</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Bytes Soft</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Bytes Hard</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Bytes Percent Folosiți</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Fișiere Folosite</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Fișiere Soft</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Fișiere Hard</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Fișiere Percent Folosite</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/lang/ru.xml
0,0 → 1,39
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: ru.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="quotas_title">
<exp>Состояние Квоты</exp>
</expression>
<expression id="plugin_quotas_002" name="quotas_user">
<exp>Пользователь</exp>
</expression>
<expression id="plugin_quotas_003" name="quotas_bused">
<exp>Используется</exp>
</expression>
<expression id="plugin_quotas_004" name="quotas_bsoft">
<exp>Программы</exp>
</expression>
<expression id="plugin_quotas_005" name="quotas_bhard">
<exp>Жесткий диск</exp>
</expression>
<expression id="plugin_quotas_006" name="quotas_bpuse">
<exp>Процентов</exp>
</expression>
<expression id="plugin_quotas_007" name="quotas_fused">
<exp>Файлы Используется</exp>
</expression>
<expression id="plugin_quotas_008" name="quotas_fsoft">
<exp>Файлов программ</exp>
</expression>
<expression id="plugin_quotas_009" name="quotas_fhard">
<exp>Файлы на жестком диске</exp>
</expression>
<expression id="plugin_quotas_010" name="quotas_fpuse">
<exp>Проценты файлов</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/quotas/class.quotas.inc.php
0,0 → 1,119
<?php
/**
* 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 2, or (at your option) any later version
* @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(PSI_APP_ROOT."/data/quotas.txt", $buffer);
break;
default:
$this->global_error->addConfigError("__construct()", "[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)/", $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();
}
}
/web/acc/phpsysinfo/plugins/quotas/quotas_bootstrap.html
0,0 → 1,39
<div class="col-lg-12" id="block_quotas" style="display:none;">
<div class="card" id="panel_quotas" style="display:none;">
<div class="card-header"><span class="lang_plugin_quotas_001">Quota Status</span>
<div id="reload_quotas" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="quotas" class="table table-hover table-sm sortable">
<thead>
<tr>
<th id="quotas_User"><span class="lang_plugin_quotas_002">User</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_003">Bytes Used</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_004">Bytes Soft</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_005">Bytes Hard</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_006">Bytes Used Percent</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_007">Files Used</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_008">Files Soft</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_009">Files Hard</span></th>
<th class="rightCell sorttable_numeric"><span class="lang_plugin_quotas_010">Files Used Percent</span></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>
</div>
/web/acc/phpsysinfo/plugins/raid/class.raid.inc.php
0,0 → 1,1407
<?php
/**
* Raid Plugin, which displays RAID status
*
* @category PHP
* @package PSI_Plugin_Raid
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version Release: 3.0
* @link http://phpsysinfo.sourceforge.net
*/
class Raid 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();
 
private $prog_items = array('mdstat','dmraid','megactl','megasasctl','graid','zpool','idrac');
 
/**
* 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);
 
$RaidProgs = array();
if (defined('PSI_PLUGIN_RAID_PROGRAM') && is_string(PSI_PLUGIN_RAID_PROGRAM)) {
if (is_string(PSI_PLUGIN_RAID_PROGRAM)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_RAID_PROGRAM)) {
$RaidProgs = eval(strtolower(PSI_PLUGIN_RAID_PROGRAM));
} else {
$RaidProgs = array(strtolower(PSI_PLUGIN_RAID_PROGRAM));
}
} else {
$this->global_error->addConfigError("__construct()", "[raid] PROGRAM");
exit;
}
} else {
$RaidProgs = $this->prog_items;
}
 
$notwas = true;
switch (strtolower(PSI_PLUGIN_RAID_ACCESS)) {
case 'command':
case 'php-snmp':
if ((PSI_OS == 'Linux') && in_array('mdstat', $RaidProgs)) {
CommonFunctions::rfts("/proc/mdstat", $this->_filecontent['mdstat'], 0, 4096, PSI_DEBUG);
$notwas = false;
}
if ((PSI_OS == 'Linux') && in_array('dmraid', $RaidProgs)) {
CommonFunctions::executeProgram("dmraid", "-s -vv 2>&1", $this->_filecontent['dmraid'], PSI_DEBUG);
$notwas = false;
}
if ((PSI_OS == 'Linux') && in_array('megactl', $RaidProgs)) {
CommonFunctions::executeProgram("megactl", "", $this->_filecontent['megactl'], PSI_DEBUG);
$notwas = false;
}
if ((PSI_OS == 'Linux') && in_array('megasasctl', $RaidProgs)) {
CommonFunctions::executeProgram("megasasctl", "", $this->_filecontent['megasasctl'], PSI_DEBUG);
$notwas = false;
}
if ((PSI_OS == 'FreeBSD') && in_array('graid', $RaidProgs)) {
CommonFunctions::executeProgram("graid", "list", $this->_filecontent['graid'], PSI_DEBUG);
$notwas = false;
}
if (in_array('zpool', $RaidProgs)) {
CommonFunctions::executeProgram("zpool", "status", $this->_filecontent['zpool'], PSI_DEBUG);
$notwas = false;
}
if (in_array('idrac', $RaidProgs)) {
if (defined('PSI_PLUGIN_RAID_IDRAC_DEVICES') && is_string(PSI_PLUGIN_RAID_IDRAC_DEVICES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_RAID_IDRAC_DEVICES)) {
$devices = eval(PSI_PLUGIN_RAID_IDRAC_DEVICES);
} else {
$devices = array(PSI_PLUGIN_RAID_IDRAC_DEVICES);
}
if (strtolower(PSI_PLUGIN_RAID_ACCESS)=="command") {
foreach ($devices as $device) {
CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$device." .1.3.6.1.4.1.674.10892.5.5.1.20", $buffer, PSI_DEBUG);
if (strlen($buffer) > 0) {
$this->_filecontent['idrac'][$device] = $buffer;
}
}
} else {
snmp_set_valueretrieval(SNMP_VALUE_LIBRARY);
snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);
foreach ($devices as $device) {
if (! PSI_DEBUG) {
restore_error_handler(); /* default error handler */
$old_err_rep = error_reporting();
error_reporting(E_ERROR); /* fatal errors only */
}
$bufferarr=snmprealwalk($device, "public", ".1.3.6.1.4.1.674.10892.5.5.1.20", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);
if (! PSI_DEBUG) {
error_reporting($old_err_rep); /* restore error level */
set_error_handler('errorHandlerPsi'); /* restore error handler */
}
if (! empty($bufferarr)) {
$buffer="";
foreach ($bufferarr as $id=>$string) {
$buffer .= $id." = ".$string."\n";
}
if (strlen($buffer) > 0) {
$this->_filecontent['idrac'][$device] = $buffer;
}
}
}
}
}
 
$notwas = false;
}
if ($notwas) {
$this->global_error->addConfigError("__construct()", "[raid] PROGRAM");
}
break;
case 'data':
foreach ($this->prog_items as $item) {
if (in_array($item, $RaidProgs)) {
if ($item !== 'idrac') {
CommonFunctions::rfts(PSI_APP_ROOT."/data/raid".$item.".txt", $this->_filecontent[$item], 0, 4096, false);
} elseif (defined('PSI_PLUGIN_RAID_IDRAC_DEVICES') && is_string(PSI_PLUGIN_RAID_IDRAC_DEVICES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_RAID_IDRAC_DEVICES)) {
$devices = eval(PSI_PLUGIN_RAID_IDRAC_DEVICES);
} else {
$devices = array(PSI_PLUGIN_RAID_IDRAC_DEVICES);
}
$pn=0;
foreach ($devices as $device) {
$buffer="";
if (CommonFunctions::rfts(PSI_APP_ROOT."/data/raid".$item.$pn.".txt", $buffer) && !empty($buffer)) {
$this->_filecontent['idrac'][$device] = $buffer;
}
$pn++;
}
}
$notwas = false;
}
}
if ($notwas) {
$this->global_error->addConfigError("__construct()", "[raid] PROGRAM");
}
break;
default:
$this->global_error->addConfigError("__construct()", "[raid] ACCESS");
break;
}
}
 
private function execute_mdstat($buffer)
{
$raiddata = preg_split("/\r?\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($raiddata)) {
// get the supported types
$supported = '';
if (preg_match('/^[a-zA-Z]+ :( \[[a-z0-9]+\])+/', $raiddata[0], $res)) {
$parts = preg_split("/ : /", $res[0]);
if (isset($parts[1]) && (trim($parts[1]) !== '')) {
$supported = preg_replace('/[\[\]]/', '', trim($parts[1]));
}
}
// get disks
if (preg_match("/^read_ahead/", $raiddata[1])) {
$count = 2;
} else {
$count = 1;
}
$cnt_filecontent = count($raiddata);
do {
$parts = preg_split("/ : /", $raiddata[$count]);
$dev = trim($parts[0]);
if (count($parts) == 2) {
$this->_result['devices'][$dev]['prog'] = "mdstat";
if ($supported !== '') $this->_result['devices'][$dev]['supported'] = $supported;
$this->_result['devices'][$dev]['items'][0]['raid_index'] = -1; //must by first
$details = preg_split('/ /', $parts[1]);
if (!strstr($details[0], 'inactive')) {
if (isset($details[2]) && strstr($details[1], '(auto-read-only)')) {
$this->_result['devices'][$dev]['level'] = $details[2];
$this->_result['devices'][$dev]['status'] = $details[0]." ".$details[1];
//$this->_result['devices'][$dev]['items'][0]['name'] = $dev." ".$details[2];
$this->_result['devices'][$dev]['items'][0]['name'] = $details[2];
$this->_result['devices'][$dev]['items'][0]['status'] = "W";
$i = 3;
} else {
$this->_result['devices'][$dev]['level'] = $details[1];
$this->_result['devices'][$dev]['status'] = $details[0];
//$this->_result['devices'][$dev]['items'][0]['name'] = $dev." ".$details[1];
$this->_result['devices'][$dev]['items'][0]['name'] = $details[1];
$this->_result['devices'][$dev]['items'][0]['status'] = "ok";
$i = 2;
}
} else {
$this->_result['devices'][$dev]['level'] = "none";
$this->_result['devices'][$dev]['status'] = $details[0];
$this->_result['devices'][$dev]['items'][0]['name'] = $dev;
$this->_result['devices'][$dev]['items'][0]['status'] = "F";
$i = 1;
}
$this->_result['devices'][$dev]['items'][0]['parentid'] = 0;
 
for ($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]['items'][$partition[1]]['raid_index'] = 0+substr(trim($partition[3]), 1, -1);
if (isset($partition[5])) {
$search = array("(", ")");
$replace = array("", "");
$this->_result['devices'][$dev]['items'][$partition[1]]['status'] = str_replace($search, $replace, trim($partition[5]));
} else {
$this->_result['devices'][$dev]['items'][$partition[1]]['status'] = "ok";
}
$this->_result['devices'][$dev]['items'][$partition[1]]['name'] = $partition[1];
$this->_result['devices'][$dev]['items'][$partition[1]]['parentid'] = 1;
$this->_result['devices'][$dev]['items'][$partition[1]]['type'] = "disk";
}
}
$optionline = $raiddata[$count].$raiddata[$count+1];
$count++;
if (preg_match('/([^\sk]*)k chunk/', $optionline, $chunksize)) {
$this->_result['devices'][$dev]['chunk_size'] = $chunksize[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));
}
if (preg_match('/\[([0-9]+)\/([0-9]+)\]/', $optionline, $res)) {
$this->_result['devices'][$dev]['registered'] = $res[1];
$this->_result['devices'][$dev]['active'] = $res[2];
}
 
if (isset($this->_result['devices'][$dev]['items'])) {
asort($this->_result['devices'][$dev]['items']);
}
if ((!isset($this->_result['devices'][$dev]['registered']) || ($this->_result['devices'][$dev]['registered']<24)) && preg_match('/\[([_U]+)\]/', $optionline, $res) && (($reslen=strlen($res[1])) > 0)) {
$notsparecount = 0;
foreach ($this->_result['devices'][$dev]['items'] as $diskkey=>$disk) {
if (($diskkey!==0) && ($this->_result['devices'][$dev]['items'][$diskkey]['status']!=="S")) {
$notsparecount++;
}
}
if ($notsparecount == $reslen) {
$partnr = 0;
foreach ($this->_result['devices'][$dev]['items'] as $diskkey=>$disk) {
if (($diskkey!==0) && ($this->_result['devices'][$dev]['items'][$diskkey]['status']!=="S")) {
if (($res[1][$partnr]=='_') && ($this->_result['devices'][$dev]['items'][$diskkey]['status']=="ok")) {
$this->_result['devices'][$dev]['items'][$diskkey]['status']="W";
}
$partnr++;
}
}
} elseif ($reslen-$notsparecount == 1) {
$partnr = 0;
foreach ($this->_result['devices'][$dev]['items'] as $diskkey=>$disk) {
if (($diskkey!==0) && ($this->_result['devices'][$dev]['items'][$diskkey]['status']!=="S")) {
if ($res[1][$partnr]=='_') {
$this->_result['devices'][$dev]['items']['none']['raid_index']=$this->_result['devices'][$dev]['items'][$diskkey]['raid_index']-1;
$this->_result['devices'][$dev]['items']['none']['status']="E";
$this->_result['devices'][$dev]['items']['none']['name']="none";
$this->_result['devices'][$dev]['items']['none']['parentid'] = 1;
$this->_result['devices'][$dev]['items']['none']['type'] = "disk";
}
$partnr++;
}
}
if ($res[1][$partnr]=='_') {
$this->_result['devices'][$dev]['items']['none']['raid_index']=$this->_result['devices'][$dev]['items'][$diskkey]['raid_index']+1;
$this->_result['devices'][$dev]['items']['none']['status']="E";
$this->_result['devices'][$dev]['items']['none']['name']="none";
$this->_result['devices'][$dev]['items']['none']['parentid'] = 1;
$this->_result['devices'][$dev]['items']['none']['type']="disk";
}
asort($this->_result['devices'][$dev]['items']);
foreach ($this->_result['devices'][$dev]['items'] as $diskkey=>$disk) {
if ($diskkey=="none") {
$this->_result['devices'][$dev]['items'][$diskkey]['raid_index']="unknown";
}
}
} else {
foreach ($this->_result['devices'][$dev]['items'] as $diskkey=>$disk) {
if ($this->_result['devices'][$dev]['items'][$diskkey]['status']=="ok") {
$this->_result['devices'][$dev]['items'][$diskkey]['status']="W";
}
}
for ($partnr=0; $partnr<$reslen-$notsparecount; $partnr++) {
$this->_result['devices'][$dev]['items']['none'.$partnr]['raid_index']="unknown";
$this->_result['devices'][$dev]['items']['none'.$partnr]['status']="E";
$this->_result['devices'][$dev]['items']['none'.$partnr]['name'] = "none".$partnr;
$this->_result['devices'][$dev]['items']['none'.$partnr]['parentid'] = 1;
$this->_result['devices'][$dev]['items']['none'.$partnr]['type'] = "disk";
}
}
}
if (preg_match(('/([a-z]+)( *)=( *)([0-9\.]+)%/'), $raiddata[$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]+)/'), $raiddata[$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');
}
} elseif (preg_match(('/^( *)([a-z]+)( *)=( *)([A-Z]+)$/'), $raiddata[$count + 1], $res)) {
$this->_result['devices'][$dev]['status'] .= " ".trim($raiddata[$count + 1]);
}
} else {
$count++;
}
} while ($cnt_filecontent > $count);
$lastline = $raiddata[$cnt_filecontent - 1];
if (strpos($lastline, "unused devices") !== false) {
$parts = preg_split("/:/", $lastline);
$unused = trim($parts[1]);
if ($unused !== "<none>") {
$details = preg_split('/ /', $parts[1], -1, PREG_SPLIT_NO_EMPTY);
$this->_result['devices']['spare']['prog'] = "mdstat";
$this->_result['devices']['spare']['status'] = "spare";
$this->_result['devices']['spare']['items'][0]['name'] = "spare";
$this->_result['devices']['spare']['items'][0]['parentid'] = 0;
$this->_result['devices']['spare']['items'][0]['status'] = "S";
foreach ($details as $id=>$disk) {
$this->_result['devices']['spare']['items'][$id+1]['name'] = $disk;
$this->_result['devices']['spare']['items'][$id+1]['parentid'] = 1;
$this->_result['devices']['spare']['items'][$id+1]['status'] = "S";
$this->_result['devices']['spare']['items'][$id+1]['type'] = "disk";
}
}
}
}
}
 
private function execute_dmraid($buffer)
{
$raiddata = preg_split("/(\r?\n\*\*\* )|(\r?\n--> )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($raiddata)) {
$group = "";
foreach ($raiddata 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)) {
if (!isset($this->_result['devices'][$partition[2]]['items'][0]['parentid'])) {
$this->_result['devices'][$partition[2]]['items'][0]['parentid'] = 0;
$this->_result['devices'][$partition[2]]['items'][0]['name'] = $partition[2];
}
$this->_result['devices'][$partition[2]]['items'][$partition[1]]['status'] = "ok";
$this->_result['devices'][$partition[2]]['items'][$partition[1]]['type'] = "disk";
$this->_result['devices'][$partition[2]]['items'][$partition[1]]['parentid'] = 1;
$this->_result['devices'][$partition[2]]['items'][$partition[1]]['name'] = $partition[1];
$this->_result['devices'][$partition[2]]['prog'] = "dmraid";
$this->_result['devices'][$partition[2]]['status'] = "ok";
$this->_result['devices'][$partition[2]]['level'] = "unknown";
} elseif (preg_match('/^ERROR: .* device\s+\/dev\/(.+)\s+(.+)\s+in RAID set\s+\"(.+)\"/', $line, $partition)) {
if (!isset($this->_result['devices'][$partition[3]]['items'][0]['parentid'])) {
$this->_result['devices'][$partition[3]]['items'][0]['parentid'] = 0;
$this->_result['devices'][$partition[3]]['items'][0]['name'] = $partition[3];
}
$this->_result['devices'][$partition[3]]['prog'] = "dmraid";
$this->_result['devices'][$partition[3]]['level'] = "unknown";
$this->_result['devices'][$partition[3]]['items'][$partition[1]]['type'] = "disk";
$this->_result['devices'][$partition[3]]['items'][$partition[1]]['parentid'] = 1;
if ($partition[2]=="broken") {
$this->_result['devices'][$partition[3]]['items'][$partition[1]]['status'] = "F";
$this->_result['devices'][$partition[3]]['status'] = "F";
} else {
$this->_result['devices'][$partition[3]]['items'][$partition[1]]['status'] = "W";
$this->_result['devices'][$partition[3]]['status'] = "W";
}
$this->_result['devices'][$partition[3]]['items'][$partition[1]]['name'] = $partition[1];
}
}
} 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]['prog'] = "dmraid";
$this->_result['devices'][$group]['name'] = trim($arrname[1]);
 
$this->_result['devices'][$group]['items'][0]['name'] = trim($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]['level'] = trim($type[1]);
//$this->_result['devices'][$group]['items'][0]['name'] .= " ".trim($type[1]);
$this->_result['devices'][$group]['items'][0]['name'] = trim($type[1]);
}
if (preg_match('/^status\s*:\s*(.*)/m', $block, $status)) {
$this->_result['devices'][$group]['status'] = trim($status[1]);
switch (trim($status[1])) {
case "broken":
$this->_result['devices'][$group]['items'][0]['status'] = "F";
break;
case "inconsistent":
$this->_result['devices'][$group]['items'][0]['status'] = "W";
break;
default:
$this->_result['devices'][$group]['items'][0]['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]);
}
 
if (!isset($this->_result['devices'][$group]['items'][0]['parentid'])) {
$this->_result['devices'][$group]['items'][0]['parentid'] = 0;
}
 
$group = "";
}
}
}
if (isset($this->_result['devices'])) {
foreach ($this->_result['devices'] as $gid=>$group) if ($group['prog'] === "dmraid") {
$id = 1;
if (isset($group['devs']) && ($group['devs']>0) &&
(!isset($group['items']) || (count($group['items'])<$group['devs'])) &&
isset($group['subsets']) && ($group['subsets']>0)) for ($i = 0; $i < $group['subsets']; $i++) {
if (isset($this->_result['devices'][$gid."-".$i]['items'][0]['parentid'])) {
foreach ($this->_result['devices'][$gid."-".$i]['items'] as $fid=>$from) {
if ($fid===0) {
$this->_result['devices'][$gid]['items'][$gid."-".$i]['parentid'] = 1;
$this->_result['devices'][$gid]['items'][$gid."-".$i]['status'] = $from['status'];
$this->_result['devices'][$gid]['items'][$gid."-".$i]['name'] = $gid."-".$i." ".$from['name'];
if (isset($from['type'])) $this->_result['devices'][$gid]['items'][$gid."-".$i]['type'] = $from['type'];
} else {
$this->_result['devices'][$gid]['items'][$from['name']]['parentid'] = 1+$id;
$this->_result['devices'][$gid]['items'][$from['name']]['status'] = $from['status'];
$this->_result['devices'][$gid]['items'][$from['name']]['name'] = $from['name'];
if (isset($from['type'])) $this->_result['devices'][$gid]['items'][$from['name']]['type'] = $from['type'];
}
}
$id+=count($this->_result['devices'][$gid."-".$i]['items']);
unset($this->_result['devices'][$gid."-".$i]);
} else {
$this->_result['devices'][$gid]['items'][$gid."-".$i]['parentid'] = 1;
$this->_result['devices'][$gid]['items'][$gid."-".$i]['status'] = "unknown";
$this->_result['devices'][$gid]['items'][$gid."-".$i]['name'] = $gid."-".$i;
$id++;
}
}
}
foreach ($this->_result['devices'] as $gid=>$group) if ($group['prog'] === "dmraid") {
if (($group['name'] !== $gid) && isset($group['items'][0]['parentid'])) {
$this->_result['devices'][$gid]['items'][0]['name'] = $group['name']." ".$group['items'][0]['name'];
}
}
}
}
}
 
private function execute_megactl($buffer, $sas = false)
{
$raiddata = preg_split("/(\r?\n)+(?=[a-z]\d+ )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($raiddata)) foreach ($raiddata as $raidgroup) {
if (preg_match("/^([a-z]\d+) /", $raidgroup, $buff)) {
if (preg_match("/^[a-z]\d+ ([^:\r\n]+) [^:\r\n]+:/", $raidgroup, $geom) || preg_match("/^[a-z]\d+ ([^:\r\n]+)/", $raidgroup, $geom)) {
$controller = trim($geom[1]);
} else {
$controller = '';
}
if (preg_match("/^[a-z]\d+ [^:\r\n]+ [^\r\n]* batt:([^:\r\n,]+)/", $raidgroup, $batt)) {
$battery = trim($batt[1]);
} else {
$battery = '';
}
$group = $buff[1];
$lines = preg_split("/\r?\n/", $raidgroup, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($lines)) {
if ($sas === true) {
$prog = "megasasctl";
$prefix = "/"; //for megactl and megasasctl conflicts
} else {
$prog = "megactl";
$prefix = "";
}
unset($lines[0]);
foreach ($lines as $line) {
$details = preg_split('/ /', preg_replace('/^hot spares +:/', 'hotspare:', $line), -1, PREG_SPLIT_NO_EMPTY);
if ((count($details) == 6) && ($details[2] === "RAID")) {
$this->_result['devices'][$prefix.$details[0]]['prog'] = $prog;
$unit = preg_replace("/^\d+/", "", $details[1]);
$value = preg_replace("/\D+$/", "", $details[1]);
switch ($unit) {
case 'B':
$this->_result['devices'][$prefix.$details[0]]['size'] = $value;
break;
case 'KiB':
$this->_result['devices'][$prefix.$details[0]]['size'] = 1024*$value;
break;
case 'MiB':
$this->_result['devices'][$prefix.$details[0]]['size'] = 1024*1024*$value;
break;
case 'GiB':
$this->_result['devices'][$prefix.$details[0]]['size'] = 1024*1024*1024*$value;
break;
case 'TiB':
$this->_result['devices'][$prefix.$details[0]]['size'] = 1024*1024*1024*1024*$value;
break;
case 'PiB':
$this->_result['devices'][$prefix.$details[0]]['size'] = 1024*1024*1024*1024*1024*$value;
break;
}
$this->_result['devices'][$prefix.$details[0]]['level'] = "RAID".$details[3]." ".$details[4];
$this->_result['devices'][$prefix.$details[0]]['status'] = $details[5];
if ($controller !== '') $this->_result['devices'][$prefix.$details[0]]['controller'] = $controller;
if ($battery !== '') $this->_result['devices'][$prefix.$details[0]]['battery'] = $battery;
$this->_result['devices'][$prefix.$details[0]]['items'][$details[0]]['parentid'] = 0;
$this->_result['devices'][$prefix.$details[0]]['items'][$details[0]]['name'] = "RAID".$details[3]." ".$details[4];
if ($details[5] !== 'optimal') {
$this->_result['devices'][$prefix.$details[0]]['items'][$details[0]]['info'] = $details[5];
}
switch ($details[5]) {
case 'optimal':
$this->_result['devices'][$prefix.$details[0]]['items'][$details[0]]['status'] = "ok";
break;
case 'OFFLINE':
$this->_result['devices'][$prefix.$details[0]]['items'][$details[0]]['status'] = "F";
break;
default:
$this->_result['devices'][$prefix.$details[0]]['items'][$details[0]]['status'] = "W";
}
} elseif (count($details) == 4) {
if (isset($this->_result['devices'][$prefix.$details[2]])) {
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['parentid'] = 1;
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['type'] = 'disk';
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['name'] = $details[0];
if ($details[3] !== 'online') {
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['info'] = $details[3];
}
switch ($details[3]) {
case 'online':
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['status'] = "ok";
break;
case 'hotspare':
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['status'] = "S";
break;
case 'rdy/fail':
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['status'] = "F";
break;
default:
$this->_result['devices'][$prefix.$details[2]]['items'][$details[0]]['status'] = "W";
}
}
} elseif ((count($details) == 2) && (($details[0]==='unconfigured:') || ($details[0]==='hotspare:'))) {
$itemn0 = rtrim($details[0], ':');
$itemn = $group .'-'.$itemn0;
$this->_result['devices'][$prefix.$itemn]['status'] = $itemn0;
$this->_result['devices'][$prefix.$itemn]['prog'] = $prog;
if ($controller !== '') $this->_result['devices'][$prefix.$itemn]['controller'] = $controller;
if ($battery !== '') $this->_result['devices'][$prefix.$itemn]['battery'] = $battery;
$this->_result['devices'][$prefix.$itemn]['items'][$itemn]['parentid'] = 0;
$this->_result['devices'][$prefix.$itemn]['items'][$itemn]['name'] = $itemn0;
if ($details[0]==='unconfigured:') {
$this->_result['devices'][$prefix.$itemn]['items'][$itemn]['status'] = "U";
} else {
$this->_result['devices'][$prefix.$itemn]['items'][$itemn]['status'] = "S";
}
} elseif (count($details) == 3) {
$itemn = '';
switch ($details[2]) {
case 'BAD':
case 'ready':
$itemn = $group .'-'.'unconfigured';
break;
case 'hotspare':
$itemn = $group .'-'.'hotspare';
}
if (($itemn !== '') && isset($this->_result['devices'][$prefix.$itemn])) {
$this->_result['devices'][$prefix.$itemn]['items'][$details[0]]['parentid'] = 1;
$this->_result['devices'][$prefix.$itemn]['items'][$details[0]]['type'] = 'disk';
$this->_result['devices'][$prefix.$itemn]['items'][$details[0]]['name'] = $details[0];
$this->_result['devices'][$prefix.$itemn]['items'][$details[0]]['info'] = $details[2];
switch ($details[2]) {
case 'ready':
$this->_result['devices'][$prefix.$itemn]['items'][$details[0]]['status'] = "U";
break;
case 'hotspare':
$this->_result['devices'][$prefix.$itemn]['items'][$details[0]]['status'] = "S";
break;
default:
$this->_result['devices'][$prefix.$itemn]['items'][$details[0]]['status'] = "F";
}
}
}
}
}
}
}
}
 
private function execute_graid($buffer)
{
if (preg_match('/^Geom name: +([^\n\r]+)/', $buffer, $geom)) {
$controller = trim($geom[1]);
} else {
$controller = '';
}
$raiddata = preg_split("/Consumers:\r?\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($raiddata)) {
$disksinfo = array();
if (isset($raiddata[1]) && (trim($raiddata[1])!=="")) {
$lines = preg_split("/\r?\n/", trim($raiddata[1]), -1, PREG_SPLIT_NO_EMPTY);
$disk = "";
foreach ($lines as $line) {
if (preg_match("/^\d+\.\s+Name:\s+(.+)/", $line, $data)) {
$disk = $data[1];
} elseif (($disk!=="") && preg_match('/^\s+State:\s+(\S+)\s+\(([^\)\s]+)\s*([\d]*)(%*)([^\)]*)\)/', $line, $data)) {
$disksinfo[$disk]['status'] = trim($data[1]);
$disksinfo[$disk]['substatus'] = trim($data[2]);
if (trim($data[4])=="%") {
$disksinfo[$disk]['percent'] = trim($data[3]);
}
}
}
}
$lines = preg_split("/\r?\n/", trim($raiddata[0]), -1, PREG_SPLIT_NO_EMPTY);
$group = "";
foreach ($lines as $line) {
if (preg_match("/^\d+\.\s+Name:\s+(.+)/", $line, $data)) {
$group = $data[1];
$this->_result['devices'][$group]['prog'] = "graid";
if ($controller !== '') $this->_result['devices'][$group]['controller'] = $controller;
} elseif ($group!=="") {
if (preg_match('/^\s+Mediasize:\s+(\d+)/', $line, $data)) {
$this->_result['devices'][$group]['size'] = trim($data[1]);
} elseif (preg_match('/^\s+State:\s+(.+)/', $line, $data)) {
$this->_result['devices'][$group]['status'] = trim($data[1]);
} elseif (preg_match('/^\s+RAIDLevel:\s+(.+)/', $line, $data)) {
$this->_result['devices'][$group]['level'] = trim($data[1]);
} elseif (preg_match('/^\s+Components:\s+(\d+)/', $line, $data)) {
$this->_result['devices'][$group]['devs'] = trim($data[1]);
} elseif (preg_match('/^\s+Label:\s+(.+)/', $line, $data)) {
$this->_result['devices'][$group]['name'] = trim($data[1]);
} elseif (preg_match('/^\s+Subdisks:\s+(.+)/', $line, $data)) {
$disks = preg_split('/\s*,\s*/', trim($data[1]), -1, PREG_SPLIT_NO_EMPTY);
$nones = 0;
$this->_result['devices'][$group]['items'][0]['parentid'] = 0;
foreach ($disks as $disk) {
if (preg_match("/^(\S+)\s+\(([^\)]+)\)/", $disk, $partition)) {
$this->_result['devices'][$group]['items'][$partition[1]]['parentid'] = 1;
$this->_result['devices'][$group]['items'][$partition[1]]['type'] = "disk";
if ($partition[2]=="ACTIVE") {
if (isset($disksinfo[$partition[1]]["status"])) {
if ($disksinfo[$partition[1]]["status"]!=="ACTIVE") {
$this->_result['devices'][$group]['items'][$partition[1]]['status'] = "W";
} elseif ($disksinfo[$partition[1]]["substatus"]=="ACTIVE") {
$this->_result['devices'][$group]['items'][$partition[1]]['status'] = "ok";
} else {
$this->_result['devices'][$group]['items'][$partition[1]]['status'] = "W";
if (isset($disksinfo[$partition[1]]["percent"])) {
$this->_result['devices'][$group]['action']['name'] = $disksinfo[$partition[1]]["substatus"];
$this->_result['devices'][$group]['action']['percent'] = $disksinfo[$partition[1]]["percent"];
}
}
} else {
$this->_result['devices'][$group]['items'][$partition[1]]['status'] = "ok";
$this->_result['devices'][$group]['items'][$partition[1]]['name'] = $partition[1];
}
$this->_result['devices'][$group]['items'][$partition[1]]['name'] = $partition[1];
} elseif ($partition[2]=="NONE") {
$this->_result['devices'][$group]['items']["none".$nones]['status'] = 'E';
$this->_result['devices'][$group]['items']["none".$nones]['name'] = "none".$nones;
$nones++;
}
}
}
}
}
}
if (isset($this->_result['devices'][$group]['items'][0]['parentid'])) {
$name = "";
if (isset($this->_result['devices'][$group]['name'])) {
$name = $this->_result['devices'][$group]['name'];
}
if (isset($this->_result['devices'][$group]['level'])) {
$name .= " " .$this->_result['devices'][$group]['level'];
}
$this->_result['devices'][$group]['items'][0]['name'] = trim($name);
if (isset($this->_result['devices'][$group]['status'])) {
if ($this->_result['devices'][$group]['status']==="OPTIMAL") {
$this->_result['devices'][$group]['items'][0]['status'] = "ok";
} else {
$this->_result['devices'][$group]['items'][0]['status'] = "W";
$this->_result['devices'][$group]['items'][0]['info'] = $this->_result['devices'][$group]['status'];
}
} else {
$this->_result['devices'][$group]['items'][0]['status'] = "ok";
}
}
}
}
 
private function execute_zpool($buffer)
{
$raiddata = preg_split("/(\r?\n)+ +(?=pool: )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($raiddata)) foreach ($raiddata as $raid) {
if (preg_match("/^pool: (\S+)/", $raid, $buff)) {
$group = $buff[1];
$this->_result['devices'][$group]['prog'] = "zpool";
if (preg_match("/^ +state: (\S+)/m", $raid, $buff)) {
$this->_result['devices'][$group]['status'] = $buff[1];
}
$databegin = preg_split("/\n[ \t]+NAME +STATE +READ +WRITE +CKSUM\r?\n/", $raid, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($databegin) && (count($databegin)==2)) {
$datas = preg_split("/\r?\n[ \t]*\r?\n/", $databegin[1], -1, PREG_SPLIT_NO_EMPTY);
$datalines = preg_split("/\r?\n/", $datas[0], -1, PREG_SPLIT_NO_EMPTY);
$rootoffset = false;
$lastparentids = array(0=>-1);
$lastindent = 0;
$lastid = 0;
foreach ($datalines as $id=>$data) {
if (preg_match("/^([ \t]+)\S/", $data, $buff)) {;
$fullbuff = preg_split("/[ \t]+/", $data, 6, PREG_SPLIT_NO_EMPTY);
$offset=strlen($buff[1]);
if ($rootoffset === false) { // first line means root
$rootoffset = $offset;
$this->_result['devices'][$group]['items'][$id]['name'] = "";//$fullbuff[0];
if (count($fullbuff) > 1) {
$this->_result['devices'][$group]['items'][$id]['status'] = $fullbuff[1];
}
$this->_result['devices'][$group]['items'][$id]['parentid'] = -2;
continue;
}
if ($offset < $rootoffset) { // some errors
continue;
}
 
$this->_result['devices'][$group]['items'][$id]['name'] = $fullbuff[0];
 
if (count($fullbuff) > 1) {
$this->_result['devices'][$group]['items'][$id]['status'] = $fullbuff[1];
}
if (count($fullbuff) > 5) {
$this->_result['devices'][$group]['items'][$id]['info'] = $fullbuff[5];
}
 
$indent = ($offset - $rootoffset)/2;
if ($indent > $lastindent) {
$lastparentids[$indent] = $lastid;
}
$this->_result['devices'][$group]['items'][$id]['parentid'] = $lastparentids[$indent];
 
if ($lastparentids[$indent] >= 0) {
if (isset($this->_result['devices'][$group]['items'][$lastparentids[$indent]]['childs'])) {
$this->_result['devices'][$group]['items'][$lastparentids[$indent]]['childs']++;
} else {
$this->_result['devices'][$group]['items'][$lastparentids[$indent]]['childs'] = 1;
}
}
 
$lastindent = $indent;
$lastid = $id;
}
}
foreach ($this->_result['devices'][$group]['items'] as $id=>$data) { // type analize
if ((!isset($data['childs']) || ($data['childs']<1)) && ($data['parentid']>=0) && !preg_match("/^mirror$|^mirror-|^spare$|^spare-|^replacing$|^replacing-|^raidz[123]$|^raidz[123]-/", $data['name'])) {
$this->_result['devices'][$group]['items'][$id]['type'] = "disk";
} elseif (isset($data['childs']) && !preg_match("/^spares$|^mirror$|^mirror-|^spare$|^spare-|^replacing$|^replacing-|^raidz[123]$|^raidz[123]-/", $data['name'])) {
if (($data['childs']==1) && ($data['parentid']==-2) && isset($this->_result['devices'][$group]['items'][$id+1]) && !preg_match("/^mirror$|^mirror-|^spare$|^spare-|^replacing$|^replacing-|^raidz[123]$|^raidz[123]-/", $this->_result['devices'][$group]['items'][$id+1]['name'])) {
$this->_result['devices'][$group]['items'][$id]['name2'] = "jbod";
} elseif ($data['childs']>1) {
$this->_result['devices'][$group]['items'][$id]['name2'] = "stripe";
}
}
}
 
foreach ($this->_result['devices'][$group]['items'] as $id=>$data) { // size optimize
if (($data['parentid']<0) && isset($data['childs']) && ($data['childs']==1) && (!isset($data['name2']) || ($data['name2']!=="jbod"))) {
if ($data['parentid']==-2) {
unset($this->_result['devices'][$group]['items'][$id]);
} elseif (($data['parentid'] == -1) && !isset($this->_result['devices'][$group]['items'][$id+1]['type'])) {
$this->_result['devices'][$group]['items'][$id+1]['name2'] = $data['name'];
$this->_result['devices'][$group]['items'][$id+1]['parentid'] = $data['parentid'];
unset($this->_result['devices'][$group]['items'][$id]);
foreach ($this->_result['devices'][$group]['items'] as $id2=>$data2) {
if ($data2['parentid']>$id) {
$this->_result['devices'][$group]['items'][$id2]['parentid'] = $data2['parentid'] - 1;
}
}
}
}
}
 
if (isset($this->_result['devices'][$group]['items'][0])) {
$shift = true;
} else {
$shift = false;
}
foreach ($this->_result['devices'][$group]['items'] as $id=>$data) {
// reindex
if ($shift) {
$this->_result['devices'][$group]['items'][$id]['parentid']++;
}
if ($data['parentid']<0) {
$this->_result['devices'][$group]['items'][$id]['parentid'] = 0;
}
 
// name append
if (isset($data['name2'])) {
if (($data['name2']==="cache") || ($data['name2']==="logs")) {
$this->_result['devices'][$group]['items'][$id]['name'] = trim($data['name2']." ".$data['name']);
} else {
$this->_result['devices'][$group]['items'][$id]['name'] = trim($data['name']." ".$data['name2']);
}
unset($this->_result['devices'][$group]['items'][$id]['name2']);
}
 
// status and info normalize
if (isset($data['status'])) {
switch ($data['status']) {
case 'AVAIL':
if (isset($data['info'])) {
$this->_result['devices'][$group]['items'][$id]['info'] = $data['status']." ".$data['info'];
} else {
$this->_result['devices'][$group]['items'][$id]['info'] = $data['status'];
}
$this->_result['devices'][$group]['items'][$id]['status'] = "S";
break;
case 'INUSE':
case 'DEGRADED':
if (isset($data['info'])) {
$this->_result['devices'][$group]['items'][$id]['info'] = $data['status']." ".$data['info'];
} else {
$this->_result['devices'][$group]['items'][$id]['info'] = $data['status'];
}
$this->_result['devices'][$group]['items'][$id]['status'] = "W";
break;
case 'UNAVAIL':
case 'FAULTED':
if (isset($data['info'])) {
$this->_result['devices'][$group]['items'][$id]['info'] = $data['status']." ".$data['info'];
} else {
$this->_result['devices'][$group]['items'][$id]['info'] = $data['status'];
}
$this->_result['devices'][$group]['items'][$id]['status'] = "F";
break;
default:
$this->_result['devices'][$group]['items'][$id]['status'] = "ok";
}
} else {
if ($this->_result['devices'][$group]['items'][$id]['name'] == "spares") {
$this->_result['devices'][$group]['items'][$id]['status'] = "S";
} else {
$this->_result['devices'][$group]['items'][$id]['status'] = "ok";
}
}
}
}
}
}
}
 
private function execute_idrac($buffer, $device)
{
$snmptablec = array(); //controller table
$snmptableb = array(); //battery table
$snmptablev = array(); //virtual disks table
$snmptablep = array(); //physical disks table
 
$buffer = preg_replace('/End of MIB\r?\n/', '', $buffer);
$buffer = preg_replace('/\s\r?\n([^\.])/', ' $1', $buffer);
$raiddata = preg_split("/\r?\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
if (!empty($raiddata)) {
foreach ($raiddata as $line) {
if (preg_match('/^(.+) = Hex-STRING:\s(.+)/', $line, $linetmp)) {
$hexchars = explode(" ", trim($linetmp[2]));
$newstring = "";
foreach ($hexchars as $hexchar) {
$hexint = hexdec($hexchar);
if (($hexint<32) || ($hexint>126)) {
$newstring .= ".";
} else {
$newstring .= chr($hexint);
}
}
if ($newstring!=="") {
$line = $linetmp[1]." = STRING: ".$newstring;
}
}
if (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.1\.1\.2\.(.*) = STRING:\s(.*)/', $line, $data)) {
$snmptablec[$data[1]]['controllerName']=trim($data[2], "\"");
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.1\.1\.8\.(.*) = STRING:\s(.*)/', $line, $data)) {
// $snmptablec[$data[1]]['controllerFWVersion']=trim($data[2], "\"");
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.1\.1\.9\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablec[$data[1]]['controllerCacheSizeInMB']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.1\.1\.37\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablec[$data[1]]['controllerRollUpStatus']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.1\.1\.78\.(.*) = STRING:\s(.*)/', $line, $data)) {
$snmptablec[$data[1]]['controllerFQDD']=trim($data[2], "\"");
 
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.15\.1\.4\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptableb[$data[1]]['batteryState']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.15\.1\.6\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptableb[$data[1]]['batteryComponentStatus']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.15\.1\.20\.(.*) = STRING:\s(.*)/', $line, $data)) {
$snmptableb[$data[1]]['batteryFQDD']=trim($data[2], "\"");
 
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.2\.(.*) = STRING:\s(.*)/', $line, $data)) {
$snmptablep[$data[1]]['physicalDiskName']=trim($data[2], "\"");
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.4\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablep[$data[1]]['physicalDiskState']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.11\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablep[$data[1]]['physicalDiskCapacityInMB']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.22\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablep[$data[1]]['physicalDiskSpareState']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.24\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablep[$data[1]]['physicalDiskComponentStatus']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.50\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablep[$data[1]]['physicalDiskOperationalState']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.51\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablep[$data[1]]['physicalDiskProgress']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.130\.4\.1\.54\.(.*) = STRING:\s(.*)/', $line, $data)) {
$snmptablep[$data[1]]['physicalDiskFQDD']=trim($data[2], "\"");
 
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.2\.(.*) = STRING:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskName']=trim($data[2], "\"");
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.4\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskState']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.6\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskSizeInMB']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.10\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskWritePolicy']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.11\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskReadPolicy']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.13\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskLayout']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.14\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablev[$data[1]]['virtualDiskStripeSize']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.20\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablev[$data[1]]['virtualDiskComponentStatus']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.23\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskBadBlocksDetected']=$data[2];
// } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.26\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
// $snmptablev[$data[1]]['virtualDiskDiskCachePolicy']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.30\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskOperationalState']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.31\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskProgress']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.674\.10892\.5\.5\.1\.20\.140\.1\.1\.35\.(.*) = STRING:\s(.*)/', $line, $data)) {
$snmptablev[$data[1]]['virtualDiskFQDD']=trim($data[2], "\"");
}
}
 
foreach ($snmptablec as $raid_controller) {
$tablec = array(); //controller result table
if (isset($raid_controller['controllerRollUpStatus'])) {
switch ($raid_controller['controllerRollUpStatus']) {
case 1:
$tablec['status'] = "W";
$tablec['info'] = "Other";
break;
case 2:
$tablec['status'] = "W";
$tablec['info'] = "Unknown";
break;
case 3:
$tablec['status'] ="ok";
break;
case 4:
$tablec['status'] ="W";
$tablec['info'] ="Non-critical";
break;
case 5:
$tablec['status'] = "F";
$tablec['info'] = "Critical";
break;
case 6:
$tablec['status'] = "F";
$tablec['info'] = "Non-recoverable";
break;
}
}
if (isset($raid_controller['controllerName'])) {
$tablec['controller'] = $raid_controller['controllerName'];
}
if (isset($raid_controller['controllerCacheSizeInMB'])) {
$tablec['cache_size'] = $raid_controller['controllerCacheSizeInMB'] * 1024 * 1024;
}
foreach ($snmptableb as $raid_battery) {
if (isset($raid_battery['batteryFQDD'])
&& isset($raid_controller['controllerFQDD'])
&& preg_match("/:".$raid_controller['controllerFQDD']."$/", $raid_battery['batteryFQDD'])) {
if (isset($raid_battery['batteryState'])) {
switch ($raid_battery['batteryState']) {
case 1:
$tablec['battery'] = "unknown";
break;
case 2:
$tablec['battery'] = "ready";
break;
case 3:
$tablec['battery'] = "failed";
break;
case 4:
$tablec['battery'] = "degraded";
break;
case 5:
$tablec['battery'] = "missing";
break;
case 6:
$tablec['battery'] = "charging";
break;
case 7:
$tablec['battery'] = "bellowThreshold";
break;
}
}
break;
}
}
foreach ($snmptablep as $raid_physical) {
if (isset($raid_physical['physicalDiskFQDD'])
&& isset($raid_controller['controllerFQDD'])
&& preg_match("/:".$raid_controller['controllerFQDD']."$/", $raid_physical['physicalDiskFQDD'])) {
$devname = $device.'-'.preg_replace('/[a-zA-Z\.]/', '', $raid_controller['controllerFQDD']);
$this->_result['devices'][$devname]['prog'] = 'idrac';
$this->_result['devices'][$devname]['name']=$raid_controller['controllerFQDD'];
if (isset($tablec['controller'])) {
$this->_result['devices'][$devname]['controller'] = $tablec['controller'];
}
if (isset($tablec['battery'])) {
$this->_result['devices'][$devname]['battery'] = $tablec['battery'];
}
if (isset($tablec['info'])) {
$this->_result['devices'][$devname]['status'] = $tablec['info'];
} elseif (isset($tablec['status'])) {
$this->_result['devices'][$devname]['status'] = $tablec['status'];
}
$this->_result['devices'][$devname]['items'][0]['name']=$raid_controller['controllerFQDD'];
$this->_result['devices'][$devname]['items'][0]['parentid'] = 0;
if (isset($tablec['status'])) {
$this->_result['devices'][$devname]['items'][0]['status'] = $tablec['status'];
if (isset($tablec['info'])) {
$this->_result['devices'][$devname]['items'][0]['info'] = $tablec['info'];
}
}
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['name']=$raid_physical['physicalDiskName'];
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['parentid'] = 1;
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['type'] = 'disk';
 
if (isset($raid_physical['physicalDiskState'])) {
switch ($raid_physical['physicalDiskState']) {
case 1:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "W";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "unknown";
break;
case 2:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "W";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "ready";
break;
case 3:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "ok";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "online";
break;
case 4:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "W";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "foreign";
break;
case 5:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "F";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "offline";
break;
case 6:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "F";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "blocked";
break;
case 7:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "F";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "failed";
break;
case 8:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "S";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "non-raid";
break;
case 9:
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['status'] = "F";
$this->_result['devices'][$devname]['items'][$raid_physical['physicalDiskName']]['info'] = "removed";
break;
}
}
}
}
foreach ($snmptablev as $raid_virtual) {
if (isset($raid_virtual['virtualDiskFQDD'])
&& isset($raid_controller['controllerFQDD'])
&& preg_match("/:".$raid_controller['controllerFQDD']."$/", $raid_virtual['virtualDiskFQDD'])) {
$devname = $device.'-'.preg_replace('/[a-zA-Z\.]/', '', $raid_virtual['virtualDiskFQDD']);
$this->_result['devices'][$devname]['prog'] = 'idrac';
$this->_result['devices'][$devname]['name']=$raid_virtual['virtualDiskFQDD'];
$this->_result['devices'][$devname]['items'][0]['name']=$raid_virtual['virtualDiskFQDD'];
$this->_result['devices'][$devname]['items'][0]['parentid'] = 0;
if (isset($tablec['controller'])) {
$this->_result['devices'][$devname]['controller'] = $tablec['controller'];
}
if (isset($tablec['battery'])) {
$this->_result['devices'][$devname]['battery'] = $tablec['battery'];
}
if (isset($tablec['cache_size'])) {
$this->_result['devices'][$devname]['cache_size'] = $tablec['cache_size'];
}
if (isset($raid_virtual['virtualDiskLayout'])) {
switch ($raid_virtual['virtualDiskLayout']) {
case 1:
$this->_result['devices'][$devname]['level'] = "other";
break;
case 2:
$this->_result['devices'][$devname]['level'] = "raid0";
break;
case 3:
$this->_result['devices'][$devname]['level'] = "raid1";
break;
case 4:
$this->_result['devices'][$devname]['level'] = "raid5";
break;
case 5:
$this->_result['devices'][$devname]['level'] = "raid6";
break;
case 6:
$this->_result['devices'][$devname]['level'] = "raid10";
break;
case 7:
$this->_result['devices'][$devname]['level'] = "raid50";
break;
case 8:
$this->_result['devices'][$devname]['level'] = "raid60";
break;
case 9:
$this->_result['devices'][$devname]['level'] = "concatraid1";
break;
case 10:
$this->_result['devices'][$devname]['level'] = "concatraid5";
break;
default:
$this->_result['devices'][$devname]['level'] = "unknown";
}
if (isset($this->_result['devices'][$devname]['level'])) {
$this->_result['devices'][$devname]['items'][0]['name'] = $this->_result['devices'][$devname]['level'];
}
}
if (isset($raid_virtual['virtualDiskState'])) {
switch ($raid_virtual['virtualDiskState']) {
case 1:
$this->_result['devices'][$devname]['status'] = "unknown";
$this->_result['devices'][$devname]['items'][0]['status']="W";
$this->_result['devices'][$devname]['items'][0]['info'] = $this->_result['devices'][$devname]['status'];
break;
case 2:
$this->_result['devices'][$devname]['status'] = "online";
$this->_result['devices'][$devname]['items'][0]['status']="ok";
$this->_result['devices'][$devname]['items'][0]['info'] = $this->_result['devices'][$devname]['status'];
break;
case 3:
$this->_result['devices'][$devname]['status'] = "failed";
$this->_result['devices'][$devname]['items'][0]['status']="F";
$this->_result['devices'][$devname]['items'][0]['info'] = $this->_result['devices'][$devname]['status'];
break;
case 4:
$this->_result['devices'][$devname]['status'] = "degraded";
$this->_result['devices'][$devname]['items'][0]['status']="W";
$this->_result['devices'][$devname]['items'][0]['info'] = $this->_result['devices'][$devname]['status'];
break;
}
}
if (isset($raid_virtual['virtualDiskOperationalState'])) {
switch ($raid_virtual['virtualDiskOperationalState']) {
case 1:
//$this->_result['devices'][$devname]['action']['name'] = "notApplicable";
break;
case 2:
$this->_result['devices'][$devname]['action']['name'] = "reconstructing";
if (isset($raid_virtual['virtualDiskProgress'])) {
$this->_result['devices'][$devname]['action']['percent'] = $raid_virtual['virtualDiskProgress'];
} else {
$this->_result['devices'][$devname]['action']['percent'] = 0;
}
break;
case 3:
$this->_result['devices'][$devname]['action']['name'] = "resyncing";
if (isset($raid_virtual['virtualDiskProgress'])) {
$this->_result['devices'][$devname]['action']['percent'] = $raid_virtual['virtualDiskProgress'];
} else {
$this->_result['devices'][$devname]['action']['percent'] = 0;
}
break;
case 4:
$this->_result['devices'][$devname]['action']['name'] = "initializing";
if (isset($raid_virtual['virtualDiskProgress'])) {
$this->_result['devices'][$devname]['action']['percent'] = $raid_virtual['virtualDiskProgress'];
} else {
$this->_result['devices'][$devname]['action']['percent'] = 0;
}
break;
case 5:
$this->_result['devices'][$devname]['action']['name'] = "backgroundInit";
if (isset($raid_virtual['virtualDiskProgress'])) {
$this->_result['devices'][$devname]['action']['percent'] = $raid_virtual['virtualDiskProgress'];
} else {
$this->_result['devices'][$devname]['action']['percent'] = 0;
}
break;
}
}
if (isset($raid_virtual['virtualDiskSizeInMB'])) {
$this->_result['devices'][$devname]['size'] = $raid_virtual['virtualDiskSizeInMB'] * 1024 * 1024;
}
 
if (isset($raid_virtual['virtualDiskReadPolicy'])) {
switch ($raid_virtual['virtualDiskReadPolicy']) {
case 1:
$this->_result['devices'][$devname]['readpolicy'] = "noReadAhead";
break;
case 2:
$this->_result['devices'][$devname]['readpolicy'] = "readAhead";
break;
case 3:
$this->_result['devices'][$devname]['readpolicy'] = "adaptiveReadAhead";
break;
}
}
if (isset($raid_virtual['virtualDiskWritePolicy'])) {
switch ($raid_virtual['virtualDiskWritePolicy']) {
case 1:
$this->_result['devices'][$devname]['writepolicy'] = "writeThrough";
break;
case 2:
$this->_result['devices'][$devname]['writepolicy'] = "writeBack";
break;
case 3:
$this->_result['devices'][$devname]['writepolicy'] = "writeBackForce";
break;
}
}
if (isset($raid_virtual['virtualDiskState'])) {
switch ($raid_virtual['virtualDiskState']) {
case 1:
$this->_result['devices'][$devname]['status'] = "unknown";
break;
case 2:
$this->_result['devices'][$devname]['status'] = "online";
break;
case 3:
$this->_result['devices'][$devname]['status'] = "failed";
break;
case 4:
$this->_result['devices'][$devname]['status'] = "degraded";
break;
}
}
if (isset($raid_virtual['virtualDiskBadBlocksDetected'])) {
$this->_result['devices'][$devname]['bad_blocks'] = $raid_virtual['virtualDiskBadBlocksDetected'];
}
}
}
}
}
}
 
/**
* 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 (count($this->_filecontent)>0) {
foreach ($this->prog_items as $item) if (isset($this->_filecontent[$item])) {
if ($item !== 'idrac') {
if (!is_null($buffer = $this->_filecontent[$item]) && (($buffer = trim($buffer)) != "")) {
switch ($item) {
case 'mdstat':
$this->execute_mdstat($buffer);
break;
case 'dmraid':
$this->execute_dmraid($buffer);
break;
case 'megactl':
$this->execute_megactl($buffer, false);
break;
case 'megasasctl':
$this->execute_megactl($buffer, true);
break;
case 'graid':
$this->execute_graid($buffer);
break;
case 'zpool':
$this->execute_zpool($buffer);
break;
}
}
} else {
if (is_array($this->_filecontent[$item])) {
foreach ($this->_filecontent[$item] as $device=>$buffer) if (($buffer = trim($buffer)) != "") {
$this->execute_idrac($buffer, /*'idrac-'.*/$device);
}
}
}
}
}
}
 
/**
* generates the XML content for the plugin
*
* @return SimpleXMLElement entire XML content for the plugin
*/
public function xml()
{
if (empty($this->_result)) {
return $this->xml->getSimpleXmlElement();
}
$hideRaids = array();
if (defined('PSI_PLUGIN_RAID_HIDE_DEVICES') && is_string(PSI_PLUGIN_RAID_HIDE_DEVICES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_RAID_HIDE_DEVICES)) {
$hideRaids = eval(PSI_PLUGIN_RAID_HIDE_DEVICES);
} else {
$hideRaids = array(PSI_PLUGIN_RAID_HIDE_DEVICES);
}
}
foreach ($this->_result['devices'] as $key=>$device) {
if (!in_array(ltrim($key, "/"), $hideRaids, true)) {
$dev = $this->xml->addChild("Raid");
$dev->addAttribute("Device_Name", ltrim($key, "/")); //for megactl and megasasctl conflicts
$dev->addAttribute("Program", $device["prog"]);
if (isset($device['level'])) $dev->addAttribute("Level", strtolower($device["level"]));
$dev->addAttribute("Status", strtolower($device["status"]));
if (isset($device['name'])) $dev->addAttribute("Name", $device["name"]);
if (isset($device['size'])) $dev->addAttribute("Size", $device["size"]);
if (isset($device['stride'])) $dev->addAttribute("Stride", $device["stride"]);
if (isset($device['subsets'])) $dev->addAttribute("Subsets", $device["subsets"]);
if (isset($device['devs'])) $dev->addAttribute("Devs", $device["devs"]);
if (isset($device['spares'])) $dev->addAttribute("Spares", $device["spares"]);
 
if (isset($device['chunk_size'])) $dev->addAttribute("Chunk_Size", $device["chunk_size"]);
if (isset($device['pers_superblock'])) $dev->addAttribute("Persistend_Superblock", $device["pers_superblock"]);
if (isset($device['algorithm'])) $dev->addAttribute("Algorithm", $device["algorithm"]);
if (isset($device['registered'])) $dev->addAttribute("Disks_Registered", $device["registered"]);
if (isset($device['active'])) $dev->addAttribute("Disks_Active", $device["active"]);
if (isset($device['controller'])) $dev->addAttribute("Controller", $device["controller"]);
if (isset($device['battery'])) $dev->addAttribute("Battery", $device["battery"]);
if (isset($device['supported'])) $dev->addAttribute("Supported", $device["supported"]);
if (isset($device['readpolicy'])) $dev->addAttribute("ReadPolicy", $device["readpolicy"]);
if (isset($device['writepolicy'])) $dev->addAttribute("WritePolicy", $device["writepolicy"]);
if (isset($device['cache_size'])) $dev->addAttribute("Cache_Size", $device["cache_size"]);
if (isset($device['bad_blocks'])) $dev->addAttribute("Bad_Blocks", $device["bad_blocks"]);
 
if (isset($device['action'])) {
$action = $dev->addChild("Action");
$action->addAttribute("Name", $device['action']['name']);
if (isset($device['action']['percent'])) $action->addAttribute("Percent", $device['action']['percent']);
 
if (isset($device['action']['finish_time'])) $action->addAttribute("Time_To_Finish", $device['action']['finish_time']);
if (isset($device['action']['finish_unit'])) $action->addAttribute("Time_Unit", $device['action']['finish_unit']);
 
}
$disks = $dev->addChild("RaidItems");
if (isset($device['items']) && (sizeof($device['items'])>0)) foreach ($device['items'] as $disk) {
if (isset($disk['name'])) {
$disktemp = $disks->addChild("Item");
$disktemp->addAttribute("Name", $disk['name']);
// if (isset($disk['raid_index'])) $disktemp->addAttribute("Index", $disk['raid_index']);
if (isset($disk['parentid'])) $disktemp->addAttribute("ParentID", $disk['parentid']);
if (isset($disk['type'])) $disktemp->addAttribute("Type", $disk['type']);
// if (in_array(strtolower($device["status"]), array('ok', 'optimal', 'active', 'online', 'degraded'))) {
$disktemp->addAttribute("Status", $disk['status']);
//} else {
// $disktemp->addAttribute("Status", "W");
//}
if (isset($disk['info'])) $disktemp->addAttribute("Info", $disk['info']);
}
}
}
}
 
return $this->xml->getSimpleXmlElement();
}
}
/web/acc/phpsysinfo/plugins/raid/css/raid.css
0,0 → 1,27
/*
$Id: raid.css 661 2012-08-27 11:26:39Z namiltd $
*/
.plugin_raid_biun {
text-align: center;
margin-bottom: 5px;
margin-left: 10px;
_margin-left: 5px; /* ie6 */
margin-right: 10px;
_margin-right: 5px; /* ie6 */
float: left;
}
 
.plugin_raid_item {
border: solid;
border-width: 2px;
border-radius: 5px;
text-align: center;
margin: 10px;
_margin: 10px 10px 10px 5px; /* ie6 */
_padding-bottom: 8px; /* ie6 */
float: left;
}
 
img.plugin_raid_biun {
margin: auto;
}
/web/acc/phpsysinfo/plugins/raid/gfx/error.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/web/acc/phpsysinfo/plugins/raid/gfx/harddrivefail.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/web/acc/phpsysinfo/plugins/raid/gfx/harddriveok.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/web/acc/phpsysinfo/plugins/raid/gfx/harddrivespare.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/web/acc/phpsysinfo/plugins/raid/gfx/harddriveunc.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/web/acc/phpsysinfo/plugins/raid/gfx/harddrivewarn.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/web/acc/phpsysinfo/plugins/raid/js/raid.js
0,0 → 1,264
/***************************************************************************
* 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: raid.js 679 2012-09-04 10:10:11Z namiltd $
//
 
/*global $, jQuery, buildBlock, genlang, createBar, plugin_translate, datetime */
 
"use strict";
 
var raid_show = false;
 
/**
* get the details of the raid
* @param {jQuery} xml part of the plugin-XML
* @param {number} id id of the device
*/
function raid_buildinfos(xml, id) {
var html = "", prog = "", devname = "", devstatus = "", devlevel = "", devcontroller = "", devbattery = "", devsupported = "", devsize = 0, devstride = 0, devsubsets = 0, devdevs = 0, devspares = 0, devchunk = 0, devalgor = "", devpersist = 0, devreg = 0, devact = 0, devcache = 0, devbad = 0, devread = "", devwrite = "", button = "";
 
prog = $(xml).attr("Program");
devname = $(xml).attr("Name");
devstatus = $(xml).attr("Status");
devlevel = $(xml).attr("Level");
devcontroller = $(xml).attr("Controller");
devbattery = $(xml).attr("Battery");
devsupported = $(xml).attr("Supported");
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);
devchunk = parseInt($(xml).attr("Chunk_Size"), 10);
devalgor = $(xml).attr("Algorithm");
devpersist = parseInt($(xml).attr("Persistend_Superblock"), 10);
devreg = parseInt($(xml).attr("Disks_Registered"), 10);
devact = parseInt($(xml).attr("Disks_Active"), 10);
devcache = parseInt($(xml).attr("Cache_Size"), 10);
devbad = parseInt($(xml).attr("Bad_Blocks"), 10);
devread = $(xml).attr("ReadPolicy");
devwrite = $(xml).attr("WritePolicy");
html += "<tr><td>" + genlang(22, "Raid") + "</td><td>" + prog + "</td></tr>";
if (devname !== undefined) html += "<tr><td>" + genlang(3, "Raid") + "</td><td>" + devname + "</td></tr>";
html += "<tr><td>" + genlang(4, "Raid") + "</td><td>" + devstatus + "</td></tr>";
if (devlevel !== undefined) html += "<tr><td>" + genlang(5, "Raid") + "</td><td>" + devlevel + "</td></tr>";
if (!isNaN(devsize)) html += "<tr><td>" + genlang(6, "Raid") + "</td><td>" + formatBytes(devsize, xml) + "</td></tr>";
if (!isNaN(devstride)) html += "<tr><td>" + genlang(7, "Raid") + "</td><td>" + devstride + "</td></tr>";
if (!isNaN(devsubsets)) html += "<tr><td>" + genlang(8, "Raid") + "</td><td>" + devsubsets + "</td></tr>";
if (!isNaN(devdevs)) html += "<tr><td>" + genlang(9, "Raid") + "</td><td>" + devdevs + "</td></tr>";
if (!isNaN(devspares)) html += "<tr><td>" + genlang(10, "Raid") + "</td><td>" + devspares + "</td></tr>";
 
if (!isNaN(devchunk)) html += "<tr><td>" + genlang(13, "Raid") + "</td><td>" + devchunk + "K</td></tr>";
if (devalgor !== undefined) html += "<tr><td>" + genlang(14, "Raid") + "</td><td>" + devalgor + "</td></tr>";
if (!isNaN(devpersist)) {
if (devpersist == 1) {
html += "<tr><td>" + genlang(15, "Raid") + "</td><td>" + genlang(16, "Raid") + "</td></tr>";
} else {
html += "<tr><td>" + genlang(15, "Raid") + "</td><td>" + genlang(17, "Raid") + "</td></tr>";
}
}
if (!isNaN(devreg) && !isNaN(devact)) html += "<tr><td>" + genlang(18, "Raid") + "</td><td>" + devreg + "/" + devact + "</td></tr>";
if (devcontroller !== undefined) html += "<tr><td>" + genlang(19, "Raid") + "</td><td>" + devcontroller + "</td></tr>";
if (devbattery !== undefined) html += "<tr><td>" + genlang(20, "Raid") + "</td><td>" + devbattery + "</td></tr>";
if (devsupported !== undefined) html += "<tr><td>" + genlang(21, "Raid") + "</td><td>" + devsupported + "</td></tr>";
if (devread !== undefined) html += "<tr><td>" + genlang(23, "Raid") + "</td><td>" + devread + "</td></tr>";
if (devwrite !== undefined) html += "<tr><td>" + genlang(24, "Raid") + "</td><td>" + devwrite + "</td></tr>";
if (!isNaN(devcache)) html += "<tr><td>" + genlang(25, "Raid") + "</td><td>" + formatBytes(devcache, xml) + "</td></tr>";
if (!isNaN(devbad)) html += "<tr><td>" + genlang(26, "Raid") + "</td><td>" + devbad + "</td></tr>";
button += "<h3 style=\"cursor:pointer\" id=\"sPlugin_Raid_Info" + id + "\"><img src=\"./gfx/bullet_toggle_plus.gif\" alt=\"plus\" title=\"\" style=\"vertical-align:middle;width:16px;\" />" + genlang(2, "Raid") + "</h3>";
button += "<h3 style=\"cursor:pointer; display:none;\" id=\"hPlugin_Raid_Info" + id + "\"><img src=\"./gfx/bullet_toggle_minus.gif\" alt=\"minus\" title=\"\" style=\"vertical-align:middle;width:16px;\" />" + genlang(2, "Raid") + "</h3>";
button += "<table id=\"Plugin_Raid_InfoTable" + id + "\" style=\"border:none; border-collapse:collapse; display:none;\"><tbody>" + html + "</tbody></table>";
return button;
}
 
/**
* generate a html string with the current action on the disks
* @param {jQuery} xml part of the plugin-XML
*/
function raid_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(11, "Raid") + ":&nbsp;" + name + "<br>";
html += createBar(percent);
if ((time !== undefined) && (tunit !== undefined)) {
html += "<br>";
html += genlang(12, "Raid") + ":&nbsp;" + time + "&nbsp;" + tunit;
}
html += "</div>";
}
});
return html;
}
 
/**
* choose the right diskdrive icon
* @param {jQuery} xml part of the plugin-XML
*/
function raid_diskicon(xml, id) {
$("RaidItems Item", xml).each(function raid_getitems(itemid) {
var status = "", name = "", type = "", info = "", parentid = 0;
 
status = $(this).attr("Status");
name = $(this).attr("Name");
type = $(this).attr("Type");
info = $(this).attr("Info");
if (info === undefined) info = "";
parentid = parseInt($(this).attr("ParentID"), 10);
 
var img = "", alt = "", bcolor = "";
switch (status) {
case "ok":
img = "harddriveok.png";
alt = "ok";
bcolor = "green";
break;
case "F":
img = "harddrivefail.png";
alt = "fail";
bcolor = "red";
break;
case "U":
img = "harddriveunc.png";
alt = "unconfigured";
bcolor = "purple";
break;
case "S":
img = "harddrivespare.png";
alt = "spare";
bcolor = "gray";
break;
case "W":
img = "harddrivewarn.png";
alt = "warning";
bcolor = "orange";
break;
default:
// alert("--" + diskstatus + "--");
img = "error.png";
alt = "error";
 
break;
}
 
if (!isNaN(parentid)) {
if (type === "disk") {
$("#Plugin_Raid_Item" + id + "-" + parentid).append("<div class=\"plugin_raid_biun\" title=\"" + info + "\"><img src=\"./plugins/raid/gfx/" + img + "\" alt=\"" + alt + "\" style=\"width:60px;height:60px;\" onload=\"PNGload($(this));\" /><br><small>" + name + "</small></div>"); //onload IE6 PNG fix
} else {
if (parentid === 0) {
$("#Plugin_Raid_List-" + id).append("<div class=\"plugin_raid_item\" id=\"Plugin_Raid_Item" + id + "-" + (itemid+1) + "\" style=\"border-color:" + bcolor + "\">" + name + "<br></div>");
} else {
$("#Plugin_Raid_Item" + id + "-" + parentid).append("<div class=\"plugin_raid_item\" id=\"Plugin_Raid_Item" + id + "-" + (itemid+1) + "\" style=\"border-color:" + bcolor + "\">" + name + "<br></div>");
}
}
}
});
}
 
/**
* fill the plugin block
* @param {jQuery} xml plugin-XML
*/
function raid_populate(xml) {
$("#Plugin_RaidTable").empty();
$("#Plugin_RaidTable").append("<tbody>");
var arr = $("Plugins Plugin_Raid Raid", xml);
arr.each(function raid_getdevice(id) {
var htmldisks = "", buildedaction = "";
htmldisks += "<table style=\"border:none; width:100%;\"><tbody>";
htmldisks += "<tr><td id=\"Plugin_Raid_List-" + id + "\"></td></tr>";
buildedaction = raid_buildaction($(this));
if (buildedaction) {
htmldisks += "<tr><td>" + buildedaction + "</td></tr>";
}
htmldisks += "<tr><td>" + raid_buildinfos($(this), id);
/*if (id != (arr.length - 1)) { // not last element
htmldisks += "<br>";
}*/
htmldisks += "</td></tr>";
htmldisks += "</tbody></table>";
 
$("#Plugin_RaidTable").append("<tr><td><br>" + $(this).attr("Device_Name") + "</td><td>" + htmldisks + "</td></tr>");
raid_diskicon(this, id);
 
$("#sPlugin_Raid_Info" + id).click(function raid_showinfo() {
$("#Plugin_Raid_InfoTable" + id).slideDown("fast");
$("#sPlugin_Raid_Info" + id).hide();
$("#hPlugin_Raid_Info" + id).show();
});
$("#hPlugin_Raid_Info" + id).click(function raid_hideinfo() {
$("#Plugin_Raid_InfoTable" + id).slideUp("fast");
$("#hPlugin_Raid_Info" + id).hide();
$("#sPlugin_Raid_Info" + id).show();
});
raid_show = true;
});
 
$("#Plugin_RaidTable").append("</tbody>");
}
 
/**
* load the xml via ajax
*/
function raid_request() {
$("#Reload_RaidTable").attr("title", "reload");
$.ajax({
url: "xml.php?plugin=Raid",
dataType: "xml",
error: function raid_error() {
$.jGrowl("Error loading XML document for Plugin Raid");
},
success: function raid_buildblock(xml) {
populateErrors(xml);
raid_populate(xml);
if (raid_show) {
plugin_translate("Raid");
$("#Plugin_Raid").show();
}
}
});
}
 
$(document).ready(function raid_buildpage() {
var html = "";
 
$("#footer").before(buildBlock("Raid", 1, true));
html += " <div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_RaidTable\" style=\"border-collapse:collapse;\">\n";
html += " </table>\n";
html += " </div>\n";
$("#Plugin_Raid").append(html);
 
$("#Plugin_Raid").css("width", "915px");
 
raid_request();
 
$("#Reload_RaidTable").click(function raid_reload(id) {
raid_request();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/raid/js/raid_bootstrap.js
0,0 → 1,160
function renderPlugin_raid(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>" + genlang(11,'raid') + ":" + String.fromCharCode(160) + name + "<br>";
html += '<table class="table table-nopadding" style="width:100%;"><tbody><tr><td style="width:44%;"><div class="progress">' +
'<div class="progress-bar progress-bar-info" style="width:' + percent + '%;"></div>' +
'</div><div class="percent">' + percent + '%</div></td><td>&nbsp;</td></tr></tbody></table>';
if ((data.Time_To_Finish !== undefined) && (data.Time_Unit !== undefined)) {
html += genlang(12,'raid') + ":" + String.fromCharCode(160) + data.Time_To_Finish + String.fromCharCode(160) + data.Time_Unit;
}
html += "</div>";
}
}
return html;
}
 
function raid_diskicon(data , id, itemid) {
var info = "";
 
info = data.Info;
if (info === undefined) info = "";
parentid = parseInt(data.ParentID, 10);
 
var img = "", alt = "", bcolor = "";
switch (data.Status) {
case "ok":
img = "harddriveok.png";
alt = "ok";
bcolor = "green";
break;
case "F":
img = "harddrivefail.png";
alt = "fail";
bcolor = "red";
break;
case "S":
img = "harddrivespare.png";
alt = "spare";
bcolor = "gray";
break;
case "U":
img = "harddriveunc.png";
alt = "unconfigured";
bcolor = "purple";
break;
case "W":
img = "harddrivewarn.png";
alt = "warning";
bcolor = "orange";
break;
default:
// alert("--" + diskstatus + "--");
img = "error.png";
alt = "error";
 
break;
}
 
if (!isNaN(parentid)) {
if (data.Type === "disk") {
$("#raid_item" + id + "-" + parentid).append("<div style=\"margin-bottom:5px;margin-right:10px;margin-left:10px;float:left;text-align:center\" title=\"" + info + "\"><img src=\"./plugins/raid/gfx/" + img + "\" alt=\"" + alt + "\" style=\"width:60px;height:60px;\" /><br><small>" + data.Name + "</small></div>");
} else {
if (parentid === 0) {
$("#raid_list-" + id).append("<div id=\"raid_item" + id + "-" + (itemid+1) + "\" style=\"border:solid;border-width:2px;border-radius:5px;border-color:" + bcolor + ";margin:10px;float:left;text-align:center\">" + data.Name + "<br></div>");
} else {
$("#raid_item" + id + "-" + parentid).append("<div id=\"raid_item" + id + "-" + (itemid+1) + "\" style=\"border:solid;border-width:2px;border-radius:5px;border-color:" + bcolor + ";margin:10px;float:left;text-align:center\">" + data.Name + "<br></div>");
}
}
}
}
 
if (data.Plugins.Plugin_Raid !== undefined) {
var raiditems = items(data.Plugins.Plugin_Raid.Raid);
if (raiditems.length > 0) {
var html = '';
for (var i = 0; i < raiditems.length ; i++) {
html += "<tr><th>"+raiditems[i]["@attributes"].Device_Name+"</th><td>";
 
if (raiditems[i].RaidItems !== undefined) {
html += "<table class=\"table table-nopadding\" style=\"width:100%;\"><tbody>";
html += "<tr><td id=\"raid_list-" + i + "\"></td></tr>";
 
if (raiditems[i].Action !== undefined) {
var buildedaction = raid_buildaction(raiditems[i].Action['@attributes']);
if (buildedaction) {
html += "<tr><td>" + buildedaction + "</td></tr>";
}
}
 
html += "<tr><td>";
html += "<table id=\"raid-" + i + "\"class=\"table table-hover table-sm\"><tbody>";
html += "<tr class=\"treegrid-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">" + genlang(2, "raid") + "</span></td><td></td></tr>";
html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(22, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Program + "</td></tr>"; // Program
if (raiditems[i]["@attributes"].Name !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(3, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Name + "</td></tr>"; // Name
html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(4, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Status + "</td></tr>"; // Status
if (raiditems[i]["@attributes"].Level !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(5, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Level + "</td></tr>"; // RAID-Level
if (!isNaN(parseInt(raiditems[i]["@attributes"].Size))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(6, 'raid')+"</span></td><td>" + formatBytes(parseInt(raiditems[i]["@attributes"].Size), data.Options["@attributes"].byteFormat) + "</td></tr>";// Size
if (!isNaN(parseInt(raiditems[i]["@attributes"].Stride))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(7, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Stride) + "</td></tr>"; // Stride
if (!isNaN(parseInt(raiditems[i]["@attributes"].Subsets))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(8, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Subsets) + "</td></tr>"; // Subsets
if (raiditems[i]["@attributes"].Devs !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(9, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Devs) + "</td></tr>"; // Devices
if (!isNaN(parseInt(raiditems[i]["@attributes"].Spares))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(10, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Spares) + "</td></tr>"; // Spares
 
if (!isNaN(parseInt(raiditems[i]["@attributes"].Chunk_Size))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(13, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Chunk_Size) + "K</td></tr>";
if (raiditems[i]["@attributes"].Algorithm !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(14, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Algorithm + "</td></tr>";
if (!isNaN(parseInt(raiditems[i]["@attributes"].Persistend_Superblock))) {
if (parseInt(raiditems[i]["@attributes"].Persistend_Superblock) == 1) {
html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(15, 'raid')+"</span></td><td>"+genlang(16, 'raid')+"</td></tr>";
} else {
html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(15, 'raid')+"</span></td><td>"+genlang(17, 'raid')+"</td></tr>";
}
}
if (!isNaN(parseInt(raiditems[i]["@attributes"].Disks_Registered)) && !isNaN(parseInt(raiditems[i]["@attributes"].Disks_Active))) {
html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(18, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Disks_Registered) + "/<wbr>" + parseInt(raiditems[i]["@attributes"].Disks_Active) + "</td></tr>";
}
if (raiditems[i]["@attributes"].Controller !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(19, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Controller + "</td></tr>"; // Controller
if (raiditems[i]["@attributes"].Battery !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(20, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Battery + "</td></tr>"; // Battery Condition
if (raiditems[i]["@attributes"].Supported !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(21, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Supported + "</td></tr>"; // Supported RAID-Types
if (raiditems[i]["@attributes"].ReadPolicy !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(23, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].ReadPolicy + "</td></tr>"; // Read Policy
if (raiditems[i]["@attributes"].WritePolicy !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(24, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].WritePolicy + "</td></tr>"; // Write Policy
if (raiditems[i]["@attributes"].Cache_Size !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(25, 'raid')+"</span></td><td>" + formatBytes(parseInt(raiditems[i]["@attributes"].Cache_Size), data.Options["@attributes"].byteFormat) + "</td></tr>"; // Cache_Size
if (raiditems[i]["@attributes"].Bad_Blocks !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(26, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Bad_Blocks) + "</td></tr>"; // Bad_Blocks
 
html += "</tbody></table>";
html += "</td></tr>";
html += "</tbody></table>";
}
/*if (i < raiditems.length-1) { // not last element
html += "<br>";
}*/
html +="</td></tr>";
}
$('#raid-data').empty().append(html);
 
for (var k = 0; k < raiditems.length ; k++) {
if (raiditems[k].RaidItems !== undefined) {
var diskitems = items(raiditems[k].RaidItems.Item);
for (var j = 0; j < diskitems.length ; j++) {
raid_diskicon(diskitems[j]["@attributes"], k, j);
}
$('#raid-'+k).treegrid({
initialState: 'collapsed',
expanderExpandedClass: 'normalicon normalicon-down',
expanderCollapsedClass: 'normalicon normalicon-right'
});
}
}
 
$('#block_raid').show();
} else {
$('#block_raid').hide();
}
} else {
$('#block_raid').hide();
}
}
/web/acc/phpsysinfo/plugins/raid/lang/cz.xml
0,0 → 1,87
<?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_raid_001" name="raid_title">
<exp>Stav RAIDu</exp>
</expression>
<expression id="plugin_raid_002" name="raid_infos">
<exp>Dodatečné informace </exp>
</expression>
<expression id="plugin_raid_003" name="raid_name">
<exp>Name</exp>
</expression>
<expression id="plugin_raid_004" name="raid_status">
<exp>Stav</exp>
</expression>
<expression id="plugin_raid_005" name="raid_level">
<exp>Úroveň RAIDu</exp>
</expression>
<expression id="plugin_raid_006" name="raid_size">
<exp>Size</exp>
</expression>
<expression id="plugin_raid_007" name="raid_stride">
<exp>Stride</exp>
</expression>
<expression id="plugin_raid_008" name="raid_subsets">
<exp>Subsets</exp>
</expression>
<expression id="plugin_raid_009" name="raid_devs">
<exp>Devices</exp>
</expression>
<expression id="plugin_raid_010" name="raid_spares">
<exp>Spares</exp>
</expression>
<expression id="plugin_raid_011" name="raid_curact">
<exp>Current Action</exp>
</expression>
<expression id="plugin_raid_012" name="raid_finish">
<exp>Čas dokončení</exp>
</expression>
<expression id="plugin_raid_013" name="raid_chunk">
<exp>Velikost proužku</exp>
</expression>
<expression id="plugin_raid_014" name="raid_algo">
<exp>Algoritmus</exp>
</expression>
<expression id="plugin_raid_015" name="raid_superb">
<exp>Persistentní Superblock</exp>
</expression>
<expression id="plugin_raid_016" name="raid_avail">
<exp>dostupný</exp>
</expression>
<expression id="plugin_raid_017" name="raids_navail">
<exp>nedostupný</exp>
</expression>
<expression id="plugin_raid_018" name="raid_regact">
<exp>Registrovné/aktivní disky</exp>
</expression>
<expression id="plugin_raid_019" name="raid_controller">
<exp>Controller</exp>
</expression>
<expression id="plugin_raid_020" name="raid_battcond">
<exp>Battery Condition</exp>
</expression>
<expression id="plugin_raid_021" name="raid_supported">
<exp>Poodporované typy RAID</exp>
</expression>
<expression id="plugin_raid_022" name="raid_program">
<exp>Program</exp>
</expression>
<expression id="plugin_raid_023" name="raid_readpolicy">
<exp>Read Policy</exp>
</expression>
<expression id="plugin_raid_024" name="raid_writepolicy">
<exp>Write Policy</exp>
</expression>
<expression id="plugin_raid_025" name="raid_cachesize">
<exp>Cache Size</exp>
</expression>
<expression id="plugin_raid_026" name="raid_badblocks">
<exp>Bad Blocks</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/raid/lang/de.xml
0,0 → 1,87
<?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_raid_001" name="raid_title">
<exp>RAID Status</exp>
</expression>
<expression id="plugin_raid_002" name="raid_infos">
<exp>Zusätzliche Informationen</exp>
</expression>
<expression id="plugin_raid_003" name="raid_name">
<exp>Name</exp>
</expression>
<expression id="plugin_raid_004" name="raid_status">
<exp>Status</exp>
</expression>
<expression id="plugin_raid_005" name="raid_level">
<exp>RAID-Level</exp>
</expression>
<expression id="plugin_raid_006" name="raid_size">
<exp>Size</exp>
</expression>
<expression id="plugin_raid_007" name="raid_stride">
<exp>Stride</exp>
</expression>
<expression id="plugin_raid_008" name="raid_subsets">
<exp>Subsets</exp>
</expression>
<expression id="plugin_raid_009" name="raid_devs">
<exp>Devices</exp>
</expression>
<expression id="plugin_raid_010" name="raid_spares">
<exp>Spares</exp>
</expression>
<expression id="plugin_raid_011" name="raid_curact">
<exp>Current Action</exp>
</expression>
<expression id="plugin_raid_012" name="raid_finish">
<exp>Fertig in</exp>
</expression>
<expression id="plugin_raid_013" name="raid_chunk">
<exp>Blockgröße</exp>
</expression>
<expression id="plugin_raid_014" name="raid_algo">
<exp>Algorithmus</exp>
</expression>
<expression id="plugin_raid_015" name="raid_superb">
<exp>Persistenter Superblock</exp>
</expression>
<expression id="plugin_raid_016" name="raid_avail">
<exp>verfügbar</exp>
</expression>
<expression id="plugin_raid_017" name="raids_navail">
<exp>nicht verfügbar</exp>
</expression>
<expression id="plugin_raid_018" name="raid_regact">
<exp>Registrierte/Aktive Platten</exp>
</expression>
<expression id="plugin_raid_019" name="raid_controller">
<exp>Controller</exp>
</expression>
<expression id="plugin_raid_020" name="raid_battcond">
<exp>Akku-Zustand</exp>
</expression>
<expression id="plugin_raid_021" name="raid_supported">
<exp>Unterstützte RAID-Typen</exp>
</expression>
<expression id="plugin_raid_022" name="raid_program">
<exp>Program</exp>
</expression>
<expression id="plugin_raid_023" name="raid_readpolicy">
<exp>Read Policy</exp>
</expression>
<expression id="plugin_raid_024" name="raid_writepolicy">
<exp>Write Policy</exp>
</expression>
<expression id="plugin_raid_025" name="raid_cachesize">
<exp>Cache Size</exp>
</expression>
<expression id="plugin_raid_026" name="raid_badblocks">
<exp>Bad Blocks</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/raid/lang/en.xml
0,0 → 1,87
<?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_raid_001" name="raid_title">
<exp>RAID Status</exp>
</expression>
<expression id="plugin_raid_002" name="raid_infos">
<exp>Additional Information</exp>
</expression>
<expression id="plugin_raid_003" name="raid_name">
<exp>Name</exp>
</expression>
<expression id="plugin_raid_004" name="raid_status">
<exp>Status</exp>
</expression>
<expression id="plugin_raid_005" name="raid_level">
<exp>RAID-Level</exp>
</expression>
<expression id="plugin_raid_006" name="raid_size">
<exp>Size</exp>
</expression>
<expression id="plugin_raid_007" name="raid_stride">
<exp>Stride</exp>
</expression>
<expression id="plugin_raid_008" name="raid_subsets">
<exp>Subsets</exp>
</expression>
<expression id="plugin_raid_009" name="raid_devs">
<exp>Devices</exp>
</expression>
<expression id="plugin_raid_010" name="raid_spares">
<exp>Spares</exp>
</expression>
<expression id="plugin_raid_011" name="raid_curact">
<exp>Current Action</exp>
</expression>
<expression id="plugin_raid_012" name="raid_finish">
<exp>Finishing in</exp>
</expression>
<expression id="plugin_raid_013" name="raid_chunk">
<exp>Chunk Size</exp>
</expression>
<expression id="plugin_raid_014" name="raid_algo">
<exp>Algorithm</exp>
</expression>
<expression id="plugin_raid_015" name="raid_superb">
<exp>Persistent Superblock</exp>
</expression>
<expression id="plugin_raid_016" name="raid_avail">
<exp>available</exp>
</expression>
<expression id="plugin_raid_017" name="raids_navail">
<exp>not available</exp>
</expression>
<expression id="plugin_raid_018" name="raid_regact">
<exp>Registered/Active Disks</exp>
</expression>
<expression id="plugin_raid_019" name="raid_controller">
<exp>Controller</exp>
</expression>
<expression id="plugin_raid_020" name="raid_battcond">
<exp>Battery Condition</exp>
</expression>
<expression id="plugin_raid_021" name="raid_supported">
<exp>Supported RAID-Types</exp>
</expression>
<expression id="plugin_raid_022" name="raid_program">
<exp>Program</exp>
</expression>
<expression id="plugin_raid_023" name="raid_readpolicy">
<exp>Read Policy</exp>
</expression>
<expression id="plugin_raid_024" name="raid_writepolicy">
<exp>Write Policy</exp>
</expression>
<expression id="plugin_raid_025" name="raid_cachesize">
<exp>Cache Size</exp>
</expression>
<expression id="plugin_raid_026" name="raid_badblocks">
<exp>Bad Blocks</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/raid/lang/fr.xml
0,0 → 1,86
<?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_raid_001" name="raid_title">
<exp>Statut RAID</exp>
</expression>
<expression id="plugin_raid_002" name="raid_infos">
<exp>Informations additionnelles</exp>
</expression>
<expression id="plugin_raid_003" name="raid_name">
<exp>Nom</exp>
</expression>
<expression id="plugin_raid_004" name="raid_status">
<exp>Status</exp>
</expression>
<expression id="plugin_raid_005" name="raid_level">
<exp>Type de RAID</exp>
</expression>
<expression id="plugin_raid_006" name="raid_size">
<exp>Taille</exp>
</expression>
<expression id="plugin_raid_007" name="raid_stride">
<exp>Granularité</exp>
</expression>
<expression id="plugin_raid_008" name="raid_subsets">
<exp>Sous-ensembles</exp>
</expression>
<expression id="plugin_raid_009" name="raid_devs">
<exp>Périphériques</exp>
</expression>
<expression id="plugin_raid_010" name="raid_spares">
<exp>Rechanges</exp>
</expression>
<expression id="plugin_raid_011" name="raid_curact">
<exp>Action courante</exp>
</expression>
<expression id="plugin_raid_012" name="raid_finish">
<exp>Temps restant</exp>
</expression>
<expression id="plugin_raid_013" name="raid_chunk">
<exp>Granularité</exp>
</expression>
<expression id="plugin_raid_014" name="raid_algo">
<exp>Algorithme</exp>
</expression>
<expression id="plugin_raid_015" name="raid_superb">
<exp>Superblocs persistants</exp>
</expression>
<expression id="plugin_raid_016" name="raid_avail">
<exp>disponible</exp>
</expression>
<expression id="plugin_raid_017" name="raids_navail">
<exp>non disponible</exp>
</expression>
<expression id="plugin_raid_018" name="raid_regact">
<exp>Disques Enregistrés/Actives</exp>
</expression>
<expression id="plugin_raid_019" name="raid_controller">
<exp>Controller</exp>
</expression>
<expression id="plugin_raid_020" name="raid_battcond">
<exp>Battery Condition</exp>
</expression>
<expression id="plugin_raid_021" name="raid_supported">
<exp>Type de RAID supporté</exp>
</expression>
<expression id="plugin_raid_022" name="raid_program">
<exp>Program</exp>
</expression>
<expression id="plugin_raid_023" name="raid_readpolicy">
<exp>Read Policy</exp>
</expression>
<expression id="plugin_raid_024" name="raid_writepolicy">
<exp>Write Policy</exp>
</expression>
<expression id="plugin_raid_025" name="raid_cachesize">
<exp>Cache Size</exp>
</expression>
<expression id="plugin_raid_026" name="raid_badblocks">
<exp>Bad Blocks</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/raid/lang/gr.xml
0,0 → 1,87
<?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: ChriZathens
-->
<tns:translationPlugin language="greek" 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_raid_001" name="raid_title">
<exp>Κατάσταση RAID</exp>
</expression>
<expression id="plugin_raid_002" name="raid_infos">
<exp>Επιπρόσθετες Πληροφορίες</exp>
</expression>
<expression id="plugin_raid_003" name="raid_name">
<exp>Όνομα</exp>
</expression>
<expression id="plugin_raid_004" name="raid_status">
<exp>Κατάσταση</exp>
</expression>
<expression id="plugin_raid_005" name="raid_level">
<exp>Τύπος RAID</exp>
</expression>
<expression id="plugin_raid_006" name="raid_size">
<exp>Μέγεθος</exp>
</expression>
<expression id="plugin_raid_007" name="raid_stride">
<exp>Stride</exp>
</expression>
<expression id="plugin_raid_008" name="raid_subsets">
<exp>Υποσύνολα</exp>
</expression>
<expression id="plugin_raid_009" name="raid_devs">
<exp>Συσκευές</exp>
</expression>
<expression id="plugin_raid_010" name="raid_spares">
<exp>Spares</exp>
</expression>
<expression id="plugin_raid_011" name="raid_curact">
<exp>Τρέχουσα Ενέργεια</exp>
</expression>
<expression id="plugin_raid_012" name="raid_finish">
<exp>Ολοκληρώνεται σε</exp>
</expression>
<expression id="plugin_raid_013" name="raid_chunk">
<exp>Μέγεθος Chunk</exp>
</expression>
<expression id="plugin_raid_014" name="raid_algo">
<exp>Αλγόριθμος</exp>
</expression>
<expression id="plugin_raid_015" name="raid_superb">
<exp>Μόνιμο Superblock</exp>
</expression>
<expression id="plugin_raid_016" name="raid_avail">
<exp>διαθέσιμο</exp>
</expression>
<expression id="plugin_raid_017" name="raids_navail">
<exp>μη διαθέσιμο</exp>
</expression>
<expression id="plugin_raid_018" name="raid_regact">
<exp>Δηλωμένοι/Ενεργοί Δίσκοι</exp>
</expression>
<expression id="plugin_raid_019" name="raid_controller">
<exp>Controller</exp>
</expression>
<expression id="plugin_raid_020" name="raid_battcond">
<exp>Κατάσταση Μπαταρίας</exp>
</expression>
<expression id="plugin_raid_021" name="raid_supported">
<exp>Αχρησιμοποίητοι Δίσκοι</exp>
</expression>
<expression id="plugin_raid_022" name="raid_program">
<exp>Πρόγραμμα</exp>
</expression>
<expression id="plugin_raid_023" name="raid_readpolicy">
<exp>Πολιτικές Ανάγνωσης</exp>
</expression>
<expression id="plugin_raid_024" name="raid_writepolicy">
<exp>Πολιτικές Εγγραφής</exp>
</expression>
<expression id="plugin_raid_025" name="raid_cachesize">
<exp>Μέγεθος Λανθάνουσας Μνήμης</exp>
</expression>
<expression id="plugin_raid_026" name="raid_badblocks">
<exp>Bad Blocks</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/raid/lang/ro.xml
0,0 → 1,87
<?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_raid_001" name="raid_title">
<exp>Stare RAID</exp>
</expression>
<expression id="plugin_raid_002" name="raid_infos">
<exp>Informații Aditionale </exp>
</expression>
<expression id="plugin_raid_003" name="raid_name">
<exp>Nume</exp>
</expression>
<expression id="plugin_raid_004" name="raid_status">
<exp>Stare</exp>
</expression>
<expression id="plugin_raid_005" name="raid_level">
<exp>Nivele RAID</exp>
</expression>
<expression id="plugin_raid_006" name="raid_size">
<exp>Dimensiune</exp>
</expression>
<expression id="plugin_raid_007" name="raid_stride">
<exp>Pas</exp>
</expression>
<expression id="plugin_raid_008" name="raid_subsets">
<exp>Subseturi</exp>
</expression>
<expression id="plugin_raid_009" name="raid_devs">
<exp>Dispozitive</exp>
</expression>
<expression id="plugin_raid_010" name="raid_spares">
<exp>Piese</exp>
</expression>
<expression id="plugin_raid_011" name="raid_curact">
<exp>Acțiune curentă</exp>
</expression>
<expression id="plugin_raid_012" name="raid_finish">
<exp>finisare în</exp>
</expression>
<expression id="plugin_raid_013" name="raid_chunk">
<exp>Chunk Size</exp>
</expression>
<expression id="plugin_raid_014" name="raid_algo">
<exp>Algoritm</exp>
</expression>
<expression id="plugin_raid_015" name="raid_superb">
<exp>Superblock persistente</exp>
</expression>
<expression id="plugin_raid_016" name="raid_avail">
<exp>disponibil</exp>
</expression>
<expression id="plugin_raid_017" name="raids_navail">
<exp>indisponibil</exp>
</expression>
<expression id="plugin_raid_018" name="raid_regact">
<exp>Înregistrate/Discuri Active</exp>
</expression>
<expression id="plugin_raid_019" name="raid_controller">
<exp>Controller</exp>
</expression>
<expression id="plugin_raid_020" name="raid_battcond">
<exp>Condiții Baterie</exp>
</expression>
<expression id="plugin_raid_021" name="raid_supported">
<exp>Discuri defolosite</exp>
</expression>
<expression id="plugin_raid_022" name="raid_program">
<exp>Program</exp>
</expression>
<expression id="plugin_raid_023" name="raid_readpolicy">
<exp>Read Policy</exp>
</expression>
<expression id="plugin_raid_024" name="raid_writepolicy">
<exp>Write Policy</exp>
</expression>
<expression id="plugin_raid_025" name="raid_cachesize">
<exp>Cache Size</exp>
</expression>
<expression id="plugin_raid_026" name="raid_badblocks">
<exp>Bad Blocks</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/raid/lang/ru.xml
0,0 → 1,86
<?xml version="1.0" encoding="utf-8"?>
<!--
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_raid_001" name="raid_title">
<exp>RAID Статус</exp>
</expression>
<expression id="plugin_raid_002" name="raid_infos">
<exp>Дополнительная Информация</exp>
</expression>
<expression id="plugin_raid_003" name="raid_name">
<exp>Имя</exp>
</expression>
<expression id="plugin_raid_004" name="raid_status">
<exp>Статус</exp>
</expression>
<expression id="plugin_raid_005" name="raid_level">
<exp>RAID-Уровень</exp>
</expression>
<expression id="plugin_raid_006" name="raid_size">
<exp>Размер</exp>
</expression>
<expression id="plugin_raid_007" name="raid_stride">
<exp>Шаг</exp>
</expression>
<expression id="plugin_raid_008" name="raid_subsets">
<exp>Подмножество</exp>
</expression>
<expression id="plugin_raid_009" name="raid_devs">
<exp>Устройство</exp>
</expression>
<expression id="plugin_raid_010" name="raid_spares">
<exp>Резервировано</exp>
</expression>
<expression id="plugin_raid_011" name="raid_curact">
<exp>Текущее действие</exp>
</expression>
<expression id="plugin_raid_012" name="raid_finish">
<exp>Окончание в</exp>
</expression>
<expression id="plugin_raid_013" name="raid_chunk">
<exp>Размер блока</exp>
</expression>
<expression id="plugin_raid_014" name="raid_algo">
<exp>Алгоритм</exp>
</expression>
<expression id="plugin_raid_015" name="raid_superb">
<exp>Постоянный суперблок</exp>
</expression>
<expression id="plugin_raid_016" name="raid_avail">
<exp>доступен</exp>
</expression>
<expression id="plugin_raid_017" name="raids_navail">
<exp>не доступен</exp>
</expression>
<expression id="plugin_raid_018" name="raid_regact">
<exp>Зарегистрировано/Активных Дисков</exp>
</expression>
<expression id="plugin_raid_019" name="raid_controller">
<exp>Controller</exp>
</expression>
<expression id="plugin_raid_020" name="raid_battcond">
<exp>Состояние аккумулятора</exp>
</expression>
<expression id="plugin_raid_021" name="raid_supported">
<exp>Неиспользуемые диски</exp>
</expression>
<expression id="plugin_raid_022" name="raid_program">
<exp>Program</exp>
</expression>
<expression id="plugin_raid_023" name="raid_readpolicy">
<exp>Read Policy</exp>
</expression>
<expression id="plugin_raid_024" name="raid_writepolicy">
<exp>Write Policy</exp>
</expression>
<expression id="plugin_raid_025" name="raid_cachesize">
<exp>Cache Size</exp>
</expression>
<expression id="plugin_raid_026" name="raid_badblocks">
<exp>Bad Blocks</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/raid/raid_bootstrap.html
0,0 → 1,15
<div class="col-lg-12" id="block_raid" style="display:none;">
<div class="card" id="panel_raid" style="display:none;">
<div class="card-header"><span class="lang_plugin_raid_001">RAID Status</span>
<div id="reload_raid" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="raid" class="table borderless table-sm">
<tbody id="raid-data">
</tbody>
</table>
</div>
</div>
</div>
</div>
/web/acc/phpsysinfo/plugins/smart/css/smart.css
0,0 → 1,10
/*
$Id: smart.css 661 2012-08-27 11:26:39Z namiltd $
*/
#Plugin_SMARTTable tbody tr td {
text-align: right;
}
 
#Plugin_SMARTTable thead tr th {
cursor: pointer;
}
/web/acc/phpsysinfo/plugins/smart/js/smart.js
0,0 → 1,148
/***************************************************************************
* 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 += "<div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_SMARTTable\" style=\"border-collapse:collapse;\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th class=\"right\">" + genlang(2, "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), "SMART") + "</th>\n";
});
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody>\n";
html += " </tbody>\n";
html += " </table>\n";
html += "</div>\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");
smart_show = true;
});
 
// 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").replace(/\)/g, ")<wbr>");
$(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)
$("Plugins Plugin_SMART columns column", xml).each(function smart_find_columns() {
i = parseInt($(this).attr("id"), 10);
if (typeof(values[i])==='undefined') {
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);
});
}
 
/**
* load the xml via ajax
*/
function smart_request() {
$("#Reload_SMARTTable").attr("title", "reload");
$.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);
if ((smart_table === undefined) || (typeof(smart_table) !== "object")) {
smart_buildTable(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_request();
 
$("#Reload_SMARTTable").click(function smart_reload(id) {
smart_request();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/smart/js/smart_bootstrap.js
0,0 → 1,85
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:"plugin_smart_101", // "Raw Read Error Rate",
2:"plugin_smart_102", // "Throughput Performance",
3:"plugin_smart_103", // "Spin Up Time",
4:"plugin_smart_104", // "Start Stop Count",
5:"plugin_smart_105", // "Reallocated Sector Ct",
7:"plugin_smart_106", // "Seek Error Rate",
8:"plugin_smart_108", // "Seek Time Performance",
9:"plugin_smart_109", // "Power On Hours",
10:"plugin_smart_110", // "Spin Retry Count",
11:"plugin_smart_111", // "Calibration Retry Count",
12:"plugin_smart_112", // "Power Cycle Count",
190:"plugin_smart_290", // "Airflow Temperature",
191:"plugin_smart_291", // "G-sense Error Rate",
192:"plugin_smart_292", // "Power-Off Retract Count",
193:"plugin_smart_293", // "Load Cycle Count",
194:"plugin_smart_294", // "Temperature",
195:"plugin_smart_295", // "Hardware ECC Recovered",
196:"plugin_smart_296", // "Reallocated Event Count",
197:"plugin_smart_297", // "Current Pending Sector",
198:"plugin_smart_298", // "Offline Uncorr.",
199:"plugin_smart_299", // "UDMA CRC Error Count",
200:"plugin_smart_300", // "Multi Zone Error Rate",
201:"plugin_smart_301", // "Soft Read Error Rate",
202:"plugin_smart_302", // "Data Address Mark Errors",
223:"plugin_smart_323", // "Load Retry Count",
225:"plugin_smart_325", }; // "Load Cycle Count"
var html = '';
var i,j;
var smartid;
 
html+="<thead>";
html+="<tr>";
html+="<th id=\"smart_name\" class=\"rightCell\">"+genlang(2, 'smart')+"</th>"; // Name
for (i = 0; i < smartitems.length ; i++) {
smartid = smartitems[i]["@attributes"].id;
if (smartnames[smartid] !== undefined) {
html+="<th class=\"sorttable_numeric rightCell\">"+ genlang(100+parseInt(smartid), 'smart') + "</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++) {
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();
}
}
/web/acc/phpsysinfo/plugins/smart/lang/cz.xml
0,0 → 1,94
<?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_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>
/web/acc/phpsysinfo/plugins/smart/lang/en.xml
0,0 → 1,94
<?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_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>
/web/acc/phpsysinfo/plugins/smart/lang/fr.xml
0,0 → 1,94
<?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_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>
/web/acc/phpsysinfo/plugins/smart/lang/gr.xml
0,0 → 1,94
<?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="greek" 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_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>
/web/acc/phpsysinfo/plugins/smart/lang/pl.xml
0,0 → 1,94
<?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_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>
/web/acc/phpsysinfo/plugins/smart/lang/ro.xml
0,0 → 1,94
<?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_smart_001" name="smart_title">
<exp>Informații S.M.A.R.T</exp>
</expression>
<expression id="plugin_smart_002" name="smart_name">
<exp>Nume</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>
/web/acc/phpsysinfo/plugins/smart/class.smart.inc.php
0,0 → 1,365
<?php
/**
* 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 2, or (at your option) any later version
* @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 'wmi':
case 'command':
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);
}
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->addConfigError("__construct()", "[smart] ACCESS");
break;
}
 
switch (strtolower(PSI_PLUGIN_SMART_ACCESS)) {
case 'wmi':
if (PSI_OS == 'WINNT') {
$asd_wmi = null;
try {
$objLocator = new COM('WbemScripting.SWbemLocator');
$wmi = $objLocator->ConnectServer('', 'root\wmi');
$asd_wmi = CommonFunctions::getWMI($wmi, 'MSStorageDriver_ATAPISmartData', array('VendorSpecific'));
} catch (Exception $e) {
}
foreach ($asd_wmi as $_nr=>$asd) {
$_name = "/dev/sd".chr(97+$_nr);
if (array_search($_name, $disks) !== false) {
$this->_filecontent[$_name] = "\nVendor Specific SMART Attributes with Thresholds\n";
$this->_filecontent[$_name] .= "ID# _ATTRIBUTE_NAME_ FLAG VALUE WORST RAW_VALUE\n";
$asdvs = $asd['VendorSpecific'];
for ($c = 2; $c < count($asdvs); $c += 12) {
//Attribute values 0x00, 0xff are invalid
$id = $asdvs[$c];
if (($id != 0) && ($id != 255)) {
switch ($id) {
case 3:
//raw16(avg16)
$this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";
break;
case 5:
case 196:
//raw16(raw16)
$this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";
break;
case 9:
case 240:
//raw24(raw8)
$this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7])."\n";
break;
case 190:
case 194:
//tempminmax
$this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";
break;
default:
//raw48
$this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7]+16777216*$asdvs[$c+8])."\n";
break;
}
}
}
$this->_filecontent[$_name] .= "SMART Error Log Version";
}
}
}
break;
case 'command':
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;
}
}
}
break;
case 'data':
$dn=0;
foreach ($disks as $disk) {
$buffer="";
if (CommonFunctions::rfts(PSI_APP_ROOT."/data/smart{$dn}.txt", $buffer) && !empty($buffer)) {
$this->_filecontent[$disk] = $buffer;
}
$dn++;
}
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 and MVMe devices
if (!empty($this->_ids[1]) && ($this->_ids[1]=="raw_value")) {
if (preg_match('/\nread\: (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[7]!=null)) {
$this->_result[$disk][0]['id'] = 1;
$this->_result[$disk][0]['attribute_name'] = "Raw_Read_Error_Rate";
$this->_result[$disk][0]['raw_value'] = trim($values[7]);
}
} elseif (preg_match('/\Media and Data Integrity Errors\: (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[5]!=null)) {
$vals=preg_replace('/,/', '', trim($values[5]));
$this->_result[$disk][0]['id'] = 1;
$this->_result[$disk][0]['attribute_name'] = "Raw_Read_Error_Rate";
$this->_result[$disk][0]['raw_value'] = $vals;
}
}
}
if (!empty($this->_ids[5]) && ($this->_ids[5]=="raw_value")) {
if (preg_match('/\nElements in grown defect list\: (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[5]!=null)) {
$this->_result[$disk][1]['id'] = 5;
$this->_result[$disk][1]['attribute_name'] = "Reallocated_Sector_Ct";
$this->_result[$disk][1]['raw_value'] = trim($values[5]);
}
}
}
if (!empty($this->_ids[9]) && ($this->_ids[9]=="raw_value")) {
if (preg_match('/\n +number of hours powered up = (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[7]!=null)) {
$vals=preg_split('/[,\.]/', trim($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];
}
} elseif (preg_match('/\nPower On Hours\: (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[3]!=null)) {
$vals=preg_replace('/,/', '', trim($values[3]));
$this->_result[$disk][2]['id'] = 9;
$this->_result[$disk][2]['attribute_name'] = "Power_On_Hours";
$this->_result[$disk][2]['raw_value'] = $vals;
}
}
}
if (!empty($this->_ids[194]) && ($this->_ids[194]=="raw_value")) {
if (preg_match('/\nCurrent Drive Temperature\: (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[3]!=null)) {
$this->_result[$disk][3]['id'] = 194;
$this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius";
$this->_result[$disk][3]['raw_value'] = trim($values[3]);
}
} elseif (preg_match('/\nTemperature\: (.*) Celsius/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[1]!=null)) {
$this->_result[$disk][3]['id'] = 194;
$this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius";
$this->_result[$disk][3]['raw_value'] = trim($values[1]);
}
}
}
if (!empty($this->_ids[12]) && ($this->_ids[12]=="raw_value")) {
if (preg_match('/\nPower Cycles\: (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[2]!=null)) {
$vals=preg_replace('/,/', '', trim($values[2]));
$this->_result[$disk][4]['id'] = 12;
$this->_result[$disk][4]['attribute_name'] = "Power_Cycle_Count";
$this->_result[$disk][4]['raw_value'] = $vals;
}
}
}
if (!empty($this->_ids[192]) && ($this->_ids[192]=="raw_value")) {
if (preg_match('/\nUnsafe Shutdowns\: (.*)\n/', $result, $lines)) {
$values=preg_split('/ +/', $lines[0]);
if (!empty($values) && ($values[2]!=null)) {
$vals=preg_replace('/,/', '', trim($values[2]));
$this->_result[$disk][5]['id'] = 192;
$this->_result[$disk][5]['attribute_name'] = "Unsafe_Shutdown_Count";
$this->_result[$disk][5]['raw_value'] = $vals;
}
}
}
}
}
//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 SimpleXMLElement 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) && isset($lineInfos['attribute_name']) && ($lineInfos['attribute_name'] !== "Power_On_Hours")) { //Power_On_Hours_and_Msec and Power_On_Seconds
$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();
}
}
/web/acc/phpsysinfo/plugins/smart/smart_bootstrap.html
0,0 → 1,12
<div class="col-lg-12" id="block_smart" style="display:none;">
<div class="card" id="panel_smart" style="display:none;">
<div class="card-header"><span class="lang_plugin_smart_001">S.M.A.R.T Informations</span>
<div id="reload_smart" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="smart" class="table table-hover table-sm"></table>
</div>
</div>
</div>
</div>
/web/acc/phpsysinfo/plugins/snmppinfo/js/snmppinfo.js
0,0 → 1,160
/***************************************************************************
* 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: snmppinfo.js 661 2012-08-27 11:26:39Z namiltd $
//
 
/*global $, jQuery, buildBlock, datetime, plugin_translate, createBar, genlang */
 
"use strict";
 
var snmppinfo_show = false;
 
/**
* build the table where content is inserted
* @param {jQuery} xml plugin-XML
*/
function snmppinfo_buildTable(xml) {
var html = "", tree = [], closed = [];
 
$("#Plugin_SNMPPInfo #Plugin_SNMPPInfoTable").remove();
 
html += " <div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_SNMPPInfoTable\" class=\"tablemain\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th>" + genlang(2, "SNMPPInfo") + "</th>\n";
html += " <th style=\"width:120px;\">" + genlang(3, "SNMPPInfo") + "</th>\n";
html += " <th class=\"right\" style=\"width:100px;\">" + genlang(4, "SNMPPInfo") + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody class=\"tree\">\n";
 
var lastdev="", index = 0 ;
$("Plugins Plugin_SNMPPInfo Printer MarkerSupplies", xml).each(function snmppinfo_getprinters(id) {
var close = 0, name = "", device = "", desc = "", unit = 0, max = 0, level = 0, percent = 0, units = "", supply = 0, sunits = "";
name = $(this).parent().attr("Name");
device = $(this).parent().attr("Device");
desc = $(this).attr("Description");
 
unit = parseInt($(this).attr("SupplyUnit"), 10);
max = parseInt($(this).attr("MaxCapacity"), 10);
level = parseInt($(this).attr("Level"), 10);
supply = parseInt($(this).attr("SupplyUnit"), 10);
 
if (max>0 && (level>=0) && (level<=max) ) {
percent = Math.round(100*level/max);
units = level+" / "+max;
} else if (max==-2 && (level>=0) && (level<=100) ) {
percent = level;
units = level+" / 100";
} else if (level==-3) {
percent = 100;
units = genlang(5, "SNMPPInfo");
} else {
percent = 0;
units = genlang(6, "SNMPPInfo");
}
 
if (device!=lastdev) {
html += " <tr><td colspan=\"3\"><div class=\"treediv\"><span class=\"treespanbold\">" + device + " (" + name + ") </div></span></td></tr>\n";
index = tree.push(0);
lastdev = device;
}
if (!isNaN(supply)) {
switch (supply) {
case 7:
sunits = "<br>" + genlang(9, "SNMPPInfo");
break;
case 13:
sunits = "<br>" + genlang(8, "SNMPPInfo");
break;
case 15:
sunits = "<br>" + genlang(7, "SNMPPInfo");
break;
case 19:
sunits = "<br>" + genlang(3, "SNMPPInfo");
break;
}
}
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + desc + "</div></span></td><td>" + createBar(percent) +"</td><td class=\"right\">" + units + sunits + "</td></tr>\n";
 
tree.push(index);
snmppinfo_show = true;
});
 
html += " </tbody>\n";
html += " </table>\n";
html += " </div>\n";
 
$("#Plugin_SNMPPInfo").append(html);
 
$("#Plugin_SNMPPInfoTable").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 snmppinfo_request() {
$("#Reload_SNMPPInfoTable").attr("title", "reload");
$.ajax({
url: "xml.php?plugin=SNMPPInfo",
dataType: "xml",
error: function snmppinfo_error() {
$.jGrowl("Error loading XML document for Plugin SNMPPInfo!");
},
success: function snmppinfo_buildblock(xml) {
populateErrors(xml);
snmppinfo_buildTable(xml);
if (snmppinfo_show) {
plugin_translate("SNMPPInfo");
$("#Plugin_SNMPPInfo").show();
}
}
});
}
 
$(document).ready(function snmppinfo_buildpage() {
$("#footer").before(buildBlock("SNMPPInfo", 1, true));
$("#Plugin_SNMPPInfo").css("width", "451px");
 
snmppinfo_request();
 
$("#Reload_SNMPPInfoTable").click(function snmppinfo_reload(id) {
snmppinfo_request();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/snmppinfo/js/snmppinfo_bootstrap.js
0,0 → 1,117
function renderPlugin_snmppinfo(data) {
 
var directives = {
Device: {
text: function () {
var Name = (this.Name !== undefined) ? (' (' + this.Name + ')'): '';
return this.Device + Name;
}
},
Percent: {
html: function () {
var max = parseInt(this.MaxCapacity);
var level = parseInt(this.Level);
var percent = 0;
 
if (max>0 && (level>=0) && (level<=max) ) {
percent = Math.round(100*level/max);
} else if (max==-2 && (level>=0) && (level<=100) ) {
percent = level;
} else if (level==-3) {
percent = 100;
}
return '<div class="progress"><div class="progress-bar progress-bar-info" style="width:' + percent + '%;"></div>' +
'</div><div class="percent">' + percent + '%</div>';
}
},
Units: {
html: function () {
var max = parseInt(this.MaxCapacity);
var level = parseInt(this.Level);
 
if (max>0 && (level>=0) && (level<=max) ) {
return level+" / "+max;
} else if (max==-2 && (level>=0) && (level<=100) ) {
return level+" / 100";
} else if (level==-3) {
return genlang(5, 'snmppinfo'); // enough
} else {
return genlang(6, 'snmppinfo'); // unknown
}
}
},
SUnits: {
html: function () {
var supply = parseInt(this.SupplyUnit);
if (isNaN(supply)) {
return "";
} else {
switch (supply) {
case 7:
return "<br>" + genlang(9, "snmppinfo");
case 13:
return "<br>" + genlang(8, "snmppinfo");
case 15:
return "<br>" + genlang(7, "snmppinfo");
case 19:
return "<br>" + genlang(3, "snmppinfo");
}
}
}
}
};
 
if (data.Plugins.Plugin_SNMPPInfo !== undefined) {
var printers = items(data.Plugins.Plugin_SNMPPInfo.Printer);
if (printers.length > 0) {
var i, j, datas;
var html = "";
for (i = 0; i < printers.length; i++) {
html+="<tr id=\"snmppinfo-" + i + "\" class=\"treegrid-snmppinfo-" + i + "\" style=\"display:none;\" >";
html+="<td colspan=\"3\"><span class=\"treegrid-spanbold\" data-bind=\"Device\"></span></td>";
html+="</tr>";
 
try {
datas = items(printers[i].MarkerSupplies);
for (j = 0; j < datas.length; j++) {
html+="<tr id=\"snmppinfo-" + i + "-" + j +"\" class=\"treegrid-parent-snmppinfo-" + i + "\">";
html+="<td><span class=\"treegrid-spanbold\" data-bind=\"Description\"></span></td>";
html+="<td><span data-bind=\"Percent\"></span></td>";
html+="<td class=\"rightCell\"><span data-bind=\"Units\"></span><span data-bind=\"SUnits\"></span></td>";
html+="</tr>";
}
}
catch (err) {
$("#snmppinfo-" + i).hide();
}
}
 
$("#snmppinfo-data").empty().append(html);
 
for (i = 0; i < printers.length; i++) {
$('#snmppinfo-'+ i).render(printers[i]["@attributes"], directives);
try {
datas = items(printers[i].MarkerSupplies);
for (j = 0; j < datas.length; j++) {
$('#snmppinfo-'+ i+ "-" + j).render(datas[j]["@attributes"], directives);
}
}
catch (err) {
$("#snmppinfo-" + i).hide();
}
}
 
$('#snmppinfo').treegrid({
initialState: 'expanded',
expanderExpandedClass: 'normalicon normalicon-down',
expanderCollapsedClass: 'normalicon normalicon-right'
});
 
$('#block_snmppinfo').show();
} else {
$('#block_snmppinfo').hide();
}
} else {
$('#block_snmppinfo').hide();
}
}
/web/acc/phpsysinfo/plugins/snmppinfo/lang/cz.xml
0,0 → 1,36
<?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_snmppinfo_001" name="snmppinfo_title">
<exp>Informace o tiskárnách</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Tiskárna</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Procenta</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Jednotky</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>dostatek</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>neznámé</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Tenths of ml</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Tenths of grams</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Impressions</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/lang/de.xml
0,0 → 1,36
<?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_snmppinfo_001" name="snmppinfo_title">
<exp>Drucker Information</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Drucker</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Prozent</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Units</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>genug</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>unbekannt</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Zehntel ml</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Tenths of Gramm</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Auflagen</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/lang/en.xml
0,0 → 1,36
<?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_snmppinfo_001" name="snmppinfo_title">
<exp>Printer Information</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Printer</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Percent</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Units</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>enough</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>unknown</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Tenths of ml</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Tenths of grams</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Impressions</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/lang/fr.xml
0,0 → 1,35
<?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_snmppinfo_001" name="snmppinfo_title">
<exp>Imprimantes</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Imprimante</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Pourcent</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Unité</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>suffisamment</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>inconnu</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Dixièmes de ml</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Dixièmes de gramme</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Impressions</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/lang/gr.xml
0,0 → 1,36
<?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: ChriZathens
-->
<tns:translationPlugin language="greek" 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_snmppinfo_001" name="snmppinfo_title">
<exp>Πληροφορίες Εκτυπωτή</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Εκτυπωτής</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Ποσοστό</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Μονάδες</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>αρκετό</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>άγνωστο</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Δεκάδες ml</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Δεκάδες γραμμάρια</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Εκτυπώσεις</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/lang/pl.xml
0,0 → 1,36
<?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_snmppinfo_001" name="snmppinfo_title">
<exp>Drukarki</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Drukarka</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Procent</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Jednostek</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>dość</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>nieznany</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Dziesiątych ml</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Dziesiątych grama</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Impresji</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/lang/ro.xml
0,0 → 1,36
<?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_snmppinfo_001" name="snmppinfo_title">
<exp>Informații Imprimantă</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Imprimantă</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Procent</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Unități</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>suficient</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>necunoscut</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Tenths of ml</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Tenths of grams</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Impressions</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/lang/ru.xml
0,0 → 1,36
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: ru.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_snmppinfo_001" name="snmppinfo_title">
<exp>Информация о принтерах</exp>
</expression>
<expression id="plugin_snmppinfo_002" name="snmppinfo_printer">
<exp>Принтер</exp>
</expression>
<expression id="plugin_snmppinfo_003" name="snmppinfo_percent">
<exp>Процент</exp>
</expression>
<expression id="plugin_snmppinfo_004" name="snmppinfo_units">
<exp>Еденицы</exp>
</expression>
<expression id="plugin_snmppinfo_005" name="snmppinfo_enough">
<exp>достаточно</exp>
</expression>
<expression id="plugin_snmppinfo_006" name="snmppinfo_unknown">
<exp>неизвестный</exp>
</expression>
<expression id="plugin_snmppinfo_007" name="snmppinfo_tenthsml">
<exp>Десятых мл</exp>
</expression>
<expression id="plugin_snmppinfo_008" name="snmppinfo_tenthsgrams">
<exp>Десятых грамма</exp>
</expression>
<expression id="plugin_snmppinfo_009" name="snmppinfo_impressions">
<exp>Отпечатков</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php
0,0 → 1,279
<?php
/**
* SNMPPInfo Plugin, which displays printers info via SNMP
*
* @category PHP
* @package PSI_Plugin_SNMPPInfo
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
* @copyright 2011 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version $Id: class.snmppinfo.inc.php 661 2012-08-27 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
class SNMPPInfo 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_SNMPPINFO_ACCESS)) {
case 'command':
if (defined('PSI_PLUGIN_SNMPPINFO_DEVICES') && is_string(PSI_PLUGIN_SNMPPINFO_DEVICES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_SNMPPINFO_DEVICES)) {
$printers = eval(PSI_PLUGIN_SNMPPINFO_DEVICES);
} else {
$printers = array(PSI_PLUGIN_SNMPPINFO_DEVICES);
}
foreach ($printers as $printer) {
CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.2.1.1.5", $buffer, PSI_DEBUG);
if (strlen($buffer) > 0) {
$this->_filecontent[$printer] = $buffer;
 
CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.4.1.367.3.2.1.2.24.1.1", $buffer1, false);
if (strlen($buffer1) > 0) {
$this->_filecontent[$printer] .= "\n".$buffer1;
}
 
CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.2.1.43.11.1.1", $buffer2, PSI_DEBUG);
if (strlen($buffer2) > 0) {
$this->_filecontent[$printer] .= "\n".$buffer2;
}
CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.2.1.43.18.1.1", $buffer3, PSI_DEBUG);
if (strlen($buffer3) > 0) {
$this->_filecontent[$printer] .= "\n".$buffer3;
}
}
}
}
break;
case 'php-snmp':
if (!extension_loaded("snmp")) {
$this->global_error->addError("Requirements error", "SNMPPInfo plugin requires the snmp extension to php in order to work properly");
break;
}
snmp_set_valueretrieval(SNMP_VALUE_LIBRARY);
snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);
if (defined('PSI_PLUGIN_SNMPPINFO_DEVICES') && is_string(PSI_PLUGIN_SNMPPINFO_DEVICES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_SNMPPINFO_DEVICES)) {
$printers = eval(PSI_PLUGIN_SNMPPINFO_DEVICES);
} else {
$printers = array(PSI_PLUGIN_SNMPPINFO_DEVICES);
}
foreach ($printers as $printer) {
if (! PSI_DEBUG) {
restore_error_handler(); /* default error handler */
$old_err_rep = error_reporting();
error_reporting(E_ERROR); /* fatal errors only */
}
$bufferarr=snmprealwalk($printer, "public", ".1.3.6.1.2.1.1.5", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);
if (! PSI_DEBUG) {
error_reporting($old_err_rep); /* restore error level */
set_error_handler('errorHandlerPsi'); /* restore error handler */
}
if (! empty($bufferarr)) {
$buffer="";
foreach ($bufferarr as $id=>$string) {
$buffer .= $id." = ".$string."\n";
}
 
restore_error_handler(); /* default error handler */
$old_err_rep = error_reporting();
error_reporting(E_ERROR); /* fatal errors only */
 
$bufferarr1=snmprealwalk($printer, "public", ".1.3.6.1.4.1.367.3.2.1.2.24.1.1", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);
 
error_reporting($old_err_rep); /* restore error level */
set_error_handler('errorHandlerPsi'); /* restore error handler */
if (! empty($bufferarr1)) {
foreach ($bufferarr1 as $id=>$string) {
$buffer .= $id." = ".$string."\n";
}
}
 
if (! PSI_DEBUG) {
restore_error_handler(); /* default error handler */
$old_err_rep = error_reporting();
error_reporting(E_ERROR); /* fatal errors only */
}
$bufferarr2=snmprealwalk($printer, "public", ".1.3.6.1.2.1.43.11.1.1", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);
if (! PSI_DEBUG) {
error_reporting($old_err_rep); /* restore error level */
set_error_handler('errorHandlerPsi'); /* restore error handler */
}
if (! empty($bufferarr2)) {
foreach ($bufferarr2 as $id=>$string) {
$buffer .= $id." = ".$string."\n";
}
}
 
if (! PSI_DEBUG) {
restore_error_handler(); /* default error handler */
$old_err_rep = error_reporting();
error_reporting(E_ERROR); /* fatal errors only */
}
$bufferarr3=snmprealwalk($printer, "public", ".1.3.6.1.2.1.43.18.1.1", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);
if (! PSI_DEBUG) {
error_reporting($old_err_rep); /* restore error level */
set_error_handler('errorHandlerPsi'); /* restore error handler */
}
if (! empty($bufferarr3)) {
foreach ($bufferarr3 as $id=>$string) {
$buffer .= $id." = ".$string."\n";
}
}
 
if (strlen(trim($buffer)) > 0) {
$this->_filecontent[$printer] = $buffer;
}
}
}
}
break;
case 'data':
if (defined('PSI_PLUGIN_SNMPPINFO_DEVICES') && is_string(PSI_PLUGIN_SNMPPINFO_DEVICES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_SNMPPINFO_DEVICES)) {
$printers = eval(PSI_PLUGIN_SNMPPINFO_DEVICES);
} else {
$printers = array(PSI_PLUGIN_SNMPPINFO_DEVICES);
}
$pn=0;
foreach ($printers as $printer) {
$buffer="";
if (CommonFunctions::rfts(PSI_APP_ROOT."/data/snmppinfo{$pn}.txt", $buffer) && !empty($buffer)) {
$this->_filecontent[$printer] = $buffer;
}
$pn++;
}
}
break;
default:
$this->global_error->addConfigError("__construct()", "[snmppinfo] ACCESS");
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)) {
return;
}
foreach ($this->_filecontent as $printer=>$result) {
$result = preg_replace('/End of MIB\r?\n/', '', $result);
$result = preg_replace('/\s\r?\n([^\.])/', ' $1', $result);
$lines = preg_split('/\r?\n/', $result);
foreach ($lines as $line) {
if (preg_match('/^(.+) = Hex-STRING:\s(.+)/', $line, $linetmp)) {
$hexchars = explode(" ", trim($linetmp[2]));
$newstring = "";
foreach ($hexchars as $hexchar) {
$hexint = hexdec($hexchar);
if (($hexint<32) || ($hexint>126)) {
$newstring .= ".";
} else {
$newstring .= chr($hexint);
}
}
if ($newstring!=="") {
$line = $linetmp[1]." = STRING: ".$newstring;
}
}
if (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.11\.1\.1\.6\.1\.(.*) = STRING:\s(.*)/', $line, $data)) {
$this->_result[$printer][$data[1]]['prtMarkerSuppliesDescription']=trim($data[2], "\"");
} elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.11\.1\.1\.7\.1\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$this->_result[$printer][$data[1]]['prtMarkerSuppliesSupplyUnit']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.11\.1\.1\.8\.1\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$this->_result[$printer][$data[1]]['prtMarkerSuppliesMaxCapacity']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.11\.1\.1\.9\.1\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$this->_result[$printer][$data[1]]['prtMarkerSuppliesLevel']=$data[2];
} elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.1\.5\.0 = STRING:\s(.*)/', $line, $data)) {
$this->_result[$printer][0]['prtMarkerSuppliesDescription']=trim($data[1], "\"");
} elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.18\.1\.1\.8\.1\.(.*) = STRING:\s(.*)/', $line, $data)) {
$this->_result[$printer][99][$data[1]]["message"]=trim($data[2], "\"");
} elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.18\.1\.1\.2\.1\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$this->_result[$printer][99][$data[1]]["severity"]=$data[2];
 
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.367\.3\.2\.1\.2\.24\.1\.1\.2\.(.*) = STRING:\s(.*)/', $line, $data)) {
$this->_result[$printer][$data[1]]['prtMarkerSuppliesDescriptionRicoh']=trim($data[2], "\"");
} elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.367\.3\.2\.1\.2\.24\.1\.1\.5\.(.*) = INTEGER:\s(.*)/', $line, $data)) {
$this->_result[$printer][$data[1]]['prtMarkerSuppliesLevelRicoh']=$data[2];
}
}
}
}
 
/**
* generates the XML content for the plugin
*
* @return SimpleXMLElement entire XML content for the plugin
*/
public function xml()
{
foreach ($this->_result as $printer=>$markersupplies_item) {
$xmlsnmppinfo_printer = $this->xml->addChild("Printer");
$xmlsnmppinfo_printer->addAttribute("Device", $printer);
if (isset($markersupplies_item[1]) &&
isset($markersupplies_item[1]['prtMarkerSuppliesDescriptionRicoh']) &&
isset($markersupplies_item[1]['prtMarkerSuppliesLevelRicoh'])) {
$ricoh = true;
} else {
$ricoh = false;
}
 
foreach ($markersupplies_item as $marker=>$snmppinfo_item) {
if ($marker==0) {
$xmlsnmppinfo_printer->addAttribute("Name", $snmppinfo_item['prtMarkerSuppliesDescription']);
} elseif ($marker==99) {
foreach ($snmppinfo_item as $item=>$iarr) {
if (isset($iarr["message"]) && $iarr["message"] != "") {
$xmlsnmppinfo_errors = $xmlsnmppinfo_printer->addChild("PrinterMessage");
$xmlsnmppinfo_errors->addAttribute("Message", $iarr["message"]);
$xmlsnmppinfo_errors->addAttribute("Severity", $iarr["severity"]);
}
}
} else {
if ($ricoh) {
if (isset($snmppinfo_item['prtMarkerSuppliesDescriptionRicoh'])) {
$xmlsnmppinfo = $xmlsnmppinfo_printer->addChild("MarkerSupplies");
 
$xmlsnmppinfo->addAttribute("Description", $snmppinfo_item['prtMarkerSuppliesDescriptionRicoh']);
$xmlsnmppinfo->addAttribute("SupplyUnit", "19");
$xmlsnmppinfo->addAttribute("MaxCapacity", "100");
$xmlsnmppinfo->addAttribute("Level", isset($snmppinfo_item['prtMarkerSuppliesLevelRicoh']) ? $snmppinfo_item['prtMarkerSuppliesLevelRicoh'] : "");
}
} else {
$xmlsnmppinfo = $xmlsnmppinfo_printer->addChild("MarkerSupplies");
 
$xmlsnmppinfo->addAttribute("Description", isset($snmppinfo_item['prtMarkerSuppliesDescription']) ? $snmppinfo_item['prtMarkerSuppliesDescription'] : "");
$xmlsnmppinfo->addAttribute("SupplyUnit", isset($snmppinfo_item['prtMarkerSuppliesSupplyUnit']) ? $snmppinfo_item['prtMarkerSuppliesSupplyUnit'] : "");
$xmlsnmppinfo->addAttribute("MaxCapacity", isset($snmppinfo_item['prtMarkerSuppliesMaxCapacity']) ? $snmppinfo_item['prtMarkerSuppliesMaxCapacity'] : "");
$xmlsnmppinfo->addAttribute("Level", isset($snmppinfo_item['prtMarkerSuppliesLevel']) ? $snmppinfo_item['prtMarkerSuppliesLevel'] : "");
}
}
}
}
 
return $this->xml->getSimpleXmlElement();
}
}
/web/acc/phpsysinfo/plugins/snmppinfo/snmppinfo_bootstrap.html
0,0 → 1,22
<div class="col-lg-6" id="block_snmppinfo" style="display:none;">
<div class="card" id="panel_snmppinfo" style="display:none;">
<div class="card-header"><span class="lang_plugin_snmppinfo_001">Printer Information</span>
<div id="reload_snmppinfo" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="snmppinfo" class="table table-hover table-sm">
<thead>
<tr>
<th><span class="lang_plugin_snmppinfo_002">Printer</span></th>
<th><span class="lang_plugin_snmppinfo_003">Percent</span></th>
<th class="rightCell"><span class="lang_plugin_snmppinfo_004">Units</span></th>
</tr>
</thead>
<tbody id="snmppinfo-data">
</tbody>
</table>
</div>
</div>
</div>
</div>
/web/acc/phpsysinfo/plugins/stablebit/gfx/off.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/acc/phpsysinfo/plugins/stablebit/gfx/on.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/acc/phpsysinfo/plugins/stablebit/js/stablebit.js
0,0 → 1,208
/***************************************************************************
* 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: stablebit.js 661 2012-08-27 11:26:39Z namiltd $
//
 
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang */
 
"use strict";
 
var stablebit_show = false;
 
/**
* build the table where content is inserted
* @param {jQuery} xml plugin-XML
*/
function stablebit_buildTable(xml) {
var html = "", tree = [], closed = [];
 
$("#Plugin_StableBit #Plugin_StableBitTable").remove();
 
html += " <div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_StableBitTable\" class=\"tablemain\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th>" + genlang(2, "StableBit") + "</th>\n";
html += " <th style=\"width:120px;\">" + genlang(3, "StableBit") + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody class=\"tree\">\n";
 
var index = 0;
 
$("Plugins Plugin_StableBit Disk", xml).each(function stablebit_getdisks(id) {
var name = "";
name = $(this).attr("Name");
if (name !== undefined) {
var serialnumber = "", firmware = "", size = 0, powerstate = "", temperaturec = "",
ishot = 0, issmartwarning = 0, issmartpastthresholds = 0, issmartpastadvisorythresholds = 0,
issmartfailurepredicted = 0, isdamaged = 0;
 
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + name + "</div></span></td></tr>\n";
index = tree.push(0);
 
serialnumber = $(this).attr("SerialNumber");
if (serialnumber !== undefined) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(4, "StableBit") + "</div></span></td><td>" + serialnumber +"</td></tr>\n";
tree.push(index);
}
firmware = $(this).attr("Firmware");
if (firmware !== undefined) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(5, "StableBit") + "</div></span></td><td>" + firmware +"</td></tr>\n";
tree.push(index);
}
size = parseInt($(this).attr("Size"), 10);
if (!isNaN(size)) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(6, "StableBit") + "</div></span></td><td>" + formatBytes(size, xml) +"</td></tr>\n";
tree.push(index);
}
powerstate = $(this).attr("PowerState");
if (powerstate !== undefined) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(7, "StableBit") + "</div></span></td><td>" + powerstate +"</td></tr>\n";
tree.push(index);
}
temperaturec = $(this).attr("TemperatureC");
if (temperaturec !== undefined) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(8, "StableBit") + "</div></span></td><td>" + formatTemp(temperaturec, xml) +"</td></tr>\n";
tree.push(index);
}
if ($(this).attr("IsHot") !== undefined) {
ishot = parseInt($(this).attr("IsHot"), 10);
if (!isNaN(ishot) && (ishot === 1)) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(9, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
else {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(9, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/off.gif\" alt=\"off\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
tree.push(index);
}
if ($(this).attr("IsSmartWarning") !== undefined) {
issmartwarning = parseInt($(this).attr("IsSmartWarning"), 10);
if (!isNaN(issmartwarning) && (issmartwarning === 1)) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(10, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
else {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(10, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/off.gif\" alt=\"off\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
tree.push(index);
}
if ($(this).attr("IsSmartPastThresholds") !== undefined) {
issmartpastthresholds = parseInt($(this).attr("IsSmartPastThresholds"), 10);
if (!isNaN(issmartpastthresholds) && (issmartpastthresholds === 1)) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(11, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
else {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(11, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/off.gif\" alt=\"off\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
tree.push(index);
}
if ($(this).attr("IsSmartPastAdvisoryThresholds") !== undefined) {
issmartpastadvisorythresholds = parseInt($(this).attr("IsSmartPastAdvisoryThresholds"), 10);
if (!isNaN(issmartpastadvisorythresholds) && (issmartpastadvisorythresholds === 1)) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(12, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
else {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(12, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/off.gif\" alt=\"off\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
tree.push(index);
}
if ($(this).attr("IsSmartFailurePredicted") !== undefined) {
issmartfailurepredicted = parseInt($(this).attr("IsSmartFailurePredicted"), 10);
if (!isNaN(issmartfailurepredicted) && (issmartfailurepredicted === 1)) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(13, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
else {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(13, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/off.gif\" alt=\"off\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
tree.push(index);
}
if ($(this).attr("IsDamaged") !== undefined) {
isdamaged = parseInt($(this).attr("IsDamaged"), 10);
if (!isNaN(isdamaged) && (isdamaged === 1)) {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(14, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
else {
html += " <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(14, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/off.gif\" alt=\"off\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
}
tree.push(index);
}
 
stablebit_show = true;
}
});
 
html += " </tbody>\n";
html += " </table>\n";
html += " </div>\n";
 
$("#Plugin_StableBit").append(html);
 
$("#Plugin_StableBitTable").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 stablebit_request() {
$("#Reload_StableBitTable").attr("title", "reload");
$.ajax({
url: "xml.php?plugin=StableBit",
dataType: "xml",
error: function stablebit_error() {
$.jGrowl("Error loading XML document for Plugin StableBit!");
},
success: function stablebit_buildblock(xml) {
populateErrors(xml);
stablebit_buildTable(xml);
if (stablebit_show) {
plugin_translate("StableBit");
$("#Plugin_StableBit").show();
}
}
});
}
 
$(document).ready(function stablebit_buildpage() {
$("#footer").before(buildBlock("StableBit", 1, true));
$("#Plugin_StableBit").css("width", "451px");
 
stablebit_request();
 
$("#Reload_StableBitTable").click(function stablebit_reload(id) {
stablebit_request();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/stablebit/js/stablebit_bootstrap.js
0,0 → 1,102
function renderPlugin_stablebit(data) {
 
var directives = {
IsHot: {
html: function () {
return (this.IsHot === "1") ? "<span class=\"badge badge-danger\">YES</span>" : "<span class=\"badge badge-success\">NO</span>";
}
},
IsSmartWarning: {
html: function () {
return (this.IsSmartWarning === "1") ? "<span class=\"badge badge-danger\">YES</span>" : "<span class=\"badge badge-success\">NO</span>";
}
},
IsSmartPastThresholds: {
html: function () {
return (this.IsSmartPastThresholds === "1") ? "<span class=\"badge badge-danger\">YES</span>" : "<span class=\"badge badge-success\">NO</span>";
}
},
IsSmartPastAdvisoryThresholds: {
html: function () {
return (this.IsSmartPastAdvisoryThresholds === "1") ? "<span class=\"badge badge-danger\">YES</span>" : "<span class=\"badge badge-success\">NO</span>";
}
},
IsSmartFailurePredicted: {
html: function () {
return (this.IsSmartFailurePredicted === "1") ? "<span class=\"badge badge-danger\">YES</span>" : "<span class=\"badge badge-success\">NO</span>";
}
},
IsDamaged: {
html: function () {
return (this.IsDamaged === "1") ? "<span class=\"badge badge-danger\">YES</span>" : "<span class=\"badge badge-success\">NO</span>";
}
},
TemperatureC: {
html: function () {
return formatTemp(this.TemperatureC, data.Options["@attributes"].tempFormat);
}
},
Size: {
html: function () {
return formatBytes(this.Size, data.Options["@attributes"].byteFormat);
}
}
};
 
if (data.Plugins.Plugin_StableBit !== undefined) {
var disks = items(data.Plugins.Plugin_StableBit.Disk);
if (disks.length > 0) {
var i, proc_param;
var html = "";
var paramlist = {SerialNumber:4, Firmware:5, Size:6, PowerState:7, TemperatureC:8, IsHot:9, IsSmartWarning:10, IsSmartPastThresholds:11, IsSmartPastAdvisoryThresholds:12, IsSmartFailurePredicted:13, IsDamaged:14};
for (i = 0; i < disks.length; i++) {
try {
html+="<tr id=\"stablebit-" + i + "\" class=\"treegrid-stablebit-" + i + "\" style=\"display:none;\" >";
html+="<td><span class=\"treegrid-spanbold\" data-bind=\"Name\"></span></td>";
html+="<td></td>";
html+="</tr>";
for (proc_param in paramlist) {
if (disks[i]["@attributes"][proc_param] !== undefined) {
html+="<tr id=\"stablebit-" + i + "-" + proc_param + "\" class=\"treegrid-parent-stablebit-" + i + "\">";
html+="<td><span class=\"treegrid-spanbold\">" + genlang(paramlist[proc_param], 'stablebit') + "</span></td>";
html+="<td class=\"rightCell\"><span data-bind=\"" + proc_param + "\"></span></td>";
html+="</tr>";
}
}
}
catch (err) {
$("#stablebit-" + i).hide();
}
}
 
$("#stablebit-data").empty().append(html);
 
for (i = 0; i < disks.length; i++) {
try {
$('#stablebit-'+ i).render(disks[i]["@attributes"]);
$("#stablebit-" + i).show();
for (proc_param in paramlist) {
if (disks[i]["@attributes"][proc_param] !== undefined) {
$('#stablebit-'+ i+ "-" + proc_param).render(disks[i]["@attributes"], directives);
}
}
}
catch (err) {
$("#stablebit-" + i).hide();
}
}
 
$('#stablebit').treegrid({
initialState: 'expanded',
expanderExpandedClass: 'normalicon normalicon-down',
expanderCollapsedClass: 'normalicon normalicon-right'
});
 
$('#block_stablebit').show();
} else {
$('#block_stablebit').hide();
}
} else {
$('#block_stablebit').hide();
}
}
/web/acc/phpsysinfo/plugins/stablebit/lang/en.xml
0,0 → 1,51
<?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_stablebit_001" name="stablebit_title">
<exp>StableBit Scanner Information</exp>
</expression>
<expression id="plugin_stablebit_002" name="stablebit_disk">
<exp>Disk</exp>
</expression>
<expression id="plugin_stablebit_003" name="stablebit_value">
<exp>Value</exp>
</expression>
<expression id="plugin_stablebit_004" name="stablebit_serialnumber">
<exp>Serial Number</exp>
</expression>
<expression id="plugin_stablebit_005" name="stablebit_firmware">
<exp>Firmware</exp>
</expression>
<expression id="plugin_stablebit_006" name="stablebit_size">
<exp>Size</exp>
</expression>
<expression id="plugin_stablebit_007" name="stablebit_powerstate">
<exp>Power state</exp>
</expression>
<expression id="plugin_stablebit_008" name="stablebit_temperaturec">
<exp>Temperature</exp>
</expression>
<expression id="plugin_stablebit_009" name="stablebit_ishot">
<exp>Is Hot</exp>
</expression>
<expression id="plugin_stablebit_010" name="stablebit_issmartwarning">
<exp>Is SMART Warning</exp>
</expression>
<expression id="plugin_stablebit_011" name="stablebit_issmartpastthresholds">
<exp>Is SMART Past Thresholds</exp>
</expression>
<expression id="plugin_stablebit_012" name="stablebit_issmartpastadvisorythresholds">
<exp>Is SMART Past Advisory Thresholds</exp>
</expression>
<expression id="plugin_stablebit_013" name="stablebit_issmartfailurepredicted">
<exp>Is SMART Failure Predicted</exp>
</expression>
<expression id="plugin_stablebit_014" name="stablebit_isdamaged">
<exp>Is Damaged</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/stablebit/lang/gr.xml
0,0 → 1,51
<?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: ChriZathens
-->
<tns:translationPlugin language="greek" 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_stablebit_001" name="stablebit_title">
<exp>Πληροφορίες Ανιχνευτή StableBit</exp>
</expression>
<expression id="plugin_stablebit_002" name="stablebit_disk">
<exp>Δίσκος</exp>
</expression>
<expression id="plugin_stablebit_003" name="stablebit_value">
<exp>Τιμή</exp>
</expression>
<expression id="plugin_stablebit_004" name="stablebit_serialnumber">
<exp>Σειριακός Αριθμός</exp>
</expression>
<expression id="plugin_stablebit_005" name="stablebit_firmware">
<exp>Yλικολογισμικό</exp>
</expression>
<expression id="plugin_stablebit_006" name="stablebit_size">
<exp>Μέγεθος</exp>
</expression>
<expression id="plugin_stablebit_007" name="stablebit_powerstate">
<exp>Κατάσταση ενέργειας</exp>
</expression>
<expression id="plugin_stablebit_008" name="stablebit_temperaturec">
<exp>Θερμοκρασία</exp>
</expression>
<expression id="plugin_stablebit_009" name="stablebit_ishot">
<exp>Είναι πολύ ζεστός</exp>
</expression>
<expression id="plugin_stablebit_010" name="stablebit_issmartwarning">
<exp>Έχει Προειδοποίηση SMART</exp>
</expression>
<expression id="plugin_stablebit_011" name="stablebit_issmartpastthresholds">
<exp>Έχει Προηγούμενα Όρια SMART</exp>
</expression>
<expression id="plugin_stablebit_012" name="stablebit_issmartpastadvisorythresholds">
<exp>Έχει Προηγούμενα Ενδεικνυόμενα Κατώτατα Όρια SMART</exp>
</expression>
<expression id="plugin_stablebit_013" name="stablebit_issmartfailurepredicted">
<exp>Έχει προβλεπόμενη αποτυχία SMART</exp>
</expression>
<expression id="plugin_stablebit_014" name="stablebit_isdamaged">
<exp>Έχει Βλάβη</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/stablebit/class.stablebit.inc.php
0,0 → 1,74
<?php
/**
* StableBit Plugin, which displays disks state
*
* @category PHP
* @package PSI_Plugin_StableBit
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
* @copyright 2017 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version $Id: class.stablebit.inc.php 661 2012-08-27 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
class StableBit extends PSI_Plugin
{
/**
* variable, which holds the result before the xml is generated out of this array
* @var array
*/
private $_result;
 
/**
* 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);
 
$this->_result = array();
}
 
private $stablebit_items = array('Name', 'Firmware', 'Size', 'TemperatureC', 'PowerState', 'IsHot', 'IsSmartWarning', 'IsSmartPastThresholds', 'IsSmartPastAdvisoryThresholds', 'IsSmartFailurePredicted', 'IsDamaged', 'SerialNumber');
 
/**
* 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 (PSI_OS == 'WINNT') {
try {
$objLocator = new COM('WbemScripting.SWbemLocator');
$wmi = $objLocator->ConnectServer('', 'root\StableBit\Scanner');
$this->_result = CommonFunctions::getWMI($wmi, 'Disks', $this->stablebit_items);
} catch (Exception $e) {
}
}
}
 
/**
* generates the XML content for the plugin
*
* @return SimpleXMLElement entire XML content for the plugin
*/
public function xml()
{
foreach ($this->_result as $disk_items) {
if (isset($disk_items['Name']) && (trim($disk_items['Name']) !== '')) {
$xmlstablebit_disk = $this->xml->addChild("Disk");
foreach ($this->stablebit_items as $item) {
if (isset($disk_items[$item]) && (($itemvalue=$disk_items[$item]) !== '') &&
(($item !== 'SerialNumber') || (defined('PSI_PLUGIN_STABLEBIT_SHOW_SERIAL') && (PSI_PLUGIN_STABLEBIT_SHOW_SERIAL === true)))) {
$xmlstablebit_disk ->addAttribute($item, $itemvalue);
}
}
}
}
 
return $this->xml->getSimpleXmlElement();
}
}
/web/acc/phpsysinfo/plugins/stablebit/stablebit_bootstrap.html
0,0 → 1,21
<div class="col-lg-6" id="block_stablebit" style="display:none;">
<div class="card" id="panel_stablebit" style="display:none;">
<div class="card-header"><span class="lang_plugin_stablebit_001">StableBit Scanner Information</span>
<div id="reload_stablebit" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="stablebit" class="table table-hover table-sm">
<thead>
<tr>
<th><span class="lang_plugin_stablebit_002">Disk</span></th>
<th class="rightCell"><span class="lang_plugin_stablebit_003">Value</span></th>
</tr>
</thead>
<tbody id="stablebit-data">
</tbody>
</table>
</div>
</div>
</div>
</div>
/web/acc/phpsysinfo/plugins/updatenotifier/js/updatenotifier.js
0,0 → 1,115
/***************************************************************************
* 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. *
***************************************************************************/
 
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar */
 
"use strict";
 
var UpdateNotifier_show = false, UpdateNotifier_table;
/**
* insert content into table
* @param {jQuery} xml plugin-XML
*/
function updatenotifier_populate(xml) {
var html = "";
$("Plugins Plugin_UpdateNotifier UpdateNotifier", xml).each(function(idp) {
var packages = "", security = "";
packages = $("packages", this).text();
security = $("security", this).text();
 
//UpdateNotifier_table.fnAddData([packages]);
//UpdateNotifier_table.fnAddData([security]);
 
html = " <tr>\n";
html += " <td>" + packages + " " + genlang(3, "UpdateNotifier") + "</td>\n";
html += " </tr>\n";
html += " <tr>\n";
html += " <td>" + security + " " + genlang(4, "UpdateNotifier") + "</td>\n";
html += " </tr>\n";
 
$("#Plugin_UpdateNotifier tbody").empty().append(html);
 
if ((packages <= 0) && (security <= 0)) {
$("#UpdateNotifierTable-info").html(genlang(5, "UpdateNotifier"));
} else {
$("#UpdateNotifierTable-info").html(genlang(2, "UpdateNotifier"));
}
 
UpdateNotifier_show = true;
});
}
 
/**
* fill the plugin block with table structure
*/
function updatenotifier_buildTable() {
var html = "";
 
html += "<div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_UpdateNotifierTable\" style=\"border-collapse:collapse;\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th id=\"UpdateNotifierTable-info\">" + genlang(2, "UpdateNotifier") + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody>\n";
html += " </tbody>\n";
html += " </table>\n";
html += "</div>\n";
 
$("#Plugin_UpdateNotifier").append(html);
 
}
 
/**
* load the xml via ajax
*/
function updatenotifier_request() {
$("#Reload_UpdateNotifierTable").attr("title", "reload");
$.ajax({
url: "xml.php?plugin=UpdateNotifier",
dataType: "xml",
error: function () {
$.jGrowl("Error loading XML document for Plugin UpdateNotifier!");
},
success: function updatenotifier_buildblock(xml) {
populateErrors(xml);
updatenotifier_populate(xml);
if (UpdateNotifier_show) {
plugin_translate("UpdateNotifier");
$("#Plugin_UpdateNotifier").show();
}
}
});
}
 
$(document).ready(function() {
$("#footer").before(buildBlock("UpdateNotifier", 1, true));
$("#Plugin_UpdateNotifier").css("width", "451px");
 
updatenotifier_buildTable();
updatenotifier_request();
 
$("#Reload_UpdateNotifierTable").click(function updatenotifier_reload(id) {
updatenotifier_request();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/updatenotifier/js/updatenotifier_bootstrap.js
0,0 → 1,25
function renderPlugin_updatenotifier(data) {
 
var directives = {
updateNotifierNbPackages: {
text: function () {
return this.packages;
}
},
updateNotifierNbSecPackages: {
text: function () {
return this.security;
}
}
};
if ((data.Plugins.Plugin_UpdateNotifier !== undefined) && (data.Plugins.Plugin_UpdateNotifier.UpdateNotifier !== undefined)){
$('#updatenotifier').render(data.Plugins.Plugin_UpdateNotifier.UpdateNotifier, directives);
if ((data.Plugins.Plugin_UpdateNotifier.UpdateNotifier.packages <= 0) &&
(data.Plugins.Plugin_UpdateNotifier.UpdateNotifier.security <= 0) ) {
$("#updatenotifier-info").html("<strong>"+genlang(5, 'updatenotifier')+"</strong>");
}
$('#block_updatenotifier').show();
} else {
$('#block_updatenotifier').hide();
}
}
/web/acc/phpsysinfo/plugins/updatenotifier/lang/cz.xml
0,0 → 1,30
<?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_updatenotifier_001" name="updatenotifier_title">
<exp>Notifikátor aktualizací</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Jsou dostupné aktualizace!</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>balíčků je připraveno k aktualizaci.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>balíčků obsahuje bezpečnostní aktualizace.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>Žádné aktualizace jsou dostupné</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Number of packages</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Number of security packages</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/lang/de.xml
0,0 → 1,30
<?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_updatenotifier_001" name="updatenotifier_title">
<exp>Updates Notifier</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Updates verfügbar</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>Pakete können aktualisiert werden.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>Updates sind Sicherheits-Updates.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>Keine Updates verfügbar</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Anzahl Pakete</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Anzahl Sicherheitspakete</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/lang/en.xml
0,0 → 1,30
<?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: Damien ROTH
-->
<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_updatenotifier_001" name="updatenotifier_title">
<exp>Updates Notifier</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Updates available</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>packages can be updated.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>updates are security updates.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>No updates available</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Number of packages</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Number of security packages</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/lang/fr.xml
0,0 → 1,30
<?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: Damien ROTH
-->
<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_updatenotifier_001" name="updatenotifier_title">
<exp>Updates Notifier</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Mises à jour disponibles</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>paquets peuvent être mit à jour.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>mises à jour concernent la sécurité.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>Pas de mises à jour disponibles</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Number of packages</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Number of security packages</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/lang/gr.xml
0,0 → 1,30
<?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: ChriZathens
-->
<tns:translationPlugin language="greek" 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_updatenotifier_001" name="updatenotifier_title">
<exp>Ειδοποιήσεις Ενημερώσεων</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Διαθέσιμες Ενημερώσεις</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>πακέτα μπορούν να ενημερωθούν.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>ενημερώσεις είναι ενημερώσεις ασφαλείας.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>Δεν υπάρχουν ενημερώσεις</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Αριθμός πακέτων</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Αριθμός πακέτων ασφαλείας</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/lang/pl.xml
0,0 → 1,30
<?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_updatenotifier_001" name="updatenotifier_title">
<exp>Updates Notifier</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Aktualizacje dostępne</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>pakietów do aktualizacji.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>to aktualizacje zabezpieczeń.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>Brak dostępnych aktualizacji</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Liczba pakietów aktualizacyjnych</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Liczba pakietów aktualizacji zabezpieczeń</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/lang/ro.xml
0,0 → 1,30
<?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_updatenotifier_001" name="updatenotifier_title">
<exp>Updates Notifier</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Actualizări Disponibile</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>Pachetele pot fi actualizate.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>Sunt actualizări de securitate.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>Nu actualizări disponibile</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Number of packages</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Number of security packages</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/lang/ru.xml
0,0 → 1,30
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: ru.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_updatenotifier_001" name="updatenotifier_title">
<exp>Оповещения об обновлениях</exp>
</expression>
<expression id="plugin_updatenotifier_002" name="updatenotifier_th">
<exp>Доступно обновление</exp>
</expression>
<expression id="plugin_updatenotifier_003" name="updatenotifier_packages">
<exp>Пакеты могут быть обновлены.</exp>
</expression>
<expression id="plugin_updatenotifier_004" name="updatenotifier_security">
<exp>Обновления безопасности.</exp>
</expression>
<expression id="plugin_updatenotifier_005" name="updatenotifier_no">
<exp>Нет доступных обновлений</exp>
</expression>
<expression id="plugin_updatenotifier_006" name="updatenotifier_no_packages">
<exp>Number of packages</exp>
</expression>
<expression id="plugin_updatenotifier_007" name="updatenotifier_no_security">
<exp>Number of security packages</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/updatenotifier/class.updatenotifier.inc.php
0,0 → 1,114
<?php
/**
* UpdateNotifier Plugin, which displays update notification from Ubuntu Landscape system
*
* @category PHP
* @package PSI_Plugin_UpdateNotifier
* @author Damien ROTH <iysaak@users.sourceforge.net>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version $Id: class.updatenotifier.inc.php 661 2012-08-27 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
class UpdateNotifier 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_UPDATENOTIFIER_ACCESS)) {
case 'command':
if (defined('PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT') && (PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT === true)) {
CommonFunctions::executeProgram("/usr/lib/update-notifier/apt-check", "--human-readable", $buffer_info);
} else {
CommonFunctions::executeProgram("/usr/lib/update-notifier/apt-check", "2>&1", $buffer_info);
}
break;
case 'data':
if (defined('PSI_PLUGIN_UPDATENOTIFIER_FILE') && is_string(PSI_PLUGIN_UPDATENOTIFIER_FILE)) {
CommonFunctions::rfts(PSI_PLUGIN_UPDATENOTIFIER_FILE, $buffer_info);
} else {
CommonFunctions::rfts("/var/lib/update-notifier/updates-available", $buffer_info);
}
break;
default:
$this->global_error->addConfigError("__construct()", "[updatenotifier] ACCESS");
break;
}
 
// Remove blank lines
$this->_filecontent = preg_split("/\r?\n/", $buffer_info, -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;
}
 
if (defined('PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT') && (PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT === true)) {
/*
Ubuntu Landscape format:
- line 1: packages to update
- line 2: security packages to update
*/
if (count($this->_filecontent) == 2) {
foreach ($this->_filecontent as $line) {
list($num, $text) = explode(" ", $line, 2);
$this->_result[] = $num;
}
} else {
$this->global_error->addWarning("Unable to parse UpdateNotifier file");
}
} else {
/*
Universal format: A;B
- A: packages to update
- B: security packages to update
*/
if (count($this->_filecontent) == 1 && strpos($this->_filecontent[0], ";") !== false) {
$this->_result = explode(";", $this->_filecontent[0]);
} else {
$this->global_error->addWarning("Unable to parse UpdateNotifier file");
}
}
}
 
/**
* generates the XML content for the plugin
*
* @return SimpleXMLElement entire XML content for the plugin
*/
public function xml()
{
if (!empty($this->_result)) {
$xmluu = $this->xml->addChild("UpdateNotifier");
$xmluu->addChild("packages", $this->_result[0]);
$xmluu->addChild("security", $this->_result[1]);
}
 
return $this->xml->getSimpleXmlElement();
}
}
/web/acc/phpsysinfo/plugins/updatenotifier/updatenotifier_bootstrap.html
0,0 → 1,14
<div class="col-lg-6" id="block_updatenotifier" style="display:none;">
<div class="card" id="panel_updatenotifier" style="display:none;">
<div class="card-header"><span class="lang_plugin_updatenotifier_001">Updates Notifier</span>
<div id="reload_updatenotifier" class="reload" title="reload"></div>
</div>
<div class="card-body">
<p id="updatenotifier-info"><strong><span class="lang_plugin_updatenotifier_002">Updates available</span></strong></p>
<ul class="list-group" id="updatenotifier">
<li class="list-group-item"><span class="badge badge-secondary" data-bind="updateNotifierNbPackages"></span><span class="lang_plugin_updatenotifier_006">Number of packages</span></li>
<li class="list-group-item"><span class="badge badge-secondary" data-bind="updateNotifierNbSecPackages"></span><span class="lang_plugin_updatenotifier_007">Number of security packages</span></li>
</ul>
</div>
</div>
</div>
/web/acc/phpsysinfo/plugins/uprecords/js/uprecords.js
0,0 → 1,126
/***************************************************************************
* 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: uprecords.js 661 2014-01-08 11:26:39 aolah76 $
 
 
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar */
 
"use strict";
 
var uprecords_show = false;
 
/**
* insert content into table
* @param {jQuery} xml plugin-XML
*/
 
function uprecords_populate(xml) {
 
var html = "", datetimeFormat = "";
 
$("Options", xml).each(function getByteFormat(id) {
datetimeFormat = $(this).attr("datetimeFormat");
});
 
$("Plugins Plugin_uprecords uprecords Item", xml).each(function uprecords_getitem(idp) {
html += " <tr>\n";
html += " <td style=\"font-weight:normal\">" + $(this).attr("hash") + "</td>\n";
html += " <td style=\"font-weight:normal\">" + $(this).attr("Uptime") + "</td>\n";
html += " <td style=\"font-weight:normal\">" + $(this).attr("System") + "</td>\n";
/*
var lastboot = new Date($(this).attr("Bootup"));
if (typeof(lastboot.toUTCString)==="function") {
html += " <td style=\"font-weight:normal\">" + lastboot.toUTCString() + "</td>\n";
} else { //deprecated
html += " <td style=\"font-weight:normal\">" + lastboot.toGMTString() + "</td>\n";
}
*/
if ((datetimeFormat !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
var lastboot = new Date($(this).attr("Bootup"));
html += " <td style=\"font-weight:normal\">" + lastboot.toLocaleString() + "</td>\n";
} else {
html += " <td style=\"font-weight:normal\">" + $(this).attr("Bootup") + "</td>\n";
}
html += " </tr>\n";
uprecords_show = true;
});
 
$("#Plugin_uprecordsTable-tbody").empty().append(html);
$('#Plugin_uprecordsTable tr:nth-child(even)').addClass('even');
 
}
 
function uprecords_buildTable() {
var html = "";
 
html += "<div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_uprecordsTable\" class=\"stripeMe\" style=\"border-collapse:collapse;\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th>" + genlang(101, "uprecords") + "</th>\n";
html += " <th>" + genlang(102, "uprecords") + "</th>\n";
html += " <th>" + genlang(103, "uprecords") + "</th>\n";
html += " <th>" + genlang(104, "uprecords") + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody id=\"Plugin_uprecordsTable-tbody\">\n";
html += " </tbody>\n";
html += " </table>\n";
html += "</div>\n";
$("#Plugin_uprecords").append(html);
}
 
/**
* load the xml via ajax
*/
 
function uprecords_request() {
$("#Reload_uprecordsTable").attr("title", "reload");
$.ajax({
url: "xml.php?plugin=uprecords",
dataType: "xml",
error: function uprecords_error() {
$.jGrowl("Error loading XML document for Plugin uprecords!");
},
success: function uprecords_buildblock(xml) {
populateErrors(xml);
uprecords_populate(xml);
if (uprecords_show) {
plugin_translate("uprecords");
$("#Plugin_uprecords").show();
}
}
});
}
 
$(document).ready(function uprecords_buildpage() {
$("#footer").before(buildBlock("uprecords", 1, true));
$("#Plugin_uprecords").css("width", "915px");
 
uprecords_buildTable();
 
uprecords_request();
 
$("#Reload_uprecordsTable").click(function uprecords_reload(id) {
uprecords_request();
$(this).attr("title", datetime());
});
});
/web/acc/phpsysinfo/plugins/uprecords/js/uprecords_bootstrap.js
0,0 → 1,35
function renderPlugin_uprecords(data) {
 
var directives = {
hash: {
html: function () {
return this.hash;
}
},
Bootup: {
html: function () {
if (((datetimeFormat = data.Options["@attributes"].datetimeFormat) !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
var bootup = new Date(this.Bootup);
return bootup.toLocaleString();
} else {
return this.Bootup;
}
}
}
};
 
if ((data.Plugins.Plugin_uprecords !== undefined) && (data.Plugins.Plugin_uprecords.Uprecords !== undefined)) {
var upitems = items(data.Plugins.Plugin_uprecords.Uprecords.Item);
if (upitems.length > 0) {
var up_memory = [];
up_memory.push_attrs(upitems);
$('#uprecords-data').render(up_memory, directives);
 
$('#block_uprecords').show();
} else {
$('#block_uprecords').hide();
}
} else {
$('#block_uprecords').hide();
}
}
/web/acc/phpsysinfo/plugins/uprecords/lang/en.xml
0,0 → 1,24
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: en.xml 661 2014-01-08 11:26:39Z aolah76 $ -->
<!--
phpSysInfo language file Language: English Created by: Ambrus Sandor Olah
-->
<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_uprecords_001" name="uprecords_title">
<exp>Uprecords</exp>
</expression>
<expression id="plugin_uprecords_101" name="uprecords_hash">
<exp>#</exp>
</expression>
<expression id="plugin_uprecords_102" name="uprecords_uptime">
<exp>Uptime</exp>
</expression>
<expression id="plugin_uprecords_103" name="uprecords_system">
<exp>System</exp>
</expression>
<expression id="plugin_uprecords_104" name="uprecords_bootup">
<exp>Boot up</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/uprecords/lang/fr.xml
0,0 → 1,23
<?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_uprecords_001" name="uprecords_title">
<exp>Uprecords</exp>
</expression>
<expression id="plugin_uprecords_101" name="uprecords_hash">
<exp>#</exp>
</expression>
<expression id="plugin_uprecords_102" name="uprecords_uptime">
<exp>Uptime</exp>
</expression>
<expression id="plugin_uprecords_103" name="uprecords_system">
<exp>Système</exp>
</expression>
<expression id="plugin_uprecords_104" name="uprecords_bootup">
<exp>Démarrage</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/uprecords/lang/gr.xml
0,0 → 1,24
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: gr.xml 661 2014-01-08 11:26:39Z aolah76 $ -->
<!--
phpSysInfo language file Language: Greek Created by: ChriZathens
-->
<tns:translationPlugin language="greek" 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_uprecords_001" name="uprecords_title">
<exp>Uprecords</exp>
</expression>
<expression id="plugin_uprecords_101" name="uprecords_hash">
<exp>#</exp>
</expression>
<expression id="plugin_uprecords_102" name="uprecords_uptime">
<exp>Ώρες Λειτουργίας</exp>
</expression>
<expression id="plugin_uprecords_103" name="uprecords_system">
<exp>Σύστημα</exp>
</expression>
<expression id="plugin_uprecords_104" name="uprecords_bootup">
<exp>Εκκίνηση</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/uprecords/lang/hu.xml
0,0 → 1,24
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: hu.xml 661 2014-01-08 11:26:39Z aolah76 $ -->
<!--
phpSysInfo language file Language: Hungarian Created by: Ambrus Sandor Olah
-->
<tns:translationPlugin language="hungarian" 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_uprecords_001" name="uprecords_title">
<exp>Uprecords</exp>
</expression>
<expression id="plugin_uprecords_101" name="uprecords_hash">
<exp>#</exp>
</expression>
<expression id="plugin_uprecords_102" name="uprecords_uptime">
<exp>Uptime</exp>
</expression>
<expression id="plugin_uprecords_103" name="uprecords_system">
<exp>Rendszer</exp>
</expression>
<expression id="plugin_uprecords_104" name="uprecords_bootup">
<exp>Rendszerindítás időpontja</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/uprecords/lang/pl.xml
0,0 → 1,24
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: pl.xml 661 2014-01-08 11:26:39Z aolah76 $ -->
<!--
phpSysInfo language file Language: Polish Created by: 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_uprecords_001" name="uprecords_title">
<exp>Uprecords</exp>
</expression>
<expression id="plugin_uprecords_101" name="uprecords_hash">
<exp>#</exp>
</expression>
<expression id="plugin_uprecords_102" name="uprecords_uptime">
<exp>Czas pracy</exp>
</expression>
<expression id="plugin_uprecords_103" name="uprecords_system">
<exp>System</exp>
</expression>
<expression id="plugin_uprecords_104" name="uprecords_bootup">
<exp>Wystartował</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/uprecords/lang/ro.xml
0,0 → 1,24
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: ro.xml 661 2014-01-08 11:26:39Z aolah76 $ -->
<!--
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_uprecords_001" name="uprecords_title">
<exp>Uprecords</exp>
</expression>
<expression id="plugin_uprecords_101" name="uprecords_hash">
<exp>#</exp>
</expression>
<expression id="plugin_uprecords_102" name="uprecords_uptime">
<exp>Uptime</exp>
</expression>
<expression id="plugin_uprecords_103" name="uprecords_system">
<exp>System</exp>
</expression>
<expression id="plugin_uprecords_104" name="uprecords_bootup">
<exp>Boot up</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/uprecords/lang/ru.xml
0,0 → 1,24
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: ru.xml 661 2015-01-05 11:26:39Z $ -->
<!--
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_uprecords_001" name="uprecords_title">
<exp>Состояное системы</exp>
</expression>
<expression id="plugin_uprecords_101" name="uprecords_hash">
<exp>#</exp>
</expression>
<expression id="plugin_uprecords_102" name="uprecords_uptime">
<exp>Аптайм</exp>
</expression>
<expression id="plugin_uprecords_103" name="uprecords_system">
<exp>Система</exp>
</expression>
<expression id="plugin_uprecords_104" name="uprecords_bootup">
<exp>Загружено</exp>
</expression>
</tns:translationPlugin>
/web/acc/phpsysinfo/plugins/uprecords/class.uprecords.inc.php
0,0 → 1,116
<?php
/**
* Uprecords plugin, which displays all uprecords informations available
*
* @category PHP
* @package PSI_Plugin_Uprecords
* @author Ambrus Sandor Olah <aolah76@freemail.hu>
* @copyright 2014 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version Release: 1.0
* @link http://phpsysinfo.sourceforge.net
*/
 
class uprecords extends PSI_Plugin
{
private $_lines;
 
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
 
$this->_lines = array();
}
 
/**
* get uprecords information
*
* @return array uprecords in array with label
*/
 
private function getUprecords()
{
$result = array();
$i = 0;
 
foreach ($this->_lines as $line) {
if (($i > 1) and (strpos($line, '---') === false)) {
$buffer = preg_split("/\s*[ |]\s+/", ltrim(ltrim($line, '->'), ' '));
if (defined('PSI_PLUGIN_UPRECORDS_SHORT_MODE') &&
(PSI_PLUGIN_UPRECORDS_SHORT_MODE === true) &&
!is_numeric($buffer[0])) {
break;
}
 
if (strpos($line, '->') !== false) {
if (defined('PSI_PLUGIN_UPRECORDS_DENOTE_BY_ASTERISK') && (PSI_PLUGIN_UPRECORDS_DENOTE_BY_ASTERISK === true)) {
$buffer[0] .= ' *';
} else {
$buffer[0] = '-> '.$buffer[0];
}
}
 
if (count($buffer) > 4) {
$buffer[3] = $buffer[3].' '.$buffer[4];
}
 
$result[$i]['hash'] = $buffer[0];
$result[$i]['Uptime'] = $buffer[1];
$result[$i]['System'] = $buffer[2];
//Date formating
$result[$i]['Bootup'] = preg_replace("/^(\S+)(\s+)/", "$1,$2", preg_replace("/^(\S+\s+\S+\s+)(\d)(\s+)/", "$1 0$2$3", trim($buffer[3])." GMT"));
}
$i++;
}
 
return $result;
}
 
public function execute()
{
$this->_lines = array();
switch (strtolower(PSI_PLUGIN_UPRECORDS_ACCESS)) {
case 'command':
$lines = "";
$options = "";
if (defined('PSI_PLUGIN_UPRECORDS_MAX_ENTRIES')) {
if (($ment = max(intval(PSI_PLUGIN_UPRECORDS_MAX_ENTRIES), 0)) != 10) {
$options=" -m ".$ment;
}
}
if (defined('PSI_PLUGIN_UPRECORDS_SHORT_MODE') && (PSI_PLUGIN_UPRECORDS_SHORT_MODE === true)) {
$options .= " -s";
}
if (CommonFunctions::executeProgram('TZ=GMT uprecords', '-a -w'.$options, $lines) && !empty($lines))
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
break;
case 'data':
if (CommonFunctions::rfts(PSI_APP_ROOT."/data/uprecords.txt", $lines) && !empty($lines))
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
break;
default:
$this->global_error->addConfigError("execute()", "[uprecords] ACCESS");
break;
}
}
 
public function xml()
{
if (empty($this->_lines))
return $this->xml->getSimpleXmlElement();
 
$arrBuff = $this->getUprecords();
if (sizeof($arrBuff) > 0) {
$uprecords = $this->xml->addChild("Uprecords");
foreach ($arrBuff as $arrValue) {
$item = $uprecords->addChild('Item');
$item->addAttribute('hash', $arrValue['hash']);
$item->addAttribute('Uptime', $arrValue['Uptime']);
$item->addAttribute('System', $arrValue['System']);
$item->addAttribute('Bootup', $arrValue['Bootup']);
}
}
 
return $this->xml->getSimpleXmlElement();
}
}
/web/acc/phpsysinfo/plugins/uprecords/uprecords_bootstrap.html
0,0 → 1,29
<div class="col-lg-12" id="block_uprecords" style="display:none;">
<div class="card" id="panel_uprecords" style="display:none;">
<div class="card-header"><span class="lang_plugin_uprecords_001">Uprecords</span>
<div id="reload_uprecords" class="reload" title="reload"></div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="uprecords" class="table table-hover table-sm">
<thead>
<tr>
<th><span class="lang_plugin_uprecords_101">#</span></th>
<th><span class="lang_plugin_uprecords_102">Uptime</span></th>
<th><span class="lang_plugin_uprecords_103">System</span></th>
<th><span class="lang_plugin_uprecords_104">Boot up</span></th>
</tr>
</thead>
<tbody id="uprecords-data">
<tr>
<th><span data-bind="hash"></span></th>
<td><span data-bind="Uptime"></span></td>
<td><span data-bind="System"></span></td>
<td><span data-bind="Bootup"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>