/web/acc/phpsysinfo/README.ALCASAR |
---|
1,6 → 1,5 |
ALCASAR adaptations : |
- remove folders "tools", "sample", "plugins", "js/vendor" |
- in "/" : remove "composer.json", "phpsysinfo.xslt", "phpsysinfo3.xsd", "Dockerfile" |
: rename & adapt phpsysinfo.ini |
- in "/" remove "composer.json", "phpsysinfo.xslt", "phpsysinfo3.xsd", "Dockerfile" |
- in folder "templates" : remove all except "aqua", "aqua.css", "html" & "plugin". "Aqua.css" has been adapted |
- language/language.php : has been modified ($lang is set by the web browser conf) |
- language/language.php : is modified ($lang is set by the web browser conf) |
/web/acc/phpsysinfo/phpsysinfo.ini |
---|
59,35 → 59,10 |
; |
BLOCKS=true |
; Maximum time in seconds a script is allowed to run before it is terminated by the parser |
; |
;MAX_TIMEOUT=30 |
; executeProgram() timeout value in seconds |
; |
;EXEC_TIMEOUT=30 |
; snmprealwalk() and executeProgram("snmpwalk") number of seconds until the first timeout |
; |
;SNMP_TIMEOUT=3 |
; snmprealwalk() and executeProgram("snmpwalk") number of times to retry if timeouts occur |
; |
;SNMP_RETRY=0 |
; External WinNT server connection parameters |
; Possibility available for WinNT and partly for LINUX (if wmic tool from wmic-linux or openvas-smb package is installed) |
; These settings can also be entered for a specific plug-in so that only it connects to an external server |
; For safety reasons make sure that phpsysinfo.ini cannot be read by the network or other users! |
; |
;WMI_HOSTNAME="hostname" |
;WMI_USER="username" |
;WMI_PASSWORD="password" |
; Plugins that should be included in xml and output |
; List of plugins should look like "plugin,plugin,plugin". See /plugins directory |
; - PLUGINS="Raid,PS" //list of plugins |
; - PLUGINS="MDStatus,PS" //list of plugins |
; - PLUGINS=false //no plugins |
; included plugins: |
; - Raid - show the software, fake, zpool or megaraid RAID status |
99,11 → 74,11 |
; - UpdateNotifier - show update notifications (only for Ubuntu server) |
; - SNMPPInfo - show printers info via SNMP |
; - Uprecords - show uprecords info |
; - Iptables - show iptables rules list |
; - PingTest - show Ping Test info |
; - StableBit - show StableBit Scanner info (WinNT) |
; - HyperV - show Hyper-V info (WinNT) |
; - Docker - show docker stats |
; - Viewer - show output of any command or file viewer.txt contents |
; |
PLUGINS=false |
255,7 → 230,6 |
; - IPMItool http://ipmitool.sourceforge.net/ (Linux) |
; - FreeIPMI http://www.gnu.org/software/freeipmi/ (FreeBSD/Linux/OpenBSD/SunOS) |
; - IPMIutil http://ipmiutil.sourceforge.net/ (Darwin/FreeBSD/Linux/SunOS/WinNT) |
; - IPMIcfg http://www.supermicro.com/en/solutions/management-software/ipmi-utilities (Linux/WinNT) |
; - K8Temp http://hur.st/k8temp/ (DragonFly/FreeBSD/NetBSD/OpenBSD) |
; - PiTemp No addon tool neded (Raspberry Pi and Banana Pi - Linux) |
; - OHM http://openhardwaremonitor.org/ (WinNT) |
264,7 → 238,6 |
; - Hwmon No addon tool neded (Linux) |
; - SpeedFan http://www.almico.com/speedfan.php (required tool packaged in: tools/speedfan/SpeedFanGet_bin.zip) (WinNT) |
; - Thinkpad No addon tool neded (Lenovo Thinkpad - Linux) |
; - NvidiaSMI Nvidia GPU drivers (FreeBSD/Linux/SunOS/WinNT) |
; |
; Example: If you want to use lmsensors : SENSOR_PROGRAM="LMSensors" |
; If you want to use lmsensors and IPMItool: SENSOR_PROGRAM="LMSensors,IPMItool" |
336,9 → 309,9 |
; Ignore usage and usage threshold for filesystem types |
; Example : IGNORE_THRESHOLD_FS_TYPES="packagefs, iso9660, squashfs, devfs, devtmpfs, tmpfs, lxfs, udf, UDF, CDFS" |
; Example : IGNORE_THRESHOLD_FS_TYPES="iso9660, squashfs, devfs, devtmpfs, lxfs, udf, UDF, CDFS" |
; |
IGNORE_THRESHOLD_FS_TYPES="packagefs, iso9660, squashfs, devfs, devtmpfs, tmpfs, lxfs, udf, UDF, CDFS" |
IGNORE_THRESHOLD_FS_TYPES="iso9660, squashfs, devfs, devtmpfs, lxfs, udf, UDF, CDFS" |
; Ignore usage of mounts |
347,12 → 320,6 |
IGNORE_USAGE="" |
; Ignore total size of mounts |
; Example : IGNORE_TOTAL="/System/Volumes/VM,/System/Volumes/Prebot" |
; |
IGNORE_TOTAL="" |
; Ignore free space size of mounts |
; Example : IGNORE_FREE="/zfs/space,/zfs/data" |
; |
372,11 → 339,6 |
HIDE_DISKS="" |
; Hide totals information |
; |
HIDE_TOTALS=false |
; ******************************** |
; NETWORK PARAMETERS |
; ******************************** |
474,20 → 436,6 |
; ******************************** |
; MISC PARAMETERS |
; ******************************** |
; define how to access the dmidecode data |
; - "data" read data from file data/dmidecode.txt |
; - "command" execute command: dmidecode -t 17 |
; If access error try execute first: chmod 4755 /usr/sbin/dmidecode |
; This method is not recommended for safety reasons! |
; |
DMIDECODE_ACCESS="command" |
; ******************************** |
; SENSORS PROGRAMS PARAMETERS |
; ******************************** |
553,21 → 501,6 |
; |
ACCESS="command" |
[sensor_ipmicfg] |
; IPMIcfg motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'ipmicfg -sdr' and/or 'ipmicfg -psfruinfo' command |
; - ACCESS="data" //read data from file data/ipmicfg.txt (output from: ipmicfg -sdr>ipmicfg.txt; ipmicfg -psfruinfo>>ipmicfg.txt) |
; |
ACCESS="command" |
; Execute power supply FRU health info |
; - true : execute 'ipmicfg --psfruinfo' |
; - false : don't execute 'ipmicfg --psfruinfo' |
; - "only" : execute 'ipmicfg --psfruinfo' and don't execute 'ipmicfg -sdr' |
; |
PSFRUINFO=true |
[sensor_k8temp] |
; K8Temp motherboard monitoring program configuration |
; |
576,14 → 509,6 |
; |
ACCESS="command" |
[sensor_thermalzone] |
; ThermalZone motherboard monitoring program configuration |
; |
; - ACCESS="command" //on Linux information is retrieved everytime through system files / on WINNT information is retrieved everytime through WMI |
; - ACCESS="data" //read data from file data/thermalzone.txt (output of WinNT command "wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CriticalTripPoint,CurrentTemperature,InstanceName") |
; |
ACCESS="command" |
[sensor_speedfan] |
; SpeedFan motherboard monitoring program configuration |
; |
592,19 → 517,7 |
; |
ACCESS="command" |
[sensor_nvidiasmi] |
; NvidiaSMI motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'nvidia-smi -q' command |
; - ACCESS="data" //read data from file data/nvidiasmi.txt |
; |
ACCESS="command" |
;The path to nvidia-smi.exe for the WinNT system |
; |
EXE_PATH="c:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" |
; ******************************** |
; PLUGINS PARAMETERS |
; ******************************** |
640,33 → 553,29 |
; Raid Plugin configuration |
; define how to access the raid statistic data |
; - "command" - mdstat: file "/proc/mdstat" is read (on Linux only) |
; - dmraid: command "dmraid -s -vv 2>&1" is run (on Linux only) |
; If access error try execute first: chmod 4755 /sbin/dmraid |
; This method is not recommended for safety reasons! |
; - megactl: command "megactl" (on Linux only) |
; downloaded from http://sourceforge.net/projects/megactl/ or http://github.com/hmage/megactl |
; If permission error try execute first: chmod 4755 /usr/sbin/megactl |
; - megasasctl: command "megasasctl" (on Linux only) |
; downloaded from http://sourceforge.net/projects/megactl/ or http://github.com/hmage/megactl |
; If permission error try execute first: chmod 4755 /usr/sbin/megasasctl |
; - megaclisas-status: command "megaclisas-status" (or "megaclisas-status.py" on WINNT) |
; downloaded from http://hwraid.le-vert.net or https://github.com/eLvErDe/hwraid (Python 2) or https://github.com/ElCoyote27/hwraid (Python 3) |
; - 3ware-status: command "3ware-status" (or 3ware-status.py" on WINNT) |
; downloaded from http://hwraid.le-vert.net or https://github.com/eLvErDe/hwraid or https://github.com/ElCoyote27/hwraid |
; - graid: command "graid list" is run (on FreeBSD only) |
; - zpool: command "zpool status" is run |
; - idrac: command "snmpwalk -Ona -c public -v 1 -r 0 -t 3 {device} .1.3.6.1.4.1.674.10892.5.5.1.20" is run |
; - "php-snmp"- idrac: execute php snmprealwalk function (php-snmp module must be installed) |
; - "command" - mdstat: file "/proc/mdstat" is read (on Linux only) |
; - dmraid: command "dmraid -s -vv 2>&1" is run (on Linux only) |
; If access error try execute first: chmod 4755 /sbin/dmraid |
; This method is not recommended for safety reasons! |
; - megactl: command "megactl" (on Linux only) |
; downloaded from http://sourceforge.net/projects/megactl/ or http://github.com/hmage/megactl |
; If permission error try execute first: chmod 4755 /usr/sbin/megactl |
; - megasasctl: command "megasasctl" (on Linux only) |
; downloaded from http://sourceforge.net/projects/megactl/ or http://github.com/hmage/megactl |
; If permission error try execute first: chmod 4755 /usr/sbin/megasasctl |
; - graid: command "graid list" is run (on FreeBSD only) |
; - zpool: command "zpool status" is run |
; - idrac: command "snmpwalk -Ona -c public -v 1 -r 0 -t 3 {device} .1.3.6.1.4.1.674.10892.5.5.1.20" is run |
; - "php-snmp"- idrac: execute php snmprealwalk function (php-snmp module must be installed) |
; - for others the option is inactive (uses "command" instead) |
; - "data" (a file must be available in the data directory of the phpsysinfo installation |
; with the filename "raidmdstat.txt" or "raiddmraid.txt" or "raidmegactl.txt" or "raidmegasasctl.txt" |
; or "raidmegaclisas-status.txt" or "raidgraid.txt" or "raidzpool.txt" or "raididrac{device_number}.txt") |
; with the filename "raidmdstat.txt" or "raiddmraid.txt" or "raidmegactl.txt" |
; or "raidmegasasctl" or "raidgraid.txt" or "raidzpool.txt" or "raididrac{device_number}.txt") |
; |
ACCESS="command" |
; define possible programs |
PROGRAM="mdstat,dmraid,megactl,megasasctl,megaclisas-status,3ware-status,graid,zpool,idrac" |
PROGRAM="mdstat,dmraid,megactl,megasasctl,graid,zpool,idrac" |
; Hide RAID devices |
; Example : HIDE_DEVICES="md127" |
686,7 → 595,7 |
; - "command" ps command is run everytime the block gets refreshed or build / on WINNT |
; information is retrieved everytime through WMI |
; - "data" (a file must be available in the data directory of the phpsysinfo installation |
; with the filename "ps.txt"; content is the output from "ps -axo pid,ppid,pmem,pcpu,args") |
; with the filename "ps.txt"; content is the output from "ps -axo pid,ppid,pmem,args") |
; |
ACCESS="command" |
711,8 → 620,8 |
; PSStatus Plugin configuration |
; define how to access the psstatus statistic data |
; - "command" pidof command is run everytime the block gets refreshed or build |
; / on WINNT information is retrieved everytime through WMI |
; - "command" pidof command is run everytime the block gets refreshed or build / on WINNT |
; information is retrieved everytime through WMI |
; - "data" a file must be available in the data directory of the phpsysinfo installation |
; with the filename "psstatus.txt"; content is the output from |
; <code>for ps in "apache2" "mysqld" "sshd"; do echo $ps "|" `pidof -s -x "$ps"`; done</code> |
755,8 → 664,7 |
; try to set: SUDO_COMMANDS="smartctl" and add to file /etc/sudoers line: apache ALL = (ALL) NOPASSWD: /usr/sbin/smartctl |
; - "data" (a file must be available in the data directory of the |
; phpsysinfo installation with the filename "smart{disk_number}.txt"; |
; content is the output from "smartctl --all device" |
; or on WinNT only from "wmic /namespace:\\root\wmi path MSStorageDriver_ATAPISmartData get VendorSpecific | more +{disk_number}") |
; content is the output from "smartctl --all device") |
; - "wmi" information is retrieved everytime through WMI (WinNT only) |
; |
ACCESS="command" |
776,11 → 684,8 |
; or for no SCSI devices: ID#-COLUMN_NAME-REPLACEMENT_ID# where REPLACEMENT_ID# is an alternative ID number. |
; COLUMN_NAME of this ID# will be displayed in the phpsysinfo S.M.A.R.T table. If you want RAW_VALUE to be displayed for the temperature (ID# 194) enter 194-RAW_VALUE |
; - IDS="194-VALUE,4-VALUE,009-RAW_VALUE" //ID#-COLUMN_NAME, ID#-COLUMN_NAME, etc... |
; The additional attributes: |
; ATA Error Count is marked as 0-RAW_VALUE |
; Non-medium Error Count is marked as 255-RAW_VALUE |
; |
IDS="005-RAW_VALUE,194-RAW_VALUE,009-RAW_VALUE,012-RAW_VALUE,193-RAW_VALUE-225,001-RAW_VALUE,007-RAW_VALUE,200-RAW_VALUE,197-RAW_VALUE,198-RAW_VALUE,0-RAW_VALUE" |
IDS="005-RAW_VALUE,194-RAW_VALUE,4-RAW_VALUE,009-RAW_VALUE,012-RAW_VALUE,193-RAW_VALUE-225,001-RAW_VALUE,007-RAW_VALUE,200-RAW_VALUE,197-RAW_VALUE,198-RAW_VALUE" |
[snmppinfo] |
856,28 → 761,17 |
DENOTE_BY_ASTERISK = false |
[viewer] |
; Viewer Plugin configuration |
[iptables] |
; Iptables Plugin configuration |
; define how to access the data |
; - "command" COMMAND command is run everytime the block gets refreshed or build |
; - "data" (a file must be available in the data directory of the phpsysinfo installation with the filename "viewer.txt") |
; define how to access the iptables rules data |
; - "command" iptables-save command is run everytime the block gets refreshed or build |
; if access error try to set: SUDO_COMMANDS="iptables-save" and add to file /etc/sudoers line: apache ALL = (ALL) NOPASSWD: /sbin/iptables-save |
; - "data" (a file must be available in the data directory of the phpsysinfo installation with the filename "iptables.txt"; content is the output from "iptables-save") |
; |
ACCESS="command" |
; define COMMAND name (for command access) |
; eg: |
; - "iptables-save" iptables-save command is run everytime the block gets refreshed or build (Linux) |
; if access error try to set: SUDO_COMMANDS="iptables-save" and add to file /etc/sudoers line: apache ALL = (ALL) NOPASSWD: /sbin/iptables-save |
; - "systeminfo" systeminfo command is run everytime the block gets refreshed or build (WinNT) |
; |
COMMAND="" |
; define COMMAND parameters (for command access) |
; |
PARAMS="" |
[pingtest] |
; PingTest Plugin configuration |
/web/acc/phpsysinfo/js/jQuery/README |
---|
13,7 → 13,7 |
jquery.dataTables.js |
-------------------- |
VERSION : 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix |
VERSION : 1.8.2+jquery1.9fix+parseJSONfix2+bindfix |
URL : http://plugins.jquery.com/project/DataTables |
DESC : dataTables is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable |
table without page refreshes. |
/web/acc/phpsysinfo/js/jQuery/jquery.dataTables.js |
---|
1,6 → 1,6 |
/* |
* File: jquery.dataTables.js |
* Version: 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix |
* Version: 1.8.2+jquery1.9fix+parseJSONfix2+bindfix |
* Description: Paginate, search and sort HTML tables |
* Author: Allan Jardine (www.sprymedia.co.uk) |
* Created: 28/3/2008 |
6363,7 → 6363,7 |
else |
{ |
sFullCookie = sNameFile + "=" + encodeURIComponent(sValue) + |
"; expires=" + date.toGMTString() +"; path=" + aParts.join('/')+"/; samesite=strict"; |
"; expires=" + date.toGMTString() +"; path=" + aParts.join('/')+"/"; |
} |
/* Are we going to go over the cookie limit of 4KiB? If so, try to delete a cookies |
6396,7 → 6396,7 |
if ( sOldName !== "" ) |
{ |
document.cookie = sOldName+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+ |
aParts.join('/') + "/; samesite=strict"; |
aParts.join('/') + "/"; |
} |
} |
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo.js |
---|
26,7 → 26,7 |
"use strict"; |
var langxml = [], filesystemTable, current_language = "", plugin_liste = [], blocks = [], langarr = [], |
showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showMemoryInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, showTotals, increaseWidth, oldnetwork = []; |
showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showMemoryInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, oldnetwork = []; |
/** |
* Fix PNG loading on IE6 or below |
57,7 → 57,7 |
} else { |
expires = ""; |
} |
document.cookie = name + "=" + value + expires + "; path=/; samesite=strict"; |
document.cookie = name + "=" + value + expires + "; path=/"; |
} |
/** |
112,19 → 112,11 |
* @param {String} template template that should be activated |
*/ |
function switchStyle(template) { |
if (increaseWidth > 0) { |
$('link[rel*=style][title]').each(function getTitle(i) { |
if (this.getAttribute('title') === 'PSI_Template') { |
this.setAttribute('href', './templates/css.php?name=' + template + '&increase=' + increaseWidth); |
} |
}); |
} else { |
$('link[rel*=style][title]').each(function getTitle(i) { |
if (this.getAttribute('title') === 'PSI_Template') { |
this.setAttribute('href', './templates/' + template + ".css"); |
} |
}); |
} |
$('link[rel*=style][title]').each(function getTitle(i) { |
if (this.getAttribute('title') === 'PSI_Template') { |
this.setAttribute('href', './templates/' + template + ".css"); |
} |
}); |
} |
/** |
289,19 → 281,17 |
html += " <th class=\"right\">" + genlang(37) + "</th>\n"; |
html += " </tr>\n"; |
html += " </thead>\n"; |
if (showTotals) { |
html += " <tfoot>\n"; |
html += " <tr style=\"font-weight : bold\">\n"; |
html += " <td> </td>\n"; |
html += " <td> </td>\n"; |
html += " <td>" + genlang(38) + "</td>\n"; |
html += " <td id=\"s_fs_total\"></td>\n"; |
html += " <td class=\"right\"><span id=\"s_fs_tfree\"></span></td>\n"; |
html += " <td class=\"right\"><span id=\"s_fs_tused\"></span></td>\n"; |
html += " <td class=\"right\"><span id=\"s_fs_tsize\"></span></td>\n"; |
html += " </tr>\n"; |
html += " </tfoot>\n"; |
} |
html += " <tfoot>\n"; |
html += " <tr style=\"font-weight : bold\">\n"; |
html += " <td> </td>\n"; |
html += " <td> </td>\n"; |
html += " <td>" + genlang(38) + "</td>\n"; |
html += " <td id=\"s_fs_total\"></td>\n"; |
html += " <td class=\"right\"><span id=\"s_fs_tfree\"></span></td>\n"; |
html += " <td class=\"right\"><span id=\"s_fs_tused\"></span></td>\n"; |
html += " <td class=\"right\"><span id=\"s_fs_tsize\"></span></td>\n"; |
html += " </tr>\n"; |
html += " </tfoot>\n"; |
html += " <tbody>\n"; |
html += " </tbody>\n"; |
html += " </table>\n"; |
413,23 → 403,6 |
} |
/** |
* format a given MT/s value to a better readable statement with the right suffix |
* @param {Number} mtps mtps value that should be formatted |
* @return {String} html string with no breaking spaces and translation statements |
*/ |
function formatMTps(mtps) { |
if ((mtps >= 0) && (mtps < 1000)) { |
return mtps.toString() + " " + genlang(131); |
} else { |
if (mtps >= 1000) { |
return round(mtps / 1000, 2) + " " + genlang(132); |
} else { |
return ""; |
} |
} |
} |
/** |
* format the byte values into a user friendly value with the corespondenting unit expression<br>support is included |
* for binary and decimal output<br>user can specify a constant format for all byte outputs or the output is formated |
* automatically so that every value can be read in a user friendly way |
713,7 → 686,7 |
pother = parseInt($(this).attr("ProcessesOther"), 10); |
} |
document.title = "System information: " + hostname + " (" + ip + ")"; |
document.title = "Système information: " + hostname + " (" + ip + ")"; |
$("#s_hostname_title").html(hostname); |
$("#s_ip_title").html(ip); |
$("#s_hostname").html(hostname); |
864,8 → 837,8 |
*/ |
function fillHWDevice(xml, type, tree, rootposition) { |
var devicecount = 0, html = ""; |
$("Hardware " + type + ((type=="MEM")?" Chip":" Device"), xml).each(function getHWDevice(deviceId) { |
var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", speed = 0, voltage = 0, devcoreposition = 0; |
$("Hardware " + type + " Device", xml).each(function getHWDevice(deviceId) { |
var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", devcoreposition = 0; |
devicecount++; |
name = $(this).attr("Name"); |
872,8 → 845,6 |
capacity = parseInt($(this).attr("Capacity"), 10); |
manufacturer = $(this).attr("Manufacturer"); |
product = $(this).attr("Product"); |
speed = parseInt($(this).attr("Speed"), 10); |
voltage = parseFloat($(this).attr("Voltage")); |
serial = $(this).attr("Serial"); |
count = parseInt($(this).attr("Count"), 10); |
if (!isNaN(count) && count > 1) { |
893,14 → 864,6 |
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(123) + ":</span></div></td><td>" + product + "</td></tr>\n"; |
tree.push(devcoreposition); |
} |
if (!isNaN(speed)) { |
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(129) + ":</span></div></td><td>" + ((type=="MEM")?formatMTps(speed):formatBPS(1000000*speed)) + "</td></tr>\n"; |
tree.push(devcoreposition); |
} |
if (!isNaN(voltage)) { |
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(52) + ":</span></div></td><td>" + round(voltage, 2) + " V</td></tr>\n"; |
tree.push(devcoreposition); |
} |
if (serial !== undefined) { |
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(124) + ":</span></div></td><td>" + serial + "</td></tr>\n"; |
tree.push(devcoreposition); |
915,7 → 878,7 |
function countHWDevice(xml, type) { |
var devicecount = 0; |
$("Hardware " + type + ((type=="MEM")?" Chip":" Device"), xml).each(function getHWDevice(deviceId) { |
$("Hardware " + type + " Device", xml).each(function getHWDevice(deviceId) { |
devicecount++; |
}); |
return devicecount; |
952,7 → 915,7 |
html += fillCpu(xml, tree, tree.push(0), closed); |
} |
var typelist = {MEM:130,PCI:17,IDE:18,SCSI:19,NVMe:126,USB:20,TB:117,I2C:118}; |
var typelist = {PCI:17,IDE:18,SCSI:19,NVMe:126,USB:20,TB:117,I2C:118}; |
for (var dev_type in typelist) { |
if (countHWDevice(xml, dev_type)) { |
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(typelist[dev_type]) + "</span></div></td></tr>\n"; |
1003,9 → 966,9 |
html1 += " <thead>\n"; |
html1 += " <tr>\n"; |
html1 += " <th>" + genlang(22) + "</th>\n"; |
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(23) + "</th>\n"; |
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(24) + "</th>\n"; |
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(25) + "</th>\n"; |
html1 += " <th class=\"right\" style=\"width:50px;\">" + genlang(23) + "</th>\n"; |
html1 += " <th class=\"right\" style=\"width:50px;\">" + genlang(24) + "</th>\n"; |
html1 += " <th class=\"right\" style=\"width:50px;\">" + genlang(25) + "</th>\n"; |
html1 += " </tr>\n"; |
html1 += " </thead>\n"; |
1119,11 → 1082,11 |
html += " <table id=\"MemoryTree\" class=\"tablemain\">\n"; |
html += " <thead>\n"; |
html += " <tr>\n"; |
html += " <th>" + genlang(34) + "</th>\n"; |
html += " <th style=\"width:33.3%;\">" + genlang(33) + "</th>\n"; |
html += " <th class=\"right\" style=\"width:14.2%;\">" + genlang(125) + "</th>\n"; |
html += " <th class=\"right\" style=\"width:14.2%;\">" + genlang(36) + "</th>\n"; |
html += " <th class=\"right\" style=\"width:14.2%;\">" + genlang(37) + "</th>\n"; |
html += " <th style=\"width:200px;\">" + genlang(34) + "</th>\n"; |
html += " <th style=\"width:285px;\">" + genlang(33) + "</th>\n"; |
html += " <th class=\"right\" style=\"width:100px;\">" + genlang(125) + "</th>\n"; |
html += " <th class=\"right\" style=\"width:100px;\">" + genlang(36) + "</th>\n"; |
html += " <th class=\"right\" style=\"width:100px;\">" + genlang(37) + "</th>\n"; |
html += " </tr>\n"; |
html += " </thead>\n"; |
html += " <tbody class=\"tree\">\n"; |
1134,7 → 1097,7 |
used = parseInt($(this).attr("Used"), 10); |
total = parseInt($(this).attr("Total"), 10); |
percent = parseInt($(this).attr("Percent"), 10); |
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(28) + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>"; |
html += "<tr><td style=\"width:200px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(28) + "</span></div></td><td style=\"width:285px;\">" + createBar(percent) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(free, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(used, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(total, xml) + "</td></tr>"; |
memoryindex = tree.push(0); |
$("Memory Details", xml).each(function getMemorydetails(id) { |
1146,15 → 1109,15 |
cached = parseInt($(this).attr("Cached"), 10); |
cachedp = parseInt($(this).attr("CachedPercent"), 10); |
if (!isNaN(app)) { |
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(64) + "</span></div></td><td>" + createBar(appp) + "</td><td class=\"right\"> </td><td class=\"right\">" + formatBytes(app, xml) + "</td><td class=\"right\"> </td></tr>"; |
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(64) + "</span></div></td><td style=\"width:285px;\">" + createBar(appp) + "</td><td class=\"right\" style=\"width:100px;\"> </td><td class=\"right\" style=\"width:100px\">" + formatBytes(app, xml) + "</td><td class=\"right\" style=\"width:100px;\"> </td></tr>"; |
tree.push(memoryindex); |
} |
if (!isNaN(cached)) { |
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(66) + "</span></div></td><td>" + createBar(cachedp) + "</td><td class=\"right\"> </td><td class=\"right\">" + formatBytes(cached, xml) + "</td><td class=\"right\"> </td></tr>"; |
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(66) + "</span></div></td><td style=\"width:285px;\">" + createBar(cachedp) + "</td><td class=\"right\" style=\"width:100px;\"> </td><td class=\"right\" style=\"width:100px;\">" + formatBytes(cached, xml) + "</td><td class=\"right\" style=\"width:100px;\"> </td></tr>"; |
tree.push(memoryindex); |
} |
if (!isNaN(buff)) { |
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(65) + "</span></div></td><td>" + createBar(buffp) + "</td><td class=\"rigth\"> </td><td class=\"right\">" + formatBytes(buff, xml) + "</td><td class=\"right\"> </td></tr>"; |
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(65) + "</span></div></td><td style=\"width:285px\">" + createBar(buffp) + "</td><td class=\"rigth\" style=\"width:100px;\"> </td><td class=\"right\" style=\"width:100px;\">" + formatBytes(buff, xml) + "</td><td class=\"right\" style=\"width:100px;\"> </td></tr>"; |
tree.push(memoryindex); |
} |
if (!isNaN(app) || !isNaN(buff) || !isNaN(cached)) { |
1170,7 → 1133,7 |
used = parseInt($(this).attr("Used"), 10); |
total = parseInt($(this).attr("Total"), 10); |
percent = parseInt($(this).attr("Percent"), 10); |
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(29) + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>"; |
html += "<tr><td style=\"width:200px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(29) + "</span></div></td><td style=\"width:285px;\">" + createBar(percent) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(free, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(used, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(total, xml) + "</td></tr>"; |
swapindex = tree.push(0); |
$("Memory Swap Mount", xml).each(function getDevices(id) { |
1189,7 → 1152,7 |
mpoint = mpid; |
} |
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + mpoint + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>"; |
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + mpoint + "</span></div></td><td style=\"width:285px;\">" + createBar(percent) + "</td><td class=\"right\" style=\"width:100px\">" + formatBytes(free, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(used, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(total, xml) + "</td></tr>"; |
tree.push(swapindex); |
}); |
}); |
1261,9 → 1224,9 |
inodes_text = "<span style=\"font-style:italic\"> (" + inodes.toString() + "%)</span>"; |
} |
if (!isNaN(ignore) && (ignore > 0) && showTotals) { |
if (ignore >= 3) { |
if ((ignore == 3) && !isNaN(threshold) && (percent >= threshold)) { |
if (!isNaN(ignore) && (ignore > 0)) { |
if (ignore >= 2) { |
if ((ignore == 2) && !isNaN(threshold) && (percent >= threshold)) { |
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn") + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]); |
} else { |
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]); |
1276,39 → 1239,33 |
} |
} |
} else { |
if (!isNaN(threshold) && (percent >= threshold) && (showTotals || isNaN(ignore) || (ignore < 4))) { |
if (!isNaN(threshold) && (percent >= threshold)) { |
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn") + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span>" + formatBytes(free, xml), "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span>" + formatBytes(size, xml)]); |
} else { |
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span>" + formatBytes(free, xml), "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span>" + formatBytes(size, xml)]); |
} |
} |
if (showTotals) { |
if (!isNaN(ignore) && (ignore > 0)) { |
if (ignore == 2) { |
total_used += used; |
} else if (ignore == 1) { |
total_used += used; |
total_size += used; |
} |
} else { |
if (!isNaN(ignore) && (ignore > 0)) { |
if (ignore == 1) { |
total_used += used; |
total_free += free; |
total_size += size; |
total_size += used; |
} |
total_usage = (total_size != 0) ? round(100 - (total_free / total_size) * 100, 2) : 0; |
} else { |
total_used += used; |
total_free += free; |
total_size += size; |
} |
total_usage = round((total_used / total_size) * 100, 2); |
}); |
if (showTotals) { |
if (!isNaN(threshold) && (total_usage >= threshold)) { |
$("#s_fs_total").html(createBar(total_usage, "barwarn")); |
} else { |
$("#s_fs_total").html(createBar(total_usage)); |
} |
$("#s_fs_tfree").html(formatBytes(total_free, xml)); |
$("#s_fs_tused").html(formatBytes(total_used, xml)); |
$("#s_fs_tsize").html(formatBytes(total_size, xml)); |
if (!isNaN(threshold) && (total_usage >= threshold)) { |
$("#s_fs_total").html(createBar(total_usage, "barwarn")); |
} else { |
$("#s_fs_total").html(createBar(total_usage)); |
} |
$("#s_fs_tfree").html(formatBytes(total_free, xml)); |
$("#s_fs_tused").html(formatBytes(total_used, xml)); |
$("#s_fs_tsize").html(formatBytes(total_size, xml)); |
} |
/** |
1327,15 → 1284,15 |
var values = false; |
$("#temperatureTable tbody").empty(); |
$("MBInfo Temperature Item", xml).each(function getTemperatures(id) { |
var label = "", value = "", event = "", limit = 0, _limit = ""; |
var label = "", value = "", limit = 0, _limit = "", event = ""; |
label = $(this).attr("Label"); |
value = $(this).attr("Value"); |
limit = parseFloat($(this).attr("Max")); |
if (isFinite(limit)) |
_limit = formatTemp(limit, xml); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
limit = parseFloat($(this).attr("Max")); |
if (isFinite(limit)) |
_limit = formatTemp(limit, xml); |
$("#temperatureTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + formatTemp(value, xml) + "</td><td class=\"right\">" + _limit + "</td></tr>"); |
values = true; |
}); |
1361,12 → 1318,9 |
var values = false; |
$("#voltageTable tbody").empty(); |
$("MBInfo Voltage Item", xml).each(function getVoltages(id) { |
var label = "", value = 0, event = "", max = 0, min = 0, _min = "", _max = ""; |
var label = "", value = 0, max = 0, min = 0, _min = "", _max = "", event = ""; |
label = $(this).attr("Label"); |
value = parseFloat($(this).attr("Value")); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
max = parseFloat($(this).attr("Max")); |
if (isFinite(max)) |
_max = round(max, 2) + " " + genlang(62); |
1373,6 → 1327,9 |
min = parseFloat($(this).attr("Min")); |
if (isFinite(min)) |
_min = round(min, 2) + " " + genlang(62); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
$("#voltageTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value, 2) + " " + genlang(62) + "</td><td class=\"right\">" + _min + "</td><td class=\"right\">" + _max + "</td></tr>"); |
values = true; |
}); |
1398,23 → 1355,16 |
var values = false; |
$("#fansTable tbody").empty(); |
$("MBInfo Fans Item", xml).each(function getFans(id) { |
var label = "", value = 0, event = "", min = 0, _min = "", unit = ""; |
var label = "", value = 0, min = 0, _min = "", event = ""; |
label = $(this).attr("Label"); |
value = parseFloat($(this).attr("Value")); |
min = parseFloat($(this).attr("Min")); |
if (isFinite(min)) |
_min = round(min,0) + " " + genlang(63); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
min = parseFloat($(this).attr("Min")); |
unit = $(this).attr("Unit"); |
if (unit === "%") { |
if (isFinite(min)) |
_min = round(min,0) + "%"; |
$("#fansTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td><td class=\"right\">" + _min + "</td></tr>"); |
} else { |
if (isFinite(min)) |
_min = round(min,0) + " " + genlang(63); |
$("#fansTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value,0) + " " + genlang(63) + "</td><td class=\"right\">" + _min + "</td></tr>"); |
} |
$("#fansTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value,0) + " " + genlang(63) + "</td><td class=\"right\">" + _min + "</td></tr>"); |
values = true; |
}); |
if (values) { |
1439,15 → 1389,15 |
var values = false; |
$("#powerTable tbody").empty(); |
$("MBInfo Power Item", xml).each(function getPowers(id) { |
var label = "", value = "", event = "", limit = 0, _limit = ""; |
var label = "", value = "", limit = 0, _limit = "", event = ""; |
label = $(this).attr("Label"); |
value = $(this).attr("Value"); |
limit = parseFloat($(this).attr("Max")); |
if (isFinite(limit)) |
_limit = round(limit, 2) + " " + genlang(103); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
limit = parseFloat($(this).attr("Max")); |
if (isFinite(limit)) |
_limit = round(limit, 2) + " " + genlang(103); |
$("#powerTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value, 2) + " " + genlang(103) + "</td><td class=\"right\">" + _limit + "</td></tr>"); |
values = true; |
}); |
1473,12 → 1423,10 |
var values = false; |
$("#currentTable tbody").empty(); |
$("MBInfo Current Item", xml).each(function getCurrents(id) { |
var label = "", value = "", event = "", min = 0, max = 0, _min = "", _max = ""; |
var label = "", value = "", min = 0, max = 0, _min = "", _max = "", event = ""; |
label = $(this).attr("Label"); |
value = $(this).attr("Value"); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
max = parseFloat($(this).attr("Max")); |
if (isFinite(max)) |
_max = round(max, 2) + " " + genlang(106); |
1485,6 → 1433,10 |
min = parseFloat($(this).attr("Min")); |
if (isFinite(min)) |
_min = round(min, 2) + " " + genlang(106); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
$("#currentTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value, 2) + " " + genlang(106) + "</td><td class=\"right\">" + _min + "</td><td class=\"right\">" + _max + "</td></tr>"); |
values = true; |
}); |
1510,18 → 1462,14 |
var values = false; |
$("#otherTable tbody").empty(); |
$("MBInfo Other Item", xml).each(function getOthers(id) { |
var label = "", value = "", event = "", unit = ""; |
var label = "", value = "", event = ""; |
label = $(this).attr("Label"); |
value = $(this).attr("Value"); |
event = $(this).attr("Event"); |
if (event !== undefined) |
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>"; |
unit = $(this).attr("Unit"); |
if (unit === "%") { |
$("#otherTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td></tr>"); |
} else { |
$("#otherTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + value + "</td></tr>"); |
} |
$("#otherTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + value + "</td></tr>"); |
values = true; |
}); |
if (values) { |
1578,59 → 1526,59 |
} |
index = tree.push(0); |
if (model !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(70) + "</span></div></td><td>" + model + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(70) + "</span></div></td><td>" + model + "</td></tr>\n"; |
tree.push(index); |
} |
if (start_time !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(72) + "</span></div></td><td>" + start_time + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(72) + "</span></div></td><td>" + start_time + "</td></tr>\n"; |
tree.push(index); |
} |
if (upsstatus !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(73) + "</span></div></td><td>" + upsstatus + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(73) + "</span></div></td><td>" + upsstatus + "</td></tr>\n"; |
tree.push(index); |
} |
if (temperature !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(84) + "</span></div></td><td>" + temperature + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(84) + "</span></div></td><td>" + temperature + "</td></tr>\n"; |
tree.push(index); |
} |
if (outages_count !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(74) + "</span></div></td><td>" + outages_count + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(74) + "</span></div></td><td>" + outages_count + "</td></tr>\n"; |
tree.push(index); |
} |
if (last_outage !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(75) + "</span></div></td><td>" + last_outage + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(75) + "</span></div></td><td>" + last_outage + "</td></tr>\n"; |
tree.push(index); |
} |
if (last_outage_finish !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(76) + "</span></div></td><td>" + last_outage_finish + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(76) + "</span></div></td><td>" + last_outage_finish + "</td></tr>\n"; |
tree.push(index); |
} |
if (line_voltage !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(77) + "</span></div></td><td>" + line_voltage + " " + genlang(82) + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(77) + "</span></div></td><td>" + line_voltage + " " + genlang(82) + "</td></tr>\n"; |
tree.push(index); |
} |
if (line_frequency !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(108) + "</span></div></td><td>" + line_frequency + " " + genlang(109) + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(108) + "</span></div></td><td>" + line_frequency + " " + genlang(109) + "</td></tr>\n"; |
tree.push(index); |
} |
if (!isNaN(load_percent)) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(78) + "</span></div></td><td>" + createBar(load_percent) + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(78) + "</span></div></td><td>" + createBar(load_percent) + "</td></tr>\n"; |
tree.push(index); |
} |
if (battery_date !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(104) + "</span></div></td><td>" + battery_date + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(104) + "</span></div></td><td>" + battery_date + "</td></tr>\n"; |
tree.push(index); |
} |
if (battery_voltage !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(79) + "</span></div></td><td>" + battery_voltage + " " + genlang(82) + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(79) + "</span></div></td><td>" + battery_voltage + " " + genlang(82) + "</td></tr>\n"; |
tree.push(index); |
} |
if (!isNaN(battery_charge_percent)) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(80) + "</span></div></td><td>" + createBar(battery_charge_percent) + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(80) + "</span></div></td><td>" + createBar(battery_charge_percent) + "</td></tr>\n"; |
tree.push(index); |
} |
if (time_left_minutes !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(81) + "</span></div></td><td>" + time_left_minutes + " " + genlang(83) + "</td></tr>\n"; |
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(81) + "</span></div></td><td>" + time_left_minutes + " " + genlang(83) + "</td></tr>\n"; |
tree.push(index); |
} |
values=true; |
1743,9 → 1691,6 |
showNetworkInfosExpanded = $("#showNetworkInfosExpanded").val().toString()==="true"; |
showMemoryInfosExpanded = $("#showMemoryInfosExpanded").val().toString()==="true"; |
showCPULoadCompact = $("#showCPULoadCompact").val().toString()==="true"; |
showTotals = $("#hideTotals").val().toString()!=="true"; |
increaseWidth = $("#increaseWidth").val().toString(); |
if (isNaN(increaseWidth) || (increaseWidth<=0)) increaseWidth = 0; |
switch ($("#showNetworkActiveSpeed").val().toString()) { |
case "bps": showNetworkActiveSpeed = 2; |
break; |
1969,8 → 1914,7 |
} |
block += "<div id=\"panel_" + plugin + "\" style=\"display:none;\">\n"; |
block += "<div id=\"Plugin_" + plugin + "\" class=\"plugin\" style=\"display:none;\">\n"; |
block += "<h2>" + reloadpic + genlang(translationid, plugin) + "\n"; |
block += "<span class=\"Hostname_" + plugin + "\"></span></h2>\n"; |
block += "<h2>" + reloadpic + genlang(translationid, plugin) + "</h2>\n"; |
block += "</div>\n"; |
block += "</div>\n"; |
return block; |
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js |
---|
21,7 → 21,7 |
} else { |
expires = ""; |
} |
document.cookie = name + "=" + value + expires + "; path=/; samesite=strict"; |
document.cookie = name + "=" + value + expires + "; path=/"; |
} |
/** |
288,13 → 288,6 |
pluginname: pluginname, |
success: function (data) { |
try { |
for (var propertyName in data.Plugins) { |
if ((data.Plugins[propertyName]["@attributes"] !== undefined) && |
((hostname = data.Plugins[propertyName]["@attributes"]["Hostname"]) !== undefined)) { |
$('span[class=hostname_' + pluginname + ']').html(hostname); |
} |
break; |
} |
// dynamic call |
window['renderPlugin_' + this.pluginname](data); |
changeLanguage(this.pluginname); |
320,13 → 313,9 |
}); |
} |
if ((ua=useragent.match(/Version\/(\d+)\.[\d\.]+ (Mobile\/\S+ )?Safari\//)) !== null) { |
if (ua[1]<=5) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari5.css'); |
} else if (ua[1]<=8) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari8.css'); |
} |
} else if ((ua=useragent.match(/Firefox\/(\d+)\.[\d\.]+/)) !== null) { |
if (((ua=useragent.match(/Safari\/(\d+)\.[\d\.]+$/)) !== null) && (ua[1]<=534)) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari5.css'); |
} else if ((ua=useragent.match(/Firefox\/(\d+)\.[\d\.]+$/)) !== null) { |
if (ua[1]<=15) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox15.css'); |
} else if (ua[1]<=20) { |
336,18 → 325,6 |
} else if (ua[1]==28) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox28.css'); |
} |
} else if ((ua=useragent.match(/Midori\/(\d+)\.?(\d+)?/)) !== null) { |
if ((ua[1]==0) && (ua.length==3) && (ua[2]<=4)) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori04.css'); |
} else if ((ua[1]==0) && (ua.length==3) && (ua[2]==5)) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori05.css'); |
} |
} else if ((ua=useragent.match(/Chrome\/(\d+)\.[\d\.]+/)) !== null) { |
if (ua[1]<=25) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome25.css'); |
} else if (ua[1]<=28) { |
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome28.css'); |
} |
} |
$(window).resize(); |
475,7 → 452,7 |
ip_string = ipv4[1]; |
ipv4 = ipv4[2].match(/[0-9]+/g); |
for (var i = 0;i < 4;i ++) { |
var byte = parseInt(ipv4[i], 10); |
var byte = parseInt(ipv4[i],10); |
if (byte<256) { |
ipv4[i] = ("0" + byte.toString(16)).substr(-2); |
} else { |
576,12 → 553,12 |
var timestamp = 0; |
var datetimeFormat; |
if ((data.Generation !== undefined) && (data.Generation["@attributes"] !== undefined) && (data.Generation["@attributes"].timestamp !== undefined) ) { |
timestamp = parseInt(data.Generation["@attributes"].timestamp, 10) * 1000; //server time |
timestamp = parseInt(data.Generation["@attributes"].timestamp)*1000; //server time |
if (isNaN(timestamp)) timestamp = Number(new Date()); //client time |
} else { |
timestamp = Number(new Date()); //client time |
} |
lastboot = new Date(timestamp - (parseInt(this.Uptime, 10) * 1000)); |
lastboot = new Date(timestamp - (parseInt(this.Uptime)*1000)); |
if (((datetimeFormat = data.Options["@attributes"].datetimeFormat) !== undefined) && (datetimeFormat.toLowerCase() === "locale")) { |
return lastboot.toLocaleString(); |
} else { |
619,24 → 596,24 |
html: function () { |
var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0; |
var not_first = false; |
processes = parseInt(this.Processes, 10); |
processes = parseInt(this.Processes); |
if (this.ProcessesRunning !== undefined) { |
p111 = parseInt(this.ProcessesRunning, 10); |
p111 = parseInt(this.ProcessesRunning); |
} |
if (this.ProcessesSleeping !== undefined) { |
p112 = parseInt(this.ProcessesSleeping, 10); |
p112 = parseInt(this.ProcessesSleeping); |
} |
if (this.ProcessesStopped !== undefined) { |
p113 = parseInt(this.ProcessesStopped, 10); |
p113 = parseInt(this.ProcessesStopped); |
} |
if (this.ProcessesZombie !== undefined) { |
p114 = parseInt(this.ProcessesZombie, 10); |
p114 = parseInt(this.ProcessesZombie); |
} |
if (this.ProcessesWaiting !== undefined) { |
p115 = parseInt(this.ProcessesWaiting, 10); |
p115 = parseInt(this.ProcessesWaiting); |
} |
if (this.ProcessesOther !== undefined) { |
p116 = parseInt(this.ProcessesOther, 10); |
p116 = parseInt(this.ProcessesOther); |
} |
if (p111 || p112 || p113 || p114 || p115 || p116) { |
processes += " ("; |
720,7 → 697,7 |
}, |
Bogomips: { |
text: function () { |
return parseInt(this.Bogomips, 10); |
return parseInt(this.Bogomips); |
} |
}, |
Load: { |
740,8 → 717,8 |
}, |
hwCount: { |
text: function() { |
if ((this.Count !== undefined) && !isNaN(this.Count) && (parseInt(this.Count, 10)>1)) { |
return parseInt(this.Count, 10); |
if ((this.Count !== undefined) && !isNaN(this.Count) && (parseInt(this.Count)>1)) { |
return parseInt(this.Count); |
} else { |
return ""; |
} |
749,30 → 726,7 |
} |
}; |
var mem_directives = { |
Speed: { |
html: function() { |
return formatMTps(this.Speed); |
} |
}, |
Voltage: { |
html: function() { |
return round(this.Voltage, 2) + ' V'; |
} |
}, |
Capacity: { |
html: function () { |
return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat); |
} |
} |
}; |
var dev_directives = { |
Speed: { |
html: function() { |
return formatBPS(1000000*this.Speed); |
} |
}, |
Capacity: { |
html: function () { |
return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat); |
825,23 → 779,15 |
$("#hardware-CPU").hide(); |
} |
var devparamlist = {Capacity:43,Manufacturer:122,Product:123,Speed:129,Voltage:52,Serial:124}; |
for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) { |
var devparamlist = {Capacity:43,Manufacturer:122,Product:123,Serial:124}; |
for (hw_type in {PCI:0,IDE:1,SCSI:2,NVMe:3,USB:4,TB:5,I2C:6}) { |
try { |
if (hw_type == 'MEM') { |
datas = items(data.Hardware[hw_type].Chip); |
} else { |
datas = items(data.Hardware[hw_type].Device); |
} |
datas = items(data.Hardware[hw_type].Device); |
for (i = 0; i < datas.length; i++) { |
if (i === 0) { |
html+="<tr id=\"hardware-" + hw_type + "\" class=\"treegrid-" + hw_type + "\">"; |
html+="<th>" + hw_type + "</th>"; |
if (hw_type == 'MEM') { |
html+="<td><span class=\"treegrid-span\">" + genlang('128') + ":</span></td>"; //Number of memories |
} else { |
html+="<td><span class=\"treegrid-span\">" + genlang('120') + ":</span></td>"; //Number of devices |
} |
html+="<td><span class=\"treegrid-span\">" + genlang('120') + ":</span></td>"; //Number of devices |
html+="<td class=\"rightCell\"><span id=\"" + hw_type + "Count\"></span></td>"; |
html+="</tr>"; |
} |
891,33 → 837,21 |
} |
var licz; |
for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) { |
for (hw_type in {PCI:0,IDE:1,SCSI:2,NVMe:3,USB:4,TB:5,I2C:6}) { |
try { |
licz = 0; |
if (hw_type == 'MEM') { |
datas = items(data.Hardware[hw_type].Chip); |
} else { |
datas = items(data.Hardware[hw_type].Device); |
} |
datas = items(data.Hardware[hw_type].Device); |
for (i = 0; i < datas.length; i++) { |
$('#hardware-'+hw_type+'-'+ i).render(datas[i]["@attributes"], hw_directives); |
if ((datas[i]["@attributes"].Count !== undefined) && !isNaN(datas[i]["@attributes"].Count) && (parseInt(datas[i]["@attributes"].Count, 10)>1)) { |
licz += parseInt(datas[i]["@attributes"].Count, 10); |
if ((datas[i]["@attributes"].Count !== undefined) && !isNaN(datas[i]["@attributes"].Count) && (parseInt(datas[i]["@attributes"].Count)>1)) { |
licz += parseInt(datas[i]["@attributes"].Count); |
} else { |
licz++; |
} |
if (hw_type == 'MEM') { |
for (proc_param in devparamlist) { |
if ((datas[i]["@attributes"][proc_param] !== undefined)) { |
$('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], mem_directives); |
} |
for (proc_param in devparamlist) { |
if ((datas[i]["@attributes"][proc_param] !== undefined)) { |
$('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], dev_directives); |
} |
} else { |
for (proc_param in devparamlist) { |
if ((datas[i]["@attributes"][proc_param] !== undefined)) { |
$('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], dev_directives); |
} |
} |
} |
} |
if (i > 0) { |
982,19 → 916,19 |
'<div class="progress-bar progress-bar-info" style="width:' + this["@attributes"].Percent + '%;"></div>' + |
'</div><div class="percent">' + this["@attributes"].Percent + '%</div>'; |
} else { |
var rest = parseInt(this["@attributes"].Percent, 10); |
var rest = parseInt(this["@attributes"].Percent); |
var html = '<div class="progress">'; |
if ((this.Details["@attributes"].AppPercent !== undefined) && (this.Details["@attributes"].AppPercent > 0)) { |
html += '<div class="progress-bar progress-bar-info" style="width:' + this.Details["@attributes"].AppPercent + '%;"></div>'; |
rest -= parseInt(this.Details["@attributes"].AppPercent, 10); |
rest -= parseInt(this.Details["@attributes"].AppPercent); |
} |
if ((this.Details["@attributes"].CachedPercent !== undefined) && (this.Details["@attributes"].CachedPercent > 0)) { |
html += '<div class="progress-bar progress-bar-warning" style="width:' + this.Details["@attributes"].CachedPercent + '%;"></div>'; |
rest -= parseInt(this.Details["@attributes"].CachedPercent, 10); |
rest -= parseInt(this.Details["@attributes"].CachedPercent); |
} |
if ((this.Details["@attributes"].BuffersPercent !== undefined) && (this.Details["@attributes"].BuffersPercent > 0)) { |
html += '<div class="progress-bar progress-bar-danger" style="width:' + this.Details["@attributes"].BuffersPercent + '%;"></div>'; |
rest -= parseInt(this.Details["@attributes"].BuffersPercent, 10); |
rest -= parseInt(this.Details["@attributes"].BuffersPercent); |
} |
if (rest > 0) { |
html += '<div class="progress-bar progress-bar-success" style="width:' + rest + '%;"></div>'; |
1079,17 → 1013,29 |
var directives = { |
Total: { |
html: function () { |
return formatBytes(this.Total, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals); |
if ((this.Ignore !== undefined) && (this.Ignore > 0)) { |
return formatBytes(this.Total, data.Options["@attributes"].byteFormat, true); |
} else { |
return formatBytes(this.Total, data.Options["@attributes"].byteFormat); |
} |
} |
}, |
Free: { |
html: function () { |
return formatBytes(this.Free, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals); |
if ((this.Ignore !== undefined) && (this.Ignore > 0)) { |
return formatBytes(this.Free, data.Options["@attributes"].byteFormat, true); |
} else { |
return formatBytes(this.Free, data.Options["@attributes"].byteFormat); |
} |
} |
}, |
Used: { |
html: function () { |
return formatBytes(this.Used, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore >= 3) && showtotals); |
if ((this.Ignore !== undefined) && (this.Ignore >= 2)) { |
return formatBytes(this.Used, data.Options["@attributes"].byteFormat, true); |
} else { |
return formatBytes(this.Used, data.Options["@attributes"].byteFormat); |
} |
} |
}, |
MountPoint: { |
1104,23 → 1050,11 |
}, |
Percent: { |
html: function () { |
var used1 = (this.Total != 0) ? Math.ceil((this.Used / this.Total) * 100) : 0; |
var used2 = Math.ceil(this.Percent); |
var used21= used2 - used1; |
if (used21 > 0) { |
return '<div class="progress">' + '<div class="' + |
( ( ((this.Ignore == undefined) || (this.Ignore < 4)) && ((data.Options["@attributes"].threshold !== undefined) && |
(parseInt(this.Percent, 10) >= parseInt(data.Options["@attributes"].threshold, 10))) ) ? 'progress-bar progress-bar-danger' : 'progress-bar progress-bar-info' ) + |
'" style="width:' + used1 + '% ;"></div>' + |
'<div class="progress-bar progress-bar-warning" style="width:' + used21 + '% ;"></div>' |
+'</div><div class="percent">' + this.Percent + '% ' + ((this.Inodes !== undefined) ? '<i>(' + this.Inodes + '%)</i>' : '') + '</div>'; |
} else { |
return '<div class="progress">' + '<div class="' + |
( ( ((this.Ignore == undefined) || (this.Ignore < 4)) && ((data.Options["@attributes"].threshold !== undefined) && |
(parseInt(this.Percent, 10) >= parseInt(data.Options["@attributes"].threshold, 10))) ) ? 'progress-bar progress-bar-danger' : 'progress-bar progress-bar-info' ) + |
'" style="width:' + used2 + '% ;"></div>' + |
'</div>' + '<div class="percent">' + this.Percent + '% ' + ((this.Inodes !== undefined) ? '<i>(' + this.Inodes + '%)</i>' : '') + '</div>'; |
} |
return '<div class="progress">' + '<div class="' + |
( ( ((this.Ignore == undefined) || (this.Ignore < 3)) && ((data.Options["@attributes"].threshold !== undefined) && |
(parseInt(this.Percent) >= parseInt(data.Options["@attributes"].threshold))) ) ? 'progress-bar progress-bar-danger' : 'progress-bar progress-bar-info' ) + |
'" style="width:' + this.Percent + '% ;"></div>' + |
'</div>' + '<div class="percent">' + this.Percent + '% ' + ((this.Inodes !== undefined) ? '<i>(' + this.Inodes + '%)</i>' : '') + '</div>'; |
} |
} |
}; |
1129,31 → 1063,23 |
var fs_data = []; |
var datas = items(data.FileSystem.Mount); |
var total = {Total:0,Free:0,Used:0}; |
var showtotals = $("#hideTotals").val().toString()!=="true"; |
for (var i = 0; i < datas.length; i++) { |
fs_data.push(datas[i]["@attributes"]); |
if (showtotals) { |
if ((datas[i]["@attributes"].Ignore !== undefined) && (datas[i]["@attributes"].Ignore > 0)) { |
if (datas[i]["@attributes"].Ignore == 2) { |
total.Used += parseInt(datas[i]["@attributes"].Used, 10); |
} else if (datas[i]["@attributes"].Ignore == 1) { |
total.Total += parseInt(datas[i]["@attributes"].Used, 10); |
total.Used += parseInt(datas[i]["@attributes"].Used, 10); |
} |
} else { |
total.Total += parseInt(datas[i]["@attributes"].Total, 10); |
total.Free += parseInt(datas[i]["@attributes"].Free, 10); |
total.Used += parseInt(datas[i]["@attributes"].Used, 10); |
if ((datas[i]["@attributes"].Ignore !== undefined) && (datas[i]["@attributes"].Ignore > 0)) { |
if (datas[i]["@attributes"].Ignore == 1) { |
total.Total += parseInt(datas[i]["@attributes"].Used); |
total.Used += parseInt(datas[i]["@attributes"].Used); |
} |
total.Percent = (total.Total != 0) ? round(100 - (total.Free / total.Total) * 100, 2) : 0; |
} else { |
total.Total += parseInt(datas[i]["@attributes"].Total); |
total.Free += parseInt(datas[i]["@attributes"].Free); |
total.Used += parseInt(datas[i]["@attributes"].Used); |
} |
total.Percent = (total.Total !== 0) ? round((total.Used / total.Total) * 100, 2) : 0; |
} |
if (i > 0) { |
$('#filesystem-data').render(fs_data, directives); |
if (showtotals) { |
$('#filesystem-foot').render(total, directives); |
$('#filesystem-foot').show(); |
} |
$('#filesystem-foot').render(total, directives); |
$('#filesystem_MountPoint').removeClass("sorttable_sorted"); //reset sort order |
// sorttable.innerSortFunction.apply(document.getElementById('filesystem_MountPoint'), []); |
sorttable.innerSortFunction.apply($('#filesystem_MountPoint')[0], []); |
1366,24 → 1292,13 |
var directives = { |
Value: { |
html: function () { |
if (this.Unit === "%") { |
return '<div class="progress">' + |
'<div class="progress-bar progress-bar-info" style="width:' + round(this.Value,0) + '%;"></div>' + |
'</div><div class="percent">' + round(this.Value,0) + '%</div>'; |
} else { |
return round(this.Value,0) + String.fromCharCode(160) + genlang(63); //RPM |
} |
return round(this.Value,0) + String.fromCharCode(160) + genlang(63); //RPM |
} |
}, |
Min: { |
html: function () { |
if (this.Min !== undefined) { |
if (this.Unit === "%") { |
return round(this.Min,0) + "%"; |
} else { |
return round(this.Min,0) + String.fromCharCode(160) + genlang(63); //RPM |
} |
} |
if (this.Min !== undefined) |
return round(this.Min,0) + String.fromCharCode(160) + genlang(63); //RPM |
} |
}, |
Label: { |
1510,18 → 1425,6 |
} |
var directives = { |
Value: { |
html: function () { |
if (this.Unit === "%") { |
return '<div class="progress">' + |
'<div class="progress-bar progress-bar-info" style="width:' + round(this.Value,0) + '%;"></div>' + |
'</div><div class="percent">' + round(this.Value,0) + '%</div>'; |
// return round(this.Value,0) + "%"; |
} else { |
return this.Value; |
} |
} |
}, |
Label: { |
html: function () { |
if (this.Event === undefined) |
1740,23 → 1643,6 |
} |
/** |
* format a given MT/s value to a better readable statement with the right suffix |
* @param {Number} mtps mtps value that should be formatted |
* @return {String} html string with no breaking spaces and translation statements |
*/ |
function formatMTps(mtps) { |
if ((mtps >= 0) && (mtps < 1000)) { |
return mtps.toString() + String.fromCharCode(160) + genlang(131); |
} else { |
if (mtps >= 1000) { |
return round(mtps / 1000, 2) + String.fromCharCode(160) + genlang(132); |
} else { |
return ""; |
} |
} |
} |
/** |
* format the byte values into a user friendly value with the corespondenting unit expression<br>support is included |
* for binary and decimal output<br>user can specify a constant format for all byte outputs or the output is formated |
* automatically so that every value can be read in a user friendly way |
/web/acc/phpsysinfo/templates/html/index_bootstrap.html |
---|
41,7 → 41,6 |
<input type="hidden" id="showNetworkActiveSpeed" value="<?php echo $showNetworkActiveSpeed;?>"/> |
<input type="hidden" id="showCPULoadCompact" value="<?php echo $showCPULoadCompact;?>"/> |
<input type="hidden" id="hideBootstrapLoader" value="<?php echo $hideBootstrapLoader;?>"/> |
<input type="hidden" id="hideTotals" value="<?php echo $hideTotals;?>"/> |
<input type="hidden" id="blocks" value="<?php echo $blocks;?>"/> |
<div class="navbar fixed-top"> |
243,7 → 242,7 |
<td class="rightCell"><span data-bind="Total"></span></td> |
</tr> |
</tbody> |
<tfoot id="filesystem-foot" style="display:none;"> |
<tfoot id="filesystem-foot"> |
<tr> |
<td></td> |
<td></td> |
/web/acc/phpsysinfo/templates/html/index_dynamic.html |
---|
10,7 → 10,7 |
<meta http-equiv="refresh" content="2; URL=index.php?disp=static" /> |
</noscript> |
<link rel="shortcut icon" href="gfx/favicon.gif" /> |
<link type="text/css" rel="stylesheet" href="./templates/misc/emptyfile.css" title="PSI_Template" /> |
<link type="text/css" rel="stylesheet" href="./templates/misc/emptyfile.css" title="PSI_Template"/> |
<link type="text/css" rel="stylesheet" href="./templates/plugin/nyroModal.full.css" /> |
<link type="text/css" rel="stylesheet" href="./templates/plugin/jquery.jgrowl.css" /> |
<link type="text/css" rel="stylesheet" href="./templates/plugin/jquery.dataTables.css" /> |
41,8 → 41,6 |
<input type="hidden" id="showMemoryInfosExpanded" value="<?php echo $showMemoryInfosExpanded;?>"/> |
<input type="hidden" id="showNetworkActiveSpeed" value="<?php echo $showNetworkActiveSpeed;?>"/> |
<input type="hidden" id="showCPULoadCompact" value="<?php echo $showCPULoadCompact;?>"/> |
<input type="hidden" id="hideTotals" value="<?php echo $hideTotals;?>"/> |
<input type="hidden" id="increaseWidth" value="<?php echo $increaseWidth;?>"/> |
<input type="hidden" id="blocks" value="<?php echo $blocks;?>"/> |
<div id="loader"> |
<h1> |
109,7 → 107,7 |
?> |
</select> |
</div> |
<div id="vitals" class="halfsize"> |
<div id="vitals"> |
<h2><span class="lang_002">System vitals</span></h2> |
<div style="overflow-x:auto;"> |
<table class="stripeMe" id="vitalsTable" style="border-collapse:collapse;"> |
172,15 → 170,15 |
</table> |
</div> |
</div> |
<div id="hardware" class="halfsize"> |
<div id="hardware"> |
</div> |
<div id="memory" class="fullsize"> |
<div id="memory"> |
</div> |
<div id="filesystem" class="fullsize"> |
<div id="filesystem"> |
</div> |
<div id="network" class="halfsize"> |
<div id="network"> |
</div> |
<div id="voltage" class="halfsize" style="display:none;"> |
<div id="voltage" style="display:none;"> |
<h2><span class="lang_052">Voltage</span></h2> |
<div style="overflow-x:auto;"> |
<table class="stripeMe" id="voltageTable" style="border-collapse:collapse;"> |
187,9 → 185,9 |
<thead> |
<tr> |
<th><span class="lang_059">Label</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_054">Value</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_055">Min</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_056">Max</span></th> |
<th class="right"><span class="lang_054">Value</span></th> |
<th class="right" style="width: 80px;"><span class="lang_055">Min</span></th> |
<th class="right" style="width: 80px;"><span class="lang_056">Max</span></th> |
</tr> |
</thead> |
<tbody> |
197,7 → 195,7 |
</table> |
</div> |
</div> |
<div id="current" class="halfsize" style="display:none;"> |
<div id="current" style="display:none;"> |
<h2><span class="lang_105">Current</span></h2> |
<div style="overflow-x:auto;"> |
<table class="stripeMe" id="currentTable" style="border-collapse:collapse;"> |
204,9 → 202,9 |
<thead> |
<tr> |
<th><span class="lang_059">Label</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_054">Value</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_055">Min</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_056">Max</span></th> |
<th class="right" style="width: 80px;"><span class="lang_054">Value</span></th> |
<th class="right" style="width: 80px;"><span class="lang_055">Min</span></th> |
<th class="right" style="width: 80px;"><span class="lang_056">Max</span></th> |
</tr> |
</thead> |
<tbody> |
214,7 → 212,7 |
</table> |
</div> |
</div> |
<div id="temperature" class="halfsize" style="display:none;"> |
<div id="temperature" style="display:none;"> |
<h2><span class="lang_051">Temperature</span></h2> |
<div style="overflow-x:auto;"> |
<table class="stripeMe" id="temperatureTable" style="border-collapse:collapse;"> |
221,8 → 219,8 |
<thead> |
<tr> |
<th><span class="lang_059">Label</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_054">Value</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_058">Limit</span></th> |
<th class="right" style="width: 80px;"><span class="lang_054">Value</span></th> |
<th class="right" style="width: 80px;"><span class="lang_058">Limit</span></th> |
</tr> |
</thead> |
<tbody> |
230,7 → 228,7 |
</table> |
</div> |
</div> |
<div id="fans" class="halfsize" style="display:none;"> |
<div id="fans" style="display:none;"> |
<h2><span class="lang_053">Fans</span></h2> |
<div style="overflow-x:auto;"> |
<table class="stripeMe" id="fansTable" style="border-collapse:collapse;"> |
237,8 → 235,8 |
<thead> |
<tr> |
<th><span class="lang_059">Label</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_054">Value</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_055">Min</span></th> |
<th class="right" style="width: 80px;"><span class="lang_054">Value</span></th> |
<th class="right" style="width: 80px;"><span class="lang_055">Min</span></th> |
</tr> |
</thead> |
<tbody> |
246,7 → 244,7 |
</table> |
</div> |
</div> |
<div id="power" class="halfsize" style="display:none;"> |
<div id="power" style="display:none;"> |
<h2><span class="lang_102">Power</span></h2> |
<div style="overflow-x:auto;"> |
<table class="stripeMe" id="powerTable" style="border-collapse:collapse;"> |
253,8 → 251,8 |
<thead> |
<tr> |
<th><span class="lang_059">Label</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_054">Value</span></th> |
<th class="right" style="width:24.3%;"><span class="lang_058">Limit</span></th> |
<th class="right" style="width: 80px;"><span class="lang_054">Value</span></th> |
<th class="right" style="width: 80px;"><span class="lang_058">Limit</span></th> |
</tr> |
</thead> |
<tbody> |
262,7 → 260,7 |
</table> |
</div> |
</div> |
<div id="other" class="halfsize" style="display:none;"> |
<div id="other" style="display:none;"> |
<h2><span class="lang_121">Other</span></h2> |
<div style="overflow-x:auto;"> |
<table class="stripeMe" id="otherTable" style="border-collapse:collapse;"> |
269,7 → 267,7 |
<thead> |
<tr> |
<th><span class="lang_059">Label</span></th> |
<th class="right" style="width:48.6%;"><span class="lang_054">Value</span></th> |
<th class="right" style="width: 160px;"><span class="lang_054">Value</span></th> |
</tr> |
</thead> |
<tbody> |
277,7 → 275,7 |
</table> |
</div> |
</div> |
<div id="ups" class="halfsize" style="display:none;"> |
<div id="ups" style="display:none;"> |
</div> |
<div id="footer"> |
<span class="lang_047">Generated by</span> <a href="http://phpsysinfo.sourceforge.net/" target="psihref">phpSysInfo - <span id="version"></span></a> |
/web/acc/phpsysinfo/templates/aqua.css |
---|
87,13 → 87,9 |
color: #2e2e2e; |
} |
select { |
background-color: #fefefe; |
} |
#select { |
text-align: right; |
padding: 10px 10px 0 10px; |
padding: 10px; |
font-size: 0.8em; |
} |
/web/acc/phpsysinfo/language/fa.xml |
---|
File deleted |
/web/acc/phpsysinfo/language/hr.xml |
---|
File deleted |
/web/acc/phpsysinfo/language/ar.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ast.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/bg.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ca.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/cz.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/da.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/de.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/en.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/es.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/et.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/fi.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/fr.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/gl.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/gr.xml |
---|
385,21 → 385,6 |
<exp>Συσκευές NVMe</exp> |
</expression> |
<expression id="127" name="os"> |
<exp>Τύπος Λ/Σ</exp> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Αριθμός τσιπ μνήμης</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Ταχύτητα</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Τσιπ Μνήμης</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/he.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/hu.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/id.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/is.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/it.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ja.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ko.xml |
---|
52,7 → 52,7 |
<exp>캐쉬 크기</exp> |
</expression> |
<expression id="016" name="bogomips"> |
<exp>BogoMIPS</exp> |
<exp>자체 테스트 클럭</exp> |
</expression> |
<expression id="017" name="pci"> |
<exp>PCI 장치</exp> |
88,13 → 88,13 |
<exp>메모리 사용량</exp> |
</expression> |
<expression id="028" name="phymem"> |
<exp>물리 메모리</exp> |
<exp>물리적 메모리</exp> |
</expression> |
<expression id="029" name="swap"> |
<exp>디스크 스왑</exp> |
</expression> |
<expression id="030" name="fs"> |
<exp>마운트된 파일시스템</exp> |
<exp>마운트된 시스템</exp> |
</expression> |
<expression id="031" name="mount"> |
<exp>마운트 지점</exp> |
130,7 → 130,7 |
<exp>GB</exp> |
</expression> |
<expression id="042" name="none"> |
<exp>없음</exp> |
<exp>none</exp> |
</expression> |
<expression id="043" name="capacity"> |
<exp>용량</exp> |
181,13 → 181,13 |
<exp>제한</exp> |
</expression> |
<expression id="059" name="s_label"> |
<exp>레이블</exp> |
<exp>Label</exp> |
</expression> |
<expression id="060" name="degreec"> |
<exp>°C</exp> |
<exp>도 (섭씨)</exp> |
</expression> |
<expression id="061" name="degreef"> |
<exp>°F</exp> |
<exp>도 (화씨)</exp> |
</expression> |
<expression id="062" name="voltage_mark"> |
<exp>V</exp> |
202,7 → 202,7 |
<exp>버퍼</exp> |
</expression> |
<expression id="066" name="cached"> |
<exp>캐시</exp> |
<exp>캐쉬</exp> |
</expression> |
<expression id="067" name="jumpto"> |
<exp>이동 : </exp> |
220,31 → 220,31 |
<exp>모드</exp> |
</expression> |
<expression id="072" name="ups_start_time"> |
<exp>시작 시간</exp> |
<exp>Started</exp> |
</expression> |
<expression id="073" name="ups_status"> |
<exp>상태</exp> |
</expression> |
<expression id="074" name="ups_outages_count"> |
<exp>작동 중단</exp> |
<exp>Outages</exp> |
</expression> |
<expression id="075" name="ups_last_outage"> |
<exp>마지막 작동 중단 사유</exp> |
<exp>Last outage cause</exp> |
</expression> |
<expression id="076" name="ups_last_outage_finish"> |
<exp>마지막 작동 중단 타임스탬프</exp> |
<exp>Last outage timestamp</exp> |
</expression> |
<expression id="077" name="ups_line_voltage"> |
<exp>라인 전압</exp> |
</expression> |
<expression id="078" name="ups_load_percent"> |
<exp>부하율</exp> |
<exp>Load percent</exp> |
</expression> |
<expression id="079" name="ups_battery_voltage"> |
<exp>배터리 전압</exp> |
</expression> |
<expression id="080" name="ups_battery_charge_percent"> |
<exp>배터리 충전률</exp> |
<exp>배터리 충전</exp> |
</expression> |
<expression id="081" name="ups_time_left_minutes"> |
<exp>배터리 남은 시간</exp> |
298,7 → 298,7 |
<exp>시스템 언어</exp> |
</expression> |
<expression id="098" name="codepage"> |
<exp>코드 페이지</exp> |
<exp>코드 페이지 (인코딩)</exp> |
</expression> |
<expression id="099" name="details"> |
<exp>세부 사항</exp> |
340,7 → 340,7 |
<exp>실행 중</exp> |
</expression> |
<expression id="112" name="ProcessesSleeping"> |
<exp>유휴 중</exp> |
<exp>sleeping</exp> |
</expression> |
<expression id="113" name="ProcessesStopped"> |
<exp>중지됨</exp> |
376,7 → 376,7 |
<exp>제품</exp> |
</expression> |
<expression id="124" name="serial"> |
<exp>시리얼 번호</exp> |
<exp>시리얼번호</exp> |
</expression> |
<expression id="125" name="memfree"> |
<exp>남은 공간</exp> |
385,21 → 385,6 |
<exp>NVMe 장치</exp> |
</expression> |
<expression id="127" name="os"> |
<exp>OS 종류</exp> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>메모리 갯수</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>속도</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>메모리</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/nl.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/no.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/pl.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>Typ systemu</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Liczba chipów pamięci</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Prędkość</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Chipy Pamięci</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/pt-br.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/pt-pt.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ro.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ru.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/sk.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/sl.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/sv.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/th.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/tr.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/tw.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/uk.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/zh.xml |
---|
387,19 → 387,4 |
<expression id="127" name="os"> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
</expression> |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/gfx/images/FreeNAS.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Deleted: svn:mime-type |
-image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Milis.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Deleted: svn:mime-type |
-image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Septor.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Deleted: svn:mime-type |
-image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/UOS.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Deleted: svn:mime-type |
-image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Mabox.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Deleted: svn:mime-type |
-image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/elementaryOS.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/web/acc/phpsysinfo/includes/to/device/class.DiskDevice.inc.php |
---|
77,7 → 77,7 |
/** |
* inodes usage in percent if available |
* |
* @var Integer |
* @var |
*/ |
private $_percentInodesUsed = null; |
84,7 → 84,7 |
/** |
* ignore mode |
* |
* @var Integer |
* @var Ignore |
*/ |
private $_ignore = 0; |
99,7 → 99,7 |
public function getPercentUsed() |
{ |
if ($this->_total > 0) { |
return 100 - min(floor($this->_free / $this->_total * 100), 100); |
return round($this->_used / $this->_total * 100); |
} else { |
return 0; |
} |
/web/acc/phpsysinfo/includes/to/device/class.HWDevice.inc.php |
---|
56,25 → 56,11 |
/** |
* serial number of the device, if not available it will be null |
* |
* @var String |
* @var Integer |
*/ |
private $_serial = null; |
/** |
* speed of the device, if not available it will be null |
* |
* @var Float |
*/ |
private $_speed = null; |
/** |
* voltage of the device, if not available it will be null |
* |
* @var Float |
*/ |
private $_voltage = null; |
/** |
* count of the device |
* |
* @var Integer |
94,8 → 80,7 |
&& $dev->getCapacity() === $this->_capacity |
&& $dev->getManufacturer() === $this->_manufacturer |
&& $dev->getProduct() === $this->_product |
&& $dev->getSerial() === $this->_serial |
&& $dev->getSpeed() === $this->_speed) { |
&& $dev->getSerial() === $this->_serial) { |
return true; |
} else { |
return false; |
207,58 → 192,6 |
} |
/** |
* Returns $_speed. |
* |
* @see HWDevice::$_speed |
* |
* @return Float |
*/ |
public function getSpeed() |
{ |
return $this->_speed; |
} |
/** |
* Sets $_speed. |
* |
* @param Float $speed speed |
* |
* @see HWDevice::$_speed |
* |
* @return Void |
*/ |
public function setSpeed($speed) |
{ |
$this->_speed = $speed; |
} |
/** |
* Returns $_voltage. |
* |
* @see HWDevice::$_voltage |
* |
* @return Float |
*/ |
public function getVoltage() |
{ |
return $this->_voltage; |
} |
/** |
* Sets $_voltage. |
* |
* @param Float $voltage voltage |
* |
* @see HWDevice::$_voltage |
* |
* @return Void |
*/ |
public function setVoltage($voltage) |
{ |
$this->_voltage = $voltage; |
} |
/** |
* Returns $_capacity. |
* |
* @see HWDevice::$_capacity |
/web/acc/phpsysinfo/includes/to/device/class.SensorDevice.inc.php |
---|
61,13 → 61,6 |
private $_event = ""; |
/** |
* unit of values of the sensor |
* |
* @var String |
*/ |
private $_unit = ""; |
/** |
* Returns $_max. |
* |
* @see Sensor::$_max |
196,30 → 189,4 |
{ |
$this->_event = $event; |
} |
/** |
* Returns $_unit. |
* |
* @see Sensor::$_unit |
* |
* @return String |
*/ |
public function getUnit() |
{ |
return $this->_unit; |
} |
/** |
* Sets $_unit. |
* |
* @param String $unit sensor unit |
* |
* @see Sensor::$_unit |
* |
* @return Void |
*/ |
public function setUnit($unit) |
{ |
$this->_unit = $unit; |
} |
} |
/web/acc/phpsysinfo/includes/to/class.System.inc.php |
---|
177,15 → 177,6 |
private $_nvmeDevices = array(); |
/** |
* array with Mem devices |
* |
* @see HWDevice |
* |
* @var array |
*/ |
private $_memDevices = array(); |
/** |
* array with disk devices |
* |
* @see DiskDevice |
974,33 → 965,6 |
} |
/** |
* Returns $_memDevices. |
* |
* @see System::$_memDevices |
* |
* @return array |
*/ |
public function getMemDevices() |
{ |
return $this->_memDevices; |
} |
/** |
* Sets $_memDevices. |
* |
* @param HWDevice $memDevices mem device |
* |
* @see System::$_memDevices |
* @see HWDevice |
* |
* @return Void |
*/ |
public function setMemDevices($memDevices) |
{ |
array_push($this->_memDevices, $memDevices); |
} |
/** |
* Returns $_diskDevices. |
* |
* @see System::$_diskDevices |
/web/acc/phpsysinfo/includes/error/class.PSI_Error.inc.php |
---|
229,9 → 229,7 |
if ($val == $arrTrace[count($arrTrace) - 1]) { |
break; |
} |
if (isset($val['file'])) { |
$strBacktrace .= str_replace(PSI_APP_ROOT, ".", $val['file']).' on line '.$val['line']; |
} |
$strBacktrace .= str_replace(PSI_APP_ROOT, ".", $val['file']).' on line '.$val['line']; |
if ($strFunc) { |
$strBacktrace .= ' in function '.$strFunc; |
} |
/web/acc/phpsysinfo/includes/js/class.JavaScriptPacker.inc.php |
---|
521,7 → 521,7 |
'; |
//}; |
/* |
' if (!\'\'.replace(/^/, String)) { |
' if (!\'\'.replace(/^/, String)) { |
// decode all the values we need |
while ($count--) $decode[$encode($count)] = $keywords[$count] || $encode($count); |
// global replacement function |
/web/acc/phpsysinfo/includes/output/class.Webpage.inc.php |
---|
188,8 → 188,6 |
$tpl->set("showNetworkActiveSpeed", defined('PSI_SHOW_NETWORK_ACTIVE_SPEED') ? (PSI_SHOW_NETWORK_ACTIVE_SPEED ? ((strtolower(PSI_SHOW_NETWORK_ACTIVE_SPEED) === 'bps') ? 'bps' :'true') : 'false') : 'false'); |
$tpl->set("showCPULoadCompact", defined('PSI_LOAD_BAR') ? ((strtolower(PSI_LOAD_BAR) === 'compact') ? 'true' :'false') : 'false'); |
$tpl->set("hideBootstrapLoader", defined('PSI_HIDE_BOOTSTRAP_LOADER') ? (PSI_HIDE_BOOTSTRAP_LOADER ? 'true' : 'false') : 'false'); |
$tpl->set("increaseWidth", defined('PSI_INCREASE_WIDTH') ? ((intval(PSI_INCREASE_WIDTH)>0) ? intval(PSI_INCREASE_WIDTH) : 0) : 0); |
$tpl->set("hideTotals", defined('PSI_HIDE_TOTALS') ? (PSI_HIDE_TOTALS ? 'true' : 'false') : 'false'); |
if (defined('PSI_BLOCKS')) { |
if (is_string(PSI_BLOCKS)) { |
if (preg_match(ARRAY_EXP, PSI_BLOCKS)) { |
/web/acc/phpsysinfo/includes/output/class.WebpageXML.inc.php |
---|
61,23 → 61,9 |
private function _prepare() |
{ |
if ($this->_pluginName === null) { |
if (((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) && defined('PSI_WMI_HOSTNAME')) { |
define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME); |
if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) { |
define('PSI_EMU_USER', PSI_WMI_USER); |
define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD); |
} else { |
define('PSI_EMU_USER', null); |
define('PSI_EMU_PASSWORD', null); |
} |
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.WINNT.inc.php')) { |
$this->error->addError("file_exists(class.WINNT.inc.php)", "WINNT is not currently supported"); |
} |
} else { |
// Figure out which OS we are running on, and detect support |
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) { |
$this->error->addError("file_exists(class.".PSI_OS.".inc.php)", PSI_OS." is not currently supported"); |
} |
// Figure out which OS we are running on, and detect support |
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) { |
$this->error->addError("file_exists(class.".PSI_OS.".inc.php)", PSI_OS." is not currently supported"); |
} |
if (!defined('PSI_MBINFO') && (!$this->_blockName || in_array($this->_blockName, array('voltage','current','temperature','fans','power','other')))) { |
139,29 → 125,6 |
// Create the XML |
$this->_xml = new XML($this->_completeXML, '', $this->_blockName); |
} else { |
if ((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) { |
$plugname = strtoupper(trim($this->_pluginName)); |
if (defined('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME')) { |
define('PSI_EMU_HOSTNAME', constant('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME')); |
if (defined('PSI_PLUGIN_'.$plugname.'_WMI_USER') && defined('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD')) { |
define('PSI_EMU_USER', constant('PSI_PLUGIN_'.$plugname.'_WMI_USER')); |
define('PSI_EMU_PASSWORD', constant('PSI_PLUGIN_'.$plugname.'_WMI_PASSWORD')); |
} else { |
define('PSI_EMU_USER', null); |
define('PSI_EMU_PASSWORD', null); |
} |
} elseif (defined('PSI_WMI_HOSTNAME')) { |
define('PSI_EMU_HOSTNAME', PSI_WMI_HOSTNAME); |
if (defined('PSI_WMI_USER') && defined('PSI_WMI_PASSWORD')) { |
define('PSI_EMU_USER', PSI_WMI_USER); |
define('PSI_EMU_PASSWORD', PSI_WMI_PASSWORD); |
} else { |
define('PSI_EMU_USER', null); |
define('PSI_EMU_PASSWORD', null); |
} |
} |
} |
// Create the XML |
$this->_xml = new XML(false, $this->_pluginName); |
} |
/web/acc/phpsysinfo/includes/plugin/class.PSI_Plugin.inc.php |
---|
130,11 → 130,5 |
$root = $dom->createElement("Plugin_".$this->_plugin_name); |
$dom->appendChild($root); |
$this->xml = new SimpleXMLExtended(simplexml_import_dom($dom), $enc); |
$plugname = strtoupper($this->_plugin_name); |
if (((PSI_OS == 'WINNT') || (PSI_OS == 'Linux')) && |
defined('PSI_PLUGIN_'.$plugname.'_WMI_HOSTNAME') && |
(!defined('PSI_WMI_HOSTNAME') || (PSI_WMI_HOSTNAME != constant('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_WMI_HOSTNAME')))) { |
$this->xml->addAttribute('Hostname', constant('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_WMI_HOSTNAME')); |
} |
} |
} |
/web/acc/phpsysinfo/includes/ups/class.apcupsd.inc.php |
---|
52,11 → 52,7 |
} |
} |
} else { //use default if address and port not defined |
if (!defined('PSI_EMU_HOSTNAME')) { |
CommonFunctions::executeProgram('apcaccess', 'status', $temp); |
} else { |
CommonFunctions::executeProgram('apcaccess', 'status '.PSI_EMU_HOSTNAME, $temp); |
} |
CommonFunctions::executeProgram('apcaccess', 'status', $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
/web/acc/phpsysinfo/includes/ups/class.nut.inc.php |
---|
57,11 → 57,7 |
} |
} |
} else { //use default if address and port not defined |
if (!defined('PSI_EMU_HOSTNAME')) { |
CommonFunctions::executeProgram('upsc', '-l', $output, PSI_DEBUG); |
} else { |
CommonFunctions::executeProgram('upsc', '-l '.PSI_EMU_HOSTNAME, $output, PSI_DEBUG); |
} |
CommonFunctions::executeProgram('upsc', '-l', $output, PSI_DEBUG); |
$ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($ups_names as $ups_name) { |
CommonFunctions::executeProgram('upsc', trim($ups_name), $temp, PSI_DEBUG); |
/web/acc/phpsysinfo/includes/ups/class.pmset.inc.php |
---|
38,11 → 38,9 |
public function __construct() |
{ |
parent::__construct(); |
if (PSI_OS == 'Darwin') { |
$temp = ""; |
if (CommonFunctions::executeProgram('pmset', '-g batt', $temp) && !empty($temp)) { |
$this->_output[] = $temp; |
} |
$temp = ""; |
if (CommonFunctions::executeProgram('pmset', '-g batt', $temp) && !empty($temp)) { |
$this->_output[] = $temp; |
} |
} |
/web/acc/phpsysinfo/includes/ups/class.powersoftplus.inc.php |
---|
38,11 → 38,9 |
public function __construct() |
{ |
parent::__construct(); |
if (PSI_OS == 'Linux') { |
CommonFunctions::executeProgram('powersoftplus', '-p', $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
CommonFunctions::executeProgram('powersoftplus', '-p', $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
} |
/web/acc/phpsysinfo/includes/class.CommonFunctions.inc.php |
---|
32,42 → 32,11 |
*/ |
private static $_cp = null; |
/** |
* value of checking run as administrator |
* |
* @var boolean |
*/ |
private static $_asadmin = null; |
public static function setcp($cp) |
{ |
self::$_cp = $cp; |
CommonFunctions::$_cp = $cp; |
} |
public static function getcp() |
{ |
return self::$_cp; |
} |
public static function isAdmin() |
{ |
if (self::$_asadmin == null) { |
if (PSI_OS == 'WINNT') { |
$strBuf = ''; |
self::executeProgram('sfc', '2>&1', $strBuf, false); // 'net session' for detection does not work if "Server" (LanmanServer) service is stopped |
if (preg_match('/^\/SCANNOW\s/m', preg_replace('/(\x00)/', '', $strBuf))) { // SCANNOW checking - also if Unicode |
self::$_asadmin = true; |
} else { |
self::$_asadmin = false; |
} |
} else { |
self::$_asadmin = false; |
} |
} |
return self::$_asadmin; |
} |
private static function _parse_log_file($string) |
{ |
if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) { |
101,7 → 70,7 |
* |
* @return string|null complete path and name of the program |
*/ |
public static function _findProgram($strProgram) |
private static function _findProgram($strProgram) |
{ |
$path_parts = pathinfo($strProgram); |
if (empty($path_parts['basename'])) { |
115,11 → 84,11 |
$path_parts = pathinfo($strProgram); |
} |
if (PSI_OS == 'WINNT') { |
if (self::readenv('Path', $serverpath)) { |
if (CommonFunctions::readenv('Path', $serverpath)) { |
$arrPath = preg_split('/;/', $serverpath, -1, PREG_SPLIT_NO_EMPTY); |
} |
} else { |
if (self::readenv('PATH', $serverpath)) { |
if (CommonFunctions::readenv('PATH', $serverpath)) { |
$arrPath = preg_split('/:/', $serverpath, -1, PREG_SPLIT_NO_EMPTY); |
} |
} |
139,7 → 108,7 |
} |
//add some default paths if we still have no paths here |
if (empty($arrPath) && (PSI_OS != 'WINNT')) { |
if (empty($arrPath) && PSI_OS != 'WINNT') { |
if (PSI_OS == 'Android') { |
array_push($arrPath, '/system/bin'); |
} else { |
148,10 → 117,10 |
} |
$exceptPath = ""; |
if ((PSI_OS == 'WINNT') && self::readenv('WinDir', $windir)) { |
if ((PSI_OS == 'WINNT') && CommonFunctions::readenv('WinDir', $windir)) { |
foreach ($arrPath as $strPath) { |
if ((strtolower($strPath) == strtolower($windir)."\\system32") && is_dir($windir."\\SysWOW64")) { |
if (is_dir($windir."\\sysnative\\drivers")) { // or strlen(decbin(~0)) == 32; is_dir($windir."\\sysnative") sometimes does not work |
if ((strtolower($strPath) == $windir."\\system32") && is_dir($windir."\\SysWOW64")) { |
if (is_dir($windir."\\sysnative")) { |
$exceptPath = $windir."\\sysnative"; //32-bit PHP on 64-bit Windows |
} else { |
$exceptPath = $windir."\\SysWOW64"; //64-bit PHP on 64-bit Windows |
176,8 → 145,12 |
if (($strPath !== $exceptPath) && !is_dir($strPath)) { |
continue; |
} |
$strProgrammpath = $strPathS.$strProgram; |
if (is_executable($strProgrammpath) || ((PSI_OS == 'WINNT') && (strtolower($path_parts['extension']) == 'py'))) { |
if (PSI_OS == 'WINNT') { |
$strProgrammpath = $strPathS.$strProgram; |
} else { |
$strProgrammpath = $strPathS.$strProgram; |
} |
if (is_executable($strProgrammpath)) { |
return $strProgrammpath; |
} |
} |
187,7 → 160,7 |
/** |
* Execute a system program. return a trim()'d result. |
* does very crude pipe and multiple commands (on WinNT) checking. you need ' | ' or ' & ' for it to work |
* does very crude pipe checking. you need ' | ' for it to work |
* ie $program = CommonFunctions::executeProgram('netstat', '-anp | grep LIST'); |
* NOT $program = CommonFunctions::executeProgram('netstat', '-anp|grep LIST'); |
* |
216,7 → 189,7 |
} |
} |
if ((PSI_OS != 'WINNT') && preg_match('/^([^=]+=[^ \t]+)[ \t]+(.*)$/', $strProgramname, $strmatch)) { |
if ((PSI_OS !== 'WINNT') && preg_match('/^([^=]+=[^ \t]+)[ \t]+(.*)$/', $strProgramname, $strmatch)) { |
$strSet = $strmatch[1].' '; |
$strProgramname = $strmatch[2]; |
} else { |
236,7 → 209,7 |
} |
} |
if ((PSI_OS != 'WINNT') && defined('PSI_SUDO_COMMANDS') && is_string(PSI_SUDO_COMMANDS)) { |
if ((PSI_OS !== 'WINNT') && defined('PSI_SUDO_COMMANDS') && is_string(PSI_SUDO_COMMANDS)) { |
if (preg_match(ARRAY_EXP, PSI_SUDO_COMMANDS)) { |
$sudocommands = eval(PSI_SUDO_COMMANDS); |
} else { |
260,18 → 233,14 |
} |
} |
// see if we've gotten a | or &, if we have we need to do path checking on the cmd |
// see if we've gotten a |, if we have we need to do path checking on the cmd |
if ($strArgs) { |
$arrArgs = preg_split('/ /', $strArgs, -1, PREG_SPLIT_NO_EMPTY); |
for ($i = 0, $cnt_args = count($arrArgs); $i < $cnt_args; $i++) { |
if (($arrArgs[$i] == '|') || ($arrArgs[$i] == '&')) { |
if ($arrArgs[$i] == '|') { |
$strCmd = $arrArgs[$i + 1]; |
$strNewcmd = self::_findProgram($strCmd); |
if ($arrArgs[$i] == '|') { |
$strArgs = preg_replace('/\| '.$strCmd.'/', '| "'.$strNewcmd.'"', $strArgs); |
} else { |
$strArgs = preg_replace('/& '.$strCmd.'/', '& "'.$strNewcmd.'"', $strArgs); |
} |
$strArgs = preg_replace("/\| ".$strCmd.'/', '| "'.$strNewcmd.'"', $strArgs); |
} |
} |
$strArgs = ' '.$strArgs; |
338,7 → 307,7 |
public static function rolv($similarFileName, $match = "//", $replace = "") |
{ |
$filename = preg_replace($match, $replace, $similarFileName); |
if (self::fileexists($filename) && self::rfts($filename, $buf, 1, 4096, false) && (($buf=trim($buf)) != "")) { |
if (CommonFunctions::fileexists($filename) && CommonFunctions::rfts($filename, $buf, 1, 4096, false) && (($buf=trim($buf)) != "")) { |
return $buf; |
} else { |
return null; |
534,9 → 503,9 |
*/ |
public static function checkForExtensions($arrExt = array()) |
{ |
if (defined('PSI_SYSTEM_CODEPAGE') && ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0))) |
if ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0)) |
$arrReq = array('simplexml', 'pcre', 'xml', 'dom'); |
elseif (PSI_OS == 'WINNT') |
elseif (PSI_OS == "WINNT") |
$arrReq = array('simplexml', 'pcre', 'xml', 'dom', 'mbstring', 'com_dotnet'); |
else |
$arrReq = array('simplexml', 'pcre', 'xml', 'dom', 'mbstring'); |
657,47 → 626,6 |
$error->addError("getWMI()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage()))); |
} |
} |
} elseif ((gettype($wmi) === "string") && (PSI_OS == 'Linux')) { |
$delimeter = '@@@DELIM@@@'; |
if (self::executeProgram('wmic', '--delimiter="'.$delimeter.'" '.$wmi.' '.$strClass.'" 2>/dev/null', $strBuf, true) && preg_match("/^CLASS:\s/", $strBuf)) { |
if (self::$_cp) { |
if (self::$_cp == 932) { |
$codename = ' (SJIS)'; |
} elseif (self::$_cp == 949) { |
$codename = ' (EUC-KR)'; |
} elseif (self::$_cp == 950) { |
$codename = ' (BIG-5)'; |
} else { |
$codename = ''; |
} |
self::convertCP($strBuf, 'windows-'.self::$_cp.$codename); |
} |
$lines = preg_split('/\n/', $strBuf, -1, PREG_SPLIT_NO_EMPTY); |
if (count($lines) >=3) { |
unset($lines[0]); |
$names = preg_split('/'.$delimeter.'/', $lines[1], -1, PREG_SPLIT_NO_EMPTY); |
$namesc = count($names); |
unset($lines[1]); |
foreach ($lines as $line) { |
$arrInstance = array(); |
$values = preg_split('/'.$delimeter.'/', $line, -1); |
if (count($values) == $namesc) { |
foreach ($values as $id=>$value) { |
if (empty($strValue)) { |
if ($value !== "(null)") $arrInstance[$names[$id]] = trim($value); |
else $arrInstance[$names[$id]] = null; |
} else { |
if (in_array($names[$id], $strValue)) { |
if ($value !== "(null)") $arrInstance[$names[$id]] = trim($value); |
else $arrInstance[$names[$id]] = null; |
} |
} |
} |
$arrData[] = $arrInstance; |
} |
} |
} |
} |
} |
return $arrData; |
738,23 → 666,18 |
*/ |
public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true) |
{ |
$arrBuffer = array(); |
$_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006); |
$strBuffer = ''; |
if ($reg === false) { |
if (defined('PSI_EMU_HOSTNAME')) { |
return false; |
} |
$last = strrpos($strName, "\\"); |
$keyname = substr($strName, $last + 1); |
if (self::$_cp) { |
if (self::executeProgram('cmd', '/c chcp '.self::$_cp.' >nul & reg query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) { |
if (CommonFunctions::$_cp) { |
if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) { |
$strBuffer = $buffer2[1]; |
} else { |
return false; |
} |
} else { |
if (self::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) { |
if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) { |
$strBuffer = $buffer2[1]; |
} else { |
return false; |
761,28 → 684,15 |
} |
} |
} elseif (gettype($reg) === "object") { |
$first = strpos($strName, "\\"); |
$last = strrpos($strName, "\\"); |
$hkey = substr($strName, 0, $first); |
if (isset($_hkey[$hkey])) { |
$sub_keys = new VARIANT(); |
try { |
$reg->Get("StdRegProv")->GetStringValue(strval($_hkey[$hkey]), substr($strName, $first+1, $last-$first-1), substr($strName, $last+1), $sub_keys); |
} catch (Exception $e) { |
if ($booErrorRep) { |
$error = PSI_Error::singleton(); |
$error->addError("GetStringValue()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage()))); |
} |
try { |
$strBuffer = $reg->RegRead($strName); |
} catch (Exception $e) { |
if ($booErrorRep) { |
$error = PSI_Error::singleton(); |
$error->addError("readReg()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage()))); |
} |
return false; |
} |
if (variant_get_type($sub_keys) !== VT_NULL) { |
$strBuffer = strval($sub_keys); |
} else { |
return false; |
} |
} else { |
return false; |
return false; |
} |
} |
789,22 → 699,20 |
return true; |
} |
/** |
* enumKey function |
* |
* @return boolean command successfull or not |
*/ |
public static function enumKey($reg, $strName, &$arrBuffer, $booErrorRep = true) |
public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true) |
{ |
$arrBuffer = array(); |
$_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006); |
if ($reg === false) { |
if (defined('PSI_EMU_HOSTNAME')) { |
return false; |
} |
if (self::$_cp) { |
if (self::executeProgram('cmd', '/c chcp '.self::$_cp.' >nul & reg query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) { |
$arrBuffer = array(); |
if ($key === false) { |
if (CommonFunctions::$_cp) { |
if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) { |
foreach ($buffer2[1] as $sub_key) { |
$arrBuffer[] = trim($sub_key); |
} |
812,7 → 720,7 |
return false; |
} |
} else { |
if (self::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) { |
if (CommonFunctions::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) { |
foreach ($buffer2[1] as $sub_key) { |
$arrBuffer[] = trim($sub_key); |
} |
820,13 → 728,13 |
return false; |
} |
} |
} elseif (gettype($reg) === "object") { |
} elseif (gettype($key) === "object") { |
$first = strpos($strName, "\\"); |
$hkey = substr($strName, 0, $first); |
if (isset($_hkey[$hkey])) { |
$sub_keys = new VARIANT(); |
try { |
$reg->Get("StdRegProv")->EnumKey(strval($_hkey[$hkey]), substr($strName, $first+1), $sub_keys); |
$key->EnumKey(strval($_hkey[$hkey]), substr($strName, $first+1), $sub_keys); |
} catch (Exception $e) { |
if ($booErrorRep) { |
$error = PSI_Error::singleton(); |
835,10 → 743,8 |
return false; |
} |
if (variant_get_type($sub_keys) !== VT_NULL) foreach ($sub_keys as $sub_key) { |
foreach ($sub_keys as $sub_key) { |
$arrBuffer[] = $sub_key; |
} else { |
return false; |
} |
} else { |
return false; |
847,62 → 753,4 |
return true; |
} |
/** |
* initWMI function |
* |
* @return string, object or false |
*/ |
public static function initWMI($namespace, $booErrorRep = false) |
{ |
$wmi = false; |
try { |
if (PSI_OS == 'Linux') { |
if (defined('PSI_EMU_HOSTNAME')) |
$wmi = '--namespace="'.$namespace.'" -U '.PSI_EMU_USER.'%'.PSI_EMU_PASSWORD.' //'.PSI_EMU_HOSTNAME.' "select * from'; |
} elseif (PSI_OS == 'WINNT') { |
$objLocator = new COM('WbemScripting.SWbemLocator'); |
if (defined('PSI_EMU_HOSTNAME')) |
$wmi = $objLocator->ConnectServer(PSI_EMU_HOSTNAME, $namespace, PSI_EMU_USER, PSI_EMU_PASSWORD); |
else |
$wmi = $objLocator->ConnectServer('', $namespace); |
} |
} catch (Exception $e) { |
if ($booErrorRep) { |
$error = PSI_Error::singleton(); |
$error->addError("WMI connect ".$namespace." error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed or credentials."); |
} |
} |
return $wmi; |
} |
/** |
* convertCP function |
* |
* @return void |
*/ |
public static function convertCP(&$strBuf, $encoding) |
{ |
if (defined('PSI_SYSTEM_CODEPAGE') && ($encoding != null) && ($encoding != PSI_SYSTEM_CODEPAGE)) { |
$systemcp = PSI_SYSTEM_CODEPAGE; |
if (preg_match("/^windows-\d+ \((.+)\)$/", $systemcp, $buf)) { |
$systemcp = $buf[1]; |
} |
if (preg_match("/^windows-\d+ \((.+)\)$/", $encoding, $buf)) { |
$encoding = $buf[1]; |
} |
$enclist = mb_list_encodings(); |
if (in_array($encoding, $enclist) && in_array($systemcp, $enclist)) { |
$strBuf = mb_convert_encoding($strBuf, $encoding, $systemcp); |
} elseif (function_exists("iconv")) { |
if (($iconvout=iconv($systemcp, $encoding.'//IGNORE', $strBuf))!==false) { |
$strBuf = $iconvout; |
} |
} elseif (function_exists("libiconv") && (($iconvout=libiconv($systemcp, $encoding, $strBuf))!==false)) { |
$strBuf = $iconvout; |
} |
} |
} |
} |
/web/acc/phpsysinfo/includes/class.Parser.inc.php |
---|
34,38 → 34,17 |
public static function lspci($debug = PSI_DEBUG) |
{ |
$arrResults = array(); |
if (CommonFunctions::executeProgram("lspci", (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS)?"-m":"", $strBuf, $debug)) { |
if (CommonFunctions::executeProgram("lspci", "", $strBuf, $debug)) { |
$arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($arrLines as $strLine) { |
$arrParams = preg_split('/ /', trim($strLine), 2); |
if (count($arrParams) == 2) |
$strName = $arrParams[1]; |
else |
$strName = "unknown"; |
$strName = preg_replace('/\(.*\)/', '', $strName); |
$dev = new HWDevice(); |
$arrParams = preg_split('/(\"? ")|(\" (?=-))/', trim($strLine)); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && ($cp = count($arrParams)) >= 6) { |
$arrParams[$cp-1] = trim($arrParams[$cp-1],'"'); // remove last " |
$dev->setName($arrParams[1].': '.$arrParams[2].' '.$arrParams[3]); |
if (preg_match('/^-/', $arrParams[4])) { |
if (($arrParams[5] !== "") && !preg_match('/^Unknown vendor/', $arrParams[5])) { |
$dev->setManufacturer(trim($arrParams[5])); |
} |
if (($arrParams[6] !== "") && !preg_match('/^Device /', $arrParams[6])) { |
$dev->setProduct(trim($arrParams[6])); |
} |
} else { |
if (($arrParams[4] !== "") && !preg_match('/^Unknown vendor/', $arrParams[4])) { |
$dev->setManufacturer(trim($arrParams[4])); |
} |
if (($arrParams[5] !== "") && !preg_match('/^Device /', $arrParams[5])) { |
$dev->setProduct(trim($arrParams[5])); |
} |
} |
} else { |
$strLine=trim(preg_replace('/(")|( -\S+)/', '', $strLine)); |
$arrParams = preg_split('/ /', trim($strLine), 2); |
if (count($arrParams) == 2) |
$strName = preg_replace('/\(rev\s[^\)]+\)/', '', $arrParams[1]); |
else |
$strName = "unknown"; |
$dev->setName($strName); |
} |
$dev->setName($strName); |
$arrResults[] = $dev; |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.nvidiasmi.inc.php |
---|
File deleted |
/web/acc/phpsysinfo/includes/mb/class.ipmicfg.inc.php |
---|
File deleted |
/web/acc/phpsysinfo/includes/mb/class.coretemp.inc.php |
---|
25,19 → 25,17 |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
if (PSI_OS == 'Linux') { |
$hwpaths = glob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) > 0)) { |
$hwpaths2 = glob("/sys/devices/platform/coretemp.*/hwmon/hwmon*/", GLOB_NOSORT); |
if (is_array($hwpaths2) && (count($hwpaths2) > 0)) { |
$hwpaths = array_merge($hwpaths, $hwpaths2); |
} |
$totalh = count($hwpaths); |
$hwpaths = array_merge($hwpaths, glob("/sys/devices/platform/coretemp.*/hwmon/hwmon*/", GLOB_NOSORT)); |
} |
if (is_array($hwpaths) && (($totalh = count($hwpaths)) > 0)) { |
for ($h = 0; $h < $totalh; $h++) { |
$this->_temperature($hwpaths[$h]); |
} |
} |
} elseif (PSI_OS == 'FreeBSD') { |
} else { |
$smp = 1; |
CommonFunctions::executeProgram('sysctl', '-n kern.smp.cpus', $smp); |
for ($i = 0; $i < $smp; $i++) { |
/web/acc/phpsysinfo/includes/mb/class.freeipmi.inc.php |
---|
27,14 → 27,14 |
public function __construct() |
{ |
parent::__construct(); |
if ((PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_FREEIPMI_ACCESS')?strtolower(PSI_SENSOR_FREEIPMI_ACCESS):'command') { |
switch (defined('PSI_SENSOR_FREEIPMI_ACCESS')?strtolower(PSI_SENSOR_FREEIPMI_ACCESS):'command') { |
case 'command': |
CommonFunctions::executeProgram('ipmi-sensors', '--output-sensor-thresholds', $lines); |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/freeipmi.txt', $lines)) { |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
/web/acc/phpsysinfo/includes/mb/class.hddtemp.inc.php |
---|
24,7 → 24,7 |
private function _temperature() |
{ |
$ar_buf = array(); |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_HDDTEMP_ACCESS')?strtolower(PSI_SENSOR_HDDTEMP_ACCESS):'command') { |
switch (defined('PSI_SENSOR_HDDTEMP_ACCESS')?strtolower(PSI_SENSOR_HDDTEMP_ACCESS):'command') { |
case 'tcp': |
$lines = ''; |
// Timo van Roermund: connect to the hddtemp daemon, use a 5 second timeout. |
/web/acc/phpsysinfo/includes/mb/class.healthd.inc.php |
---|
27,7 → 27,7 |
public function __construct() |
{ |
parent::__construct(); |
if (PSI_OS == 'FreeBSD') switch (defined('PSI_SENSOR_HEALTHD_ACCESS')?strtolower(PSI_SENSOR_HEALTHD_ACCESS):'command') { |
switch (defined('PSI_SENSOR_HEALTHD_ACCESS')?strtolower(PSI_SENSOR_HEALTHD_ACCESS):'command') { |
case 'command': |
if (CommonFunctions::executeProgram('healthdc', '-t', $lines)) { |
$lines0 = preg_split("/\n/", $lines, 1, PREG_SPLIT_NO_EMPTY); |
/web/acc/phpsysinfo/includes/mb/class.hwmon.inc.php |
---|
37,13 → 37,6 |
$dev->setName($buf.$name); |
} else { |
$labelname = trim(preg_replace("/_input$/", "", pathinfo($sensor[$i], PATHINFO_BASENAME))); |
if (($name == " (drivetemp)") && (count($buf = CommonFunctions::gdc($hwpath . "device/block", false)))) { |
$labelname = "/dev/" . $buf[0]; |
if (($buf = CommonFunctions::rolv($hwpath . "device/model"))!==null) { |
$labelname .= " (".$buf.")"; |
$name = ""; |
} |
} |
if ($labelname !== "") { |
$dev->setName($labelname.$name); |
} else { |
246,21 → 239,17 |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
$hwpaths = glob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) > 0)) { |
$hwpaths2 = glob("/sys/class/hwmon/hwmon*/device/", GLOB_NOSORT); |
if (is_array($hwpaths2) && (count($hwpaths2) > 0)) { |
$hwpaths = array_merge($hwpaths, $hwpaths2); |
} |
$totalh = count($hwpaths); |
for ($h = 0; $h < $totalh; $h++) { |
$this->_temperature($hwpaths[$h]); |
$this->_voltage($hwpaths[$h]); |
$this->_fans($hwpaths[$h]); |
$this->_power($hwpaths[$h]); |
$this->_current($hwpaths[$h]); |
} |
$hwpaths = glob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) > 0)) { |
$hwpaths = array_merge($hwpaths, glob("/sys/class/hwmon/hwmon*/device/", GLOB_NOSORT)); |
} |
if (is_array($hwpaths) && (($totalh = count($hwpaths)) > 0)) { |
for ($h = 0; $h < $totalh; $h++) { |
$this->_temperature($hwpaths[$h]); |
$this->_voltage($hwpaths[$h]); |
$this->_fans($hwpaths[$h]); |
$this->_power($hwpaths[$h]); |
$this->_current($hwpaths[$h]); |
} |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.hwsensors.inc.php |
---|
27,12 → 27,10 |
public function __construct() |
{ |
parent::__construct(); |
if (PSI_OS == 'OpenBSD') { |
$lines = ""; |
// CommonFunctions::executeProgram('sysctl', '-w hw.sensors', $lines); |
CommonFunctions::executeProgram('sysctl', 'hw.sensors', $lines); |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
$lines = ""; |
// CommonFunctions::executeProgram('sysctl', '-w hw.sensors', $lines); |
CommonFunctions::executeProgram('sysctl', 'hw.sensors', $lines); |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
/** |
/web/acc/phpsysinfo/includes/mb/class.ipmitool.inc.php |
---|
28,7 → 28,7 |
{ |
parent::__construct(); |
$lines = ""; |
if (!defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_IPMITOOL_ACCESS')?strtolower(PSI_SENSOR_IPMITOOL_ACCESS):'command') { |
switch (defined('PSI_SENSOR_IPMITOOL_ACCESS')?strtolower(PSI_SENSOR_IPMITOOL_ACCESS):'command') { |
case 'command': |
CommonFunctions::executeProgram('ipmitool', 'sensor -v', $lines); |
break; |
/web/acc/phpsysinfo/includes/mb/class.ipmiutil.inc.php |
---|
27,7 → 27,7 |
public function __construct() |
{ |
parent::__construct(); |
if (!defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_IPMIUTIL_ACCESS')?strtolower(PSI_SENSOR_IPMIUTIL_ACCESS):'command') { |
switch (defined('PSI_SENSOR_IPMIUTIL_ACCESS')?strtolower(PSI_SENSOR_IPMIUTIL_ACCESS):'command') { |
case 'command': |
CommonFunctions::executeProgram('ipmiutil', 'sensor -stw', $lines); |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
/web/acc/phpsysinfo/includes/mb/class.k8temp.inc.php |
---|
27,7 → 27,7 |
public function __construct() |
{ |
parent::__construct(); |
if ((PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_K8TEMP_ACCESS')?strtolower(PSI_SENSOR_K8TEMP_ACCESS):'command') { |
switch (defined('PSI_SENSOR_K8TEMP_ACCESS')?strtolower(PSI_SENSOR_K8TEMP_ACCESS):'command') { |
case 'command': |
$lines = ""; |
CommonFunctions::executeProgram('k8temp', '', $lines); |
/web/acc/phpsysinfo/includes/mb/class.lmsensors.inc.php |
---|
28,7 → 28,7 |
{ |
parent::__construct(); |
$lines = ""; |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_LMSENSORS_ACCESS')?strtolower(PSI_SENSOR_LMSENSORS_ACCESS):'command') { |
switch (defined('PSI_SENSOR_LMSENSORS_ACCESS')?strtolower(PSI_SENSOR_LMSENSORS_ACCESS):'command') { |
case 'command': |
CommonFunctions::executeProgram("sensors", "", $lines); |
break; |
/web/acc/phpsysinfo/includes/mb/class.mbm5.inc.php |
---|
34,16 → 34,14 |
public function __construct() |
{ |
parent::__construct(); |
if ((PSI_OS == 'WINNT') && !defined('PSI_EMU_HOSTNAME')) { |
$delim = "/;/"; |
CommonFunctions::rfts(PSI_APP_ROOT."/data/MBM5.csv", $buffer); |
if (strpos($buffer, ";") === false) { |
$delim = "/,/"; |
} |
$buffer = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY); |
$this->_buf_label = preg_split($delim, substr($buffer[0], 0, -2), -1, PREG_SPLIT_NO_EMPTY); |
$this->_buf_value = preg_split($delim, substr($buffer[1], 0, -2), -1, PREG_SPLIT_NO_EMPTY); |
$delim = "/;/"; |
CommonFunctions::rfts(PSI_APP_ROOT."/data/MBM5.csv", $buffer); |
if (strpos($buffer, ";") === false) { |
$delim = "/,/"; |
} |
$buffer = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY); |
$this->_buf_label = preg_split($delim, substr($buffer[0], 0, -2), -1, PREG_SPLIT_NO_EMPTY); |
$this->_buf_value = preg_split($delim, substr($buffer[1], 0, -2), -1, PREG_SPLIT_NO_EMPTY); |
} |
/** |
/web/acc/phpsysinfo/includes/mb/class.mbmon.inc.php |
---|
27,7 → 27,7 |
public function __construct() |
{ |
parent::__construct(); |
if ((PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_MBMON_ACCESS')?strtolower(PSI_SENSOR_MBMON_ACCESS):'command') { |
switch (defined('PSI_SENSOR_MBMON_ACCESS')?strtolower(PSI_SENSOR_MBMON_ACCESS):'command') { |
case 'tcp': |
$fp = fsockopen("localhost", 411, $errno, $errstr, 5); |
if ($fp) { |
/web/acc/phpsysinfo/includes/mb/class.ohm.inc.php |
---|
27,14 → 27,19 |
public function __construct() |
{ |
parent::__construct(); |
if ((PSI_OS == 'WINNT') || defined('PSI_EMU_HOSTNAME')) { |
$_wmi = CommonFunctions::initWMI('root\OpenHardwareMonitor', true); |
if ($_wmi) { |
$tmpbuf = CommonFunctions::getWMI($_wmi, 'Sensor', array('Parent', 'Name', 'SensorType', 'Value')); |
if ($tmpbuf) foreach ($tmpbuf as $buffer) { |
if (!isset($this->_buf[$buffer['SensorType']]) || !isset($this->_buf[$buffer['SensorType']][$buffer['Parent'].' '.$buffer['Name']])) { // avoid duplicates |
$this->_buf[$buffer['SensorType']][$buffer['Parent'].' '.$buffer['Name']] = $buffer['Value']; |
} |
$_wmi = null; |
try { |
// initialize the wmi object |
$objLocator = new COM('WbemScripting.SWbemLocator'); |
$_wmi = $objLocator->ConnectServer('', 'root\OpenHardwareMonitor'); |
} catch (Exception $e) { |
$this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for OpenHardwareMonitor data."); |
} |
if ($_wmi) { |
$tmpbuf = CommonFunctions::getWMI($_wmi, 'Sensor', array('Parent', 'Name', 'SensorType', 'Value')); |
if ($tmpbuf) foreach ($tmpbuf as $buffer) { |
if (!isset($this->_buf[$buffer['SensorType']]) || !isset($this->_buf[$buffer['SensorType']][$buffer['Parent'].' '.$buffer['Name']])) { // avoid duplicates |
$this->_buf[$buffer['SensorType']][$buffer['Parent'].' '.$buffer['Name']] = $buffer['Value']; |
} |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.pitemp.inc.php |
---|
57,10 → 57,8 |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
$this->_temperature(); |
$this->_voltage(); |
$this->_current(); |
} |
$this->_temperature(); |
$this->_voltage(); |
$this->_current(); |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.qtssnmp.inc.php |
---|
75,9 → 75,7 |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
$this->_temperature(); |
$this->_fans(); |
} |
$this->_temperature(); |
$this->_fans(); |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.speedfan.inc.php |
---|
23,7 → 23,7 |
public function __construct() |
{ |
parent::__construct(); |
if ((PSI_OS == 'WINNT') && !defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_SPEEDFAN_ACCESS')?strtolower(PSI_SENSOR_SPEEDFAN_ACCESS):'command') { |
switch (defined('PSI_SENSOR_SPEEDFAN_ACCESS')?strtolower(PSI_SENSOR_SPEEDFAN_ACCESS):'command') { |
case 'command': |
if (CommonFunctions::executeProgram("SpeedFanGet.exe", "", $buffer, PSI_DEBUG) && (strlen($buffer) > 0)) { |
if (preg_match("/^Temperatures:\s+(.+)$/m", $buffer, $out)) { |
/web/acc/phpsysinfo/includes/mb/class.thermalzone.inc.php |
---|
27,34 → 27,18 |
public function __construct() |
{ |
parent::__construct(); |
switch (defined('PSI_SENSOR_THERMALZONE_ACCESS')?strtolower(PSI_SENSOR_THERMALZONE_ACCESS):'command') { |
case 'command': |
if ((PSI_OS == 'WINNT') || defined('PSI_EMU_HOSTNAME')) { |
if (defined('PSI_EMU_HOSTNAME') || CommonFunctions::isAdmin()) { |
$_wmi = CommonFunctions::initWMI('root\WMI', true); |
if ($_wmi) { |
$this->_buf = CommonFunctions::getWMI($_wmi, 'MSAcpi_ThermalZoneTemperature', array('InstanceName', 'CriticalTripPoint', 'CurrentTemperature')); |
} |
} else { |
$this->error->addError("Error reading data from thermalzone sensor", "Allowed only for systems with administrator privileges (run as administrator)"); |
} |
if (PSI_OS == 'WINNT') { |
$_wmi = null; |
try { |
// initialize the wmi object |
$objLocator = new COM('WbemScripting.SWbemLocator'); |
$_wmi = $objLocator->ConnectServer('', 'root\WMI'); |
} catch (Exception $e) { |
$this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for ThermalZone data."); |
} |
break; |
case 'data': |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::rfts(PSI_APP_ROOT.'/data/thermalzone.txt', $lines, 0, 4096, false)) { //output of "wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CriticalTripPoint,CurrentTemperature,InstanceName" |
$lines = trim(preg_replace('/[\x00-\x09\x0b-\x1F]/', '', $lines)); |
$lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
if ((($clines=count($lines)) > 1) && preg_match("/CriticalTripPoint\s+CurrentTemperature\s+InstanceName/i", $lines[0])) for ($i = 1; $i < $clines; $i++) { |
$values = preg_split("/\s+/", trim($lines[$i]), -1, PREG_SPLIT_NO_EMPTY); |
if (count($values)==3) { |
$this->_buf[] = array('CriticalTripPoint'=>trim($values[0]), 'CurrentTemperature'=>trim($values[1]), 'InstanceName'=>trim($values[2])); |
} |
} |
if ($_wmi) { |
$this->_buf = CommonFunctions::getWMI($_wmi, 'MSAcpi_ThermalZoneTemperature', array('InstanceName', 'CriticalTripPoint', 'CurrentTemperature')); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_thermalzone] ACCESS'); |
break; |
} |
} |
65,9 → 49,7 |
*/ |
private function _temperature() |
{ |
$mode = defined('PSI_SENSOR_THERMALZONE_ACCESS')?strtolower(PSI_SENSOR_THERMALZONE_ACCESS):'command'; |
if ((($mode == 'command') && ((PSI_OS == 'WINNT') || defined('PSI_EMU_HOSTNAME'))) |
|| (($mode == 'data') && !defined('PSI_EMU_HOSTNAME'))) { |
if (PSI_OS == 'WINNT') { |
if ($this->_buf) foreach ($this->_buf as $buffer) { |
if (isset($buffer['CurrentTemperature']) && (($value = ($buffer['CurrentTemperature'] - 2732)/10) > -100)) { |
$dev = new SensorDevice(); |
83,7 → 65,7 |
$this->mbinfo->setMbTemp($dev); |
} |
} |
} elseif (($mode == 'command') && (PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) { |
} else { |
$notwas = true; |
$thermalzones = glob('/sys/class/thermal/thermal_zone*/'); |
if (is_array($thermalzones) && (count($thermalzones) > 0)) foreach ($thermalzones as $thermalzone) { |
/web/acc/phpsysinfo/includes/mb/class.thinkpad.inc.php |
---|
23,18 → 23,11 |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
if (PSI_OS == 'Linux') { |
$hwpaths = glob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) == 1)) { |
$hwpaths2 = glob("/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon*/", GLOB_NOSORT); |
if (is_array($hwpaths2) && (count($hwpaths2) > 0)) { |
$hwpaths = array_merge($hwpaths, $hwpaths2); |
} |
$totalh = count($hwpaths); |
for ($h = 0; $h < $totalh; $h++) { |
$this->_temperature($hwpaths[$h]); |
$this->_fans($hwpaths[$h]); |
} |
$this->_temperature($hwpaths[0]); |
$this->_fans($hwpaths[0]); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.BSDCommon.inc.php |
---|
175,7 → 175,7 |
protected function readdmesg() |
{ |
if ($this->_dmesg === null) { |
if ((PSI_OS != 'Darwin') && (CommonFunctions::rfts('/var/run/dmesg.boot', $buf, 0, 4096, false) || CommonFunctions::rfts('/var/log/dmesg.boot', $buf, 0, 4096, false) || CommonFunctions::rfts('/var/run/dmesg.boot', $buf))) { // Once again but with debug |
if ((PSI_OS != "Darwin") && (CommonFunctions::rfts('/var/run/dmesg.boot', $buf, 0, 4096, false) || CommonFunctions::rfts('/var/log/dmesg.boot', $buf, 0, 4096, false) || CommonFunctions::rfts('/var/run/dmesg.boot', $buf))) { // Once again but with debug |
$parts = preg_split("/rebooting|Uptime/", $buf, -1, PREG_SPLIT_NO_EMPTY); |
$this->_dmesg = preg_split("/\n/", $parts[count($parts) - 1], -1, PREG_SPLIT_NO_EMPTY); |
} else { |
247,38 → 247,21 |
$s = preg_replace('/{ /', '', $s); |
$s = preg_replace('/ }/', '', $s); |
$this->sys->setLoad($s); |
if (PSI_LOAD_BAR) { |
if (PSI_OS != 'Darwin') { |
if ($fd = $this->grabkey('kern.cp_time')) { |
// Find out the CPU load |
// user + sys = load |
// total = total |
if (preg_match($this->_CPURegExp2, $fd, $res) && (sizeof($res) > 4)) { |
$load = $res[2] + $res[3] + $res[4]; // cpu.user + cpu.sys |
$total = $res[2] + $res[3] + $res[4] + $res[5]; // cpu.total |
// we need a second value, wait 1 second befor getting (< 1 second no good value will occour) |
sleep(1); |
$fd = $this->grabkey('kern.cp_time'); |
if (preg_match($this->_CPURegExp2, $fd, $res) && (sizeof($res) > 4)) { |
$load2 = $res[2] + $res[3] + $res[4]; |
$total2 = $res[2] + $res[3] + $res[4] + $res[5]; |
$this->sys->setLoadPercent((100 * ($load2 - $load)) / ($total2 - $total)); |
} |
} |
} |
} else { |
$ncpu = $this->grabkey('hw.ncpu'); |
if (!is_null($ncpu) && (trim($ncpu) != "") && ($ncpu >= 1) && CommonFunctions::executeProgram('ps', "-A -o %cpu", $pstable, false) && !empty($pstable)) { |
$pslines = preg_split("/\n/", $pstable, -1, PREG_SPLIT_NO_EMPTY); |
if (!empty($pslines) && (count($pslines)>1) && (trim($pslines[0])==="%CPU")) { |
array_shift($pslines); |
$sum = 0; |
foreach ($pslines as $psline) { |
$sum+=trim($psline); |
} |
$this->sys->setLoadPercent(min($sum/$ncpu, 100)); |
} |
} |
if (PSI_LOAD_BAR && (PSI_OS != "Darwin")) { |
if ($fd = $this->grabkey('kern.cp_time')) { |
// Find out the CPU load |
// user + sys = load |
// total = total |
preg_match($this->_CPURegExp2, $fd, $res); |
$load = $res[2] + $res[3] + $res[4]; // cpu.user + cpu.sys |
$total = $res[2] + $res[3] + $res[4] + $res[5]; // cpu.total |
// we need a second value, wait 1 second befor getting (< 1 second no good value will occour) |
sleep(1); |
$fd = $this->grabkey('kern.cp_time'); |
preg_match($this->_CPURegExp2, $fd, $res); |
$load2 = $res[2] + $res[3] + $res[4]; |
$total2 = $res[2] + $res[3] + $res[4] + $res[5]; |
$this->sys->setLoadPercent((100 * ($load2 - $load)) / ($total2 - $total)); |
} |
} |
} |
292,7 → 275,7 |
{ |
$dev = new CpuDevice(); |
if (PSI_OS == 'NetBSD') { |
if (PSI_OS == "NetBSD") { |
if ($model = $this->grabkey('machdep.cpu_brand')) { |
$dev->setModel($model); |
} |
307,7 → 290,7 |
$notwas = true; |
foreach ($this->readdmesg() as $line) { |
if ($notwas) { |
if (preg_match($this->_CPURegExp1, $line, $ar_buf) && (sizeof($ar_buf) > 2)) { |
if (preg_match($this->_CPURegExp1, $line, $ar_buf)) { |
if ($dev->getCpuSpeed() === 0) { |
$dev->setCpuSpeed(round($ar_buf[2])); |
} |
346,11 → 329,11 |
protected function scsi() |
{ |
foreach ($this->readdmesg() as $line) { |
if (preg_match($this->_SCSIRegExp1, $line, $ar_buf) && (sizeof($ar_buf) > 2)) { |
if (preg_match($this->_SCSIRegExp1, $line, $ar_buf)) { |
$dev = new HWDevice(); |
$dev->setName($ar_buf[1].": ".trim($ar_buf[2])); |
$this->sys->setScsiDevices($dev); |
} elseif (preg_match($this->_SCSIRegExp2, $line, $ar_buf) && (sizeof($ar_buf) > 1)) { |
} elseif (preg_match($this->_SCSIRegExp2, $line, $ar_buf)) { |
/* duplication security */ |
$notwas = true; |
foreach ($this->sys->getScsiDevices() as $finddev) { |
358,7 → 341,7 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if (isset($ar_buf[3]) && ($ar_buf[3]==="G")) { |
$finddev->setCapacity($ar_buf[2] * 1024 * 1024 * 1024); |
} elseif (isset($ar_buf[2])) { |
} else { |
$finddev->setCapacity($ar_buf[2] * 1024 * 1024); |
} |
} |
372,13 → 355,13 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if (isset($ar_buf[3]) && ($ar_buf[3]==="G")) { |
$dev->setCapacity($ar_buf[2] * 1024 * 1024 * 1024); |
} elseif (isset($ar_buf[2])) { |
} else { |
$dev->setCapacity($ar_buf[2] * 1024 * 1024); |
} |
} |
$this->sys->setScsiDevices($dev); |
} |
} elseif (preg_match($this->_SCSIRegExp3, $line, $ar_buf) && (sizeof($ar_buf) > 1)) { |
} elseif (preg_match($this->_SCSIRegExp3, $line, $ar_buf)) { |
/* duplication security */ |
$notwas = true; |
foreach ($this->sys->getScsiDevices() as $finddev) { |
385,7 → 368,7 |
if ($notwas && (substr($finddev->getName(), 0, strpos($finddev->getName(), ': ')) == $ar_buf[1])) { |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS |
&& defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) { |
if (isset($ar_buf[2])) $finddev->setSerial(trim($ar_buf[2])); |
$finddev->setSerial(trim($ar_buf[2])); |
} |
$notwas = false; |
break; |
396,7 → 379,7 |
$dev->setName($ar_buf[1]); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS |
&& defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) { |
if (isset($ar_buf[2])) $dev->setSerial(trim($ar_buf[2])); |
$dev->setSerial(trim($ar_buf[2])); |
} |
$this->sys->setScsiDevices($dev); |
} |
465,11 → 448,11 |
{ |
if ((!$results = Parser::lspci(false)) && (!$results = $this->pciconf())) { |
foreach ($this->readdmesg() as $line) { |
if (preg_match($this->_PCIRegExp1, $line, $ar_buf) && (sizeof($ar_buf) > 2)) { |
if (preg_match($this->_PCIRegExp1, $line, $ar_buf)) { |
$dev = new HWDevice(); |
$dev->setName($ar_buf[1].": ".$ar_buf[2]); |
$results[] = $dev; |
} elseif (preg_match($this->_PCIRegExp2, $line, $ar_buf) && (sizeof($ar_buf) > 2)) { |
} elseif (preg_match($this->_PCIRegExp2, $line, $ar_buf)) { |
$dev = new HWDevice(); |
$dev->setName($ar_buf[1].": ".$ar_buf[2]); |
$results[] = $dev; |
609,19 → 592,7 |
*/ |
protected function usb() |
{ |
$notwas = true; |
if ((PSI_OS == 'FreeBSD') && CommonFunctions::executeProgram('usbconfig', '', $bufr, false)) { |
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($lines as $line) { |
if (preg_match('/^(ugen[0-9]+\.[0-9]+): <([^,]*)(.*)> at (usbus[0-9]+)/', $line, $ar_buf)) { |
$notwas = false; |
$dev = new HWDevice(); |
$dev->setName($ar_buf[2]); |
$this->sys->setUSBDevices($dev); |
} |
} |
} |
if ($notwas) foreach ($this->readdmesg() as $line) { |
foreach ($this->readdmesg() as $line) { |
// if (preg_match('/^(ugen[0-9\.]+): <(.*)> (.*) (.*)/', $line, $ar_buf)) { |
// $dev->setName($ar_buf[1].": ".$ar_buf[2]); |
if (preg_match('/^(u[a-z]+[0-9]+): <([^,]*)(.*)> on (usbus[0-9]+)/', $line, $ar_buf)) { |
/web/acc/phpsysinfo/includes/os/class.Darwin.inc.php |
---|
325,16 → 325,14 |
$swap1 = preg_split('/M/', $swapBuff); |
$swap2 = preg_split('/=/', $swap1[1]); |
$swap3 = preg_split('/=/', $swap1[2]); |
if (($swap=trim($swap1[0])) > 0) { |
$dev = new DiskDevice(); |
$dev->setName('SWAP'); |
$dev->setMountPoint('SWAP'); |
$dev->setFsType('swap'); |
$dev->setTotal($swap * 1024 * 1024); |
$dev->setUsed(trim($swap2[1]) * 1024 * 1024); |
$dev->setFree(trim($swap3[1]) * 1024 * 1024); |
$this->sys->setSwapDevices($dev); |
} |
$dev = new DiskDevice(); |
$dev->setName('SWAP'); |
$dev->setMountPoint('SWAP'); |
$dev->setFsType('swap'); |
$dev->setTotal($swap1[0] * 1024 * 1024); |
$dev->setUsed($swap2[1] * 1024 * 1024); |
$dev->setFree($swap3[1] * 1024 * 1024); |
$this->sys->setSwapDevices($dev); |
} |
} |
} |
415,37 → 413,28 |
protected function distro() |
{ |
$this->sys->setDistributionIcon('Darwin.png'); |
if ((!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG) || !preg_match('/\n\s*System Version:/', $buffer)) |
&& (!CommonFunctions::executeProgram('sw_vers', '', $buffer, PSI_DEBUG) || !preg_match('/^ProductName:/', $buffer))) { |
if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) { |
parent::distro(); |
} else { |
$distro_tmp = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($distro_tmp as $info) { |
$info_tmp = preg_split('/:/', $info, 2); |
if (isset($distro_tmp[0]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") && |
isset($distro_tmp[1]) && !is_null($distro_tmp[1]) && (trim($distro_tmp[1]) != "")) { |
$distro_arr[trim($info_tmp[0])] = trim($info_tmp[1]); |
} |
} |
if (isset($distro_arr['ProductName']) && isset($distro_arr['ProductVersion']) && isset($distro_arr['BuildVersion'])) { |
$distro_arr['System Version'] = $distro_arr['ProductName'].' '.$distro_arr['ProductVersion'].' ('.$distro_arr['BuildVersion'].')'; |
} |
if (isset($distro_arr['System Version'])) { |
$distro = $distro_arr['System Version']; |
if (preg_match('/^Mac OS|^OS X|^macOS/', $distro)) { |
$this->sys->setDistributionIcon('Apple.png'); |
if (preg_match('/(^Mac OS X Server|^Mac OS X|^OS X Server|^OS X|^macOS Server|^macOS) ((\d+)\.\d+)/', $distro, $ver) |
&& ($list = @parse_ini_file(PSI_APP_ROOT."/data/osnames.ini", true))) { |
if (isset($list['macOS'][$ver[2]])) { |
$distro.=' '.$list['macOS'][$ver[2]]; |
} elseif (isset($list['macOS'][$ver[3]])) { |
$distro.=' '.$list['macOS'][$ver[3]]; |
$arrBuff = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($arrBuff as $line) { |
$arrLine = preg_split("/:/", $line, -1, PREG_SPLIT_NO_EMPTY); |
if (trim($arrLine[0]) === "System Version") { |
$distro = trim($arrLine[1]); |
if (preg_match('/^Mac OS|^OS X|^macOS/', $distro)) { |
$this->sys->setDistributionIcon('Apple.png'); |
if (preg_match('/(^Mac OS X Server|^Mac OS X|^OS X Server|^OS X|^macOS Server|^macOS) (\d+\.\d+)/', $distro, $ver) |
&& ($list = @parse_ini_file(PSI_APP_ROOT."/data/osnames.ini", true)) |
&& isset($list['OS X'][$ver[2]])) { |
$distro.=' '.$list['OS X'][$ver[2]]; |
} |
} |
$this->sys->setDistribution($distro); |
return; |
} |
$this->sys->setDistribution($distro); |
} else { |
parent::distro(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.FreeBSD.inc.php |
---|
133,16 → 133,9 |
*/ |
private function _distroicon() |
{ |
if (CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (($version=trim($version)) != '')) { |
if (extension_loaded('pfSense')) { // pfSense detection |
$this->sys->setDistribution('pfSense '. $version); |
$this->sys->setDistributionIcon('pfSense.png'); |
} elseif (preg_match('/^FreeNAS/i', $version)) { // FreeNAS detection |
$this->sys->setDistribution($version); |
$this->sys->setDistributionIcon('FreeNAS.png'); |
} else { |
$this->sys->setDistributionIcon('FreeBSD.png'); |
} |
if (extension_loaded('pfSense') && CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (trim($version) != '')) { // pfSense detection |
$this->sys->setDistribution('pfSense '. trim($version)); |
$this->sys->setDistributionIcon('pfSense.png'); |
} else { |
$this->sys->setDistributionIcon('FreeBSD.png'); |
} |
/web/acc/phpsysinfo/includes/os/class.Haiku.inc.php |
---|
45,12 → 45,12 |
$dev->setModel($ar_buf[1]); |
$arrLines = preg_split("/\n/", $cpu, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($arrLines as $Line) { |
if (preg_match("/^\s+Data TLB:\s+(.*)K-byte/", $Line, $Line_buf) || preg_match("/^\s+L0 Data TLB:\s+(.*)K-byte/", $Line, $Line_buf)) { |
$dev->setCache(max(intval($Line_buf[1])*1024, $dev->getCache())); |
} elseif (preg_match("/^\s+Data TLB:\s+(.*)M-byte/", $Line, $Line_buf) || preg_match("/^\s+L0 Data TLB:\s+(.*)M-byte/", $Line, $Line_buf)) { |
$dev->setCache(max(intval($Line_buf[1])*1024*1024, $dev->getCache())); |
} elseif (preg_match("/^\s+Data TLB:\s+(.*)G-byte/", $Line, $Line_buf) || preg_match("/^\s+L0 Data TLB:\s+(.*)G-byte/", $Line, $Line_buf)) { |
$dev->setCache(max(intval($Line_buf[1])*1024*1024*1024, $dev->getCache())); |
if (preg_match("/^\s+Data TLB:\s+(.*)K-byte/", $Line, $Line_buf)) { |
$dev->setCache(max($Line_buf[1]*1024, $dev->getCache())); |
} elseif (preg_match("/^\s+Data TLB:\s+(.*)M-byte/", $Line, $Line_buf)) { |
$dev->setCache(max($Line_buf[1]*1024*1024, $dev->getCache())); |
} elseif (preg_match("/^\s+Data TLB:\s+(.*)G-byte/", $Line, $Line_buf)) { |
$dev->setCache(max($Line_buf[1]*1024*1024*1024, $dev->getCache())); |
} elseif (preg_match("/\s+VMX/", $Line, $Line_buf)) { |
$dev->setVirt("vmx"); |
} elseif (preg_match("/\s+SVM/", $Line, $Line_buf)) { |
156,28 → 156,19 |
*/ |
private function _uptime() |
{ |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) day[s]?,[ ]+(\d+):(\d+),/", $buf, $ar_buf)) { |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
$days = $ar_buf[1]; |
$this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60); |
} elseif (preg_match("/up[ ]+(\d+):(\d+),/", $buf, $ar_buf)) { |
if (CommonFunctions::executeProgram('uptime', '-u', $buf)) { |
if (preg_match("/^up (\d+) minute[s]?/", $buf, $ar_buf)) { |
$min = $ar_buf[1]; |
$this->sys->setUptime($min * 60); |
} elseif (preg_match("/^up (\d+) hour[s]?, (\d+) minute[s]?/", $buf, $ar_buf)) { |
$min = $ar_buf[2]; |
$hours = $ar_buf[1]; |
$this->sys->setUptime($hours * 3600 + $min * 60); |
} elseif (preg_match("/up (\d+) day[s]?, (\d+) hour[s]?, (\d+) minute[s]?$/", $buf, $ar_buf)) { |
} elseif (preg_match("/^up (\d+) day[s]?, (\d+) hour[s]?, (\d+) minute[s]?/", $buf, $ar_buf)) { |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
$days = $ar_buf[1]; |
$this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60); |
} elseif (preg_match("/up (\d+) hour[s]?, (\d+) minute[s]?$/", $buf, $ar_buf)) { |
$min = $ar_buf[2]; |
$hours = $ar_buf[1]; |
$this->sys->setUptime($hours * 3600 + $min * 60); |
} elseif (preg_match("/up (\d+) minute[s]?$/", $buf, $ar_buf)) { |
$min = $ar_buf[1]; |
$this->sys->setUptime($min * 60); |
} |
} |
} |
240,7 → 231,7 |
if (preg_match("/(.*)bytes free\s+\(used\/max\s+(.*)\s+\/\s+(.*)\)\s*\n\s+\(cached\s+(.*)\)/", $bufr, $ar_buf)) { |
$this->sys->setMemTotal($ar_buf[3]); |
$this->sys->setMemFree($ar_buf[1]); |
$this->sys->setMemCache(min($ar_buf[4], $ar_buf[2])); |
$this->sys->setMemCache($ar_buf[4]); |
$this->sys->setMemUsed($ar_buf[2]); |
} |
} |
/web/acc/phpsysinfo/includes/os/class.Linux.inc.php |
---|
29,7 → 29,7 |
/** |
* Assoc array of all CPUs loads. |
*/ |
private $_cpu_loads = null; |
protected $_cpu_loads; |
/** |
* Machine |
75,7 → 75,7 |
} |
if ($machine != "") { |
$machine = trim(preg_replace("/^\/,?/", "", preg_replace("/ ?(To be filled by O\.E\.M\.|System manufacturer|System Product Name|Not Specified|Default string) ?/i", "", $machine))); |
$machine = trim(preg_replace("/^\/,?/", "", preg_replace("/ ?(To be filled by O\.E\.M\.|System manufacturer|System Product Name|Not Specified) ?/i", "", $machine))); |
} |
if (CommonFunctions::fileexists($filename="/etc/config/uLinux.conf") // QNAP detection |
138,7 → 138,7 |
if (CommonFunctions::executeProgram($uname, '-m', $strBuf, PSI_DEBUG)) { |
$result .= ' '.$strBuf; |
} |
} elseif (CommonFunctions::rfts('/proc/version', $strBuf, 1) && preg_match('/version\s+(\S+)/', $strBuf, $ar_buf)) { |
} elseif (CommonFunctions::rfts('/proc/version', $strBuf, 1) && preg_match('/version\s+(\S+)/', $strBuf, $ar_buf)) { |
$result = $ar_buf[1]; |
if (preg_match('/SMP/', $strBuf)) { |
$result .= ' (SMP)'; |
154,12 → 154,9 |
$result .= ' [docker]'; |
} |
} |
if (CommonFunctions::rfts('/proc/version', $strBuf2, 1, 4096, false)) { |
if (preg_match('/^Linux version [\d\.-]+-Microsoft/', $strBuf2)) { |
$result .= ' [wsl]'; |
} elseif (preg_match('/^Linux version [\d\.-]+-microsoft-standard/', $strBuf2)) { |
$result .= ' [wsl2]'; |
} |
if (CommonFunctions::rfts('/proc/version', $strBuf2, 1, 4096, false) |
&& preg_match('/^Linux version [\d\.-]+-Microsoft/', $strBuf2)) { |
$result .= ' [lxss]'; |
} |
$this->sys->setKernel($result); |
} |
231,7 → 228,7 |
$this->_cpu_loads = array(); |
$cpu_tmp = array(); |
if (CommonFunctions::rfts('/proc/stat', $buf, 0, 4096, PSI_DEBUG && (PSI_OS != 'Android'))) { |
if (CommonFunctions::rfts('/proc/stat', $buf)) { |
if (preg_match_all('/^(cpu[0-9]*) (.*)/m', $buf, $matches, PREG_SET_ORDER)) { |
foreach ($matches as $line) { |
$cpu = $line[1]; |
252,7 → 249,7 |
// we need a second value, wait 1 second befor getting (< 1 second no good value will occour) |
sleep(1); |
if (CommonFunctions::rfts('/proc/stat', $buf, 0, 4096, PSI_DEBUG)) { |
if (CommonFunctions::rfts('/proc/stat', $buf)) { |
if (preg_match_all('/^(cpu[0-9]*) (.*)/m', $buf, $matches, PREG_SET_ORDER)) { |
foreach ($matches as $line) { |
$cpu = $line[1]; |
282,7 → 279,7 |
if (isset($this->_cpu_loads[$cpuline])) { |
return $this->_cpu_loads[$cpuline]; |
} else { |
return null; |
return 0; |
} |
} |
615,13 → 612,13 |
} |
if ($booDevice) { |
$dev = new HWDevice(); |
$dev->setName(preg_replace('/\(rev\s[^\)]+\)\.$/', '', trim($strLine))); |
$dev->setName(preg_replace('/\([^\)]+\)\.$/', '', trim($strLine))); |
$this->sys->setPciDevices($dev); |
/* |
list($strKey, $strValue) = preg_split('/: /', $strLine, 2); |
if (!preg_match('/bridge/i', $strKey) && !preg_match('/USB/i ', $strKey)) { |
$dev = new HWDevice(); |
$dev->setName(preg_replace('/\(rev\s[^\)]+\)\.$/', '', trim($strValue))); |
$dev->setName(preg_replace('/\([^\)]+\)\.$/', '', trim($strValue))); |
$this->sys->setPciDevices($dev); |
} |
*/ |
776,10 → 773,6 |
if ($product!==null) { |
$usbarray[$usbid]['product'] = $product; |
} |
$speed = CommonFunctions::rolv($usbdevices[$i], '/\/idProduct$/', '/speed'); |
if ($product!==null) { |
$usbarray[$usbid]['speed'] = $speed; |
} |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS |
&& defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) { |
$serial = CommonFunctions::rolv($usbdevices[$i], '/\/idProduct$/', '/serial'); |
792,16 → 785,12 |
} |
} |
if ((count($usbarray) == 0) && CommonFunctions::rfts('/proc/bus/usb/devices', $bufr, 0, 4096, false)) { //usb-devices |
if ((count($usbarray) == 0) && CommonFunctions::rfts('/proc/bus/usb/devices', $bufr, 0, 4096, false)) { |
$devnum = -1; |
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($bufe as $buf) { |
if (preg_match('/^T/', $buf)) { |
$devnum++; |
if (preg_match('/\sSpd=([\d\.]+)/', $buf, $bufr) |
&& isset($bufr[1]) && ($bufr[1]!=="")) { |
$usbarray[$devnum]['speed'] = $bufr[1]; |
} |
} elseif (preg_match('/^S:/', $buf)) { |
list($key, $value) = preg_split('/: /', $buf, 2); |
list($key, $value2) = preg_split('/=/', $value, 2); |
870,14 → 859,10 |
$product = ''; |
} |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if (isset($usbdev['speed'])) { |
$dev->setSpeed($usbdev['speed']); |
} |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL |
&& isset($usbdev['serial'])) { |
$dev->setSerial($usbdev['serial']); |
} |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS |
&& defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL |
&& isset($usbdev['serial'])) { |
$dev->setSerial($usbdev['serial']); |
} |
if (isset($usbdev['name']) && (($name=$usbdev['name']) !== 'unknown')) { |
1022,8 → 1007,9 |
if (preg_match('/\s+encap:Ethernet\s+HWaddr\s(\S+)/i', $buf2, $ar_buf2) |
|| preg_match('/\s+encap:UNSPEC\s+HWaddr\s(\S+)-00-00-00-00-00-00-00-00-00-00\s*$/i', $buf2, $ar_buf2) |
|| preg_match('/^\s+ether\s+(\S+)\s+txqueuelen/i', $buf2, $ar_buf2) |
|| preg_match('/^\s+link\/\S+\s+(\S+)\s+brd/i', $buf2, $ar_buf2) |
|| preg_match('/^\s+link\/\S+\s+(\S+)$/i', $buf2, $ar_buf2)) { |
|| preg_match('/^\s+link\/ether\s+(\S+)\s+brd/i', $buf2, $ar_buf2) |
|| preg_match('/^\s+link\/ether\s+(\S+)$/i', $buf2, $ar_buf2) |
|| preg_match('/^\s+link\/ieee802.11\s+(\S+)$/i', $buf2, $ar_buf2)) { |
if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) { |
$macaddr = preg_replace('/:/', '-', strtoupper($ar_buf2[1])); |
if ($macaddr === '00-00-00-00-00-00') { // empty |
1052,8 → 1038,7 |
if ($macaddr != "") { |
$dev->setInfo($macaddr.($dev->getInfo()?';'.$dev->getInfo():'')); |
} |
if ((!CommonFunctions::rfts('/sys/class/net/'.trim($dev_name).'/operstate', $buf, 1, 4096, false) || (($down=strtolower(trim($buf)))=="") || ($down!=="down")) && |
(CommonFunctions::rfts('/sys/class/net/'.trim($dev_name).'/speed', $buf, 1, 4096, false) && (($speed=trim($buf))!="") && ($buf > 0) && ($buf < 65535))) { |
if (CommonFunctions::rfts('/sys/class/net/'.trim($dev_name).'/speed', $buf, 1, 4096, false) && (($speed=trim($buf))!="") && ($buf > 0) && ($buf < 65535)) { |
if ($speed > 1000) { |
$speed = $speed/1000; |
$unit = "G"; |
1100,8 → 1085,8 |
} |
$was = true; |
if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS)) { |
if ((!CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/operstate', $buf, 1, 4096, false) || (($down=strtolower(trim($buf)))=="") || ($down!=="down")) && |
(CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/speed', $buf, 1, 4096, false) && (($speed=trim($buf))!="") && ($buf > 0) && ($buf < 65535))) { |
if (CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/speed', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$speed = trim($buf); |
if ($speed > 1000) { |
$speed = $speed/1000; |
$unit = "G"; |
1108,8 → 1093,8 |
} else { |
$unit = "M"; |
} |
if (CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/duplex', $buf, 1, 4096, false) && (($duplex=strtolower(trim($buf)))!="") && ($duplex!='unknown')) { |
$speedinfo = $speed.$unit.'b/s '.$duplex; |
if (CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/duplex', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$speedinfo = $speed.$unit.'b/s '.strtolower(trim($buf)); |
} else { |
$speedinfo = $speed.$unit.'b/s'; |
} |
1118,8 → 1103,7 |
} else { |
if ($was) { |
if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS)) { |
if (preg_match('/^\s+link\/\S+\s+(\S+)\s+brd/i', $line, $ar_buf2) |
|| preg_match('/^\s+link\/\S+\s+(\S+)$/i', $line, $ar_buf2)) { |
if (preg_match('/^\s+link\/ether\s+(\S+)\s+brd/i', $line, $ar_buf2)) { |
if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $macaddr = preg_replace('/:/', '-', strtoupper($ar_buf2[1])); |
} elseif (preg_match('/^\s+inet\s+([^\/\s]+).*peer\s+([^\/\s]+).*\s+scope\s((global)|(host))/i', $line, $ar_buf2)) { |
if ($ar_buf2[1] != $ar_buf2[2]) { |
1173,8 → 1157,8 |
$dev->setName($ar_buf[1]); |
$was = true; |
if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS)) { |
if ((!CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/operstate', $buf, 1, 4096, false) || (($down=strtolower(trim($buf)))=="") || ($down!=="down")) && |
(CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/speed', $buf, 1, 4096, false) && (($speed=trim($buf))!="") && ($buf > 0) && ($buf < 65535))) { |
if (CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/speed', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$speed = trim($buf); |
if ($speed > 1000) { |
$speed = $speed/1000; |
$unit = "G"; |
1181,21 → 1165,15 |
} else { |
$unit = "M"; |
} |
if (CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/duplex', $buf, 1, 4096, false) && (($duplex=strtolower(trim($buf)))!="") && ($duplex!='unknown')) { |
$speedinfo = $speed.$unit.'b/s '.$duplex; |
if (CommonFunctions::rfts('/sys/class/net/'.$ar_buf[1].'/duplex', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$speedinfo = $speed.$unit.'b/s '.strtolower(trim($buf)); |
} else { |
$speedinfo = $speed.$unit.'b/s'; |
} |
} |
if (preg_match('/^'.$ar_buf[1].'\s+Link\sencap:Ethernet\s+HWaddr\s(\S+)/i', $line, $ar_buf2) |
|| preg_match('/^'.$ar_buf[1].'\s+Link\s+encap:UNSPEC\s+HWaddr\s(\S+)-00-00-00-00-00-00-00-00-00-00\s*$/i', $line, $ar_buf2)) { |
if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) { |
$macaddr = preg_replace('/:/', '-', strtoupper($ar_buf2[1])); |
if ($macaddr === '00-00-00-00-00-00') { // empty |
$macaddr = ""; |
} |
} |
} elseif (preg_match('/^'.$ar_buf[1].':\s+ip\s+(\S+)\s+mask/i', $line, $ar_buf2)) |
if (preg_match('/^'.$ar_buf[1].'\s+Link\sencap:Ethernet\s+HWaddr\s(\S+)/i', $line, $ar_buf2)) |
if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $macaddr = preg_replace('/:/', '-', strtoupper($ar_buf2[1])); |
elseif (preg_match('/^'.$ar_buf[1].':\s+ip\s+(\S+)\s+mask/i', $line, $ar_buf2)) |
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]); |
} |
} else { |
1217,14 → 1195,8 |
if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS)) { |
if (preg_match('/\s+encap:Ethernet\s+HWaddr\s(\S+)/i', $line, $ar_buf2) |
|| preg_match('/\s+encap:UNSPEC\s+HWaddr\s(\S+)-00-00-00-00-00-00-00-00-00-00\s*$/i', $line, $ar_buf2) |
|| preg_match('/^\s+ether\s+(\S+)\s+txqueuelen/i', $line, $ar_buf2)) { |
if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) { |
$macaddr = preg_replace('/:/', '-', strtoupper($ar_buf2[1])); |
if ($macaddr === '00-00-00-00-00-00') { // empty |
$macaddr = ""; |
} |
} |
if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $macaddr = preg_replace('/:/', '-', strtoupper($ar_buf2[1])); |
} elseif (preg_match('/^\s+inet\saddr:(\S+)\s+P-t-P:(\S+)/i', $line, $ar_buf2) |
|| preg_match('/^\s+inet\s+(\S+)\s+netmask.+destination\s+(\S+)/i', $line, $ar_buf2)) { |
if ($ar_buf2[1] != $ar_buf2[2]) { |
/web/acc/phpsysinfo/includes/os/class.OS.inc.php |
---|
132,9 → 132,9 |
*/ |
protected function _ip() |
{ |
if ((PSI_USE_VHOST === true) && !defined('PSI_EMU_HOSTNAME')) { |
if (PSI_USE_VHOST === true) { |
if ((CommonFunctions::readenv('SERVER_ADDR', $result) || CommonFunctions::readenv('LOCAL_ADDR', $result)) //is server address defined |
&& !strstr($result, '.') && strstr($result, ':')) { //is IPv6, quick version of preg_match('/\(([[0-9A-Fa-f\:]+)\)/', $result) |
&& !strstr($result, '.') && strstr($result, ':')) { //is IPv6, quick version of preg_match('/\(([[0-9A-Fa-f\:]+)\)/', $result) |
$dnsrec = dns_get_record($this->sys->getHostname(), DNS_AAAA); |
if (isset($dnsrec[0]['ipv6'])) { //is DNS IPv6 record |
$this->sys->setIp($dnsrec[0]['ipv6']); //from DNS (avoid IPv6 NAT translation) |
144,131 → 144,16 |
} else { |
$this->sys->setIp(gethostbyname($this->sys->getHostname())); //IPv4 only |
} |
} elseif (((PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) && (CommonFunctions::readenv('SERVER_ADDR', $result) || CommonFunctions::readenv('LOCAL_ADDR', $result))) { |
$this->sys->setIp(preg_replace('/^::ffff:/i', '', $result)); |
} else { |
//$this->sys->setIp(gethostbyname($this->sys->getHostname())); |
$hn = $this->sys->getHostname(); |
$ghbn = gethostbyname($hn); |
if (defined('PSI_EMU_HOSTNAME') && ($hn === $ghbn)) { |
$this->sys->setIp(PSI_EMU_HOSTNAME); |
if (CommonFunctions::readenv('SERVER_ADDR', $result) || CommonFunctions::readenv('LOCAL_ADDR', $result)) { |
$this->sys->setIp(preg_replace('/^::ffff:/i', '', $result)); |
} else { |
$this->sys->setIp($ghbn); |
$this->sys->setIp(gethostbyname($this->sys->getHostname())); |
} |
} |
} |
/** |
* MEM information from dmidecode |
* |
* @return void |
*/ |
protected function _dmimeminfo() |
{ |
$banks = array(); |
$buffer = ''; |
if (defined('PSI_DMIDECODE_ACCESS') && (strtolower(PSI_DMIDECODE_ACCESS)=="data")) { |
CommonFunctions::rfts(PSI_APP_ROOT.'/data/dmidecode.txt', $buffer); |
} elseif (CommonFunctions::_findProgram('dmidecode')) { |
CommonFunctions::executeProgram('dmidecode', '-t 17', $buffer, PSI_DEBUG); |
} |
if (!empty($buffer)) { |
$banks = preg_split('/^(?=Handle\s)/m', $buffer, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($banks as $bank) if (preg_match('/^Handle\s/', $bank)) { |
$lines = preg_split("/\n/", $bank, -1, PREG_SPLIT_NO_EMPTY); |
$mem = array(); |
foreach ($lines as $line) if (preg_match('/^\s+([^:]+):(.+)/' ,$line, $params)) { |
if (preg_match('/^0x([A-F\d]+)/', $params2 = trim($params[2]), $buff)) { |
$mem[trim($params[1])] = trim($buff[1]); |
} elseif ($params2 != '') { |
$mem[trim($params[1])] = $params2; |
} |
} |
if (isset($mem['Size']) && preg_match('/^(\d+)\s(M|G)B$/', $mem['Size'], $size) && ($size[1] > 0)) { |
$dev = new HWDevice(); |
$name = ''; |
if (isset($mem['Part Number']) && !preg_match("/^PartNum\d+$/", $part = $mem['Part Number']) && ($part != 'None') && ($part != 'N/A') && ($part != 'Not Specified') && ($part != 'NOT AVAILABLE')) { |
$name = $part; |
} |
if (isset($mem['Locator']) && (($dloc = $mem['Locator']) != 'None') && ($dloc != 'N/A') && ($dloc != 'Not Specified')) { |
if ($name != '') { |
$name .= ' - '.$dloc; |
} else { |
$name = $dloc; |
} |
} |
if (isset($mem['Bank Locator']) && (($bank = $mem['Bank Locator']) != 'None') && ($bank != 'N/A') && ($bank != 'Not Specified')) { |
if ($name != '') { |
$name .= ' in '.$bank; |
} else { |
$name = 'Physical Memory in '.$bank; |
} |
} |
if ($name != '') { |
$dev->setName(trim($name)); |
} else { |
$dev->setName('Physical Memory'); |
} |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if (isset($mem['Manufacturer']) && !preg_match("/^([A-F\d]{4}|[A-F\d]{12}|[A-F\d]{16})$/", $manufacturer = $mem['Manufacturer']) && !preg_match("/^Manufacturer\d+$/", $manufacturer) && !preg_match("/^Mfg \d+$/", $manufacturer) && !preg_match("/^JEDEC ID:/", $manufacturer) && ($manufacturer != 'None') && ($manufacturer != 'N/A') && ($manufacturer != 'Not Specified') && ($manufacturer != 'UNKNOWN')) { |
$dev->setManufacturer($manufacturer); |
} |
if ($size[2] == 'G') { |
$dev->setCapacity($size[1]*1024*1024*1024); |
} else { |
$dev->setCapacity($size[1]*1024*1024); |
} |
$memtype = ''; |
if (isset($mem['Type']) && (($type = $mem['Type']) != 'None') && ($type != 'N/A') && ($type != 'Not Specified') && ($type != 'Other') && ($type != 'Unknown') && ($type != '<OUT OF SPEC>')) { |
if (isset($mem['Speed']) && preg_match('/^(\d+)\s(MHz|MT\/s)/', $mem['Speed'], $speed) && ($speed[1] > 0) && (preg_match('/^(DDR\d*)(.*)/', $type, $dr) || preg_match('/^(SDR)AM(.*)/', $type, $dr))) { |
if (isset($mem['Minimum Voltage']) && isset($mem['Total Width']) && |
preg_match('/^([\d\.]+)\sV$/', $mem['Minimum Voltage'], $minv) && preg_match('/^([\d\.]+)\sV$/', $mem['Maximum Voltage'], $maxv) && |
($minv[1] > 0) && ($maxv[1] >0) && ($minv[1] < $maxv[1])) { |
$lv = 'L'; |
} else { |
$lv = ''; |
} |
if (isset($dr[2])) { |
$memtype = $dr[1].$lv.'-'.$speed[1].' '.$dr[2]; |
} else { |
$memtype = $dr[1].$lv.'-'.$speed[1]; |
} |
} else { |
$memtype = $type; |
} |
} |
if (isset($mem['Form Factor']) && (($form = $mem['Form Factor']) != 'None') && ($form != 'N/A') && ($form != 'Not Specified') && ($form != 'Other') && ($form != 'Unknown') && !preg_match('/ '.$form.'$/', $memtype)) { |
$memtype .= ' '.$form; |
} |
if (isset($mem['Data Width']) && isset($mem['Total Width']) && |
preg_match('/^(\d+)\sbits$/', $mem['Data Width'], $dataw) && preg_match('/^(\d+)\sbits$/', $mem['Total Width'], $totalw) && |
($dataw[1] > 0) && ($totalw[1] >0) && ($dataw[1] < $totalw[1])) { |
$memtype .= ' ECC'; |
} |
if (isset($mem['Type Detail']) && preg_match('/Registered/', $mem['Type Detail'])) { |
$memtype .= ' REG'; |
} |
if (($memtype = trim($memtype)) != '') { |
$dev->setProduct($memtype); |
} |
if (isset($mem['Configured Clock Speed']) && preg_match('/^(\d+)\s(MHz|MT\/s)$/', $mem['Configured Clock Speed'], $clock) && ($clock[1] > 0)) { |
$dev->setSpeed($clock[1]); |
} |
if (isset($mem['Configured Voltage']) && preg_match('/^([\d\.]+)\sV$/', $mem['Configured Voltage'], $voltage) && ($voltage[1] > 0)) { |
$dev->setVoltage($voltage[1]); |
} |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL && |
isset($mem['Serial Number']) && !preg_match("/^SerNum\d+$/", $serial = $mem['Serial Number']) && ($serial != 'None') && ($serial != 'Not Specified')) { |
$dev->setSerial($serial); |
} |
} |
$this->sys->setMemDevices($dev); |
} |
} |
} |
} |
/** |
* get the filled or unfilled (with default values) System object |
* |
* @see PSI_Interface_OS::getSys() |
281,9 → 166,6 |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_ip(); |
} |
if ((!$this->blockname || $this->blockname==='hardware') && (PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) { |
$this->_dmimeminfo(); |
} |
return $this->sys; |
} |
/web/acc/phpsysinfo/includes/os/class.OpenBSD.inc.php |
---|
71,12 → 71,8 |
$dev->setName($ar_buf_b[0]); |
$dev->setTxBytes($ar_buf_b[4]); |
$dev->setRxBytes($ar_buf_b[3]); |
if (sizeof($ar_buf_n) == 9) { |
$dev->setErrors($ar_buf_n[4] + $ar_buf_n[6]); |
$dev->setDrops($ar_buf_n[8]); |
} elseif (sizeof($ar_buf_n) == 8) { |
$dev->setDrops($ar_buf_n[4] + $ar_buf_n[6]); |
} |
$dev->setErrors($ar_buf_n[4] + $ar_buf_n[6]); |
$dev->setDrops($ar_buf_n[8]); |
if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig', $ar_buf_b[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) { |
$speedinfo = ""; |
$bufe2 = preg_split("/\n/", $bufr2, -1, PREG_SPLIT_NO_EMPTY); |
/web/acc/phpsysinfo/includes/os/class.SunOS.inc.php |
---|
147,17 → 147,17 |
*/ |
private function _kernel() |
{ |
if (CommonFunctions::executeProgram('uname', '-s', $kernel, PSI_DEBUG) && ($kernel != "")) { |
if (CommonFunctions::executeProgram('uname', '-r', $version, PSI_DEBUG) && ($version != "")) { |
$kernel.=' '.$version; |
if (CommonFunctions::executeProgram('uname', '-s', $os, PSI_DEBUG) && ($os!="")) { |
if (CommonFunctions::executeProgram('uname', '-r', $version, PSI_DEBUG) && ($version!="")) { |
$os.=' '.$version; |
} |
if (CommonFunctions::executeProgram('uname', '-v', $subversion, PSI_DEBUG) && ($subversion != "")) { |
$kernel.=' ('.$subversion.')'; |
if (CommonFunctions::executeProgram('uname', '-v', $subversion, PSI_DEBUG) && ($subversion!="")) { |
$os.=' ('.$subversion.')'; |
} |
if (CommonFunctions::executeProgram('uname', '-i', $platform, PSI_DEBUG) && ($platform != "")) { |
$kernel.=' '.$platform; |
if (CommonFunctions::executeProgram('uname', '-i', $platform, PSI_DEBUG) && ($platform!="")) { |
$os.=' '.$platform; |
} |
$this->sys->setKernel($kernel); |
$this->sys->setKernel($os); |
} |
} |
338,16 → 338,14 |
$this->sys->setMemTotal($this->_kstat('unix:0:system_pages:pagestotal') * $pagesize); |
$this->sys->setMemUsed($this->_kstat('unix:0:system_pages:pageslocked') * $pagesize); |
$this->sys->setMemFree($this->_kstat('unix:0:system_pages:pagesfree') * $pagesize); |
if (($swap=$this->_kstat('unix:0:vminfo:swap_avail')) > 0) { |
$dev = new DiskDevice(); |
$dev->setName('SWAP'); |
$dev->setFsType('swap'); |
$dev->setMountPoint('SWAP'); |
$dev->setTotal($swap / 1024); |
$dev->setUsed($this->_kstat('unix:0:vminfo:swap_alloc') / 1024); |
$dev->setFree($this->_kstat('unix:0:vminfo:swap_free') / 1024); |
$this->sys->setSwapDevices($dev); |
} |
$dev = new DiskDevice(); |
$dev->setName('SWAP'); |
$dev->setFsType('swap'); |
$dev->setMountPoint('SWAP'); |
$dev->setTotal($this->_kstat('unix:0:vminfo:swap_avail') / 1024); |
$dev->setUsed($this->_kstat('unix:0:vminfo:swap_alloc') / 1024); |
$dev->setFree($this->_kstat('unix:0:vminfo:swap_free') / 1024); |
$this->sys->setSwapDevices($dev); |
} |
/** |
/web/acc/phpsysinfo/includes/os/class.WINNT.inc.php |
---|
63,7 → 63,7 |
private $_systeminfo = null; |
/** |
* holds the COM object that we pull WMI root\CIMv2 data from |
* holds the COM object that we pull all the WMI data from |
* |
* @var Object |
*/ |
70,7 → 70,7 |
private $_wmi = null; |
/** |
* holds the COM object that we pull all the EnumKey and RegRead data from |
* holds the COM object that we pull all the RegRead data from |
* |
* @var Object |
*/ |
77,11 → 77,11 |
private $_reg = null; |
/** |
* holds result of 'cmd /c ver' |
* holds the COM object that we pull all the EnumKey data from |
* |
* @var string |
* @var Object |
*/ |
private $_ver = ""; |
private $_key = null; |
/** |
* holds all devices, which are in the system |
88,7 → 88,7 |
* |
* @var array |
*/ |
private $_wmidevices = array(); |
private $_wmidevices; |
/** |
* holds all disks, which are in the system |
95,7 → 95,7 |
* |
* @var array |
*/ |
private $_wmidisks = array(); |
private $_wmidisks; |
/** |
* store language encoding of the system to convert some output to utf-8 |
129,7 → 129,7 |
*/ |
private function _get_Win32_ComputerSystem() |
{ |
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model', 'SystemFamily')); |
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model')); |
return $this->_Win32_ComputerSystem; |
} |
174,12 → 174,8 |
*/ |
private function _get_systeminfo() |
{ |
if (!defined('PSI_EMU_HOSTNAME')) { |
if ($this->_systeminfo === null) CommonFunctions::executeProgram('systeminfo', '', $this->_systeminfo, false); |
return $this->_systeminfo; |
} else { |
return ''; |
} |
if ($this->_systeminfo === null) CommonFunctions::executeProgram('systeminfo', '', $this->_systeminfo, false); |
return $this->_systeminfo; |
} |
/** |
188,60 → 184,27 |
public function __construct($blockname = false) |
{ |
parent::__construct($blockname); |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::executeProgram('cmd', '/c ver 2>nul', $ver_value, false) && (($ver_value = trim($ver_value)) !== "")) { |
$this->_ver = $ver_value; |
try { |
// initialize the wmi object |
$objLocator = new COM('WbemScripting.SWbemLocator'); |
$this->_wmi = $objLocator->ConnectServer('', 'root\CIMv2'); |
} catch (Exception $e) { |
$this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed."); |
} |
if (($this->_ver !== "") && preg_match("/ReactOS\r?\n\S+\s+.+/", $this->_ver)) { |
$this->_wmi = false; // No WMI info on ReactOS yet |
$this->_reg = false; // No EnumKey and ReadReg on ReactOS yet |
} else { |
if (PSI_OS == 'WINNT') { |
if (defined('PSI_EMU_HOSTNAME')) { |
try { |
$objLocator = new COM('WbemScripting.SWbemLocator'); |
$wmi = $objLocator->ConnectServer('', 'root\CIMv2'); |
$buffer = CommonFunctions::getWMI($wmi, 'Win32_OperatingSystem', array('CodeSet')); |
if (!$buffer) { |
$reg = $objLocator->ConnectServer('', 'root\default'); |
if (CommonFunctions::readReg($reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
$buffer[0]['CodeSet'] = $strBuf; |
} |
} |
if ($buffer && isset($buffer[0])) { |
if (isset($buffer[0]['CodeSet'])) { |
$codeset = $buffer[0]['CodeSet']; |
if ($codeset == 932) { |
$codename = ' (SJIS)'; |
} elseif ($codeset == 949) { |
$codename = ' (EUC-KR)'; |
} elseif ($codeset == 950) { |
$codename = ' (BIG-5)'; |
} else { |
$codename = ''; |
} |
define('PSI_SYSTEM_CODEPAGE', 'windows-'.$codeset.$codename); |
} |
} |
} catch (Exception $e) { |
define('PSI_SYSTEM_CODEPAGE', null); |
if (PSI_DEBUG) { |
$this->error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed"); |
} |
} |
} else { |
define('PSI_SYSTEM_CODEPAGE', null); |
} |
} |
$this->_wmi = CommonFunctions::initWMI('root\CIMv2', true); |
if (PSI_OS == 'WINNT') { |
$this->_reg = CommonFunctions::initWMI('root\default', PSI_DEBUG); |
if (gettype($this->_reg) === "object") { |
$this->_reg->Security_->ImpersonationLevel = 3; |
} |
} else { |
$this->_reg = false; // No EnumKey and ReadReg on Linux |
} |
try { |
// initialize the RegRead object |
$this->_reg = new COM("WScript.Shell"); |
} catch (Exception $e) { |
//$this->error->addError("Windows Scripting Host error", "PhpSysInfo can not initialize Windows Scripting Host for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed."); |
$this->_reg = false; |
} |
try { |
// initialize the EnumKey object |
$this->_key = new COM("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv"); |
} catch (Exception $e) { |
//$this->error->addError("WWinmgmts Impersonationlevel Script Error", "PhpSysInfo can not initialize Winmgmts Impersonationlevel Script for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed."); |
$this->_key = false; |
} |
$this->_getCodeSet(); |
} |
311,44 → 274,9 |
} |
} else { |
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID')); |
$this->_wmidisks = array(); |
} |
if (empty($this->_wmidevices)) { |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\Scsi"; |
$id = 0; |
if (CommonFunctions::enumKey($this->_reg, $hkey, $portBuf, false)) { |
foreach ($portBuf as $scsiport) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport, $busBuf, false)) { |
foreach ($busBuf as $scsibus) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus, $tarBuf, false)) { |
foreach ($tarBuf as $scsitar) if (!strncasecmp($scsitar, "Target Id ", strlen("Target Id "))) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar, $logBuf, false)) { |
foreach ($logBuf as $scsilog) if (!strncasecmp($scsilog, "Logical Unit Id ", strlen("Logical Unit Id "))) { |
$hkey2 = $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar."\\".$scsilog."\\"; |
if ((CommonFunctions::readReg($this->_reg, $hkey2."DeviceType", $typeBuf, false) || CommonFunctions::readReg($this->_reg, $hkey2."Type", $typeBuf, false)) |
&& (($typeBuf=strtolower(trim($typeBuf))) !== "")) { |
if ((($typeBuf == 'diskperipheral') || ($typeBuf == 'cdromperipheral')) |
&& CommonFunctions::readReg($this->_reg, $hkey2."Identifier", $ideBuf, false)) { |
$this->_wmidevices[] = array('Name'=>$ideBuf, 'PNPDeviceID'=>'SCSI\\'.$id); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL |
&& (CommonFunctions::readReg($this->_reg, $hkey2."SerialNumber", $serBuf, false)) |
&& (($serBuf=trim($serBuf)) !== "")) { |
$this->_wmidisks[] = array('PNPDeviceID'=>'SCSI\\'.$id, 'SerialNumber'=>$serBuf); |
} |
$id++; |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
$list = array(); |
foreach ($this->_wmidevices as $device) { |
if (substr($device['PNPDeviceID'], 0, strpos($device['PNPDeviceID'], "\\") + 1) == ($strType."\\")) { |
356,7 → 284,7 |
if (!isset($device['PNPClass']) || ($device['PNPClass']===$strType) || ($device['PNPClass']==='System')) { |
$device['PNPClass'] = null; |
} |
if (!isset($device['Manufacturer']) || preg_match('/^\(.*\)$/', $device['Manufacturer']) || (($device['PNPClass']==='USB') && preg_match('/\sUSB\s/', $device['Manufacturer']))) { |
if (preg_match('/^\(.*\)$/', $device['Manufacturer'])) { |
$device['Manufacturer'] = null; |
} |
$device['Capacity'] = null; |
400,7 → 328,7 |
*/ |
private function _hostname() |
{ |
if ((PSI_USE_VHOST === true) && !defined('PSI_EMU_HOSTNAME')) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
$buffer = $this->_get_Win32_ComputerSystem(); |
419,19 → 347,11 |
(version_compare("255.255.255.255", $ip, "=="))) { |
$this->sys->setHostname($result); // internal ip |
} else { |
$hostname = gethostbyaddr($ip); |
if ($hostname !== false) |
$this->sys->setHostname($hostname); |
else |
$this->sys->setHostname($result); |
$this->sys->setHostname(gethostbyaddr($ip)); |
} |
} else { |
$this->sys->setHostname($result); |
} |
} elseif (defined('PSI_EMU_HOSTNAME')) { |
$this->sys->setHostname(PSI_EMU_HOSTNAME); |
} elseif (CommonFunctions::readenv('COMPUTERNAME', $hnm)) { |
$this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::readenv('COMPUTERNAME', $hnm)) $this->sys->setHostname($hnm); |
} |
} |
} |
493,7 → 413,7 |
*/ |
protected function _users() |
{ |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::executeProgram('quser', '', $strBuf, false) && (strlen($strBuf) > 0)) { |
if (CommonFunctions::executeProgram('quser', '', $strBuf, false) && (strlen($strBuf) > 0)) { |
$lines = preg_split('/\n/', $strBuf); |
$users = count($lines)-1; |
} else { |
540,17 → 460,13 |
else |
$icon = 'Win8.png'; |
$this->sys->setDistributionIcon($icon); |
} elseif ($this->_ver !== "") { |
if (preg_match("/ReactOS\r?\n\S+\s+(.+)/", $this->_ver, $ar_temp)) { |
if (preg_match("/^(\d+\.\d+\.\d+[\S]*)(.+)$/", trim($ar_temp[1]), $ver_temp)) { |
$this->sys->setDistribution("ReactOS ".trim($ver_temp[1])); |
$this->sys->setKernel(trim($ver_temp[2])); |
} else { |
$this->sys->setDistribution("ReactOS"); |
$this->sys->setKernel($ar_temp[1]); |
} |
} elseif (CommonFunctions::executeProgram('cmd', '/c ver 2>nul', $ver_value, false)) { |
if (preg_match("/ReactOS\r?\nVersion\s+(.+)/", $ver_value, $ar_temp)) { |
$this->sys->setDistribution("ReactOS"); |
$this->sys->setKernel($ar_temp[1]); |
$this->sys->setDistributionIcon('ReactOS.png'); |
} elseif (preg_match("/^(Microsoft [^\[]*)\s*\[\D*\s*(.+)\]/", $this->_ver, $ar_temp)) { |
$this->_wmi = false; // No WMI info on ReactOS yet |
} elseif (preg_match("/^(Microsoft [^\[]*)\s*\[\D*\s*(.+)\]/", $ver_value, $ar_temp)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProductName", $strBuf, false) && (strlen($strBuf) > 0)) { |
if (preg_match("/^Microsoft /", $strBuf)) { |
$this->sys->setDistribution($strBuf); |
572,12 → 488,12 |
$icon = 'WinXP.png'; |
$this->sys->setDistributionIcon($icon); |
} else { |
$this->sys->setDistribution("WINNT"); |
$this->sys->setDistributionIcon('WINNT.png'); |
$this->sys->setDistribution("WinNT"); |
$this->sys->setDistributionIcon('Win2000.png'); |
} |
} else { |
$this->sys->setDistribution("WINNT"); |
$this->sys->setDistributionIcon('WINNT.png'); |
$this->sys->setDistribution("WinNT"); |
$this->sys->setDistributionIcon('Win2000.png'); |
} |
} |
626,7 → 542,7 |
$allCpus = $this->_get_Win32_Processor(); |
if (!$allCpus) { |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor"; |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (CommonFunctions::enumKey($this->_key, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $coreCount) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\ProcessorNameString", $strBuf, false)) { |
$allCpus[$coreCount]['Name'] = $strBuf; |
695,75 → 611,19 |
private function _machine() |
{ |
$buffer = $this->_get_Win32_ComputerSystem(); |
$bufferp = CommonFunctions::getWMI($this->_wmi, 'Win32_BaseBoard', array('Product')); |
$bufferb = CommonFunctions::getWMI($this->_wmi, 'Win32_BIOS', array('SMBIOSBIOSVersion', 'ReleaseDate')); |
if (!$buffer) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\systemManufacturer", $strBuf, false)) { |
$buffer[0]['Manufacturer'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemProductName", $strBuf, false)) { |
$buffer[0]['Model'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemFamily", $strBuf, false)) { |
$buffer[0]['SystemFamily'] = $strBuf; |
} |
} |
if (!$bufferp) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BaseBoardProduct", $strBuf, false)) { |
$bufferp[0]['Product'] = $strBuf; |
} |
} |
if (!$bufferb) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion", $strBuf, false)) { |
$bufferb[0]['SMBIOSBIOSVersion'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSReleaseDate", $strBuf, false)) { |
$bufferb[0]['ReleaseDate'] = $strBuf; |
} |
} |
$buf = ""; |
$model = ""; |
if ($buffer && isset($buffer[0])) { |
if (isset($buffer[0]['Manufacturer']) && !preg_match("/^To be filled by O\.E\.M\.$|^System manufacturer$|^Not Specified$/i", $buf2=trim($buffer[0]['Manufacturer'])) && ($buf2 !== "")) { |
if ($buffer) { |
$buf = ""; |
if (isset($buffer[0]['Manufacturer']) && !preg_match("/^To be filled by O\.E\.M\.$|^System manufacturer$|^Not Specified$/i", $buf2=$buffer[0]['Manufacturer'])) { |
$buf .= ' '.$buf2; |
} |
if (isset($buffer[0]['Model']) && !preg_match("/^To be filled by O\.E\.M\.$|^System Product Name$|^Not Specified$/i", $buf2=trim($buffer[0]['Model'])) && ($buf2 !== "")) { |
$model = $buf2; |
if (isset($buffer[0]['Model']) && !preg_match("/^To be filled by O\.E\.M\.$|^System Product Name$|^Not Specified$/i", $buf2=$buffer[0]['Model'])) { |
$buf .= ' '.$buf2; |
} |
} |
if ($bufferp && isset($bufferp[0])) { |
if (isset($bufferp[0]['Product']) && !preg_match("/^To be filled by O\.E\.M\.$|^BaseBoard Product Name$|^Not Specified$|^Default string$/i", $buf2=trim($bufferp[0]['Product'])) && ($buf2 !== "")) { |
if ($buf2 !== $model) { |
$buf .= '/'.$buf2; |
} elseif (isset($buffer[0]['SystemFamily']) && !preg_match("/^To be filled by O\.E\.M\.$|^System Family$|^Not Specified$/i", $buf2=trim($buffer[0]['SystemFamily'])) && ($buf2 !== "")) { |
$buf .= '/'.$buf2; |
} |
if (trim($buf) != "") { |
$this->sys->setMachine(trim($buf)); |
} |
} |
if ($bufferb && isset($bufferb[0])) { |
$bver = ""; |
$brel = ""; |
if (isset($bufferb[0]['SMBIOSBIOSVersion']) && (($buf2=trim($bufferb[0]['SMBIOSBIOSVersion'])) !== "")) { |
$bver .= ' '.$buf2; |
} |
if (isset($bufferb[0]['ReleaseDate'])) { |
if (preg_match("/^(\d{4})(\d{2})(\d{2})\d{6}\.\d{6}\+\d{3}$/", $bufferb[0]['ReleaseDate'], $dateout)) { |
$brel .= ' '.$dateout[2].'/'.$dateout[3].'/'.$dateout[1]; |
} elseif (preg_match("/^\d{2}\/\d{2}\/\d{4}$/", $bufferb[0]['ReleaseDate'])) { |
$brel .= ' '.$bufferb[0]['ReleaseDate']; |
} |
} |
if ((trim($bver) !== "") || (trim($brel) !== "")) { |
$buf .= ', BIOS'.$bver.$brel; |
} |
} |
if (trim($buf) != "") { |
$this->sys->setMachine(trim($buf)); |
} |
} |
/** |
777,11 → 637,7 |
$dev = new HWDevice(); |
$dev->setName($pciDev['Name']); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if (($pciDev['Manufacturer'] !== null) && preg_match("/^@[^\.]+\.inf,%([^%]+)%$/i", trim($pciDev['Manufacturer']), $mbuff)) { |
$dev->setManufacturer($mbuff[1]); |
} else { |
$dev->setManufacturer($pciDev['Manufacturer']); |
} |
$dev->setManufacturer($pciDev['Manufacturer']); |
$dev->setProduct($pciDev['Product']); |
} |
$this->sys->setPciDevices($dev); |
842,16 → 698,16 |
if ($allDevices) { |
$aliases = array(); |
$hkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"; |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (CommonFunctions::enumKey($this->_key, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $netID) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\PnPInstanceId", $strInstanceID, false)) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\PnPInstanceId", $strInstanceID, false)) { //a w Name jest net alias |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\".$strInstanceID."\\FriendlyName", $strName, false)) { |
$cname = str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strName); //convert to canonical |
$cname = str_replace(array('(', ')', '#'), array('[', ']', '_'), $strName); //convert to canonical |
if (!isset($aliases[$cname])) { // duplicate checking |
$aliases[$cname]['id'] = $netID; |
$aliases[$cname]['name'] = $strName; |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\Name", $strCName, false) |
&& (str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strCName) !== $cname)) { |
&& (str_replace(array('(', ')', '#'), array('[', ']', '_'), $strCName) !== $cname)) { |
$aliases[$cname]['netname'] = $strCName; |
} |
} else { |
864,11 → 720,11 |
$aliases2 = array(); |
$hkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards"; |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (CommonFunctions::enumKey($this->_key, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $netCount) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\Description", $strName, false) |
&& CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\ServiceName", $strGUID, false)) { |
$cname = str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strName); //convert to canonical |
$cname = str_replace(array('(', ')', '#'), array('[', ']', '_'), $strName); //convert to canonical |
if (!isset($aliases2[$cname])) { // duplicate checking |
$aliases2[$cname]['id'] = $strGUID; |
$aliases2[$cname]['name'] = $strName; |
1109,7 → 965,7 |
public function _processes() |
{ |
$processes['*'] = 0; |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::executeProgram('qprocess', '*', $strBuf, false) && (strlen($strBuf) > 0)) { |
if (CommonFunctions::executeProgram('qprocess', '*', $strBuf, false) && (strlen($strBuf) > 0)) { |
$lines = preg_split('/\n/', $strBuf); |
$processes['*'] = (count($lines)-1) - 3 ; //correction for process "qprocess *" |
} |
1122,184 → 978,6 |
} |
/** |
* MEM information |
* |
* @return void |
*/ |
private function _meminfo() |
{ |
$allMems = CommonFunctions::getWMI($this->_wmi, 'Win32_PhysicalMemory', array('PartNumber', 'DeviceLocator', 'Capacity', 'Manufacturer', 'SerialNumber', 'Speed', 'ConfiguredClockSpeed', 'ConfiguredVoltage', 'MemoryType', 'SMBIOSMemoryType', 'FormFactor', 'DataWidth', 'TotalWidth', 'BankLabel', 'MinVoltage', 'MaxVoltage')); |
if ($allMems) { |
$reg = false; |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
$arrMems = CommonFunctions::getWMI($this->_wmi, 'Win32_PhysicalMemoryArray', array('MemoryErrorCorrection')); |
$reg = (count($arrMems) == 1) && isset($arrMems[0]['MemoryErrorCorrection']) && ($arrMems[0]['MemoryErrorCorrection'] == 6); |
} |
foreach ($allMems as $mem) { |
$dev = new HWDevice(); |
$name = ''; |
if (isset($mem['PartNumber']) && !preg_match("/^PartNum\d+$/", $part = $mem['PartNumber']) && ($part != '') && ($part != 'None') && ($part != 'N/A') && ($part != 'NOT AVAILABLE')) { |
$name = $part; |
} |
if (isset($mem['DeviceLocator']) && (($dloc = $mem['DeviceLocator']) != '') && ($dloc != 'None') && ($dloc != 'N/A')) { |
if ($name != '') { |
$name .= ' - '.$dloc; |
} else { |
$name = $dloc; |
} |
} |
if (isset($mem['BankLabel']) && (($bank = $mem['BankLabel']) != '') && ($bank != 'None') && ($bank != 'N/A')) { |
if ($name != '') { |
$name .= ' in '.$bank; |
} else { |
$name = 'Physical Memory in '.$bank; |
} |
} |
if ($name != '') { |
$dev->setName(trim($name)); |
} else { |
$dev->setName('Physical Memory'); |
} |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if (isset($mem['Manufacturer']) && !preg_match("/^([A-F\d]{4}|[A-F\d]{12}|[A-F\d]{16})$/", $manufacturer = $mem['Manufacturer']) && !preg_match("/^Manufacturer\d+$/", $manufacturer) && !preg_match("/^Mfg \d+$/", $manufacturer) && ($manufacturer != '') && ($manufacturer != 'None') && ($manufacturer != 'N/A') && ($manufacturer != 'UNKNOWN')) { |
$dev->setManufacturer($manufacturer); |
} |
if (isset($mem['Capacity'])) { |
$dev->setCapacity($mem['Capacity']); |
} |
$memtype = ''; |
if (isset($mem['MemoryType']) && (($memval = $mem['MemoryType']) != 0)) { |
switch ($memval) { |
// case 0: $memtype = 'Unknown'; break; |
// case 1: $memtype = 'Other'; break; |
case 2: $memtype = 'DRAM'; break; |
case 3: $memtype = 'Synchronous DRAM'; break; |
case 4: $memtype = 'Cache DRAM'; break; |
case 5: $memtype = 'EDO'; break; |
case 6: $memtype = 'EDRAM'; break; |
case 7: $memtype = 'VRAM'; break; |
case 8: $memtype = 'SRAM'; break; |
case 9: $memtype = 'RAM'; break; |
case 10: $memtype = 'ROM'; break; |
case 11: $memtype = 'Flash'; break; |
case 12: $memtype = 'EEPROM'; break; |
case 13: $memtype = 'FEPROM'; break; |
case 14: $memtype = 'EPROM'; break; |
case 15: $memtype = 'CDRAM'; break; |
case 16: $memtype = '3DRAM'; break; |
case 17: $memtype = 'SDRAM'; break; |
case 18: $memtype = 'SGRAM'; break; |
case 19: $memtype = 'RDRAM'; break; |
case 20: $memtype = 'DDR'; break; |
case 21: $memtype = 'DDR2'; break; |
case 22: $memtype = 'DDR2 FB-DIMM'; break; |
case 24: $memtype = 'DDR3'; break; |
case 25: $memtype = 'FBD2'; break; |
case 26: $memtype = 'DDR4'; break; |
} |
} elseif (isset($mem['SMBIOSMemoryType'])) { |
switch ($mem['SMBIOSMemoryType']) { |
// case 0: $memtype = 'Invalid'; break; |
// case 1: $memtype = 'Other'; break; |
// case 2: $memtype = 'Unknown'; break; |
case 3: $memtype = 'DRAM'; break; |
case 4: $memtype = 'EDRAM'; break; |
case 5: $memtype = 'VRAM'; break; |
case 6: $memtype = 'SRAM'; break; |
case 7: $memtype = 'RAM'; break; |
case 8: $memtype = 'ROM'; break; |
case 9: $memtype = 'FLASH'; break; |
case 10: $memtype = 'EEPROM'; break; |
case 11: $memtype = 'FEPROM'; break; |
case 12: $memtype = 'EPROM'; break; |
case 13: $memtype = 'CDRAM'; break; |
case 14: $memtype = '3DRAM'; break; |
case 15: $memtype = 'SDRAM'; break; |
case 16: $memtype = 'SGRAM'; break; |
case 17: $memtype = 'RDRAM'; break; |
case 18: $memtype = 'DDR'; break; |
case 19: $memtype = 'DDR2'; break; |
case 20: $memtype = 'DDR2 FB-DIMM'; break; |
case 24: $memtype = 'DDR3'; break; |
case 25: $memtype = 'FBD2'; break; |
case 26: $memtype = 'DDR4'; break; |
case 27: $memtype = 'LPDDR'; break; |
case 28: $memtype = 'LPDDR2'; break; |
case 29: $memtype = 'LPDDR3'; break; |
case 30: $memtype = 'DDR3'; break; |
case 31: $memtype = 'FBD2'; break; |
case 32: $memtype = 'Logical non-volatile device'; break; |
case 33: $memtype = 'HBM2'; break; |
case 34: $memtype = 'DDR5'; break; |
case 35: $memtype = 'LPDDR5'; break; |
} |
} |
if (isset($mem['Speed']) && (($speed = $mem['Speed']) > 0) && (preg_match('/^(DDR\d*)(.*)/', $memtype, $dr) || preg_match('/^(SDR)AM(.*)/', $memtype, $dr))) { |
if (isset($mem['MinVoltage']) && isset($mem['MaxVoltage']) && (($minv = $mem['MinVoltage']) > 0) && (($maxv = $mem['MaxVoltage']) > 0) && ($minv < $maxv)) { |
$lv = 'L'; |
} else { |
$lv = ''; |
} |
if (isset($dr[2])) { |
$memtype = $dr[1].$lv.'-'.$speed.' '.$dr[2]; |
} else { |
$memtype = $dr[1].$lv.'-'.$speed; |
} |
} |
if (isset($mem['FormFactor'])) { |
switch ($mem['FormFactor']) { |
// case 0: $memtype .= ' Unknown'; break; |
// case 1: $memtype .= ' Other'; break; |
case 2: $memtype .= ' SIP'; break; |
case 3: $memtype .= ' DIP'; break; |
case 4: $memtype .= ' ZIP'; break; |
case 5: $memtype .= ' SOJ'; break; |
case 6: $memtype .= ' Proprietary'; break; |
case 7: $memtype .= ' SIMM'; break; |
case 8: $memtype .= ' DIMM'; break; |
case 9: $memtype .= ' TSOPO'; break; |
case 10: $memtype .= ' PGA'; break; |
case 11: $memtype .= ' RIM'; break; |
case 12: $memtype .= ' SODIMM'; break; |
case 13: $memtype .= ' SRIMM'; break; |
case 14: $memtype .= ' SMD'; break; |
case 15: $memtype .= ' SSMP'; break; |
case 16: $memtype .= ' QFP'; break; |
case 17: $memtype .= ' TQFP'; break; |
case 18: $memtype .= ' SOIC'; break; |
case 19: $memtype .= ' LCC'; break; |
case 20: $memtype .= ' PLCC'; break; |
case 21: $memtype .= ' BGA'; break; |
case 22: $memtype .= ' FPBGA'; break; |
case 23: $memtype .= ' LGA'; break; |
} |
} |
if (isset($mem['DataWidth']) && isset($mem['TotalWidth']) && (($dataw = $mem['DataWidth']) > 0) && (($totalw = $mem['TotalWidth']) > 0) && ($dataw < $totalw)) { |
$memtype .= ' ECC'; |
} |
if ($reg) { |
$memtype .= ' REG'; |
} |
if (($memtype = trim($memtype)) != '') { |
$dev->setProduct($memtype); |
} |
if (isset($mem['ConfiguredClockSpeed']) && (($clock = $mem['ConfiguredClockSpeed']) > 0)) { |
$dev->setSpeed($clock); |
} |
if (isset($mem['ConfiguredVoltage']) && (($voltage = $mem['ConfiguredVoltage']) > 0)) { |
$dev->setVoltage($voltage/1000); |
} |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL && |
isset($mem['SerialNumber']) && !preg_match("/^SerNum\d+$/", $serial = $mem['SerialNumber']) && ($serial != '') && ($serial != 'None')) { |
$dev->setSerial($serial); |
} |
} |
$this->sys->setMemDevices($dev); |
} |
} |
} |
/** |
* get the information |
* |
* @see PSI_Interface_OS::build() |
1325,7 → 1003,6 |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->_machine(); |
$this->_cpuinfo(); |
$this->_meminfo(); |
$this->_hardware(); |
} |
if (!$this->blockname || $this->blockname==='filesystem') { |
/web/acc/phpsysinfo/includes/xml/class.XML.inc.php |
---|
66,6 → 66,13 |
private $_plugin = ''; |
/** |
* generate a xml for a plugin or for the main app |
* |
* @var boolean |
*/ |
private $_plugin_request = false; |
/** |
* generate the entire xml with all plugins or only a part of the xml (main or plugin) |
* |
* @var boolean |
86,17 → 93,19 |
public function __construct($complete = false, $pluginname = "", $blockname = false) |
{ |
$this->_errors = PSI_Error::singleton(); |
$this->_plugin = $pluginname; |
if ($pluginname == "") { |
$this->_plugin_request = false; |
$this->_plugin = ''; |
} else { |
$this->_plugin_request = true; |
$this->_plugin = $pluginname; |
} |
if ($complete) { |
$this->_complete_request = true; |
} else { |
$this->_complete_request = false; |
} |
if (defined('PSI_EMU_HOSTNAME')) { |
$os = 'WINNT'; |
} else { |
$os = PSI_OS; |
} |
$os = PSI_OS; |
$this->_sysinfo = new $os($blockname); |
$this->_plugins = CommonFunctions::getPlugins(); |
$this->_xmlbody(); |
160,12 → 169,8 |
} |
} |
} |
if (defined('PSI_EMU_HOSTNAME')) { |
$vitals->addAttribute('OS', 'WINNT'); |
} else { |
$vitals->addAttribute('OS', (PSI_OS=='Android')?'Linux':PSI_OS); |
} |
// $vitals->addAttribute('OS', PSI_OS); |
$vitals->addAttribute('OS', (PSI_OS=='Android')?'Linux':PSI_OS); |
} |
/** |
213,58 → 218,12 |
if ($this->_sys->getMachine() != "") { |
$hardware->addAttribute('Name', $this->_sys->getMachine()); |
} |
$cpu = null; |
$vendortab = null; |
foreach ($this->_sys->getCpus() as $oneCpu) { |
if ($cpu === null) $cpu = $hardware->addChild('CPU'); |
$tmp = $cpu->addChild('CpuCore'); |
$tmp->addAttribute('Model', $oneCpu->getModel()); |
if ($oneCpu->getCpuSpeed() !== 0) { |
$tmp->addAttribute('CpuSpeed', max($oneCpu->getCpuSpeed(), 0)); |
} |
if ($oneCpu->getCpuSpeedMax() !== 0) { |
$tmp->addAttribute('CpuSpeedMax', $oneCpu->getCpuSpeedMax()); |
} |
if ($oneCpu->getCpuSpeedMin() !== 0) { |
$tmp->addAttribute('CpuSpeedMin', $oneCpu->getCpuSpeedMin()); |
} |
/* |
if ($oneCpu->getTemp() !== null) { |
$tmp->addAttribute('CpuTemp', $oneCpu->getTemp()); |
} |
*/ |
if ($oneCpu->getBusSpeed() !== null) { |
$tmp->addAttribute('BusSpeed', $oneCpu->getBusSpeed()); |
} |
if ($oneCpu->getCache() !== null) { |
$tmp->addAttribute('Cache', $oneCpu->getCache()); |
} |
if ($oneCpu->getVirt() !== null) { |
$tmp->addAttribute('Virt', $oneCpu->getVirt()); |
} |
if ($oneCpu->getVendorId() !== null) { |
if ($vendortab === null) $vendortab = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true); |
$shortvendorid = preg_replace('/[\s!]/', '', $oneCpu->getVendorId()); |
if ($vendortab && ($shortvendorid != "") && isset($vendortab['manufacturer'][$shortvendorid])) { |
$tmp->addAttribute('Manufacturer', $vendortab['manufacturer'][$shortvendorid]); |
} |
} |
if ($oneCpu->getBogomips() !== null) { |
$tmp->addAttribute('Bogomips', $oneCpu->getBogomips()); |
} |
if ($oneCpu->getLoad() !== null) { |
$tmp->addAttribute('Load', $oneCpu->getLoad()); |
} |
} |
$mem = null; |
foreach (System::removeDupsAndCount($this->_sys->getMemDevices()) as $dev) { |
if ($mem === null) $mem = $hardware->addChild('MEM'); |
$tmp = $mem->addChild('Chip'); |
$pci = null; |
foreach (System::removeDupsAndCount($this->_sys->getPciDevices()) as $dev) { |
if ($pci === null) $pci = $hardware->addChild('PCI'); |
$tmp = $pci->addChild('Device'); |
$tmp->addAttribute('Name', $dev->getName()); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if ($dev->getCapacity() !== null) { |
$tmp->addAttribute('Capacity', $dev->getCapacity()); |
} |
if ($dev->getManufacturer() !== null) { |
$tmp->addAttribute('Manufacturer', $dev->getManufacturer()); |
} |
271,24 → 230,15 |
if ($dev->getProduct() !== null) { |
$tmp->addAttribute('Product', $dev->getProduct()); |
} |
if ($dev->getSpeed() !== null) { |
$tmp->addAttribute('Speed', $dev->getSpeed()); |
} |
if ($dev->getVoltage() !== null) { |
$tmp->addAttribute('Voltage', $dev->getVoltage()); |
} |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL && ($dev->getSerial() !== null)) { |
$tmp->addAttribute('Serial', $dev->getSerial()); |
} |
} |
if ($dev->getCount() > 1) { |
$tmp->addAttribute('Count', $dev->getCount()); |
} |
} |
$pci = null; |
foreach (System::removeDupsAndCount($this->_sys->getPciDevices()) as $dev) { |
if ($pci === null) $pci = $hardware->addChild('PCI'); |
$tmp = $pci->addChild('Device'); |
$usb = null; |
foreach (System::removeDupsAndCount($this->_sys->getUsbDevices()) as $dev) { |
if ($usb === null) $usb = $hardware->addChild('USB'); |
$tmp = $usb->addChild('Device'); |
$tmp->addAttribute('Name', $dev->getName()); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if ($dev->getManufacturer() !== null) { |
297,6 → 247,9 |
if ($dev->getProduct() !== null) { |
$tmp->addAttribute('Product', $dev->getProduct()); |
} |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL && ($dev->getSerial() !== null)) { |
$tmp->addAttribute('Serial', $dev->getSerial()); |
} |
} |
if ($dev->getCount() > 1) { |
$tmp->addAttribute('Count', $dev->getCount()); |
353,29 → 306,6 |
$tmp->addAttribute('Count', $dev->getCount()); |
} |
} |
$usb = null; |
foreach (System::removeDupsAndCount($this->_sys->getUsbDevices()) as $dev) { |
if ($usb === null) $usb = $hardware->addChild('USB'); |
$tmp = $usb->addChild('Device'); |
$tmp->addAttribute('Name', $dev->getName()); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
if ($dev->getManufacturer() !== null) { |
$tmp->addAttribute('Manufacturer', $dev->getManufacturer()); |
} |
if ($dev->getProduct() !== null) { |
$tmp->addAttribute('Product', $dev->getProduct()); |
} |
if ($dev->getSpeed() !== null) { |
$tmp->addAttribute('Speed', $dev->getSpeed()); |
} |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL && ($dev->getSerial() !== null)) { |
$tmp->addAttribute('Serial', $dev->getSerial()); |
} |
} |
if ($dev->getCount() > 1) { |
$tmp->addAttribute('Count', $dev->getCount()); |
} |
} |
$tb = null; |
foreach (System::removeDupsAndCount($this->_sys->getTbDevices()) as $dev) { |
if ($tb === null) $tb = $hardware->addChild('TB'); |
394,6 → 324,50 |
$tmp->addAttribute('Count', $dev->getCount()); |
} |
} |
$cpu = null; |
$vendortab = null; |
foreach ($this->_sys->getCpus() as $oneCpu) { |
if ($cpu === null) $cpu = $hardware->addChild('CPU'); |
$tmp = $cpu->addChild('CpuCore'); |
$tmp->addAttribute('Model', $oneCpu->getModel()); |
if ($oneCpu->getCpuSpeed() !== 0) { |
$tmp->addAttribute('CpuSpeed', max($oneCpu->getCpuSpeed(), 0)); |
} |
if ($oneCpu->getCpuSpeedMax() !== 0) { |
$tmp->addAttribute('CpuSpeedMax', $oneCpu->getCpuSpeedMax()); |
} |
if ($oneCpu->getCpuSpeedMin() !== 0) { |
$tmp->addAttribute('CpuSpeedMin', $oneCpu->getCpuSpeedMin()); |
} |
/* |
if ($oneCpu->getTemp() !== null) { |
$tmp->addAttribute('CpuTemp', $oneCpu->getTemp()); |
} |
*/ |
if ($oneCpu->getBusSpeed() !== null) { |
$tmp->addAttribute('BusSpeed', $oneCpu->getBusSpeed()); |
} |
if ($oneCpu->getCache() !== null) { |
$tmp->addAttribute('Cache', $oneCpu->getCache()); |
} |
if ($oneCpu->getVirt() !== null) { |
$tmp->addAttribute('Virt', $oneCpu->getVirt()); |
} |
if ($oneCpu->getVendorId() !== null) { |
if ($vendortab === null) $vendortab = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true); |
$shortvendorid = preg_replace('/[\s!]/', '', $oneCpu->getVendorId()); |
if ($vendortab && ($shortvendorid != "") && isset($vendortab['manufacturer'][$shortvendorid])) { |
$tmp->addAttribute('Manufacturer', $vendortab['manufacturer'][$shortvendorid]); |
} |
} |
if ($oneCpu->getBogomips() !== null) { |
$tmp->addAttribute('Bogomips', $oneCpu->getBogomips()); |
} |
if ($oneCpu->getLoad() !== null) { |
$tmp->addAttribute('Load', $oneCpu->getLoad()); |
} |
} |
} |
/** |
449,18 → 423,12 |
private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i) |
{ |
$mount->addAttribute('MountPointID', $i); |
if ($dev->getFsType()!=="") { |
$mount->addAttribute('FSType', $dev->getFsType()); |
} |
if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType()); |
$mount->addAttribute('Name', $dev->getName()); |
$mount->addAttribute('Free', sprintf("%.0f", $dev->getFree())); |
$mount->addAttribute('Used', sprintf("%.0f", $dev->getUsed())); |
$mount->addAttribute('Total', sprintf("%.0f", $dev->getTotal())); |
$percentUsed = $dev->getPercentUsed(); |
$mount->addAttribute('Percent', $percentUsed); |
if ($dev->getPercentInodesUsed() !== null) { |
$mount->addAttribute('Inodes', $dev->getPercentInodesUsed()); |
} |
$mount->addAttribute('Percent', $dev->getPercentUsed()); |
if ($dev->getIgnore() > 0) $mount->addAttribute('Ignore', $dev->getIgnore()); |
if (PSI_SHOW_MOUNT_OPTION === true) { |
if ($dev->getOptions() !== null) { |
467,6 → 435,9 |
$mount->addAttribute('MountOptions', preg_replace("/,/", ", ", $dev->getOptions())); |
} |
} |
if ($dev->getPercentInodesUsed() !== null) { |
$mount->addAttribute('Inodes', $dev->getPercentInodesUsed()); |
} |
if (PSI_SHOW_MOUNT_POINT === true) { |
$mount->addAttribute('MountPoint', $dev->getMountPoint()); |
} |
479,7 → 450,7 |
*/ |
private function _buildFilesystems() |
{ |
$hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreTotal = $ignoreUsage = $ignoreThreshold = array(); |
$hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array(); |
$i = 1; |
if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) { |
if (preg_match(ARRAY_EXP, PSI_HIDE_MOUNTS)) { |
513,13 → 484,6 |
$ignoreFree = array(PSI_IGNORE_FREE); |
} |
} |
if (defined('PSI_IGNORE_TOTAL') && is_string(PSI_IGNORE_TOTAL)) { |
if (preg_match(ARRAY_EXP, PSI_IGNORE_TOTAL)) { |
$ignoreTotal = eval(PSI_IGNORE_TOTAL); |
} else { |
$ignoreTotal = array(PSI_IGNORE_TOTAL); |
} |
} |
if (defined('PSI_IGNORE_USAGE') && is_string(PSI_IGNORE_USAGE)) { |
if (preg_match(ARRAY_EXP, PSI_IGNORE_USAGE)) { |
$ignoreUsage = eval(PSI_IGNORE_USAGE); |
539,10 → 503,8 |
if (!in_array($disk->getMountPoint(), $hideMounts, true) && !in_array($disk->getFsType(), $hideFstypes, true) && !in_array($disk->getName(), $hideDisks, true)) { |
$mount = $fs->addChild('Mount'); |
if (in_array($disk->getFsType(), $ignoreThreshold, true)) { |
$disk->setIgnore(4); |
$disk->setIgnore(3); |
} elseif (in_array($disk->getMountPoint(), $ignoreUsage, true)) { |
$disk->setIgnore(3); |
} elseif (in_array($disk->getMountPoint(), $ignoreTotal, true)) { |
$disk->setIgnore(2); |
} elseif (in_array($disk->getMountPoint(), $ignoreFree, true)) { |
$disk->setIgnore(1); |
592,9 → 554,6 |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
} |
if ($dev->getUnit() !== "") { |
$item->addAttribute('Unit', $dev->getUnit()); |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
607,14 → 566,12 |
$item = $volt->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
if (($dev->getMin() === null) || ($dev->getMin() != 0) || ($dev->getMax() === null) || ($dev->getMax() != 0)) { |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
} |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
} |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
} |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
642,14 → 599,12 |
$item = $current->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
if (($dev->getMin() === null) || ($dev->getMin() != 0) || ($dev->getMax() === null) || ($dev->getMax() != 0)) { |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
} |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
} |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
} |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
662,9 → 617,6 |
$item = $other->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
if ($dev->getUnit() !== "") { |
$item->addAttribute('Unit', $dev->getUnit()); |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
746,7 → 698,7 |
*/ |
private function _buildXml() |
{ |
if (($this->_plugin == '') || $this->_complete_request) { |
if (!$this->_plugin_request || $this->_complete_request) { |
if ($this->_sys === null) { |
if (PSI_DEBUG === true) { |
// unstable version check |
809,23 → 761,20 |
private function _buildPlugins() |
{ |
$pluginroot = $this->_xml->addChild("Plugins"); |
if ((($this->_plugin != '') || $this->_complete_request) && count($this->_plugins) > 0) { |
if (($this->_plugin_request || $this->_complete_request) && count($this->_plugins) > 0) { |
$plugins = array(); |
if ($this->_complete_request) { |
$plugins = $this->_plugins; |
} |
if (($this->_plugin != '')) { |
if ($this->_plugin_request) { |
$plugins = array($this->_plugin); |
} |
foreach ($plugins as $plugin) { |
if (!$this->_complete_request || !defined('PSI_PLUGIN_'.strtoupper($plugin).'_WMI_HOSTNAME') || |
(defined('PSI_WMI_HOSTNAME') && (PSI_WMI_HOSTNAME == constant('PSI_PLUGIN_'.strtoupper($plugin).'_WMI_HOSTNAME')))) { |
$object = new $plugin($this->_sysinfo->getEncoding()); |
$object->execute(); |
$oxml = $object->xml(); |
if (sizeof($oxml) > 0) { |
$pluginroot->combinexml($oxml); |
} |
$object = new $plugin($this->_sysinfo->getEncoding()); |
$object->execute(); |
$oxml = $object->xml(); |
if (sizeof($oxml) > 0) { |
$pluginroot->combinexml($oxml); |
} |
} |
} |
866,7 → 815,7 |
$options->addAttribute('threshold', 90); |
} |
if (count($this->_plugins) > 0) { |
if (($this->_plugin != '')) { |
if ($this->_plugin_request) { |
$plug = $this->_xml->addChild('UsedPlugins'); |
$plug->addChild('Plugin')->addAttribute('name', $this->_plugin); |
} elseif ($this->_complete_request) { |
/web/acc/phpsysinfo/data/.htaccess |
---|
File deleted |
/web/acc/phpsysinfo/data/ModelTranslation.txt |
---|
31,8 → 31,6 |
iMac18,3:iMac Core i5/i7:Intel Core I5-7500/I5-7600/I5-7600K/I7-7700K |
iMac19,1:iMac Core i5/i9:Intel Core I5-8500/I5-8600/I5-9600K/I9-9900K |
iMac19,2:iMac Core i3/i5/i7:Intel Core I3-8100/I5-8500/I7-8700 |
iMac20,1:iMac Core i5/i7/i9:Intel Core I5-10500/I5-10600/I7-10700K/I9-10910 |
iMac20,2:iMac Core i7/i9:Intel Core I7-10700K/I9-10910 |
M43ADP1,1:Development Mac Pro:Intel Xeon X5340 |
MacBook1,1:MacBook Core Duo:Intel Core Duo T2400/T2500 |
MacBook2,1:MacBook Core 2 Duo:Intel Core 2 Duo T5600/T7200/T7400 |
58,8 → 56,6 |
MacBookAir7,1:MacBook Air Core i5/i7:Intel Core I5-5250U/I7-5650U |
MacBookAir7,2:MacBook Air Core i5/i7:Intel Core I5-5250U/I7-5650U |
MacBookAir8,1:MacBook Air Core i5:Intel Core I5-8210Y |
MacBookAir9,1:MacBook Air Core i3/i5/i7:Intel Core I3-1000NG4/I5-1030NG7/I7-1060NG7 |
MacBookAir10,1:MacBook Air M1:Apple M1 |
MacBookPro1,1:MacBook Pro Core Duo:Intel Core Duo L2400/T2400/T2500/T2600 |
MacBookPro1,2:MacBook Pro Core Duo:Intel Core Duo T2600 |
MacBookPro2,1:MacBook Pro Core 2 Duo:Intel Core 2 Duo T7600 |
98,10 → 94,6 |
MacBookPro15,3:MacBook Pro Core i7/i9:Intel Core I7-8850H/I9-8950HK/I9-9880H/I9-9980HK |
MacBookPro15,4:MacBook Pro Core i5/i7:Intel Core I5-8257U/I7-8557U |
MacBookPro16,1:MacBook Pro Core i7/i9:Intel Core I7-9750H/I9-9880H/I9-9980HK |
MacBookPro16,2:MacBook Pro Core i5/i7:Intel Core I5-1038NG7/I7-1068NG7 |
MacBookPro16,3:MacBook Pro Core i5/i7:Intel Core I5-8257U/I7-8557U |
MacBookPro16,4:MacBook Pro Core i7/i9:Intel Core I7-9750H/I9-9880H/I9-9980HK |
MacBookPro17,1:MacBook Pro M1:Apple M1 |
Macmini1,1:Mac mini Core Solo/Duo:Intel Core Duo T2300/T2400 Solo T1200 |
Macmini2,1:Mac mini Core 2 Duo:Intel Core 2 Duo T5600/T7200 |
Macmini3,1:Mac mini Core 2 Duo:Intel Core 2 Duo P7350/P8400/P7550/P8700/P8800 |
113,7 → 105,6 |
Macmini6,2:Mac mini Core i7:Intel Core I7-3615QM/I7-3720QM |
Macmini7,1:Mac mini Core i5/i7:Intel Core I5-4260U/I5-4278U/I5-4308U/I7-4578U |
Macmini8,1:Mac mini Core i3/i5/i7:Intel Core I3-8100/I5-8500B/I7-8700B |
Macmini9,1:Mac mini M1:Apple M1 |
MacPro1,1:Mac Pro Quad Core:Intel Xeon 5130/5150/5160 |
MacPro2,1:Mac Pro Eight Core:Intel Xeon X5365 |
MacPro3,1:Mac Pro Quad/Eight Core:Intel Xeon E5462/E5472/X5482 |
120,7 → 111,6 |
MacPro4,1:Mac Pro Quad/Eight Core:Intel Xeon E5520/E5550/X5570/W3520/W3540/W3580 |
MacPro5,1:Mac Pro Quad/Six/Eight/Twelve Core:Intel Xeon E5620/E5645/W3530/W3565/W3680/X5650/X5670/X5675 |
MacPro6,1:Mac Pro Quad/Six/Eight/Twelve Core:Intel Xeon E5-1620v2/E5-1650v2/E5-1680v2/E5-2697v2 |
MacPro7,1:Mac Pro Eight/12/16/24/28 Core:Intel Xeon W-3223/W-3235/W-3245/W-3265M/W-3275M |
PowerBook1,1:PowerBook G3:PowerPC 750 (G3) |
PowerBook2,1:iBook G3:PowerPC 750 (G3) |
PowerBook2,2:iBook G3:PowerPC 750cx (G3) |
/web/acc/phpsysinfo/data/cpus.ini |
---|
1,7 → 1,4 |
[cpu] |
; Ampere Computing |
;0xc0 |
; ARM Limited |
0x41,0x810="ARM810" |
0x41,0x920="ARM920" |
35,11 → 32,9 |
0x41,0xc20="Cortex-M7" |
0x41,0xc60="Cortex-M0+" |
0x41,0xd01="Cortex-A32" |
0x41,0xd02="Cortex-A34" |
0x41,0xd03="Cortex-A53" |
0x41,0xd04="Cortex-A35" |
0x41,0xd05="Cortex-A55" |
0x41,0xd06="Cortex-A65" |
0x41,0xd07="Cortex-A57" |
0x41,0xd08="Cortex-A72" |
0x41,0xd09="Cortex-A73" |
51,17 → 46,12 |
0x41,0xd13="Cortex-R52" |
0x41,0xd20="Cortex-M23" |
0x41,0xd21="Cortex-M33" |
0x41,0xd41="Cortex-A78" |
0x41,0xd43="Cortex-A65AE" |
0x41,0xd44="Cortex-X1" |
0x41,0xd4a="Neoverse E1" |
; Broadcom Corporation - ('B') cores. |
0x42,0xf="Brahma B15" |
0x42,0x100="Brahma B53" |
; Broadcom ('B') cores. |
0x42,0x516="Vulcan/ThunderX2 T99p1" |
; Cavium Inc. - ('C') cores. |
; Cavium ('C') cores. |
0x43,0x0a0="ThunderX" |
0x43,0x0a1="ThunderX T88" |
0x43,0x0a2="ThunderX T81" |
68,27 → 58,18 |
0x43,0x0a3="ThunderX T83" |
0x43,0x0af="ThunderX2 T99" |
; DEC - Digital Equipment Corporation |
; DEC |
0x44,0xa10="SA110" |
0x44,0xa11="SA1100" |
; Fujitsu Ltd. |
0x46,0x1="A64FX" |
; Infineon Technologies AG |
;0x49 |
; Motorola or Freescale Semiconductor Inc. |
;0x4d |
; NVIDIA Corporation |
; Nvidia |
0x4e,0x000="Denver" |
0x4e,0x003="Denver 2" |
; APM - Applied Micro Circuits Corporation - ('P') cores. |
; APM ('P') cores. |
0x50,0x000="xgene1" |
; Qualcomm Inc. - ('Q') cores. |
; Qualcomm ('Q') cores. |
0x51,0x00f="Scorpion" |
0x51,0x02d="Scorpion" |
0x51,0x04d="Krait" |
98,10 → 79,6 |
0x51,0x211="Kryo Silver" |
0x51,0x800="Kryo 260/280 Gold (Cortex-A73)" |
0x51,0x801="Kryo 260/280 Silver (Cortex-A53)" |
0x51,0x802="Kryo 385 Gold (Cortex-A75)" |
0x51,0x803="Kryo 385 Silver (Cortex-A55)" |
0x51,0x804="Kryo 485 Gold" |
0x51,0x805="Kryo 485 Silver" |
0x51,0xc00="Falkor" |
0x51,0xc01="Saphira" |
108,31 → 85,15 |
; Samsung ('S') cores. |
0x53,0x001="exynos-m1" |
; Texas Instruments |
; |
0x54,0x925="TI925" |
; Marvell Semiconductor Inc. |
; Marvell |
0x56,0x131="Feroceon 88FR131" |
0x56,0x581="PJ4/PJ4B" |
0x56,0x584="PJ4B-MP/PJ4C" |
; Apple Inc. |
0x61,0x1="Cyclone" |
0x61,0x2="Typhoon" |
0x61,0x3="Typhoon/Capri" |
0x61,0x4="Twister" |
0x61,0x5="Twister/Elba/Malta" |
0x61,0x6="Hurricane" |
0x61,0x7="Hurricane/Myst" |
; Faraday |
0x66,0x526="FA526" |
0x66,0x626="FA626" |
; HXT |
0x68,0x0="Phecda" |
;Intel Corporation/Marvell |
;Intel/Marvell |
0x69,0x200="i80200" |
0x69,0x210="PXA250A" |
0x69,0x212="PXA210A" |
158,8 → 119,8 |
[manufacturer] |
AMDisbetter="AMD" |
AuthenticAMD="AMD" |
CentaurHauls="IDT WinChip/Centaur" |
CyrixInstead="Cyrix/STMicro./IBM" |
CentaurHauls="Centaur" |
CyrixInstead="Cyrix" |
HygonGenuine="Hygon" |
GenuineIntel="Intel" |
TransmetaCPU="Transmeta" |
174,12 → 135,9 |
Vortex86SoC="Vortex" |
bhyvebhyve="bhyve" |
KVMKVMKVM="KVM" |
E2KMACHINE="MCST Elbrus" |
MicrosoftHv="Microsoft Hyper-V" |
lrpepyhvr="Parallels" |
VMwareVMware="VMware" |
XenVMMXenVMM="Xen HVM" |
ACRNACRNACRN="Project ACRN" |
TCGTCGTCGTCG="QEMU" |
QNXQVMBSQG="QNX Hypervisor" |
IBM/S390="IBM" |
/web/acc/phpsysinfo/data/distros.ini |
---|
81,12 → 81,6 |
Name = "4MLinux" |
Files = "/etc/4MLinux-version" |
[Milis Linux] |
Image = "Milis.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;not detected in "/etc/os-release" |
[Lunar Linux] |
Image = "Lunar.png" |
;detected in "/etc/lsb-release" |
127,32 → 121,6 |
Image = "Generations.png" |
;detected in "/etc/os-release" |
[MaboxLinux] |
Image = "Mabox.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;wrong in "/etc/os-release" |
;wrong in "/etc/manjaro-release" Manjaro |
;wrong in "/etc/arch-release" Manjaro |
[Netrunner] |
Image = "Netrunner.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[NetrunnerSE] |
Image = "Netrunner.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;wrong in "/etc/debian_version" Debian |
[Netrunner Rolling] |
Image = "Netrunner.png" |
;detected in "/etc/os-release" |
;wrong in "/etc/manjaro-release" Manjaro |
[Manjaro Linux] |
Image = "Manjaro.png" |
Files = "/etc/manjaro-release" |
231,13 → 199,6 |
Image = "PureOS.png" |
;detected in "/etc/os-release" |
[Septor] |
Image = "Septor.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[SalentOS] |
Image = "SalentOS.png" |
;detected in "lsb_release -a" |
359,17 → 320,6 |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[Uos] |
Image = "UOS.png" |
;detected in "lsb_release -a" |
;wrong in "/etc/debian_version" Debian |
[uos] |
Image = "UOS.png" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[LinuxDeepin] |
Image = "Deepin.png" |
;detected in "lsb_release -a" |
452,6 → 402,24 |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[Netrunner] |
Image = "Netrunner.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[NetrunnerSE] |
Image = "Netrunner.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;wrong in "/etc/debian_version" Debian |
[Netrunner Rolling] |
Image = "Netrunner.png" |
;detected in "/etc/os-release" |
;wrong in "/etc/manjaro-release" Manjaro |
[Peppermint] |
Image = "Peppermint.png" |
;detected in "lsb_release -a" |
/web/acc/phpsysinfo/data/osnames.ini |
---|
24,7 → 24,7 |
8.1="Oreo" |
9.0="Pie" |
[macOS] |
[OS X] |
10.0="Cheetah" |
10.1="Puma" |
10.2="Jaguar" |
41,4 → 41,3 |
10.13="High Sierra" |
10.14="Mojave" |
10.15="Catalina" |
11="Big Sur" |
/web/acc/phpsysinfo/CHANGELOG.md |
---|
3,32 → 3,6 |
http://phpsysinfo.sourceforge.net/ |
phpSysInfo 3.3.4 |
---------------- |
- [FIX] Fixed display in static mode |
phpSysInfo 3.3.3 |
---------------- |
- [ADD] Persian (Farsi) Translation fa.xml |
- [ADD] Croatian Translation hr.xml |
- [ADD] Mabox, Milis, FreeNAS, UOS and Septor to detected distros |
- [ADD] SMART plugin - reading contents of wmic command for WinNT |
- [ADD] Raid plugin - 3ware-status status |
- [ADD] IPMIcfg sensor program support |
- [NEW] Ability to read information from an external WinNT server (new WMI_HOSTNAME, WMI_USER and WMI_PASSWORD parameters) |
- [NEW] NvidiaSMI - sensors monitoring for Nvidia GPU |
- [NEW] plugin Viewer - show output of any command or file viewer.txt contents |
- [NEW] Memory chips information |
- [NEW] USB devices speed info on Linux |
- [NEW] IGNORE_TOTAL option |
- [NEW] HIDE_TOTALS option |
- [NEW] INCREASE_WIDTH option for frontend "dynamic" |
- [DEL] Removed deprecated plugin Iptables |
phpSysInfo 3.3.2 |
---------------- |
36,7 → 10,6 |
- [ADD] Exherbo and EasyOS to detected distros |
- [ADD] PCI devices list on SunOS |
- [ADD] Raid plugin - megaclisas-status status |
- [NEW] OS Type information |
- [NEW] CPU manufacturer information |
/web/acc/phpsysinfo/README.md |
---|
5,7 → 5,7 |
* Copyright (c), 1999-2009, Michael Cramer ([sf.net/users/bigmichi1](https://sf.net/users/bigmichi1)) |
* Copyright (c), 2007-2008, Audun Larsen ([sf.net/users/xqus](https://sf.net/users/xqus)) |
* Copyright (c), 2007-2015, Erkan Valentin ([github.com/rk4an](https://github.com/rk4an), [sf.net/users/jacky672](https://sf.net/users/jacky672)) |
* Copyright (c), 2009-2021, Mieczyslaw Nalewaj ([github.com/namiltd](https://github.com/namiltd), [sf.net/users/namiltd](https://sf.net/users/namiltd)) |
* Copyright (c), 2009-2020, Mieczyslaw Nalewaj ([github.com/namiltd](https://github.com/namiltd), [sf.net/users/namiltd](https://sf.net/users/namiltd)) |
* Copyright (c), 2010-2012, Damien Roth ([sf.net/users/iysaak](https://sf.net/users/iysaak)) |
/web/acc/phpsysinfo/read_config.php |
---|
3,7 → 3,7 |
/** |
* phpSysInfo version |
*/ |
define('PSI_VERSION', '3.3.4'); |
define('PSI_VERSION', '3.3.2'); |
/** |
* phpSysInfo configuration |
*/ |
108,7 → 108,6 |
|| file_exists($fname = '/etc/locale.conf') |
|| file_exists($fname = '/etc/sysconfig/language') |
|| file_exists($fname = '/etc/profile.d/lang.sh') |
|| file_exists($fname = '/etc/profile.d/i18n.sh') |
|| file_exists($fname = '/etc/profile')) { |
$contents = @file_get_contents($fname); |
} else { |
115,8 → 114,8 |
$contents = false; |
if (file_exists('/system/build.prop')) { //Android |
define('PSI_OS', 'Android'); |
if (function_exists('exec') && @exec('uname -o 2>/dev/null', $unameo) && (sizeof($unameo)>0) && (($unameo0 = trim($unameo[0])) != "")) { |
define('PSI_UNAMEO', $unameo0); // is Android on Termux |
if (@exec('uname -o 2>/dev/null', $unameo) && (sizeof($unameo)>0) && (($unameo0 = trim($unameo[0])) != "")) { |
define('PSI_UNAMEO', $unameo0); |
} |
if (!defined('PSI_MODE_POPEN')) { //if not overloaded in phpsysinfo.ini |
if (!function_exists("proc_open")) { //proc_open function test by executing 'pwd' command |
173,7 → 172,7 |
if (file_exists($vtfname = '/sys/module/vt/parameters/default_utf8') |
&& (trim(@file_get_contents($vtfname)) === "1")) { |
define('PSI_SYSTEM_CODEPAGE', 'UTF-8'); |
} elseif (function_exists('exec') && @exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) { //if not overloaded in phpsysinfo.ini |
} elseif (@exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) { //if not overloaded in phpsysinfo.ini |
foreach ($lines as $line) { |
if (preg_match('/^charmap="?([^"]*)/', $line, $matches2)) { |
define('PSI_SYSTEM_CODEPAGE', $matches2[1]); |
182,7 → 181,7 |
} |
} |
} |
if (!defined('PSI_SYSTEM_LANG') && function_exists('exec') && @exec($matches[1].' locale 2>/dev/null', $lines2)) { //also if not overloaded in phpsysinfo.ini |
if (!defined('PSI_SYSTEM_LANG') && @exec($matches[1].' locale 2>/dev/null', $lines2)) { //also if not overloaded in phpsysinfo.ini |
foreach ($lines2 as $line) { |
if (preg_match('/^LC_MESSAGES="?([^\."@]*)/', $line, $matches2)) { |
$lang = ""; |
202,7 → 201,7 |
} |
} elseif (PHP_OS == 'Haiku') { |
if (!(defined('PSI_SYSTEM_CODEPAGE') && defined('PSI_SYSTEM_LANG')) //also if both not overloaded in phpsysinfo.ini |
&& function_exists('exec') && @exec('locale --message 2>/dev/null', $lines)) { |
&& @exec('locale -m 2>/dev/null', $lines)) { |
foreach ($lines as $line) { |
if (preg_match('/^"?([^\."]*)\.?([^"]*)/', $line, $matches2)) { |
228,7 → 227,7 |
} |
} elseif (PHP_OS == 'Darwin') { |
if (!defined('PSI_SYSTEM_LANG') //if not overloaded in phpsysinfo.ini |
&& function_exists('exec') && @exec('defaults read /Library/Preferences/.GlobalPreferences AppleLocale 2>/dev/null', $lines)) { |
&& @exec('defaults read /Library/Preferences/.GlobalPreferences AppleLocale 2>/dev/null', $lines)) { |
$lang = ""; |
if (is_readable(PSI_APP_ROOT.'/data/languages.ini') && ($langdata = @parse_ini_file(PSI_APP_ROOT.'/data/languages.ini', true))) { |
if (isset($langdata['Linux']['_'.$lines[0]])) { |
243,13 → 242,6 |
} |
} |
/* maximum time in seconds a script is allowed to run before it is terminated by the parser */ |
if (defined('PSI_MAX_TIMEOUT')) { |
ini_set('max_execution_time', max(intval(PSI_MAX_TIMEOUT), 0)); |
} else { |
ini_set('max_execution_time', 30); |
} |
/* executeProgram() timeout value in seconds */ |
if (defined('PSI_EXEC_TIMEOUT')) { |
define('PSI_EXEC_TIMEOUT_INT', max(intval(PSI_EXEC_TIMEOUT), 1)); |
283,7 → 275,7 |
define('PSI_SYSTEM_CODEPAGE', 'UTF-8'); |
} elseif (PSI_OS=='Minix') { |
define('PSI_SYSTEM_CODEPAGE', 'CP437'); |
} elseif (PSI_OS!='WINNT') { |
} else { |
define('PSI_SYSTEM_CODEPAGE', null); |
} |
} |