/web/acc/phpsysinfo/CHANGELOG.md |
---|
3,26 → 3,6 |
http://phpsysinfo.sourceforge.net/ |
phpSysInfo 3.4.1 |
---------------- |
- [ADD] Linuxfx, EndeavourOS, Garuda, Arco and Artix Linux to detected distros |
- [FIX] Fixed sensors voltages |
- [UPD] UpdateNotifier plugin - compatibility with newer data formats |
phpSysInfo 3.4.0 |
---------------- |
- [ADD] Omarine, NethServer, JingOS, KDE neon, Alma, Virtuozzo, EuroLinux and Rocky Linux to detected distros |
- [NEW] HIDE_NETWORK_INTERFACE_REGEX option to use a regular expression in the name of a hidden network interface |
- [NEW] Ability to read UPS information from a file |
- [NEW] Virtualizer detection on Linux, Android, FreeBSD, NetBSD, OpenBSD and WinNT |
- [NEW] ROOTFS option to set root path of the system |
- [UPD] Changed all data file extensions from .txt to .tmp |
- [UPD] Sensor CoreTemp renamed to CpuMem and extended to read the CPU and memory supply voltages |
phpSysInfo 3.3.4 |
---------------- |
/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-2022, Mieczyslaw Nalewaj ([github.com/namiltd](https://github.com/namiltd), [sf.net/users/namiltd](https://sf.net/users/namiltd)) |
* Copyright (c), 2009-2021, 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)) |
30,7 → 30,7 |
- DragonFly |
- HP-UX |
- Darwin / Mac OS / OS X |
- Windows 2000 / XP / 2003 / Vista / 2008 / 7 / 2011 / 2012 / 8 / 8.1 / 10 / 10 IoT / 2016 / 2019 / 2022 / 11 |
- Windows 2000 / XP / 2003 / Vista / 2008 / 7 / 2011 / 2012 / 8 / 8.1 / 10 / 2016 / 2019 |
- Android |
#### Platforms currently in progress: |
69,7 → 69,7 |
#### Docker container installation |
- `sudo docker build -t phpsysinfo github.com/phpsysinfo/phpsysinfo#main` |
- `sudo docker build -t phpsysinfo github.com/phpsysinfo/phpsysinfo` |
- `sudo docker run -i -p 8080:80 -t phpsysinfo` |
- go to http://localhost:8080/phpsysinfo/ |
/web/acc/phpsysinfo/data/.htaccess |
---|
1,4 → 1,3 |
# Deny all requests from Apache 2.0-2.2 |
<IfModule !mod_authz_core.c> |
order deny,allow |
deny from all |
/web/acc/phpsysinfo/data/ModelTranslation.txt |
---|
33,8 → 33,6 |
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 |
iMac21,1:MacBook Air M1:Apple M1 |
iMac21,2:MacBook Air M1:Apple M1 |
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 |
104,10 → 102,6 |
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 |
MacBookPro18,1:MacBook Pro M1 Pro:Apple M1 Pro |
MacBookPro18,2:MacBook Pro M1 Max:Apple M1 Max |
MacBookPro18,3:MacBook Pro M1 Pro:Apple M1 Pro |
MacBookPro18,4:MacBook Pro M1 Max:Apple M1 Max |
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 |
/web/acc/phpsysinfo/data/cpus.ini |
---|
1,7 → 1,4 |
[cpu] |
; Qemu |
0x0,0x51="QEMU TCG" |
; Ampere Computing |
;0xc0 |
52,21 → 49,12 |
0x41,0xd0d="Cortex-A77" |
0x41,0xd0e="Cortex-A76AE" |
0x41,0xd13="Cortex-R52" |
0x41,0xd15="Cortex-R82" |
0x41,0xd20="Cortex-M23" |
0x41,0xd21="Cortex-M33" |
0x41,0xd22="Cortex-M55" |
0x41,0xd40="Neoverse V1" |
0x41,0xd41="Cortex-A78" |
0x41,0xd42="Cortex-A78AE" |
0x41,0xd43="Cortex-A65AE" |
0x41,0xd44="Cortex-X1" |
0x41,0xd46="Cortex-A510" |
0x41,0xd47="Cortex-A710" |
0x41,0xd48="Cortex-X2" |
0x41,0xd49="Neoverse N2" |
0x41,0xd4a="Neoverse E1" |
0x41,0xd4b="Cortex-A78C" |
; Broadcom Corporation - ('B') cores. |
0x42,0xf="Brahma B15" |
74,18 → 62,11 |
0x42,0x516="Vulcan/ThunderX2 T99p1" |
; Cavium Inc. - ('C') cores. |
0x43,0xa0="ThunderX" |
0x43,0xa1="ThunderX T88" |
0x43,0xa2="Octeon TX T81" |
0x43,0xa3="Octeon TX T83" |
0x43,0xaf="ThunderX2 T99" |
0x43,0xb0="Octeon TX2" |
0x43,0xb1="Octeon TX2 T98" |
0x43,0xb2="Octeon TX2 T93/T96" |
0x43,0xb3="Octeon TX2 F95" |
0x43,0xb4="Octeon TX2 F95N" |
0x43,0xb5="Octeon TX2 F95MM" |
0x43,0xb8="ThunderX3 T110" |
0x43,0x0a0="ThunderX" |
0x43,0x0a1="ThunderX T88" |
0x43,0x0a2="ThunderX T81" |
0x43,0x0a3="ThunderX T83" |
0x43,0x0af="ThunderX2 T99" |
; DEC - Digital Equipment Corporation |
0x44,0xa10="SA110" |
94,10 → 75,6 |
; Fujitsu Ltd. |
0x46,0x1="A64FX" |
; HiSilicon Technologies, Inc. |
0x48,0xd01="TSV110" |
0x48,0xd40="Cortex-A76" |
; Infineon Technologies AG |
;0x49 |
105,36 → 82,31 |
;0x4d |
; NVIDIA Corporation |
0x4e,0x0="Denver" |
0x4e,0x3="Denver 2" |
0x4e,0x000="Denver" |
0x4e,0x003="Denver 2" |
; APM - Applied Micro Circuits Corporation - ('P') cores. |
0x50,0x0="xgene1" |
0x50,0x000="xgene1" |
; Qualcomm Inc. - ('Q') cores. |
0x51,0xf="Scorpion" |
0x51,0x2d="Scorpion" |
0x51,0x4d="Krait" |
0x51,0x6f="Krait" |
0x51,0x00f="Scorpion" |
0x51,0x02d="Scorpion" |
0x51,0x04d="Krait" |
0x51,0x06f="Krait" |
0x51,0x201="Kryo Silver" |
0x51,0x205="Kryo Gold" |
0x51,0x211="Kryo Silver" |
0x51,0x800="Kryo 2xx Gold (Cortex-A73)" |
0x51,0x801="Kryo 2xx Silver (Cortex-A53)" |
0x51,0x802="Kryo 3xx Gold (Cortex-A75)" |
0x51,0x803="Kryo 3xx Silver (Cortex-A55)" |
0x51,0x804="Kryo 4xx Gold (Cortex-A76)" |
0x51,0x805="Kryo 4xx/5xx Silver (Cortex-A55)" |
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" |
; Samsung ('S') cores. |
0x53,0x1="Exynos M1/M2 Mongoose" |
0x53,0x1,0x1="Exynos M1 Mongoose" |
0x53,0x1,0x4="Exynos M2 Mongoose" |
0x53,0x2="Exynos M3 Mongoose" |
0x53,0x3="Exynos M4 Mongoose" |
0x53,0x4="Exynos M5 Mongoose" |
0x53,0x001="exynos-m1" |
; Texas Instruments |
0x54,0x925="TI925" |
199,11 → 171,10 |
Shanghai="Zhaoxin" |
UMCUMCUMC="UMC" |
VIAVIAVIA="VIA" |
Vortex86SoC="DM&P Vortex" |
E2KMACHINE="MCST Elbrus" |
GenuineAO486="ao486 soft CPU" |
Vortex86SoC="Vortex" |
bhyvebhyve="bhyve" |
KVMKVMKVM="KVM" |
E2KMACHINE="MCST Elbrus" |
MicrosoftHv="Microsoft Hyper-V" |
lrpepyhvr="Parallels" |
VMwareVMware="VMware" |
211,6 → 182,4 |
ACRNACRNACRN="Project ACRN" |
TCGTCGTCGTCG="QEMU" |
QNXQVMBSQG="QNX Hypervisor" |
UnisysSpar64="Unisys sPar" |
VBoxVBoxVBox="Oracle VM VirtualBox" |
IBM/S390="IBM" |
/web/acc/phpsysinfo/data/distros.ini |
---|
97,11 → 97,6 |
Mode = "Execute" |
Files = "/usr/bin/crux" |
[Omarine] |
Image = "Omarine.png" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
[Foresight] |
Image = "Foresight.png" |
;detected in "/etc/distro-release" |
132,50 → 127,13 |
Image = "Generations.png" |
;detected in "/etc/os-release" |
[Artix] |
Image = "Artix.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
[Artix Linux] |
Image = "Artix.png" |
Files = "/etc/artix-release" |
Mode = "Detection" |
;detected in "/etc/os-release" |
[EndeavourOS] |
Image = "EndeavourOS.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/arch-release" Arch |
[ArcoLinux] |
Image = "Arco.png" |
Files = "/etc/arcolinux-release" |
Mode = "Detection" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/arch-release" Arch |
[Garuda] |
Image = "Garuda.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;wrong in "/etc/arch-release" Arch |
[Garuda Linux] |
Image = "Garuda.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" Manjaro |
;wrong in "/etc/os-release" |
;wrong in "/etc/manjaro-release" Manjaro |
;wrong in "/etc/arch-release" Arch |
;wrong in "/etc/arch-release" Manjaro |
[Netrunner] |
Image = "Netrunner.png" |
195,46 → 153,37 |
;detected in "/etc/os-release" |
;wrong in "/etc/manjaro-release" Manjaro |
[ManjaroLinux] |
Image = "Manjaro.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
[Manjaro Linux] |
Image = "Manjaro.png" |
Files = "/etc/manjaro-release" |
;detected in "/etc/os-release" |
[Manjaro-ARM] |
[ManjaroLinux] |
Image = "Manjaro.png" |
Name = "Manjaro ARM" |
Files = "/etc/manjaro-arm-version" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
[void] |
Image = "Void.png" |
;detected in "/etc/os-release" |
;wrong in "/etc/arch-release" Arch |
[VoidLinux] |
Image = "Void.png" |
;detected in "lsb_release -a"" |
[void] |
Image = "Void.png" |
[Arch Linux ARM] |
Image = "Arch.png" |
;detected in "/etc/os-release" |
[Arch] |
Image = "Arch.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
[Arch Linux] |
Image = "Arch.png" |
Files = "/etc/arch-release" |
;detected in "/etc/os-release" |
[Arch Linux ARM] |
[Arch] |
Image = "Arch.png" |
;detected in "/etc/os-release" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
[Cobalt] |
Image = "Cobalt.png" |
448,37 → 397,6 |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[Elementary] |
Image = "elementaryOS.png" |
;detected in "lsb_release -a" |
;wrong in "/etc/debian_version" Debian |
[JingOS] |
Image = "JingOS.png" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[Jingos] |
Image = "JingOS.png" |
;detected in "lsb_release -a" |
[jingos] |
Image = "JingOS.png" |
;detected in "/etc/lsb-release" |
[KDE neon] |
Image = "KDEneon.png" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[KDE] |
Image = "KDEneon.png" |
;detected in "lsb_release -a" |
[neon] |
Image = "KDEneon.png" |
;detected in "/etc/lsb-release" |
[PearLinux] |
Image = "Pear.png" |
;detected in "lsb_release -a" |
493,13 → 411,6 |
;wrong in "/etc/os-release" Ubuntu |
;wrong in "/etc/debian_version" Debian |
[pearOS] |
Image = "Pear.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[PearOS] |
Image = "Pear.png" |
;detected in "lsb_release -a" |
548,18 → 459,6 |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[Linuxfx] |
Image = "Linuxfx.png" |
Name="Linuxfx" |
Files = "/etc/fx.version" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/debian_version" Debian |
[Ubuntu Linuxfx] |
Image = "Linuxfx.png" |
;detected in "lsb_release -a" |
[Ubuntu] |
Image = "Ubuntu.png" |
;detected in "lsb_release -a" |
680,10 → 579,6 |
Image = "Amazon.png" |
;detected in "lsb_release -a" |
[Amazon Linux AMI] |
Image = "Amazon.png" |
;detected in /etc/os-release |
[RedFlag] |
Image = "RedFlag.png" |
Files = "/etc/redflag-release" |
725,10 → 620,6 |
Image = "Pisi.png" |
;detected in "/etc/system-release" |
[Springdale Linux] |
Image = "Springdale.png" |
;detected in "/etc/os-release" |
[Springdale] |
Image = "Springdale.png" |
Files = "/etc/PU_IAS-release;/etc/puias-release;/etc/springdale-release" |
736,14 → 627,6 |
;detected in "/etc/redhat-release" |
;detected in "/etc/system-release" |
[NethServer] |
Image = "NethServer.png" |
Files = "/etc/nethserver-release" |
;detected in "/etc/os-release" |
;wrong in "/etc/centos-release" CentOS |
;wrong in "/etc/redhat-release" CentOS |
;wrong in "/etc/system-release" CentOS |
[SME] |
Image = "SMEServer.png" |
Files = "/etc/e-smith-release" |
797,50 → 680,7 |
;detected in "/etc/redhat-release" |
;detected in "/etc/system-release" |
[AlmaLinux] |
Image = "Alma.png" |
Files = "/etc/almalinux-release" |
;detected in "lsb_release -a" |
;wrong in "/etc/centos-release" CentOS |
;detected in "/etc/os-release" |
;detected in "/etc/redhat-release" |
;detected in "/etc/system-release" |
[Virtuozzo Linux] |
Image = "Virtuozzo.png" |
;detected in "/etc/os-release" |
[Virtuozzo] |
Image = "Virtuozzo.png" |
Files = "/etc/vzlinux-release" |
;detected in "lsb_release -a" |
;detected in "/etc/redhat-release" |
;detected in "/etc/system-release" |
[Rocky Linux] |
Image = "Rocky.png" |
;detected in "/etc/os-release" |
[Rocky] |
Image = "Rocky.png" |
Files = "/etc/rocky-release" |
;detected in "lsb_release -a" |
;detected in "/etc/redhat-release" |
;detected in "/etc/system-release" |
[EuroLinux] |
Image = "EuroLinux.png" |
Files = "/etc/el-release" |
;detected in "lsb_release -a" |
;detected in "/etc/os-release" |
;detected in "/etc/redhat-release" |
;detected in "/etc/system-release" |
[CentOS Linux] |
Image = "CentOS.png" |
;detected in "/etc/os-release" |
; at the end because some distros may also have the same files (like SMEServer, AlmaLinux, NethServer) |
; at the end because some distros may also have the same files (like SMEServer) |
[CentOS] |
Image = "CentOS.png" |
Files = "/etc/centos-release" |
1037,27 → 877,11 |
Image = "openSUSE.png" |
;detected in "/etc/os-release" |
[openSUSE Tumbleweed] |
Image = "openSUSE.png" |
;detected in "/etc/os-release" |
[openSUSE project] |
Image = "openSUSE.png" |
;detected in "lsb_release -a" |
[SUSE LINUX openSUSE] |
Image = "openSUSE.png" |
;detected in "lsb_release -a" |
[SUSE] |
Image = "SUSE.png" |
;detected in "/etc/SuSE-release" |
[SLES] |
Image = "SUSE.png" |
;detected in "/etc/os-release" |
; at the end because some distros may also have the same files (like openSUSE, SUSE) |
; at the end because some distros may also have the same files (like openSUSE) |
[SUSE LINUX] |
Image = "SUSE.png" |
Mode = "Analyse" |
1182,7 → 1006,7 |
Mode = "Analyse" |
Files = "/etc/mandrake-release;/etc/mandrakelinux-release" |
; at the end because some distros may also have the same files (like SMEServer, Fuduntu, ALT, VortexBox, Qubes, Korora, Fedora, CentOS, Oracle, Scientific, CloudLinux, Mandrake, MandrivaLinux, Mageia, PCLinuxOS, ROSA, OpenMandriva, HipServ, NeoKylin, Springdale, Rocky, EuroLinux, AlmaLinux, Virtuozzo, NethServer) |
; at the end because some distros may also have the same files (like SMEServer, Fuduntu, ALT, VortexBox, Qubes, Korora, Fedora, CentOS, Oracle, Scientific, CloudLinux, Mandrake, MandrivaLinux, Mageia, PCLinuxOS, ROSA, OpenMandriva, HipServ, NeoKylin, Springdale) |
[RedHat] |
Image = "RedHat.png" |
Mode = "Analyse" |
1189,10 → 1013,6 |
Files = "/etc/redhat-release;/etc/redhat_version" |
;detected in "/etc/system-release" |
[Red Hat Enterprise Linux Server] |
Image = "RedHat.png" |
;detected in "/etc/os-release" |
[Red Hat Enterprise Linux Everything] |
Image = "RedHat.png" |
;detected in "/etc/os-release" |
/web/acc/phpsysinfo/data/osnames.ini |
---|
42,21 → 42,3 |
10.14="Mojave" |
10.15="Catalina" |
11="Big Sur" |
12="Monterey" |
[win10] |
10240="1507" |
10586="1511" |
14393="1607" |
15063="1703" |
16299="1709" |
17134="1803" |
17763="1809" |
18362="1903" |
18363="1909" |
19041="2004" |
19042="20H2" |
19043="21H1" |
19044="21H2" |
21996="leaked" |
22000="21H2" |
/web/acc/phpsysinfo/data/raspberry.ini |
---|
33,8 → 33,6 |
14="3 A+" |
16="Compute Module 3+" |
17="4 B" |
19="400" |
20="Compute Module 4" |
[manufacturer] |
0="Sony UK" |
/web/acc/phpsysinfo/gfx/images/Rocky.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/NethServer.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/JingOS.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/Virtuozzo.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/Alma.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/Omarine.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/EndeavourOS.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/EuroLinux.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/Win11.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/Garuda.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/Arco.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/Linuxfx.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/KDEneon.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/Artix.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/includes/class.CommonFunctions.inc.php |
---|
26,12 → 26,48 |
class CommonFunctions |
{ |
/** |
* holds dmi memory data |
* holds codepage for chcp |
* |
* @var array |
* @var integer |
*/ |
private static $_dmimd = null; |
private static $_cp = null; |
/** |
* value of checking run as administrator |
* |
* @var boolean |
*/ |
private static $_asadmin = null; |
public static function setcp($cp) |
{ |
self::$_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)=="+"))) { |
141,7 → 177,7 |
continue; |
} |
$strProgrammpath = $strPathS.$strProgram; |
if (is_executable($strProgrammpath) || ((PSI_OS == 'WINNT') && (strtolower($path_parts['extension']) == 'py') && is_file($strProgrammpath))) { |
if (is_executable($strProgrammpath) || ((PSI_OS == 'WINNT') && (strtolower($path_parts['extension']) == 'py'))) { |
return $strProgrammpath; |
} |
} |
159,7 → 195,7 |
* @param string $strArgs arguments to the program |
* @param string &$strBuffer output of the command |
* @param boolean $booErrorRep en- or disables the reporting of errors which should be logged |
* @param int $timeout timeout value in seconds (default value is PSI_EXEC_TIMEOUT_INT) |
* @param integer $timeout timeout value in seconds (default value is PSI_EXEC_TIMEOUT_INT) |
* |
* @return boolean command successfull or not |
*/ |
180,11 → 216,6 |
} |
} |
if (PSI_ROOT_FILESYSTEM !== '') { // disabled if ROOTFS defined |
return false; |
} |
if ((PSI_OS != 'WINNT') && preg_match('/^([^=]+=[^ \t]+)[ \t]+(.*)$/', $strProgramname, $strmatch)) { |
$strSet = $strmatch[1].' '; |
$strProgramname = $strmatch[2]; |
250,7 → 281,7 |
$strError = ''; |
$pipes = array(); |
$descriptorspec = array(0=>array("pipe", "r"), 1=>array("pipe", "w"), 2=>array("pipe", "w")); |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) { |
if (PSI_OS == 'WINNT') { |
$process = $pipes[1] = popen($strSet.$strProgram.$strArgs." 2>nul", "r"); |
} else { |
261,7 → 292,7 |
} |
if (is_resource($process)) { |
$te = self::_timeoutfgets($pipes, $strBuffer, $strError, $timeout); |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) { |
$return_value = pclose($pipes[1]); |
} else { |
fclose($pipes[0]); |
351,8 → 382,8 |
* |
* @param string $strFileName name of the file which should be read |
* @param string &$strRet content of the file (reference) |
* @param int $intLines control how many lines should be read |
* @param int $intBytes control how many bytes of each line should be read |
* @param integer $intLines control how many lines should be read |
* @param integer $intBytes control how many bytes of each line should be read |
* @param boolean $booErrorRep en- or disables the reporting of errors which should be logged |
* |
* @return boolean command successfull or not |
374,18 → 405,12 |
} |
} |
if (PSI_ROOT_FILESYSTEM !== '') { |
$rfsinfo = "[".PSI_ROOT_FILESYSTEM."]"; |
} else { |
$rfsinfo = ''; |
} |
$strFile = ""; |
$intCurLine = 1; |
$error = PSI_Error::singleton(); |
if (file_exists(PSI_ROOT_FILESYSTEM.$strFileName)) { |
if (is_readable(PSI_ROOT_FILESYSTEM.$strFileName)) { |
if ($fd = fopen(PSI_ROOT_FILESYSTEM.$strFileName, 'r')) { |
if (file_exists($strFileName)) { |
if (is_readable($strFileName)) { |
if ($fd = fopen($strFileName, 'r')) { |
while (!feof($fd)) { |
$strFile .= fgets($fd, $intBytes); |
if ($intLines <= $intCurLine && $intLines != 0) { |
405,7 → 430,7 |
} |
} else { |
if ($booErrorRep) { |
$error->addError('fopen('.$rfsinfo.$strFileName.')', 'file can not read by phpsysinfo'); |
$error->addError('fopen('.$strFileName.')', 'file can not read by phpsysinfo'); |
} |
return false; |
412,7 → 437,7 |
} |
} else { |
if ($booErrorRep) { |
$error->addError('fopen('.$rfsinfo.$strFileName.')', 'file permission error'); |
$error->addError('fopen('.$strFileName.')', 'file permission error'); |
} |
return false; |
419,7 → 444,7 |
} |
} else { |
if ($booErrorRep) { |
$error->addError('file_exists('.$rfsinfo.$strFileName.')', 'the file does not exist on your machine'); |
$error->addError('file_exists('.$strFileName.')', 'the file does not exist on your machine'); |
} |
return false; |
429,72 → 454,6 |
} |
/** |
* read a data file and return the content as a string |
* |
* @param string $strDataFileName name of the data file which should be read |
* @param string &$strRet content of the data file (reference) |
* |
* @return boolean command successfull or not |
*/ |
public static function rftsdata($strDataFileName, &$strRet) |
{ |
$strFile = ""; |
$strFileName = PSI_APP_ROOT."/data/".$strDataFileName; |
$error = PSI_Error::singleton(); |
if (file_exists($strFileName)) { |
if (is_readable($strFileName)) { |
if ($fd = fopen($strFileName, 'r')) { |
while (!feof($fd)) { |
$strFile .= fgets($fd, 4096); |
} |
fclose($fd); |
$strRet = $strFile; |
} else { |
$error->addError('fopen('.$strFileName.')', 'file can not read by phpsysinfo'); |
return false; |
} |
} else { |
$error->addError('fopen('.$strFileName.')', 'file permission error'); |
return false; |
} |
} else { |
$error->addError('file_exists('.$strFileName.')', 'the file does not exist on your machine'); |
return false; |
} |
return true; |
} |
/** |
* Find pathnames matching a pattern |
* |
* @param string $pattern the pattern. No tilde expansion or parameter substitution is done. |
* @param int $flags |
* |
* @return an array containing the matched files/directories, an empty array if no file matched or false on error |
*/ |
public static function findglob($pattern, $flags = 0) |
{ |
$outarr = glob(PSI_ROOT_FILESYSTEM.$pattern, $flags); |
if (PSI_ROOT_FILESYSTEM == '') { |
return $outarr; |
} elseif ($outarr === false) { |
return false; |
} else { |
$len = strlen(PSI_ROOT_FILESYSTEM); |
$newoutarr = array(); |
foreach ($outarr as $out) { |
$newoutarr[] = substr($out, $len); // path without ROOTFS |
} |
return $newoutarr; |
} |
} |
/** |
* file exists |
* |
* @param string $strFileName name of the file which should be check |
516,7 → 475,7 |
} |
} |
$exists = file_exists(PSI_ROOT_FILESYSTEM.$strFileName); |
$exists = file_exists($strFileName); |
if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && (substr(PSI_LOG, 0, 1)!="-") && (substr(PSI_LOG, 0, 1)!="+")) { |
if ((substr($strFileName, 0, 5) === "/dev/") && $exists) { |
error_log("---".gmdate('r T')."--- Reading: ".$strFileName."\ndevice exists\n", 3, PSI_LOG); |
575,7 → 534,7 |
*/ |
public static function checkForExtensions($arrExt = array()) |
{ |
if (defined('PSI_SYSTEM_CODEPAGE') && (PSI_SYSTEM_CODEPAGE !== null) && ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0))) |
if (defined('PSI_SYSTEM_CODEPAGE') && ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0))) |
$arrReq = array('simplexml', 'pcre', 'xml', 'dom'); |
elseif (PSI_OS == 'WINNT') |
$arrReq = array('simplexml', 'pcre', 'xml', 'dom', 'mbstring', 'com_dotnet'); |
597,7 → 556,7 |
$text .= " </Error>\n"; |
$text .= "</phpsysinfo>"; |
if ($error) { |
header('Content-Type: text/xml'); |
header("Content-Type: text/xml\n\n"); |
echo $text; |
die(); |
} |
606,10 → 565,10 |
/** |
* get the content of stdout/stderr with the option to set a timeout for reading |
* |
* @param array $pipes array of file pointers for stdin, stdout, stderr (proc_open()) |
* @param string &$out target string for the output message (reference) |
* @param string &$err target string for the error message (reference) |
* @param int $timeout timeout value in seconds |
* @param array $pipes array of file pointers for stdin, stdout, stderr (proc_open()) |
* @param string &$out target string for the output message (reference) |
* @param string &$err target string for the error message (reference) |
* @param integer $timeout timeout value in seconds |
* |
* @return boolean timeout expired or not |
*/ |
619,7 → 578,7 |
$e = null; |
$te = false; |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) { |
$pipe2 = false; |
} else { |
$pipe2 = true; |
655,6 → 614,96 |
} |
/** |
* function for getting a list of values in the specified context |
* optionally filter this list, based on the list from third parameter |
* |
* @param $wmi object holds the COM object that we pull the WMI data from |
* @param string $strClass name of the class where the values are stored |
* @param array $strValue filter out only needed values, if not set all values of the class are returned |
* |
* @return array content of the class stored in an array |
*/ |
public static function getWMI($wmi, $strClass, $strValue = array()) |
{ |
$arrData = array(); |
if (gettype($wmi) === "object") { |
$value = ""; |
try { |
$objWEBM = $wmi->Get($strClass); |
$arrProp = $objWEBM->Properties_; |
$arrWEBMCol = $objWEBM->Instances_(); |
foreach ($arrWEBMCol as $objItem) { |
if (is_array($arrProp)) { |
reset($arrProp); |
} |
$arrInstance = array(); |
foreach ($arrProp as $propItem) { |
$value = $objItem->{$propItem->Name}; //instead exploitable eval("\$value = \$objItem->".$propItem->Name.";"); |
if (empty($strValue)) { |
if (is_string($value)) $arrInstance[$propItem->Name] = trim($value); |
else $arrInstance[$propItem->Name] = $value; |
} else { |
if (in_array($propItem->Name, $strValue)) { |
if (is_string($value)) $arrInstance[$propItem->Name] = trim($value); |
else $arrInstance[$propItem->Name] = $value; |
} |
} |
} |
$arrData[] = $arrInstance; |
} |
} catch (Exception $e) { |
if (PSI_DEBUG) { |
$error = PSI_Error::singleton(); |
$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; |
} |
/** |
* get all configured plugins from phpsysinfo.ini (file must be included and processed before calling this function) |
* |
* @return array |
683,94 → 732,177 |
} |
/** |
* get virtualizer from dmi data |
* readReg function |
* |
* @return string|null |
* @return boolean command successfull or not |
*/ |
public static function decodevirtualizer($vendor_data) |
public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true) |
{ |
if (gettype($vendor_data) === "array") { |
$vendarray = array( |
'KVM' => 'kvm', // KVM |
'Amazon EC2' => 'amazon', // Amazon EC2 Nitro using Linux KVM |
'QEMU' => 'qemu', // QEMU |
'VMware' => 'vmware', // VMware https://kb.vmware.com/s/article/1009458 |
'VMW' => 'vmware', |
'innotek GmbH' => 'oracle', // Oracle VM VirtualBox |
'VirtualBox' => 'oracle', |
'Xen' => 'xen', // Xen hypervisor |
'Bochs' => 'bochs', // Bochs |
'Parallels' => 'parallels', // Parallels |
// https://wiki.freebsd.org/bhyve |
'BHYVE' => 'bhyve', // bhyve |
'Hyper-V' => 'microsoft', // Hyper-V |
'Microsoft Corporation Virtual Machine' => 'microsoft' // Hyper-V |
); |
for ($i = 0; $i < count($vendor_data); $i++) { |
foreach ($vendarray as $vend=>$virt) { |
if (preg_match('/^'.$vend.'/', $vendor_data[$i])) { |
return $virt; |
$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; |
} |
$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)) { |
$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)) { |
$strBuffer = $buffer2[1]; |
} else { |
return false; |
} |
} |
} 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()))); |
} |
return false; |
} |
if (variant_get_type($sub_keys) !== VT_NULL) { |
$strBuffer = strval($sub_keys); |
} else { |
return false; |
} |
} else { |
return false; |
} |
} elseif (gettype($vendor_data) === "string") { |
$vidarray = array( |
'bhyvebhyve' => 'bhyve', // bhyve |
'KVMKVMKVM' => 'kvm', // KVM |
'MicrosoftHv' => 'microsoft', // Hyper-V |
'lrpepyhvr' => 'parallels', // Parallels |
'UnisysSpar64' => 'spar', // Unisys sPar |
'VMwareVMware' => 'vmware', // VMware |
'XenVMMXenVMM' => 'xen', // Xen hypervisor |
'ACRNACRNACRN' => 'acrn', // ACRN hypervisor |
'TCGTCGTCGTCG' => 'qemu', // QEMU |
'QNXQVMBSQG' => 'qnx', // QNX hypervisor |
'VBoxVBoxVBox' => 'oracle' // Oracle VM VirtualBox |
); |
$shortvendorid = trim(preg_replace('/[\s!\.]/', '', $vendor_data)); |
if (($shortvendorid !== "") && isset($vidarray[$shortvendorid])) { |
return $vidarray[$shortvendorid]; |
} |
} |
return null; |
return true; |
} |
/** |
* readdmimemdata function |
* enumKey function |
* |
* @return array |
* @return boolean command successfull or not |
*/ |
public static function readdmimemdata() |
public static function enumKey($reg, $strName, &$arrBuffer, $booErrorRep = true) |
{ |
if ((PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME') && (self::$_dmimd === null)) { |
self::$_dmimd = array(); |
$buffer = ''; |
if (defined('PSI_DMIDECODE_ACCESS') && (strtolower(PSI_DMIDECODE_ACCESS)==='data')) { |
self::rftsdata('dmidecode.tmp', $buffer); |
} elseif (self::_findProgram('dmidecode')) { |
self::executeProgram('dmidecode', '-t 17', $buffer, PSI_DEBUG); |
$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 (!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 (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)) { |
foreach ($buffer2[1] as $sub_key) { |
$arrBuffer[] = trim($sub_key); |
} |
if (!empty($mem)) { |
self::$_dmimd[] = $mem; |
} else { |
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)) { |
foreach ($buffer2[1] as $sub_key) { |
$arrBuffer[] = trim($sub_key); |
} |
} else { |
return false; |
} |
} |
} elseif (gettype($reg) === "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); |
} catch (Exception $e) { |
if ($booErrorRep) { |
$error = PSI_Error::singleton(); |
$error->addError("enumKey()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage())));; |
} |
return false; |
} |
if (variant_get_type($sub_keys) !== VT_NULL) foreach ($sub_keys as $sub_key) { |
$arrBuffer[] = $sub_key; |
} else { |
return false; |
} |
} else { |
return false; |
} |
} |
return self::$_dmimd; |
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 |
---|
40,7 → 40,7 |
$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 " |
$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])) { |
117,7 → 117,7 |
$mount_parm[] = $parm; |
} |
} |
} elseif (CommonFunctions::rfts(((PSI_ROOT_FILESYSTEM === '')||(PHP_OS !== 'Linux'))?"/etc/mtab":"/proc/1/mounts", $mount)) { |
} elseif (CommonFunctions::rfts("/etc/mtab", $mount)) { |
$mount = preg_split("/\n/", $mount, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($mount as $mount_line) { |
if (preg_match("/(\S+) (\S+) (\S+) (\S+) ([0-9]+) ([0-9]+)/", $mount_line, $mount_buf)) { |
/web/acc/phpsysinfo/includes/error/class.PSI_Error.inc.php |
---|
171,8 → 171,8 |
$error->addAttribute('Message', $arrLine['message']); |
$error->addAttribute('Function', $arrLine['command']); |
} |
header('Cache-Control: no-cache, must-revalidate'); |
header('Content-Type: text/xml'); |
header("Cache-Control: no-cache, must-revalidate\n"); |
header("Content-Type: text/xml\n\n"); |
echo $xml->getSimpleXmlElement()->asXML(); |
exit(); |
} |
/web/acc/phpsysinfo/includes/js/class.JavaScriptPacker.inc.php |
---|
159,9 → 159,8 |
{ |
$parser = new ParseMaster(); |
// replace: $name -> n, $$name -> na |
$parser->add( |
'/((\\x24+)([a-zA-Z$_]+))(\\d*)/', |
array('fn' => '_replace_name') |
$parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/', |
array('fn' => '_replace_name') |
); |
// replace: _name -> _0, double-underscore (__name) is ignored |
$regexp = '/\\b_[A-Za-z\\d]\\w*/'; |
170,8 → 169,7 |
// quick ref |
$encoded = $keywords['encoded']; |
$parser->add( |
$regexp, |
$parser->add($regexp, |
array( |
'fn' => '_replace_encoded', |
'data' => $encoded |
196,8 → 194,7 |
$encoded = $keywords['encoded']; |
// encode |
$parser->add( |
$regexp, |
$parser->add($regexp, |
array( |
'fn' => '_replace_encoded', |
'data' => $encoded |
/web/acc/phpsysinfo/includes/mb/class.cpumem.inc.php |
---|
File deleted |
/web/acc/phpsysinfo/includes/mb/class.coretemp.inc.php |
---|
0,0 → 1,56 |
<?php |
/** |
* coretemp sensor class, getting hardware temperature information through sysctl on FreeBSD |
* or from /sys/devices/platform/coretemp. on Linux |
* |
* PHP version 5 |
* |
* @category PHP |
* @package PSI_Sensor |
* @author Michael Cramer <BigMichi1@users.sourceforge.net> |
* @author William Johansson <radar@radhuset.org> |
* @copyright 2009 phpSysInfo |
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version |
* @version Release: 3.0 |
* @link http://phpsysinfo.sourceforge.net |
*/ |
class Coretemp extends Hwmon |
{ |
/** |
* get the information |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
$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); |
for ($h = 0; $h < $totalh; $h++) { |
$this->_temperature($hwpaths[$h]); |
} |
} |
} elseif (PSI_OS == 'FreeBSD') { |
$smp = 1; |
CommonFunctions::executeProgram('sysctl', '-n kern.smp.cpus', $smp); |
for ($i = 0; $i < $smp; $i++) { |
$temp = 0; |
if (CommonFunctions::executeProgram('sysctl', '-n dev.cpu.'.$i.'.temperature', $temp)) { |
$temp = preg_replace('/,/', '.', preg_replace('/C/', '', $temp)); |
$dev = new SensorDevice(); |
$dev->setName("CPU ".($i + 1)); |
$dev->setValue($temp); |
// $dev->setMax(70); |
$this->mbinfo->setMbTemp($dev); |
} |
} |
} |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.freeipmi.inc.php |
---|
33,12 → 33,13 |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rftsdata('freeipmi.tmp', $lines)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/freeipmi.txt', $lines)) { |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_freeipmi] ACCESS'); |
break; |
} |
} |
172,7 → 173,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.hddtemp.inc.php |
---|
90,6 → 90,7 |
break; |
default: |
$this->error->addConfigError("temperature()", "[sensor_hddtemp] ACCESS"); |
break; |
} |
// Timo van Roermund: parse the info from the hddtemp daemon. |
foreach ($ar_buf as $line) { |
114,7 → 115,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.healthd.inc.php |
---|
37,7 → 37,7 |
} |
break; |
case 'data': |
if (CommonFunctions::rftsdata('healthd.tmp', $lines)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/healthd.txt', $lines)) { |
$lines0 = preg_split("/\n/", $lines, 1, PREG_SPLIT_NO_EMPTY); |
if (count($lines0) == 1) { |
$this->_values = preg_split("/\t+/", $lines0[0]); |
46,6 → 46,7 |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_healthd] ACCESS'); |
break; |
} |
} |
145,7 → 146,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.hwmon.inc.php |
---|
22,7 → 22,7 |
*/ |
protected function _temperature($hwpath) |
{ |
$sensor = CommonFunctions::findglob($hwpath."temp*_input", GLOB_NOSORT); |
$sensor = glob($hwpath."temp*_input", GLOB_NOSORT); |
if (is_array($sensor) && (($total = count($sensor)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) if (($buf = CommonFunctions::rolv($sensor[$i]))!==null) { |
71,7 → 71,7 |
*/ |
private function _voltage($hwpath) |
{ |
$sensor = CommonFunctions::findglob($hwpath."in*_input", GLOB_NOSORT); |
$sensor = glob($hwpath."in*_input", GLOB_NOSORT); |
if (is_array($sensor) && (($total = count($sensor)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) if (($buf = CommonFunctions::rolv($sensor[$i]))!==null) { |
114,7 → 114,7 |
*/ |
protected function _fans($hwpath) |
{ |
$sensor = CommonFunctions::findglob($hwpath."fan*_input", GLOB_NOSORT); |
$sensor = glob($hwpath."fan*_input", GLOB_NOSORT); |
if (is_array($sensor) && (($total = count($sensor)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) if (($buf = CommonFunctions::rolv($sensor[$i]))!==null) { |
159,7 → 159,7 |
*/ |
private function _power($hwpath) |
{ |
$sensor = CommonFunctions::findglob($hwpath."power*_input", GLOB_NOSORT); |
$sensor = glob($hwpath."power*_input", GLOB_NOSORT); |
if (is_array($sensor) && (($total = count($sensor)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) if (($buf = CommonFunctions::rolv($sensor[$i]))!==null) { |
202,7 → 202,7 |
*/ |
private function _current($hwpath) |
{ |
$sensor = CommonFunctions::findglob($hwpath."curr*_input", GLOB_NOSORT); |
$sensor = glob($hwpath."curr*_input", GLOB_NOSORT); |
if (is_array($sensor) && (($total = count($sensor)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) if (($buf = CommonFunctions::rolv($sensor[$i]))!==null) { |
242,14 → 242,14 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
$hwpaths = CommonFunctions::findglob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT); |
$hwpaths = glob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) > 0)) { |
$hwpaths2 = CommonFunctions::findglob("/sys/class/hwmon/hwmon*/device/", GLOB_NOSORT); |
$hwpaths2 = glob("/sys/class/hwmon/hwmon*/device/", GLOB_NOSORT); |
if (is_array($hwpaths2) && (count($hwpaths2) > 0)) { |
$hwpaths = array_merge($hwpaths, $hwpaths2); |
} |
/web/acc/phpsysinfo/includes/mb/class.hwsensors.inc.php |
---|
136,7 → 136,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.ipmicfg.inc.php |
---|
40,12 → 40,13 |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rftsdata('ipmicfg.tmp', $lines)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ipmicfg.txt', $lines)) { |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_ipmicfg] ACCESS'); |
break; |
} |
} |
59,15 → 60,15 |
foreach ($this->_lines as $line) { |
$buffer = preg_split("/\s*\|\s*/", $line); |
if ((!defined('PSI_SENSOR_IPMICFG_PSFRUINFO') || (strtolower(PSI_SENSOR_IPMICFG_PSFRUINFO)!=="only")) && |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*([-\d]+)C\/[-\d]+F\s*$/", $buffer[2], $valbuff)) { |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*([-\d]+)C\/[-\d]+F\s*$/",$buffer[2], $valbuff)) { |
$dev = new SensorDevice(); |
$dev->setName($namebuff[1]); |
if ($valbuff[1]<-128) $valbuff[1]+=256; //+256 correction |
$dev->setValue($valbuff[1]); |
if (preg_match("/^\s*([-\d]+)C\/[-\d]+F\s*$/", $buffer[3], $valbuffmin)) { |
if (preg_match("/^\s*([-\d]+)C\/[-\d]+F\s*$/",$buffer[3], $valbuffmin)) { |
if ($valbuffmin[1]<-128) $valbuffmin[1]+=256; //+256 correction |
} |
if (preg_match("/^\s*([-\d]+)C\/[-\d]+F\s*$/", $buffer[4], $valbuffmax)) { |
if (preg_match("/^\s*([-\d]+)C\/[-\d]+F\s*$/",$buffer[4], $valbuffmax)) { |
if ($valbuffmax[1]<-128) $valbuffmax[1]+=256; //+256 correction |
$dev->setMax($valbuffmax[1]); |
} |
95,14 → 96,14 |
foreach ($this->_lines as $line) { |
$buffer = preg_split("/\s*\|\s*/", $line); |
if ((!defined('PSI_SENSOR_IPMICFG_PSFRUINFO') || (strtolower(PSI_SENSOR_IPMICFG_PSFRUINFO)!=="only")) && |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*([\d\.]+)\sV\s*$/", $buffer[2], $valbuff)) { |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*([\d\.]+)\sV\s*$/",$buffer[2], $valbuff)) { |
$dev = new SensorDevice(); |
$dev->setName($namebuff[1]); |
$dev->setValue($valbuff[1]); |
if (preg_match("/^\s*([\d\.].+)\sV\s*$/", $buffer[3], $valbuffmin)) { |
if (preg_match("/^\s*([\d\.].+)\sV\s*$/",$buffer[3], $valbuffmin)) { |
$dev->setMin($valbuffmin[1]); |
} |
if (preg_match("/^\s*([\d\.].+)\sV\s*$/", $buffer[4], $valbuffmax)) { |
if (preg_match("/^\s*([\d\.].+)\sV\s*$/",$buffer[4], $valbuffmax)) { |
$dev->setMax($valbuffmax[1]); |
} |
if (trim($buffer[0]) != "OK") $dev->setEvent(trim($buffer[0])); |
121,11 → 122,11 |
foreach ($this->_lines as $line) { |
$buffer = preg_split("/\s*\|\s*/", $line); |
if ((!defined('PSI_SENSOR_IPMICFG_PSFRUINFO') || (strtolower(PSI_SENSOR_IPMICFG_PSFRUINFO)!=="only")) && |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*(\d+)\sRPM\s*$/", $buffer[2], $valbuff)) { |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*(\d+)\sRPM\s*$/",$buffer[2], $valbuff)) { |
$dev = new SensorDevice(); |
$dev->setName($namebuff[1]); |
$dev->setValue($valbuff[1]); |
if (preg_match("/^\s*(\d+)\sRPM\s*$/", $buffer[3], $valbuffmin)) { |
if (preg_match("/^\s*(\d+)\sRPM\s*$/",$buffer[3], $valbuffmin)) { |
$dev->setMin($valbuffmin[1]); |
} |
if ((trim($buffer[0]) != "OK") && isset($valbuffmin[1])) { |
152,11 → 153,11 |
foreach ($this->_lines as $line) { |
$buffer = preg_split("/\s*\|\s*/", $line); |
if ((!defined('PSI_SENSOR_IPMICFG_PSFRUINFO') || (strtolower(PSI_SENSOR_IPMICFG_PSFRUINFO)!=="only")) && |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*(\d+)\sWatts\s*$/", $buffer[2], $valbuff)) { |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*(\d+)\sWatts\s*$/",$buffer[2], $valbuff)) { |
$dev = new SensorDevice(); |
$dev->setName($namebuff[1]); |
$dev->setValue($valbuff[1]); |
if (preg_match("/^\s*(\d+)\sWatts\s*$/", $buffer[4], $valbuffmax)) { |
if (preg_match("/^\s*(\d+)\sWatts\s*$/",$buffer[4], $valbuffmax)) { |
$dev->setMax($valbuffmax[1]); |
} |
if (trim($buffer[0]) != "OK") $dev->setEvent(trim($buffer[0])); |
175,14 → 176,14 |
foreach ($this->_lines as $line) { |
$buffer = preg_split("/\s*\|\s*/", $line); |
if ((!defined('PSI_SENSOR_IPMICFG_PSFRUINFO') || (strtolower(PSI_SENSOR_IPMICFG_PSFRUINFO)!=="only")) && |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*([\d\.]+)\sAmps\s*$/", $buffer[2], $valbuff)) { |
(count($buffer)==6) && preg_match("/^\s*\(\d+\)\s(.*)\s*$/", $buffer[1], $namebuff) && preg_match("/^\s*([\d\.]+)\sAmps\s*$/",$buffer[2], $valbuff)) { |
$dev = new SensorDevice(); |
$dev->setName($namebuff[1]); |
$dev->setValue($valbuff[1]); |
if (preg_match("/^\s*([\d\.].+)\sAmps\s*$/", $buffer[3], $valbuffmin)) { |
if (preg_match("/^\s*([\d\.].+)\sAmps\s*$/",$buffer[3], $valbuffmin)) { |
$dev->setMin($valbuffmin[1]); |
} |
if (preg_match("/^\s*([\d\.].+)\sAmps\s*$/", $buffer[4], $valbuffmax)) { |
if (preg_match("/^\s*([\d\.].+)\sAmps\s*$/",$buffer[4], $valbuffmax)) { |
$dev->setMax($valbuffmax[1]); |
} |
if (trim($buffer[0]) != "OK") $dev->setEvent(trim($buffer[0])); |
224,7 → 225,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.ipmitool.inc.php |
---|
33,10 → 33,11 |
CommonFunctions::executeProgram('ipmitool', 'sensor -v', $lines); |
break; |
case 'data': |
CommonFunctions::rftsdata('ipmitool.tmp', $lines); |
CommonFunctions::rfts(PSI_APP_ROOT.'/data/ipmitool.txt', $lines); |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_ipmitool] ACCESS'); |
break; |
} |
if (trim($lines) !== "") { |
if (preg_match("/^Sensor ID\s+/", $lines)) { //new data format ('ipmitool sensor -v') |
125,6 → 126,7 |
$sens['Sensor Type (Discrete)'] = ''; |
$sens['State'] = $buffer[1]; |
} |
break; |
} |
$this->_buf[] = $sens; |
} |
304,7 → 306,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.ipmiutil.inc.php |
---|
33,12 → 33,13 |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rftsdata('ipmiutil.tmp', $lines)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ipmiutil.txt', $lines)) { |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_ipmiutil] ACCESS'); |
break; |
} |
} |
229,15 → 230,11 |
$buffer5s = preg_split("/\s+/", $buffer5 = $buffer[5]); |
if (isset($buffer5s[1])) { |
if (preg_match('/^[0-9A-Fa-f]+$/', $buffer5s[0])) { |
$value = hexdec($buffer5s[0]) & 0xff; |
if ($buffer5s[1] === 'DiscreteEvt') { |
$dev->setValue('0x'.dechex($value)); |
} elseif (($buffer5s[1] === 'DiscreteUnit') && ($value > 0)) { |
$dev->setValue('0x'.dechex($value - 1)); |
} else { |
$dev->setValue($buffer5); |
} |
$value = hexdec($buffer5s[0]) & 0xff; |
if ($buffer5s[1] === 'DiscreteEvt') { |
$dev->setValue('0x'.dechex($value)); |
} elseif (($buffer5s[1] === 'DiscreteUnit') && ($value > 0)) { |
$dev->setValue('0x'.dechex($value - 1)); |
} else { |
$dev->setValue($buffer5); |
} |
254,7 → 251,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.k8temp.inc.php |
---|
34,12 → 34,13 |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rftsdata('k8temp.tmp', $lines)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/k8temp.txt', $lines)) { |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_k8temp] ACCESS'); |
break; |
} |
} |
70,7 → 71,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.lmsensors.inc.php |
---|
33,10 → 33,11 |
CommonFunctions::executeProgram("sensors", "", $lines); |
break; |
case 'data': |
CommonFunctions::rftsdata('lmsensors.tmp', $lines); |
CommonFunctions::rfts(PSI_APP_ROOT.'/data/lmsensors.txt', $lines); |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_lmsensors] ACCESS'); |
break; |
} |
if (trim($lines) !== "") { |
73,23 → 74,15 |
; |
} elseif (preg_match("/^(.+):(.+).C\s*\((.+)=(.+).C\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+).C,(.+)=(.+).C\)(.*)\)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+).C,(.+)=(.+).C\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+).C\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+).C\s*\(/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+).C\s+\D+/", $line, $data)) { |
; |
} else { |
preg_match("/^(.+):(.+).C\r?$/", $line, $data); |
preg_match("/^(.+):(.+).C$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+).?$/", trim($value), $newvalue)) { |
$data[$key] = floatval($newvalue[1]); |
$data[$key] = 0+trim($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
146,8 → 139,8 |
} elseif (isset($data[4]) && $data[2] <= $data[4]) { |
$dev->setMax($data[4]); |
} |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || preg_match("/\s(ALARM)\s+sensor\s+=/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
if (preg_match("/\sALARM\s*$/", $line) || preg_match("/\sALARM\s+sensor\s+=/", $line)) { |
$dev->setEvent("Alarm"); |
} |
$this->mbinfo->setMbTemp($dev); |
} |
178,23 → 171,15 |
; |
} elseif (preg_match("/^(.+):(.+) RPM\s*\((.+)=(.+) RPM\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) RPM,(.+)=(.+)\)(.*)\)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) RPM,(.+)=(.+)\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) RPM\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) RPM\s*\(/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) RPM\s+\D+/", $line, $data)) { |
; |
} else { |
preg_match("/^(.+):(.+) RPM\r?$/", $line, $data); |
preg_match("/^(.+):(.+) RPM$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+).?$/", trim($value), $newvalue)) { |
$data[$key] = floatval($newvalue[1]); |
$data[$key] = 0+trim($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
205,8 → 190,8 |
if (isset($data[4])) { |
$dev->setMin(trim($data[4])); |
} |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
} |
$this->mbinfo->setMbFan($dev); |
} |
235,22 → 220,16 |
; |
} elseif (preg_match("/^(.+):(.+) V\s*\((.+)=(.+) V,(.+)=(.+) V\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) V,(.+)=(.+) V\)(.*)\)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) V,(.+)=(.+) V\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) V\s*\(/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) V\s+\D+/", $line, $data)) { |
; |
} else { |
preg_match("/^(.+):(.+) V\r?$/", $line, $data); |
preg_match("/^(.+):(.+) V$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+)$/", trim($value), $newvalue)) { |
$data[$key] = floatval($newvalue[1]); |
$data[$key] = 0+trim($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
264,8 → 243,8 |
if (isset($data[6])) { |
$dev->setMax($data[6]); |
} |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
} |
$this->mbinfo->setMbVolt($dev); |
} |
295,27 → 274,19 |
; |
} elseif (preg_match("/^(.+):(.+) W\s*\((.+)=(.+) W,(.+)=(.+) W\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) W,(.+)=(.+) W\)(.*)\)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) W,(.+)=(.+) W\)(.*)/", $line, $data)) { |
; |
} else |
*/ |
if (preg_match("/^(.+):(.+) W\s*\((.+)=(.+) W\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) W\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) W\s*\(/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) W\s+\D+/", $line, $data)) { |
; |
} else { |
preg_match("/^(.+):(.+) W\r?$/", $line, $data); |
preg_match("/^(.+):(.+) W$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+).?$/", trim($value), $newvalue)) { |
$data[$key] = floatval($newvalue[1]); |
$data[$key] = 0+trim($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
332,8 → 303,8 |
if (isset($data[4]) && $data[2] <= $data[4]) { |
$dev->setMax($data[4]); |
} |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
} |
$this->mbinfo->setMbPower($dev); |
} |
362,16 → 333,10 |
; |
} elseif (preg_match("/^(.+):(.+) A\s*\((.+)=(.+) A,(.+)=(.+) A\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) A,(.+)=(.+) A\)(.*)\)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):\s*(FAULT)\s*\((.+)=(.+) A,(.+)=(.+) A\)(.*)/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) A\s*\(/", $line, $data)) { |
; |
} elseif (preg_match("/^(.+):(.+) A\s+\D+/", $line, $data)) { |
; |
} else { |
preg_match("/^(.+):(.+) A\r?$/", $line, $data); |
preg_match("/^(.+):(.+) A$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
390,8 → 355,8 |
if (isset($data[6])) { |
$dev->setMax($data[6]); |
} |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
} |
$this->mbinfo->setMbCurrent($dev); |
} |
416,8 → 381,8 |
} |
} |
$data = array(); |
preg_match("/^(.+):\s*([^\-\+\d\s].+)\r?$/", $line, $data); |
if ((count($data)>2) && ($data[1]!=="Adapter") && !preg_match("/^FAULT/", $data[2])) { |
preg_match("/^(.+):\s*([^\-\+\d\s].+)$/", $line, $data); |
if ((count($data)>2) && ($data[1]!=="Adapter")) { |
$dev = new SensorDevice(); |
$dev->setName($data[1].$sname); |
if (preg_match("/(.*\s*)ALARM\s*$/", $data[2], $aldata)) { |
440,7 → 405,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.mbm5.inc.php |
---|
36,7 → 36,7 |
parent::__construct(); |
if ((PSI_OS == 'WINNT') && !defined('PSI_EMU_HOSTNAME')) { |
$delim = "/;/"; |
CommonFunctions::rftsdata("MBM5.csv", $buffer); |
CommonFunctions::rfts(PSI_APP_ROOT."/data/MBM5.csv", $buffer); |
if (strpos($buffer, ";") === false) { |
$delim = "/,/"; |
} |
110,7 → 110,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.mbmon.inc.php |
---|
45,12 → 45,13 |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rftsdata('mbmon.tmp', $lines)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/mbmon.txt', $lines)) { |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_mbmon] ACCESS'); |
break; |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.nvidiasmi.inc.php |
---|
43,12 → 43,13 |
$this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rftsdata('nvidiasmi.tmp', $lines)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/nvidiasmi.txt', $lines)) { |
$this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_nvidiasmi] ACCESS'); |
break; |
} |
} |
57,80 → 58,81 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
$gpuc=count($this->_gpus); |
switch ($gpuc) { |
case 0: |
$this->error->addError("nvidia-smi", "No values"); |
break; |
case 1: |
$this->error->addError("nvidia-smi", "Error: ".$this->_gpus[0]); |
break; |
default: |
for ($c = 0; $c < $gpuc; $c++) { |
if (preg_match("/^\s+GPU Current Temp\s+:\s*(\d+)\s*C\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." (nvidiasmi)"); |
$dev->setValue($out[1]); |
if (preg_match("/^\s+GPU Shutdown Temp\s+:\s*(\d+)\s*C\s*$/m", $this->_gpus[$c], $out)) { |
$dev->setMax($out[1]); |
case 0: |
$this->error->addError("nvidia-smi", "No values"); |
break; |
case 1: |
$this->error->addError("nvidia-smi", "Error: ".$this->_gpus[0]); |
break; |
default: |
for ($c = 0; $c < $gpuc; $c++) { |
if (preg_match("/^\s+GPU Current Temp\s+:\s*(\d+)\s*C\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." (nvidiasmi)"); |
$dev->setValue($out[1]); |
if (preg_match("/^\s+GPU Shutdown Temp\s+:\s*(\d+)\s*C\s*$/m", $this->_gpus[$c], $out)) { |
$dev->setMax($out[1]); |
} |
$this->mbinfo->setMbTemp($dev); |
} |
$this->mbinfo->setMbTemp($dev); |
} |
if (preg_match("/^\s+Power Draw\s+:\s*([\d\.]+)\s*W\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." (nvidiasmi)"); |
$dev->setValue($out[1]); |
if (preg_match("/^\s+Power Limit\s+:\s*([\d\.]+)\s*W\s*$/m", $this->_gpus[$c], $out)) { |
$dev->setMax($out[1]); |
if (preg_match("/^\s+Power Draw\s+:\s*([\d\.]+)\s*W\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." (nvidiasmi)"); |
$dev->setValue($out[1]); |
if (preg_match("/^\s+Power Limit\s+:\s*([\d\.]+)\s*W\s*$/m", $this->_gpus[$c], $out)) { |
$dev->setMax($out[1]); |
} |
$this->mbinfo->setMbPower($dev); |
} |
$this->mbinfo->setMbPower($dev); |
if (preg_match("/^\s+Fan Speed\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbFan($dev); |
} |
if (preg_match("/^\s+Performance State\s+:\s*(\S+)\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Performance State (nvidiasmi)"); |
$dev->setValue($out[1]); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Gpu\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Memory\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Memory Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Encoder\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Encoder Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Decoder\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Decoder Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
} |
if (preg_match("/^\s+Fan Speed\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbFan($dev); |
} |
if (preg_match("/^\s+Performance State\s+:\s*(\S+)\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Performance State (nvidiasmi)"); |
$dev->setValue($out[1]); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Gpu\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Memory\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Memory Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Encoder\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Encoder Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
if (preg_match("/^\s+Decoder\s+:\s*(\d+)\s*%\s*$/m", $this->_gpus[$c], $out)) { |
$dev = new SensorDevice(); |
$dev->setName("GPU ".($c)." Decoder Utilization (nvidiasmi)"); |
$dev->setValue($out[1]); |
$dev->setUnit("%"); |
$this->mbinfo->setMbOther($dev); |
} |
} |
break; |
} |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.ohm.inc.php |
---|
28,9 → 28,9 |
{ |
parent::__construct(); |
if ((PSI_OS == 'WINNT') || defined('PSI_EMU_HOSTNAME')) { |
$_wmi = WINNT::initWMI('root\OpenHardwareMonitor', true); |
$_wmi = CommonFunctions::initWMI('root\OpenHardwareMonitor', true); |
if ($_wmi) { |
$tmpbuf = WINNT::getWMI($_wmi, 'Sensor', array('Parent', 'Name', 'SensorType', 'Value')); |
$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']; |
105,7 → 105,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.pitemp.inc.php |
---|
22,11 → 22,11 |
CommonFunctions::rfts('/sys/class/thermal/thermal_zone0/temp', $temp, 1); |
CommonFunctions::rfts('/sys/class/thermal/thermal_zone0/trip_point_0_temp', $temp_max, 1, 4096, PSI_DEBUG); |
} |
if (($temp !== null) && (($temp = trim($temp)) != "")) { |
if (!is_null($temp) && (($temp = trim($temp)) != "")) { |
$dev = new SensorDevice(); |
$dev->setName("CPU 1"); |
$dev->setValue($temp / 1000); |
if (($temp_max !== null) && (($temp_max = trim($temp_max)) != "") && ($temp_max > 0)) { |
if (!is_null($temp_max) && (($temp_max = trim($temp_max)) != "") && ($temp_max > 0)) { |
$dev->setMax($temp_max / 1000); |
} |
$this->mbinfo->setMbTemp($dev); |
36,7 → 36,7 |
private function _voltage() |
{ |
$volt = null; |
if (CommonFunctions::rfts('/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/ac/voltage_now', $volt, 1, 4096, false) && ($volt !== null) && (($volt = trim($volt)) != "")) { // Banana Pi |
if (CommonFunctions::rfts('/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/ac/voltage_now', $volt, 1, 4096, false) && !is_null($volt) && (($volt = trim($volt)) != "")) { // Banana Pi |
$dev = new SensorDevice(); |
$dev->setName("Voltage 1"); |
$dev->setValue($volt / 1000000); |
47,7 → 47,7 |
private function _current() |
{ |
$current = null; |
if (CommonFunctions::rfts('/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/ac/current_now', $current, 1, 4096, false) && ($current !== null) && (($current = trim($current)) != "")) { // Banana Pi |
if (CommonFunctions::rfts('/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/ac/current_now', $current, 1, 4096, false) && !is_null($current) && (($current = trim($current)) != "")) { // Banana Pi |
$dev = new SensorDevice(); |
$dev->setName("Current 1"); |
$dev->setValue($current / 1000000); |
/web/acc/phpsysinfo/includes/mb/class.qtssnmp.inc.php |
---|
71,7 → 71,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.speedfan.inc.php |
---|
38,7 → 38,7 |
} |
break; |
case 'data': |
if (CommonFunctions::rftsdata('speedfan.tmp', $buffer) && (strlen($buffer) > 0)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/speedfan.txt', $buffer) && (strlen($buffer) > 0)) { |
if (preg_match("/^Temperatures:\s+(.+)$/m", $buffer, $out)) { |
$this->_filecontent["temp"] = $out[1]; |
} |
52,6 → 52,7 |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_speedfan] ACCESS'); |
break; |
} |
} |
114,7 → 115,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.thermalzone.inc.php |
---|
30,24 → 30,18 |
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') || WINNT::isAdmin()) { |
$_wmi = WINNT::initWMI('root\WMI', true); |
if (defined('PSI_EMU_HOSTNAME') || CommonFunctions::isAdmin()) { |
$_wmi = CommonFunctions::initWMI('root\WMI', true); |
if ($_wmi) { |
$this->_buf = WINNT::getWMI($_wmi, 'MSAcpi_ThermalZoneTemperature', array('InstanceName', 'CriticalTripPoint', 'CurrentTemperature')); |
$this->_buf = CommonFunctions::getWMI($_wmi, 'MSAcpi_ThermalZoneTemperature', array('InstanceName', 'CriticalTripPoint', 'CurrentTemperature')); |
} |
} else { |
$_wmi = WINNT::getcimv2wmi(); |
if ($_wmi) { |
$this->_buf = WINNT::getWMI($_wmi, 'Win32_PerfFormattedData_Counters_ThermalZoneInformation', array('Name', 'HighPrecisionTemperature', 'Temperature')); |
} |
if (!$this->_buf || PSI_DEBUG) { |
$this->error->addError("Error reading data from thermalzone sensor", "Allowed only for systems with administrator privileges (run as administrator)"); |
} |
$this->error->addError("Error reading data from thermalzone sensor", "Allowed only for systems with administrator privileges (run as administrator)"); |
} |
} |
break; |
case 'data': |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::rftsdata('thermalzone.tmp', $lines)) { //output of "wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CriticalTripPoint,CurrentTemperature,InstanceName" |
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++) { |
60,6 → 54,7 |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_thermalzone] ACCESS'); |
break; |
} |
} |
86,27 → 81,15 |
$dev->setMax($maxvalue); |
} |
$this->mbinfo->setMbTemp($dev); |
} else { |
if ((isset($buffer['HighPrecisionTemperature']) && (($value = ($buffer['HighPrecisionTemperature'] - 2732)/10) > -100)) |
|| (isset($buffer['Temperature']) && (($value = ($buffer['Temperature'] - 273)) > -100))) { |
$dev = new SensorDevice(); |
if (isset($buffer['Name']) && preg_match("/([^\\\\\. ]+)$/", $buffer['Name'], $outbuf)) { |
$dev->setName('ThermalZone '.$outbuf[1]); |
} else { |
$dev->setName('ThermalZone THM0'); |
} |
$dev->setValue($value); |
$this->mbinfo->setMbTemp($dev); |
} |
} |
} |
} elseif (($mode == 'command') && (PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) { |
$notwas = true; |
$thermalzones = CommonFunctions::findglob('/sys/class/thermal/thermal_zone*/'); |
$thermalzones = glob('/sys/class/thermal/thermal_zone*/'); |
if (is_array($thermalzones) && (count($thermalzones) > 0)) foreach ($thermalzones as $thermalzone) { |
$thermalzonetemp = $thermalzone.'temp'; |
$temp = null; |
if (CommonFunctions::rfts($thermalzonetemp, $temp, 1, 4096, false) && ($temp !== null) && (($temp = trim($temp)) != "")) { |
if (CommonFunctions::rfts($thermalzonetemp, $temp, 1, 4096, false) && !is_null($temp) && (($temp = trim($temp)) != "")) { |
if ($temp >= 1000) { |
$div = 1000; |
} elseif ($temp >= 200) { |
121,7 → 104,7 |
$dev->setValue($temp); |
$temp_type = null; |
if (CommonFunctions::rfts($thermalzone.'type', $temp_type, 1, 4096, false) && ($temp_type !== null) && (($temp_type = trim($temp_type)) != "")) { |
if (CommonFunctions::rfts($thermalzone.'type', $temp_type, 1, 4096, false) && !is_null($temp_type) && (($temp_type = trim($temp_type)) != "")) { |
$dev->setName($temp_type); |
} else { |
$dev->setName("ThermalZone"); |
128,7 → 111,7 |
} |
$temp_max = null; |
if (CommonFunctions::rfts($thermalzone.'trip_point_0_temp', $temp_max, 1, 4096, false) && ($temp_max !== null) && (($temp_max = trim($temp_max)) != "") && ($temp_max > -40)) { |
if (CommonFunctions::rfts($thermalzone.'trip_point_0_temp', $temp_max, 1, 4096, false) && !is_null($temp_max) && (($temp_max = trim($temp_max)) != "") && ($temp_max > -40)) { |
$temp_max = $temp_max / $div; |
if (($temp_max != 0) || ($temp != 0)) { // if non-zero values |
$dev->setMax($temp_max); |
142,10 → 125,10 |
} |
} |
if ($notwas) { |
$thermalzones = (PSI_ROOT_FILESYSTEM.'/proc/acpi/thermal_zone/TH*/temperature'); |
$thermalzones = glob('/proc/acpi/thermal_zone/TH*/temperature'); |
if (is_array($thermalzones) && (count($thermalzones) > 0)) foreach ($thermalzones as $thermalzone) { |
$temp = null; |
if (CommonFunctions::rfts($thermalzone, $temp, 1, 4096, false) && ($temp !== null) && (($temp = trim($temp)) != "")) { |
if (CommonFunctions::rfts($thermalzone, $temp, 1, 4096, false) && !is_null($temp) && (($temp = trim($temp)) != "")) { |
$dev = new SensorDevice(); |
if (preg_match("/^\/proc\/acpi\/thermal_zone\/(.+)\/temperature$/", $thermalzone, $name)) { |
$dev->setName("ThermalZone ".$name[1]); |
165,7 → 148,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.thinkpad.inc.php |
---|
19,14 → 19,14 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
$hwpaths = CommonFunctions::findglob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT); |
$hwpaths = glob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) == 1)) { |
$hwpaths2 = CommonFunctions::findglob("/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon*/", GLOB_NOSORT); |
$hwpaths2 = glob("/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon*/", GLOB_NOSORT); |
if (is_array($hwpaths2) && (count($hwpaths2) > 0)) { |
$hwpaths = array_merge($hwpaths, $hwpaths2); |
} |
/web/acc/phpsysinfo/includes/os/class.BSDCommon.inc.php |
---|
28,11 → 28,6 |
abstract class BSDCommon extends OS |
{ |
/** |
* Assoc array of all CPUs loads. |
*/ |
private $_cpu_loads = null; |
/** |
* content of the syslog |
* |
* @var array |
215,7 → 210,7 |
*/ |
protected function hostname() |
{ |
if (PSI_USE_VHOST) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('hostname', '', $buf, PSI_DEBUG)) { |
241,40 → 236,18 |
} |
/** |
* Virtualizer info |
* Processor Load |
* optionally create a loadbar |
* |
* @return void |
*/ |
private function virtualizer() |
protected function loadavg() |
{ |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$testvirt = $this->sys->getVirtualizer(); |
$novm = true; |
foreach ($testvirt as $virtkey=>$virtvalue) if ($virtvalue) { |
$novm = false; |
break; |
} |
// Detect QEMU cpu |
if ($novm && isset($testvirt["cpuid:QEMU"])) { |
$this->sys->setVirtualizer('qemu'); // QEMU |
$novm = false; |
} |
if ($novm && isset($testvirt["hypervisor"])) { |
$this->sys->setVirtualizer('unknown'); |
} |
} |
} |
/** |
* CPU usage |
* |
* @return void |
*/ |
protected function cpuusage() |
{ |
if (($this->_cpu_loads === null)) { |
$this->_cpu_loads = array(); |
$s = $this->grabkey('vm.loadavg'); |
$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 |
289,17 → 262,13 |
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]; |
if ($total2 != $total) { |
$this->_cpu_loads['cpu'] = (100 * ($load2 - $load)) / ($total2 - $total); |
} else { |
$this->_cpu_loads['cpu'] = 0; |
} |
$this->sys->setLoadPercent((100 * ($load2 - $load)) / ($total2 - $total)); |
} |
} |
} |
} else { |
$ncpu = $this->grabkey('hw.ncpu'); |
if (($ncpu !== "") && ($ncpu >= 1) && CommonFunctions::executeProgram('ps', "-A -o %cpu", $pstable, false) && !empty($pstable)) { |
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); |
307,38 → 276,14 |
foreach ($pslines as $psline) { |
$sum+=trim($psline); |
} |
$this->_cpu_loads['cpu'] = min($sum/$ncpu, 100); |
$this->sys->setLoadPercent(min($sum/$ncpu, 100)); |
} |
} |
} |
} |
if (isset($this->_cpu_loads['cpu'])) { |
return $this->_cpu_loads['cpu']; |
} else { |
return null; |
} |
} |
/** |
* Processor Load |
* optionally create a loadbar |
* |
* @return void |
*/ |
protected function loadavg() |
{ |
$s = $this->grabkey('vm.loadavg'); |
$s = preg_replace('/{ /', '', $s); |
$s = preg_replace('/ }/', '', $s); |
$this->sys->setLoad($s); |
if (PSI_LOAD_BAR) { |
$this->sys->setLoadPercent($this->cpuusage()); |
} |
} |
/** |
* CPU information |
* |
* @return void |
346,43 → 291,39 |
protected function cpuinfo() |
{ |
$dev = new CpuDevice(); |
$cpumodel = $this->grabkey('hw.model'); |
$dev->setModel($cpumodel); |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && preg_match('/^QEMU Virtual CPU version /', $cpumodel)) { |
$this->sys->setVirtualizer("cpuid:QEMU", false); |
if (PSI_OS == 'NetBSD') { |
if ($model = $this->grabkey('machdep.cpu_brand')) { |
$dev->setModel($model); |
} |
if ($cpuspeed = $this->grabkey('machdep.tsc_freq')) { |
$dev->setCpuSpeed(round($cpuspeed / 1000000)); |
} |
} |
if ($dev->getModel() === "") { |
$dev->setModel($this->grabkey('hw.model')); |
} |
$notwas = true; |
foreach ($this->readdmesg() as $line) { |
if ($notwas) { |
$regexps = preg_split("/\n/", $this->_CPURegExp1, -1, PREG_SPLIT_NO_EMPTY); // multiple regexp separated by \n |
foreach ($regexps as $regexp) { |
if (preg_match($regexp, $line, $ar_buf) && (sizeof($ar_buf) > 2)) { |
if ($dev->getCpuSpeed() === 0) { |
$dev->setCpuSpeed(round($ar_buf[2])); |
} |
$notwas = false; |
break; |
if (preg_match($this->_CPURegExp1, $line, $ar_buf) && (sizeof($ar_buf) > 2)) { |
if ($dev->getCpuSpeed() === 0) { |
$dev->setCpuSpeed(round($ar_buf[2])); |
} |
$notwas = false; |
} |
} else { |
if (preg_match("/^\s+Origin| Features/", $line, $ar_buf)) { |
if (preg_match("/^\s+Origin[ ]*=[ ]*\"(.+)\"/", $line, $ar_buf)) { |
$dev->setVendorId($ar_buf[1]); |
} elseif (preg_match("/ Features2[ ]*=.*<(.+)>/", $line, $ar_buf)) { |
if (preg_match("/ Origin| Features/", $line, $ar_buf)) { |
if (preg_match("/ Features2[ ]*=.*<(.*)>/", $line, $ar_buf)) { |
$feats = preg_split("/,/", strtolower(trim($ar_buf[1])), -1, PREG_SPLIT_NO_EMPTY); |
foreach ($feats as $feat) { |
if (($feat=="vmx") || ($feat=="svm")) { |
$dev->setVirt($feat); |
} elseif ($feat=="hv") { |
if ($dev->getVirt() === null) { |
$dev->setVirt('hypervisor'); |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$this->sys->setVirtualizer("hypervisor", false); |
} |
break 2; |
} |
} |
break; |
} |
} else break; |
} |
389,12 → 330,8 |
} |
$ncpu = $this->grabkey('hw.ncpu'); |
if (($ncpu === "") || !($ncpu >= 1)) { |
if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1))) |
$ncpu = 1; |
} |
if (($ncpu == 1) && PSI_LOAD_BAR) { |
$dev->setLoad($this->cpuusage()); |
} |
for ($ncpu ; $ncpu > 0 ; $ncpu--) { |
$this->sys->setCpus($dev); |
} |
401,99 → 338,6 |
} |
/** |
* Machine information |
* |
* @return void |
*/ |
private function machine() |
{ |
if ((PSI_OS == 'NetBSD') || (PSI_OS == 'OpenBSD')) { |
$buffer = array(); |
if (PSI_OS == 'NetBSD') { // NetBSD |
$buffer['Manufacturer'] = $this->grabkey('machdep.dmi.system-vendor'); |
$buffer['Model'] = $this->grabkey('machdep.dmi.system-product'); |
$buffer['Product'] = $this->grabkey('machdep.dmi.board-product'); |
$buffer['SMBIOSBIOSVersion'] = $this->grabkey('machdep.dmi.bios-version'); |
$buffer['ReleaseDate'] = $this->grabkey('machdep.dmi.bios-date'); |
} else { // OpenBSD |
$buffer['Manufacturer'] = $this->grabkey('hw.vendor'); |
$buffer['Model'] = $this->grabkey('hw.product'); |
$buffer['Product'] = ""; |
$buffer['SMBIOSBIOSVersion'] = ""; |
$buffer['ReleaseDate'] = ""; |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$vendor_array = array(); |
$vendor_array[] = $buffer['Model']; |
$vendor_array[] = trim($buffer['Manufacturer']." ".$buffer['Model']); |
if (PSI_OS == 'NetBSD') { // NetBSD |
$vendor_array[] = $this->grabkey('machdep.dmi.board-vendor'); |
$vendor_array[] = $this->grabkey('machdep.dmi.bios-vendor'); |
} |
$virt = CommonFunctions::decodevirtualizer($vendor_array); |
if ($virt !== null) { |
$this->sys->setVirtualizer($virt); |
} |
} |
$buf = ""; |
if (($buffer['Manufacturer'] !== "") && !preg_match("/^To be filled by O\.E\.M\.$|^System manufacturer$|^Not Specified$/i", $buf2=trim($buffer['Manufacturer'])) && ($buf2 !== "")) { |
$buf .= ' '.$buf2; |
} |
if (($buffer['Model'] !== "") && !preg_match("/^To be filled by O\.E\.M\.$|^System Product Name$|^Not Specified$/i", $buf2=trim($buffer['Model'])) && ($buf2 !== "")) { |
$model = $buf2; |
$buf .= ' '.$buf2; |
} |
if (($buffer['Product'] !== "") && !preg_match("/^To be filled by O\.E\.M\.$|^BaseBoard Product Name$|^Not Specified$|^Default string$/i", $buf2=trim($buffer['Product'])) && ($buf2 !== "")) { |
if ($buf2 !== $model) { |
$buf .= '/'.$buf2; |
} elseif (isset($buffer['SystemFamily']) && !preg_match("/^To be filled by O\.E\.M\.$|^System Family$|^Not Specified$/i", $buf2=trim($buffer['SystemFamily'])) && ($buf2 !== "")) { |
$buf .= '/'.$buf2; |
} |
} |
$bver = ""; |
$brel = ""; |
if (($buf2=trim($buffer['SMBIOSBIOSVersion'])) !== "") { |
$bver .= ' '.$buf2; |
} |
if ($buffer['ReleaseDate'] !== "") { |
if (preg_match("/^(\d{4})(\d{2})(\d{2})$/", $buffer['ReleaseDate'], $dateout)) { |
$brel .= ' '.$dateout[2].'/'.$dateout[3].'/'.$dateout[1]; |
} elseif (preg_match("/^\d{2}\/\d{2}\/\d{4}$/", $buffer['ReleaseDate'])) { |
$brel .= ' '.$buffer['ReleaseDate']; |
} |
} |
if ((trim($bver) !== "") || (trim($brel) !== "")) { |
$buf .= ', BIOS'.$bver.$brel; |
} |
if (trim($buf) !== "") { |
$this->sys->setMachine(trim($buf)); |
} |
} elseif ((PSI_OS == 'FreeBSD') && defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$vendorid = $this->grabkey('hw.hv_vendor'); |
if (trim($vendorid) === "") { |
foreach ($this->readdmesg() as $line) if (preg_match("/^Hypervisor: Origin = \"(.+)\"/", $line, $ar_buf)) { |
if (trim($ar_buf[1]) !== "") { |
$vendorid = $ar_buf[1]; |
} |
break; |
} |
} |
if (trim($vendorid) !== "") { |
$virt = CommonFunctions::decodevirtualizer($vendorid); |
if ($virt !== null) { |
$this->sys->setVirtualizer($virt); |
} else { |
$this->sys->setVirtualizer('unknown'); |
} |
} |
} |
} |
/** |
* SCSI devices |
* get the scsi device information out of dmesg |
* |
560,8 → 404,8 |
} |
/* cleaning */ |
foreach ($this->sys->getScsiDevices() as $finddev) { |
if (strpos($finddev->getName(), ': ') !== false) |
$finddev->setName(substr(strstr($finddev->getName(), ': '), 2)); |
if (strpos($finddev->getName(), ': ') !== false) |
$finddev->setName(substr(strstr($finddev->getName(), ': '), 2)); |
} |
} |
814,34 → 658,11 |
} |
/** |
* UpTime |
* time the system is running |
* |
* @return void |
*/ |
private function uptime() |
{ |
if ($kb = $this->grabkey('kern.boottime')) { |
if (preg_match("/sec = ([0-9]+)/", $kb, $buf)) { // format like: { sec = 1096732600, usec = 885425 } Sat Oct 2 10:56:40 2004 |
$this->sys->setUptime(time() - $buf[1]); |
} else { |
date_default_timezone_set('UTC'); |
$kbt = strtotime($kb); |
if (($kbt !== false) && ($kbt != -1)) { |
$this->sys->setUptime(time() - $kbt); // format like: Sat Oct 2 10:56:40 2004 |
} else { |
$this->sys->setUptime(time() - $kb); // format like: 1096732600 |
} |
} |
} |
} |
/** |
* get the information |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
851,12 → 672,9 |
$this->kernel(); |
$this->_users(); |
$this->loadavg(); |
$this->uptime(); |
} |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->machine(); |
$this->cpuinfo(); |
$this->virtualizer(); |
$this->pci(); |
$this->ide(); |
$this->scsi(); |
/web/acc/phpsysinfo/includes/os/class.Darwin.inc.php |
---|
90,6 → 90,25 |
} |
/** |
* UpTime |
* time the system is running |
* |
* @return void |
*/ |
private function _uptime() |
{ |
if (CommonFunctions::executeProgram('sysctl', '-n kern.boottime', $a, PSI_DEBUG)) { |
$tmp = explode(" ", $a); |
if ($tmp[0]=="{") { /* kern.boottime= { sec = 1096732600, usec = 885425 } Sat Oct 2 10:56:40 2004 */ |
$data = trim($tmp[3], ","); |
$this->sys->setUptime(time() - $data); |
} else { /* kern.boottime= 1096732600 */ |
$this->sys->setUptime(time() - $a); |
} |
} |
} |
/** |
* get CPU information |
* |
* @return void |
100,9 → 119,9 |
if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) { |
$dev->setModel(preg_replace('/Processor type: /', '', $buf)); |
$buf=$this->grabkey('hw.model'); |
if (($buf !== null) && (trim($buf) != "")) { |
if (!is_null($buf) && (trim($buf) != "")) { |
$this->sys->setMachine(trim($buf)); |
if (CommonFunctions::rftsdata('ModelTranslation.txt', $buffer)) { |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ModelTranslation.txt', $buffer)) { |
$buffer = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($buffer as $line) { |
$ar_buf = preg_split("/:/", $line, 3); |
115,12 → 134,12 |
} |
} |
$buf=$this->grabkey('machdep.cpu.brand_string'); |
if (($buf !== null) && (trim($buf) != "") && |
if (!is_null($buf) && (trim($buf) != "") && |
((trim($buf) != "i486 (Intel 80486)") || ($dev->getModel() == ""))) { |
$dev->setModel(trim($buf)); |
} |
$buf=$this->grabkey('machdep.cpu.features'); |
if (($buf !== null) && (trim($buf) != "")) { |
if (!is_null($buf) && (trim($buf) != "")) { |
if (preg_match("/ VMX/", $buf)) { |
$dev->setVirt("vmx"); |
} elseif (preg_match("/ SVM/", $buf)) { |
132,21 → 151,17 |
$dev->setBusSpeed(round($this->grabkey('hw.busfrequency') / 1000000)); |
$bufn=$this->grabkey('hw.cpufrequency_min'); |
$bufx=$this->grabkey('hw.cpufrequency_max'); |
if (($bufn !== null) && (trim($bufn) != "") && ($bufx !== null) && (trim($bufx) != "") && ($bufn != $bufx)) { |
if (!is_null($bufn) && (trim($bufn) != "") && !is_null($bufx) && (trim($bufx) != "") && ($bufn != $bufx)) { |
$dev->setCpuSpeedMin(round($bufn / 1000000)); |
$dev->setCpuSpeedMax(round($bufx / 1000000)); |
} |
$buf=$this->grabkey('hw.l2cachesize'); |
if ($buf !== "") { |
if (!is_null($buf) && (trim($buf) != "")) { |
$dev->setCache(round($buf)); |
} |
$ncpu = $this->grabkey('hw.ncpu'); |
if (($ncpu === "") || !($ncpu >= 1)) { |
if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1))) |
$ncpu = 1; |
} |
if (($ncpu == 1) && PSI_LOAD_BAR) { |
$dev->setLoad($this->cpuusage()); |
} |
for ($ncpu ; $ncpu > 0 ; $ncpu--) { |
$this->sys->setCpus($dev); |
} |
407,8 → 422,8 |
$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]) && ($distro_tmp[0] !== null) && (trim($distro_tmp[0]) != "") && |
isset($distro_tmp[1]) && ($distro_tmp[1] !== null) && (trim($distro_tmp[1]) != "")) { |
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]); |
} |
} |
470,12 → 485,13 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
parent::build(); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_uptime(); |
$this->_processes(); |
} |
if (!$this->blockname || $this->blockname==='hardware') { |
/web/acc/phpsysinfo/includes/os/class.FreeBSD.inc.php |
---|
42,6 → 42,19 |
} |
/** |
* UpTime |
* time the system is running |
* |
* @return void |
*/ |
private function _uptime() |
{ |
$s = preg_split('/ /', $this->grabkey('kern.boottime')); |
$a = preg_replace('/,/', '', $s[3]); |
$this->sys->setUptime(time() - $a); |
} |
/** |
* get network information |
* |
* @return void |
182,7 → 195,7 |
* |
* @see BSDCommon::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
189,13 → 202,14 |
parent::build(); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distroicon(); |
$this->_uptime(); |
$this->_processes(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memoryadditional(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.Haiku.inc.php |
---|
217,7 → 217,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('uname', '-n', $result, PSI_DEBUG)) { |
368,11 → 368,11 |
/** |
* get the information |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
$this->error->addWarning("The Haiku version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addError("WARN", "The Haiku version of phpSysInfo is a work in progress, some things currently don't work"); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distro(); |
$this->_hostname(); |
387,6 → 387,9 |
$this->_pci(); |
$this->_usb(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
393,8 → 396,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.Linux.inc.php |
---|
27,231 → 27,55 |
class Linux extends OS |
{ |
/** |
* Uptime command result. |
*/ |
private $_uptime = null; |
/** |
* Assoc array of all CPUs loads. |
*/ |
private $_cpu_loads = null; |
/** |
* Version string. |
* Machine |
* |
* @return void |
*/ |
private $_kernel_string = null; |
/** |
* Array of info from Bios. |
*/ |
private $_machine_info = null; |
/** |
* Array of info from dmesg. |
*/ |
private $_dmesg_info = null; |
/** |
* Result of systemd-detect-virt. |
*/ |
private $system_detect_virt = null; |
/** |
* Get info from dmesg |
* |
* @return array |
*/ |
private function _get_dmesg_info() |
private function _machine() |
{ |
if ($this->_dmesg_info === null) { |
$this->_dmesg_info = array(); |
if (CommonFunctions::rfts('/var/log/dmesg', $result, 0, 4096, false)) { |
if (preg_match('/^[\s\[\]\.\d]*DMI:\s*(.+)/m', $result, $ar_buf)) { |
$this->_dmesg_info['dmi'] = trim($ar_buf[1]); |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null) && preg_match('/^[\s\[\]\.\d]*Hypervisor detected:\s*(.+)/m', $result, $ar_buf)) { |
$this->_dmesg_info['hypervisor'] = trim($ar_buf[1]); |
} |
$machine = ""; |
if ((CommonFunctions::rfts('/var/log/dmesg', $result, 0, 4096, false) |
&& preg_match('/^[\s\[\]\.\d]*DMI:\s*(.*)/m', $result, $ar_buf)) |
||(CommonFunctions::executeProgram('dmesg', '', $result, false) |
&& preg_match('/^[\s\[\]\.\d]*DMI:\s*(.*)/m', $result, $ar_buf))) { |
$machine = trim($ar_buf[1]); |
} else { //data from /sys/devices/virtual/dmi/id/ |
$product = ""; |
$board = ""; |
$bios = ""; |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/board_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$machine = trim($buf); |
} |
if ((count($this->_dmesg_info) < ((defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null))?2:1)) && CommonFunctions::executeProgram('dmesg', '', $result, false)) { |
if (!isset($this->_dmesg_info['dmi']) && preg_match('/^[\s\[\]\.\d]*DMI:\s*(.+)/m', $result, $ar_buf)) { |
$this->_dmesg_info['dmi'] = trim($ar_buf[1]); |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null) && !isset($this->_dmesg_info['hypervisor']) && preg_match('/^[\s\[\]\.\d]*Hypervisor detected:\s*(.+)/m', $result, $ar_buf)) { |
$this->_dmesg_info['hypervisor'] = trim($ar_buf[1]); |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/product_name', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$product = trim($buf); |
} |
} |
return $this->_dmesg_info; |
} |
/** |
* Get machine info |
* |
* @return string |
*/ |
private function _get_machine_info() |
{ |
if ($this->_machine_info === null) { |
$this->_machine_info = array(); |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
if (CommonFunctions::executeProgram('systemd-detect-virt', '-v', $resultv, false)) { |
$this->system_detect_virt = $resultv; |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/board_name', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$board = trim($buf); |
} |
$vendor_array = array(); |
if ((($dmesg = $this->_get_dmesg_info()) !== null) && isset($dmesg['dmi'])) { |
$this->_machine_info['machine'] = $dmesg['dmi']; |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null)) { |
/* Test this before sys_vendor to detect KVM over QEMU */ |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/product_name', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = $product_name = trim($buf); |
} else { |
$product_name = ''; |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/sys_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = trim($buf); |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/board_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
if ($product_name != "") { |
$vendor_array[] = trim($buf)." ".$product_name; |
} else { |
$vendor_array[] = trim($buf); |
} |
} else { |
$vendor_array[] = $dmesg['dmi']; |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/bios_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = trim($buf); |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/product_version', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = trim($buf); |
} |
} |
} else { // 'machine' data from /sys/devices/virtual/dmi/id/ |
$bios = ""; |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null)) { |
// Test this before sys_vendor to detect KVM over QEMU |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/product_name', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = $product_name = trim($buf); |
} else { |
$product_name = ''; |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/sys_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = trim($buf); |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/board_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
if ($product_name != "") { |
$this->_machine_info['machine'] = trim($buf)." ".$product_name; |
} else { |
$this->_machine_info['machine'] = trim($buf); |
} |
$vendor_array[] = $this->_machine_info["machine"]; |
} elseif ($product_name != "") { |
$this->_machine_info['machine'] = $product_name; |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/bios_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = trim($buf); |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/product_version', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$vendor_array[] = trim($buf); |
} |
} else { |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/board_vendor', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$this->_machine_info['machine'] = trim($buf); |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/product_name', $buf, 1, 4096, false) && (trim($buf)!="")) { |
if (isset($this->_machine_info['machine'])) { |
$this->_machine_info['machine'] .= " ".trim($buf); |
} else { |
$this->_machine_info['machine'] = trim($buf); |
} |
} |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/board_name', $buf, 1, 4096, false) && (trim($buf)!="")) { |
if (isset($this->_machine_info['machine'])) { |
$this->_machine_info['machine'] .= "/".trim($buf); |
} else { |
$this->_machine_info['machine'] = trim($buf); |
} |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/bios_version', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$bios = trim($buf); |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/bios_date', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$bios = trim($bios." ".trim($buf)); |
} |
if ($bios != "") { |
if (isset($this->_machine_info['machine'])) { |
$this->_machine_info['machine'] .= ", BIOS ".$bios; |
} else { |
$this->_machine_info['machine'] = "BIOS ".$bios; |
} |
} |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/bios_version', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$bios = trim($buf); |
} |
if (isset($this->_machine_info['machine'])) { |
$this->_machine_info['machine'] = trim(preg_replace("/^\/,?/", "", preg_replace("/ ?(To be filled by O\.E\.M\.|System manufacturer|System Product Name|Not Specified|Default string) ?/i", "", $this->_machine_info['machine']))); |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/bios_date', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$bios = trim($bios." ".trim($buf)); |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null) && count($vendor_array)>0) { |
$virt = CommonFunctions::decodevirtualizer($vendor_array); |
if ($virt !== null) { |
$this->_machine_info['hypervisor'] = $virt; |
} |
if ($product != "") { |
$machine .= " ".$product; |
} |
} |
return $this->_machine_info; |
} |
/** |
* Get kernel string |
* |
* @return string |
*/ |
private function _get_kernel_string() |
{ |
if ($this->_kernel_string === null) { |
$this->_kernel_string = ""; |
if (CommonFunctions::executeProgram($uname="uptrack-uname", '-r', $strBuf, false) || // show effective kernel if ksplice uptrack is installed |
CommonFunctions::executeProgram($uname="uname", '-r', $strBuf, PSI_DEBUG)) { |
$this->_kernel_string = $strBuf; |
if (CommonFunctions::executeProgram($uname, '-v', $strBuf, PSI_DEBUG)) { |
if (preg_match('/ SMP /', $strBuf)) { |
$this->_kernel_string .= ' (SMP)'; |
} |
} |
if (CommonFunctions::executeProgram($uname, '-m', $strBuf, PSI_DEBUG)) { |
$this->_kernel_string .= ' '.$strBuf; |
} |
} elseif (CommonFunctions::rfts('/proc/version', $strBuf, 1)) { |
if (preg_match('/version\s+(\S+)/', $strBuf, $ar_buf)) { |
$this->_kernel_string = $ar_buf[1]; |
if (preg_match('/ SMP /', $strBuf)) { |
$this->_kernel_string .= ' (SMP)'; |
} |
} |
if ($board != "") { |
$machine .= "/".$board; |
} |
if ($bios != "") { |
$machine .= ", BIOS ".$bios; |
} |
} |
return $this->_kernel_string; |
} |
/** |
* Machine |
* |
* @return void |
*/ |
private function _machine() |
{ |
$machine_info = $this->_get_machine_info(); |
if (isset($machine_info['machine'])) { |
$machine = $machine_info['machine']; |
} else { |
$machine = ""; |
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))); |
} |
if (CommonFunctions::fileexists($filename="/etc/config/uLinux.conf") // QNAP detection |
260,7 → 84,7 |
&& CommonFunctions::fileexists($filename="/etc/platform.conf") // Platform detection |
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false) |
&& preg_match("/^DISPLAY_NAME\s*=\s*(\S+)/m", $buf, $mach_buf) && ($mach_buf[1]!=="")) { |
if ($machine !== "") { |
if ($machine != "") { |
$machine = "QNAP ".$mach_buf[1].' - '.$machine; |
} else { |
$machine = "QNAP ".$mach_buf[1]; |
267,7 → 91,7 |
} |
} |
if ($machine !== "") { |
if ($machine != "") { |
$this->sys->setMachine($machine); |
} |
} |
279,7 → 103,7 |
*/ |
protected function _hostname() |
{ |
if (PSI_USE_VHOST) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::rfts('/proc/sys/kernel/hostname', $result, 1, 4096, PSI_DEBUG && (PSI_OS != 'Android'))) { |
291,6 → 115,7 |
} elseif (CommonFunctions::executeProgram('hostname', '', $ret)) { |
$this->sys->setHostname($ret); |
} |
} |
} |
301,216 → 126,42 |
*/ |
private function _kernel() |
{ |
if (($verBuf = $this->_get_kernel_string()) != "") { |
$this->sys->setKernel($verBuf); |
} |
} |
/** |
* Virtualizer info |
* |
* @return void |
*/ |
protected function _virtualizer() |
{ |
if (!defined('PSI_SHOW_VIRTUALIZER_INFO') || !PSI_SHOW_VIRTUALIZER_INFO) { |
return; |
} |
if ($this->system_detect_virt !== null) { |
if (($this->system_detect_virt !== "") && ($this->system_detect_virt !== "none")) { |
$this->sys->setVirtualizer($this->system_detect_virt); |
} |
if (($verBuf = $this->_get_kernel_string()) !== "") { |
if (preg_match('/^[\d\.-]+-microsoft-standard/', $verBuf)) { |
$this->sys->setVirtualizer('wsl2', 'wsl'); // Windows Subsystem for Linux 2 |
$result = ""; |
if (CommonFunctions::executeProgram($uname="uptrack-uname", '-r', $strBuf, false) || // show effective kernel if ksplice uptrack is installed |
CommonFunctions::executeProgram($uname="uname", '-r', $strBuf, PSI_DEBUG)) { |
$result = $strBuf; |
if (CommonFunctions::executeProgram($uname, '-v', $strBuf, PSI_DEBUG)) { |
if (preg_match('/SMP/', $strBuf)) { |
$result .= ' (SMP)'; |
} |
} |
if (CommonFunctions::executeProgram('systemd-detect-virt', '-c', $resultc, false) && ($resultc !== "") && ($resultc !== "none")) { |
$this->sys->setVirtualizer($resultc); |
if (CommonFunctions::executeProgram($uname, '-m', $strBuf, PSI_DEBUG)) { |
$result .= ' '.$strBuf; |
} |
} else { |
$cpuvirt = $this->sys->getVirtualizer(); // previous info from _cpuinfo() |
$novm = true; |
// code based on src/basic/virt.c from systemd-detect-virt source code (https://github.com/systemd/systemd) |
// First, try to detect Oracle Virtualbox and Amazon EC2 Nitro, even if they use KVM, as well as Xen even if |
// it cloaks as Microsoft Hyper-V. Attempt to detect uml at this stage also since it runs as a user-process |
// nested inside other VMs. Also check for Xen now, because Xen PV mode does not override CPUID when nested |
// inside another hypervisor. |
$machine_info = $this->_get_machine_info(); |
if (isset($machine_info['hypervisor'])) { |
$hypervisor = $machine_info['hypervisor']; |
if (($hypervisor === 'oracle') || ($hypervisor === 'amazon') || ($hypervisor === 'xen')) { |
$this->sys->setVirtualizer($hypervisor); |
$novm = false; |
} |
} 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)'; |
} |
// Detect UML |
if ($novm) { |
if (isset($cpuvirt["cpuid:UserModeLinux"])) { |
$this->sys->setVirtualizer('uml'); // User-mode Linux |
$novm = false; |
} |
} |
// Detect Xen |
if ($novm && is_dir('/proc/xen')) { |
// xen Dom0 is detected as XEN in hypervisor and maybe others. |
// In order to detect the Dom0 as not virtualization we need to |
// double-check it |
if (CommonFunctions::rfts('/sys/hypervisor/properties/features', $features, 1, 4096, false)) { |
if ((hexdec($features) & 2048) == 0) { // XENFEAT_dom0 is not set |
$this->sys->setVirtualizer('xen'); // Xen hypervisor (only domU, not dom0) |
$novm = false; |
} |
} elseif (CommonFunctions::rfts('/proc/xen/capabilities', $capabilities, 1, 4096, false) && !preg_match('/control_d/', $capabilities)) { // control_d not in capabilities |
$this->sys->setVirtualizer('xen'); // Xen hypervisor (only domU, not dom0) |
$novm = false; |
} |
} |
// Second, try to detect from CPUID, this will report KVM for whatever software is used even if info in DMI is overwritten. |
// Since the vendor_id in /proc/cpuinfo is overwritten on virtualization we use values from msr-cpuid. |
if ($novm && CommonFunctions::executeProgram('msr-cpuid', '', $bufr, false) |
&& (preg_match('/^40000000 00000000: [0-9a-f]{8} \S{4} [0-9a-f]{8} ([A-Za-z0-9\.]{4}) [0-9a-f]{8} ([A-Za-z0-9\.]{4}) [0-9a-f]{8} ([A-Za-z0-9\.]{4})/m', $bufr, $cpuid))) { |
$virt = CommonFunctions::decodevirtualizer($cpuid[1].$cpuid[2].$cpuid[3]); |
if ($virt !== null) { |
$this->sys->setVirtualizer($virt); |
} |
} |
// Third, try to detect from DMI. |
if ($novm && isset($hypervisor)) { |
$this->sys->setVirtualizer($hypervisor); |
$novm = false; |
} |
// Check high-level hypervisor sysfs file |
if ($novm && CommonFunctions::rfts('/sys/hypervisor/type', $type, 1, 4096, false) && ($type === "xen")) { |
$this->sys->setVirtualizer('xen'); // Xen hypervisor |
$novm = false; |
} |
if ($novm) { |
if (CommonFunctions::rfts('/proc/device-tree/hypervisor/compatible', $compatible, 1, 4096, false)) { |
switch ($compatible) { |
case 'linux,kvm': |
$this->sys->setVirtualizer('kvm'); // KVM |
$novm = false; |
break; |
case 'vmware': |
$this->sys->setVirtualizer('vmware'); // VMware |
$novm = false; |
break; |
case 'xen': |
$this->sys->setVirtualizer('xen'); // Xen hypervisor |
$novm = false; |
} |
} else { |
if (CommonFunctions::fileexists('/proc/device-tree/ibm,partition-name') |
&& CommonFunctions::fileexists('/proc/device-tree/hmc-managed?') |
&& CommonFunctions::fileexists('/proc/device-tree/chosen/qemu,graphic-width')) { |
$this->sys->setVirtualizer('powervm'); // IBM PowerVM hypervisor |
$novm = false; |
} else { |
$names = CommonFunctions::findglob('/proc/device-tree', GLOB_NOSORT); |
if (is_array($names) && (($total = count($names)) > 0)) { |
for ($i = 0; $i < $total; $i++) { |
if (preg_match('/fw-cfg/', $names[$i])) { |
$this->sys->setVirtualizer('qemu'); // QEMU |
$novm = false; |
break; |
} |
} |
} |
} |
} |
} |
if ($novm && CommonFunctions::rfts('/proc/sysinfo', $sysinfo, 0, 4096, false) && preg_match('//VM00 Control Program:\s*(\S+)/m', $sysinfo, $vcp)) { |
if ($vcp[1] === 'z/VM') { |
$this->sys->setVirtualizer('zvm'); // s390 z/VM |
} else { |
$this->sys->setVirtualizer('kvm'); // KVM |
} |
$novm = false; |
} |
// Additional tests outside of the systemd-detect-virt source code |
if ($novm && (($dmesg = $this->_get_dmesg_info()) !== null) && isset($dmesg['hypervisor'])) { |
switch ($dmesg['hypervisor']) { |
case 'VMware': |
$this->sys->setVirtualizer('vmware'); // VMware |
$novm = false; |
break; |
case 'KVM': |
$this->sys->setVirtualizer('kvm'); // KVM |
$novm = false; |
break; |
case 'Microsoft HyperV': |
case 'Microsoft Hyper-V': |
$this->sys->setVirtualizer('microsoft'); // Hyper-V |
$novm = false; |
break; |
case 'ACRN': |
$this->sys->setVirtualizer('acrn'); // ACRN hypervisor |
$novm = false; |
break; |
case 'Jailhouse': |
$this->sys->setVirtualizer('jailhouse'); // Jailhouse |
$novm = false; |
break; |
case 'Xen': |
case 'Xen PV': |
case 'Xen HVM': |
// xen Dom0 is detected as XEN in hypervisor and maybe others. |
// In order to detect the Dom0 as not virtualization we need to |
// double-check it |
if (CommonFunctions::rfts('/sys/hypervisor/properties/features', $features, 1, 4096, false)) { |
if ((hexdec($features) & 2048) == 0) { // XENFEAT_dom0 is not set |
$this->sys->setVirtualizer('xen'); // Xen hypervisor (only domU, not dom0) |
$novm = false; |
} |
} elseif (CommonFunctions::rfts('/proc/xen/capabilities', $capabilities, 1, 4096, false) && !preg_match('/control_d/', $capabilities)) { // control_d not in capabilities |
$this->sys->setVirtualizer('xen'); // Xen hypervisor (only domU, not dom0) |
$novm = false; |
} |
} |
} |
// Detect QEMU cpu |
if ($novm && isset($cpuvirt["cpuid:QEMU"])) { |
$this->sys->setVirtualizer('qemu'); // QEMU |
$novm = false; |
} |
if ($novm && isset($cpuvirt["hypervisor"])) { |
$this->sys->setVirtualizer('unknown'); |
} |
if ((count(CommonFunctions::gdc('/proc/vz', false)) == 0) && (count(CommonFunctions::gdc('/proc/bc', false)) > 0)) { |
$this->sys->setVirtualizer('openvz'); // OpenVZ/Virtuozzo |
} |
if (($verBuf = $this->_get_kernel_string()) !== "") { |
if (preg_match('/^[\d\.-]+-Microsoft/', $verBuf)) { |
$this->sys->setVirtualizer('wsl'); // Windows Subsystem for Linux |
} elseif (preg_match('/^[\d\.-]+-microsoft-standard/', $verBuf)) { |
$this->sys->setVirtualizer('wsl2'); // Windows Subsystem for Linux 2 |
} |
} |
} |
if ($result != "") { |
if (CommonFunctions::rfts('/proc/self/cgroup', $strBuf2, 0, 4096, false)) { |
if (preg_match('/:\/lxc\//m', $strBuf2)) { |
$this->sys->setVirtualizer('lxc'); // Linux container |
if (preg_match('/:\/lxc\//m', $strBuf2)) { |
$result .= ' [lxc]'; |
} elseif (preg_match('/:\/docker\//m', $strBuf2)) { |
$this->sys->setVirtualizer('docker'); // Docker |
$result .= ' [docker]'; |
} elseif (preg_match('/:\/system\.slice\/docker\-/m', $strBuf2)) { |
$this->sys->setVirtualizer('docker'); // Docker |
$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]'; |
} |
} |
$this->sys->setKernel($result); |
} |
} |
525,21 → 176,21 |
if (CommonFunctions::rfts('/proc/uptime', $buf, 1, 4096, PSI_OS != 'Android')) { |
$ar_buf = preg_split('/ /', $buf); |
$this->sys->setUptime(trim($ar_buf[0])); |
} elseif (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) day[s]?,[ ]+(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
} elseif (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+) day[s]?,[ ]+(\d+) min,/", $this->_uptime, $ar_buf)) { |
} elseif (preg_match("/up (\d+) day[s]?,[ ]+(\d+) min,/", $buf, $ar_buf)) { |
$min = $ar_buf[2]; |
$days = $ar_buf[1]; |
$this->sys->setUptime($days * 86400 + $min * 60); |
} elseif (preg_match("/up[ ]+(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
} elseif (preg_match("/up[ ]+(\d+):(\d+),/", $buf, $ar_buf)) { |
$min = $ar_buf[2]; |
$hours = $ar_buf[1]; |
$this->sys->setUptime($hours * 3600 + $min * 60); |
} elseif (preg_match("/up[ ]+(\d+) min,/", $this->_uptime, $ar_buf)) { |
} elseif (preg_match("/up[ ]+(\d+) min,/", $buf, $ar_buf)) { |
$min = $ar_buf[1]; |
$this->sys->setUptime($min * 60); |
} |
559,7 → 210,7 |
// don't need the extra values, only first three |
unset($result[3]); |
$this->sys->setLoad(implode(' ', $result)); |
} elseif ((($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) && preg_match("/load average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
} elseif (CommonFunctions::executeProgram('uptime', '', $buf) && preg_match("/load average: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
if (PSI_LOAD_BAR) { |
572,11 → 223,11 |
* |
* @param String $cpuline cpu for which load should be meassured |
* |
* @return int |
* @return Integer |
*/ |
protected function _parseProcStat($cpuline) |
{ |
if ($this->_cpu_loads === null) { |
if (is_null($this->_cpu_loads)) { |
$this->_cpu_loads = array(); |
$cpu_tmp = array(); |
644,7 → 295,6 |
protected function _cpuinfo() |
{ |
if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) { |
$cpulist = null; |
$raslist = null; |
668,7 → 318,6 |
$_arch = null; |
$_impl = null; |
$_part = null; |
$_vari = null; |
$_hard = null; |
$_revi = null; |
$_cpus = null; |
691,9 → 340,6 |
case 'cpu part': |
$_part = $arrBuff1; |
break; |
case 'cpu variant': |
$_vari = $arrBuff1; |
break; |
case 'hardware': |
$_hard = $arrBuff1; |
break; |
715,9 → 361,9 |
break; |
case 'vendor_id': |
$_vend = $arrBuff1; |
break; |
case 'cpu': |
$procname = $arrBuff1; |
break; |
} |
} |
} |
731,7 → 377,6 |
$arch = null; |
$impl = null; |
$part = null; |
$vari = null; |
$dev = new CpuDevice(); |
$details = preg_split("/\n/", $processor, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($details as $detail) { |
741,7 → 386,7 |
case 'processor': |
$proc = $arrBuff1; |
if (is_numeric($proc)) { |
if (($procname !== null) && (strlen($procname)>0)) { |
if (strlen($procname)>0) { |
$dev->setModel($procname); |
} |
} else { |
757,13 → 402,13 |
break; |
case 'cpu mhz': |
case 'clock': |
if ($arrBuff1 > 0) { // openSUSE fix |
if ($arrBuff1 > 0) { //openSUSE fix |
$dev->setCpuSpeed($arrBuff1); |
$speedset = true; |
} |
break; |
case 'cpu mhz static': |
if ($arrBuff1 > 0) { // openSUSE fix |
if ($arrBuff1 > 0) { //openSUSE fix |
$dev->setCpuSpeedMax($arrBuff1); |
} |
break; |
789,15 → 434,9 |
$dev->setVirt("vmx"); |
} elseif (preg_match("/ svm/", $arrBuff1)) { |
$dev->setVirt("svm"); |
} elseif (preg_match("/ hypervisor/", $arrBuff1)) { |
$dev->setVirt("hypervisor"); |
} |
if (preg_match("/ hypervisor/", $arrBuff1)) { |
if ($dev->getVirt() === null) { |
$dev->setVirt("hypervisor"); |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null)) { |
$this->sys->setVirtualizer("hypervisor", false); |
} |
} |
break; |
case 'i size': |
case 'd size': |
816,14 → 455,9 |
case 'cpu part': |
$part = $arrBuff1; |
break; |
case 'cpu variant': |
$vari = $arrBuff1; |
break; |
case 'vendor_id': |
$dev->setVendorId($arrBuff1); |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && preg_match('/^User Mode Linux/', $arrBuff1)) { |
$this->sys->setVirtualizer("cpuid:UserModeLinux", false); |
} |
break; |
} |
} |
} |
830,7 → 464,6 |
if ($arch === null) $arch = $_arch; |
if ($impl === null) $impl = $_impl; |
if ($part === null) $part = $_part; |
if ($vari === null) $vari = $_vari; |
// sparc64 specific code follows |
// This adds the ability to display the cache that a CPU has |
845,8 → 478,8 |
// sparc64 specific code ends |
// XScale detection code |
if (($arch === "5TE") && ($dev->getBogomips() !== null)) { |
$dev->setCpuSpeed($dev->getBogomips()); // BogoMIPS are not BogoMIPS on this CPU, it's the speed |
if (($arch === "5TE") && ($dev->getBogomips() != null)) { |
$dev->setCpuSpeed($dev->getBogomips()); //BogoMIPS are not BogoMIPS on this CPU, it's the speed |
$speedset = true; |
$dev->setBogomips(null); // no BogoMIPS available, unset previously set BogoMIPS |
} |
863,12 → 496,9 |
} |
if (($dev->getVendorId() === null) && ($_vend !== null)) { |
$dev->setVendorId($_vend); |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && preg_match('/^User Mode Linux/', $_vend)) { |
$this->sys->setVirtualizer("cpuid:UserModeLinux", false); |
} |
} |
if ($proc !== null) { |
if ($proc != null) { |
if (!is_numeric($proc)) { |
$proc = 0; |
} |
931,12 → 561,11 |
$this->sys->setMachine($_hard); |
} |
if ($cpulist === null) $cpulist = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true); |
if ($cpulist && (((($vari !== null) && isset($cpulist['cpu'][$cpufromlist = strtolower($impl.','.$part.','.$vari)])) |
|| isset($cpulist['cpu'][$cpufromlist = strtolower($impl.','.$part)])))) { |
if ($cpulist && (isset($cpulist['cpu'][$cpuimplpart = strtolower($impl.','.$part)]))) { |
if (($cpumodel = $dev->getModel()) !== '') { |
$dev->setModel($cpumodel.' - '.$cpulist['cpu'][$cpufromlist]); |
$dev->setModel($cpumodel.' - '.$cpulist['cpu'][$cpuimplpart]); |
} else { |
$dev->setModel($cpulist['cpu'][$cpufromlist]); |
$dev->setModel($cpulist['cpu'][$cpuimplpart]); |
} |
} |
} elseif (($_hard !== null) && ($this->sys->getMachine() === '')) { // other hardware |
943,23 → 572,15 |
$this->sys->setMachine($_hard); |
} |
$cpumodel = $dev->getModel(); |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && ($this->system_detect_virt === null) && preg_match('/^QEMU Virtual CPU version /', $cpumodel)) { |
$this->sys->setVirtualizer("cpuid:QEMU", false); |
if ($dev->getModel() === "") { |
$dev->setModel("unknown"); |
} |
if ($cpumodel === "") { |
if (($vendid = $dev->getVendorId()) !== "") { |
$dev->setModel($vendid); |
} else { |
$dev->setModel("unknown"); |
} |
} |
$cpucount++; |
$this->sys->setCpus($dev); |
} |
} |
$cpudevices = CommonFunctions::findglob('/sys/devices/system/cpu/cpu*/uevent', GLOB_NOSORT); |
$cpudevices = glob('/sys/devices/system/cpu/cpu*/uevent', GLOB_NOSORT); |
if (is_array($cpudevices) && (($cpustopped = count($cpudevices)-$cpucount) > 0)) { |
for (; $cpustopped > 0; $cpustopped--) { |
$dev = new CpuDevice(); |
1008,7 → 629,7 |
} |
} |
} else { |
$pcidevices = CommonFunctions::findglob('/sys/bus/pci/devices/*/uevent', GLOB_NOSORT); |
$pcidevices = glob('/sys/bus/pci/devices/*/uevent', GLOB_NOSORT); |
if (is_array($pcidevices) && (($total = count($pcidevices)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) { |
1096,7 → 717,7 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS |
&& ($dev_type[1]==='Direct-Access')) { |
$sizelist = CommonFunctions::findglob('/sys/bus/scsi/devices/'.intval($scsiid[1]).':'.intval($scsiid[2]).':'.intval($scsiid[3]).':'.intval($scsiid[4]).'/*/*/size', GLOB_NOSORT); |
$sizelist = glob('/sys/bus/scsi/devices/'.intval($scsiid[1]).':'.intval($scsiid[2]).':'.intval($scsiid[3]).':'.intval($scsiid[4]).'/*/*/size', GLOB_NOSORT); |
if (is_array($sizelist) && (($total = count($sizelist)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) { |
1128,7 → 749,7 |
$device = preg_split("/ /", $buf, 7); |
if (((isset($device[6]) && trim($device[6]) != "")) || |
((isset($device[5]) && trim($device[5]) != ""))) { |
$usbid = intval($device[1]).'-'.intval(trim($device[3], ':')).' '.$device[5]; |
$usbid = intval($device[1]).'-'.intval(trim($device[3],':')).' '.$device[5]; |
if ((isset($device[6]) && trim($device[6]) != "")) { |
$usbarray[$usbid]['name'] = trim($device[6]); |
} else { |
1138,10 → 759,10 |
} |
} |
$usbdevices = CommonFunctions::findglob('/sys/bus/usb/devices/*/idProduct', GLOB_NOSORT); |
$usbdevices = glob('/sys/bus/usb/devices/*/idProduct', GLOB_NOSORT); |
if (is_array($usbdevices) && (($total = count($usbdevices)) > 0)) { |
for ($i = 0; $i < $total; $i++) { |
if (CommonFunctions::rfts($usbdevices[$i], $idproduct, 1, 4096, false) && (($idproduct=trim($idproduct)) != "")) { // is readable |
if (CommonFunctions::rfts($usbdevices[$i], $idproduct, 1, 4096, false) && (($idproduct=trim($idproduct)) != "")) { //is readable |
$busnum = CommonFunctions::rolv($usbdevices[$i], '/\/idProduct$/', '/busnum'); |
$devnum = CommonFunctions::rolv($usbdevices[$i], '/\/idProduct$/', '/devnum'); |
$idvendor = CommonFunctions::rolv($usbdevices[$i], '/\/idProduct$/', '/idVendor'); |
1171,7 → 792,7 |
} |
} |
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)) { //usb-devices |
$devnum = -1; |
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($bufe as $buf) { |
1196,7 → 817,8 |
&& defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL |
&& !preg_match('/\W/', trim($value2))) { |
$usbarray[$devnum]['serial'] = trim($value2); |
} |
} |
break; |
} |
} |
} |
1279,7 → 901,7 |
*/ |
protected function _i2c() |
{ |
$i2cdevices = CommonFunctions::findglob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT); |
$i2cdevices = glob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT); |
if (is_array($i2cdevices) && (($total = count($i2cdevices)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) { |
1335,23 → 957,24 |
if (isset($nlocate[4]) && isset($nsize[4])) { |
if (preg_match('/\/\s*([0-9\.]+)\s*(B|KB|MB|GB|TB|PB)$/', str_replace(',', '.', trim(substr($buf, $nlocate[4], $nsize[4]))), $tmpbuf)) { |
switch ($tmpbuf[2]) { |
case 'B': |
$dev->setCapacity($tmpbuf[1]); |
break; |
case 'KB': |
$dev->setCapacity(1000*$tmpbuf[1]); |
break; |
case 'MB': |
$dev->setCapacity(1000*1000*$tmpbuf[1]); |
break; |
case 'GB': |
$dev->setCapacity(1000*1000*1000*$tmpbuf[1]); |
break; |
case 'TB': |
$dev->setCapacity(1000*1000*1000*1000*$tmpbuf[1]); |
break; |
case 'PB': |
$dev->setCapacity(1000*1000*1000*1000*1000*$tmpbuf[1]); |
case 'B': |
$dev->setCapacity($tmpbuf[1]); |
break; |
case 'KB': |
$dev->setCapacity(1000*$tmpbuf[1]); |
break; |
case 'MB': |
$dev->setCapacity(1000*1000*$tmpbuf[1]); |
break; |
case 'GB': |
$dev->setCapacity(1000*1000*1000*$tmpbuf[1]); |
break; |
case 'TB': |
$dev->setCapacity(1000*1000*1000*1000*$tmpbuf[1]); |
break; |
case 'PB': |
$dev->setCapacity(1000*1000*1000*1000*1000*$tmpbuf[1]); |
break; |
} |
} |
} |
1403,7 → 1026,7 |
|| preg_match('/^\s+link\/\S+\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') || ($macaddr === '00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00') || ($macaddr === '--') || ($macaddr === '0.0.0.0')) { // empty |
if ($macaddr === '00-00-00-00-00-00') { // empty |
$macaddr = ""; |
} |
} |
1497,12 → 1120,7 |
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 (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) { |
$macaddr = preg_replace('/:/', '-', strtoupper($ar_buf2[1])); |
if (($macaddr === '00-00-00-00-00-00') || ($macaddr === '00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00') || ($macaddr === '--') || ($macaddr === '0.0.0.0')) { // empty |
$macaddr = ""; |
} |
} |
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]) { |
$dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1].";:".$ar_buf2[2]); |
1647,8 → 1265,6 |
protected function _memory() |
{ |
if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) { |
$swaptotal = null; |
$swapfree = null; |
$bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($bufe as $buf) { |
if (preg_match('/^MemTotal:\s+(\d+)\s*kB/i', $buf, $ar_buf)) { |
1659,15 → 1275,11 |
$this->sys->setMemCache($ar_buf[1] * 1024); |
} elseif (preg_match('/^Buffers:\s+(\d+)\s*kB/i', $buf, $ar_buf)) { |
$this->sys->setMemBuffer($ar_buf[1] * 1024); |
} elseif (preg_match('/^SwapTotal:\s+(\d+)\s*kB/i', $buf, $ar_buf)) { |
$swaptotal = $ar_buf[1] * 1024; |
} elseif (preg_match('/^SwapFree:\s+(\d+)\s*kB/i', $buf, $ar_buf)) { |
$swapfree = $ar_buf[1] * 1024; |
} |
} |
$this->sys->setMemUsed($this->sys->getMemTotal() - $this->sys->getMemFree()); |
// values for splitting memory usage |
if (($this->sys->getMemCache() !== null) && ($this->sys->getMemBuffer() !== null)) { |
if ($this->sys->getMemCache() !== null && $this->sys->getMemBuffer() !== null) { |
$this->sys->setMemApplication($this->sys->getMemUsed() - $this->sys->getMemCache() - $this->sys->getMemBuffer()); |
} |
if (CommonFunctions::rfts('/proc/swaps', $sbuf, 0, 4096, false)) { |
1683,13 → 1295,6 |
$dev->setFree($dev->getTotal() - $dev->getUsed()); |
$this->sys->setSwapDevices($dev); |
} |
} elseif (($swaptotal !== null) && ($swapfree !== null) && ($swaptotal > 0)) { |
$dev = new DiskDevice(); |
$dev->setName("SWAP"); |
$dev->setTotal($swaptotal); |
$dev->setFree($swapfree); |
$dev->setUsed($dev->getTotal() - $dev->getFree()); |
$this->sys->setSwapDevices($dev); |
} |
} |
} |
1714,7 → 1319,7 |
$df_args .= "-x $Fstype "; |
} |
if ($df_args !== "") { |
$df_args = trim($df_args); // trim spaces |
$df_args = trim($df_args); //trim spaces |
$arrResult = Parser::df("-P $df_args 2>/dev/null"); |
} else { |
$arrResult = Parser::df("-P 2>/dev/null"); |
1737,17 → 1342,17 |
return; |
} |
// We have the '2>/dev/null' because Ubuntu gives an error on this command which causes the distro to be unknown |
if (CommonFunctions::executeProgram('lsb_release', '-a 2>/dev/null', $distro_info, PSI_DEBUG) && strlen($distro_info) > 0) { |
$distro_tmp = preg_split("/\r?\n/", $distro_info, -1, PREG_SPLIT_NO_EMPTY); |
if (CommonFunctions::executeProgram('lsb_release', '-a 2>/dev/null', $distro_info, PSI_DEBUG) && (strlen($distro_info) > 0)) { |
$distro_tmp = preg_split("/\n/", $distro_info, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($distro_tmp as $info) { |
$info_tmp = preg_split('/:/', $info, 2); |
if (isset($distro_tmp[0]) && ($distro_tmp[0] !== null) && (trim($distro_tmp[0]) != "") && |
isset($distro_tmp[1]) && ($distro_tmp[1] !== null) && (trim($distro_tmp[1]) != "")) { |
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[trim($info_tmp[0])] = trim($info_tmp[1]); |
} |
} |
if (!isset($distro['Distributor ID']) && !isset($distro['Description'])) { // Systems like StartOS |
if (isset($distro_tmp[0]) && ($distro_tmp[0] !== null) && (trim($distro_tmp[0]) != "")) { |
if (isset($distro_tmp[0]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "")) { |
$this->sys->setDistribution(trim($distro_tmp[0])); |
if (preg_match('/^(\S+)\s*/', $distro_tmp[0], $id_buf) |
&& isset($list[trim($id_buf[1])]['Image'])) { |
1755,13 → 1360,9 |
} |
} |
} else { |
if (isset($distro['Description']) && ($distro['Description'] != "n/a") && isset($distro['Distributor ID']) && $distro['Distributor ID']=="Neon") { // Neon systems |
$distro_tmp = preg_split("/\s/", $distro['Description'], -1, PREG_SPLIT_NO_EMPTY); |
$distro['Distributor ID'] = $distro_tmp[0]; |
} |
if (isset($distro['Description']) |
&& preg_match('/^NAME=\s*"?([^"\r\n]+)"?\s*$/', $distro['Description'], $name_tmp)) { |
$distro['Description'] = trim($name_tmp[1]); |
&& preg_match('/^NAME=\s*"?([^"\n]+)"?\s*$/', $distro['Description'], $name_tmp)) { |
$distro['Description'] = $name_tmp[1]; |
} |
if (isset($distro['Description']) |
&& ($distro['Description'] != "n/a") |
1780,36 → 1381,22 |
$this->sys->setDistribution($this->sys->getDistribution()." ".$distro['Release']); |
} |
} |
} elseif (isset($distro['Distributor ID'])) { |
if ($distro['Distributor ID'] != "n/a") { |
$this->sys->setDistribution($distro['Distributor ID']); |
if (isset($distro['Release']) && ($distro['Release'] != "n/a")) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".$distro['Release']); |
} |
if (isset($distro['Codename']) && ($distro['Codename'] != "n/a")) { |
$this->sys->setDistribution($this->sys->getDistribution()." (".$distro['Codename'].")"); |
} |
} elseif (isset($distro['Description']) && ($distro['Description'] != "n/a")) { |
$this->sys->setDistribution($distro['Description']); |
} elseif (isset($distro['Distributor ID']) && ($distro['Distributor ID'] != "n/a")) { |
$this->sys->setDistribution($distro['Distributor ID']); |
if (isset($distro['Release']) && ($distro['Release'] != "n/a")) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".$distro['Release']); |
} |
if (isset($distro['Codename']) && ($distro['Codename'] != "n/a")) { |
$this->sys->setDistribution($this->sys->getDistribution()." (".$distro['Codename'].")"); |
} |
} |
if (isset($distro['Distributor ID'])) { |
$distrib = $distro['Distributor ID']; |
if (isset($distro['Description'])) { |
$distarr = preg_split("/\s/", $distro['Description'], -1, PREG_SPLIT_NO_EMPTY); |
if (isset($distarr[0])) { |
if ($distrib != "n/a") { |
$distrib .= ' '.$distarr[0]; |
} else { |
$distrib = $distarr[0]; |
} |
} |
if (isset($distro['Distributor ID']) && ($distro['Distributor ID'] != "n/a") && isset($list[$distro['Distributor ID']]['Image'])) { |
$this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']); |
} elseif (isset($distro['Description']) && ($distro['Description'] != "n/a")) { |
$this->sys->setDistribution($distro['Description']); |
if (isset($list[$distro['Description']]['Image'])) { |
$this->sys->setDistributionIcon($list[$distro['Description']]['Image']); |
} |
if (isset($list[$distrib]['Image'])) { |
$this->sys->setDistributionIcon($list[$distrib]['Image']); |
} elseif (($distro['Distributor ID'] != "n/a") && isset($list[$distro['Distributor ID']]['Image'])) { |
$this->sys->setDistributionIcon($list[$distro['Distributor ID']]['Image']); |
} |
} |
} |
} else { |
1824,11 → 1411,11 |
// Fall back in case 'lsb_release' does not exist but exist /etc/lsb-release |
if (CommonFunctions::fileexists($filename="/etc/lsb-release") |
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false) |
&& preg_match('/^DISTRIB_ID="?([^"\r\n]+)/m', $buf, $id_buf)) { |
if (preg_match('/^DISTRIB_DESCRIPTION="?([^"\r\n]+)/m', $buf, $desc_buf) |
&& preg_match('/^DISTRIB_ID="?([^"\n]+)"?/m', $buf, $id_buf)) { |
if (preg_match('/^DISTRIB_DESCRIPTION="?([^"\n]+)"?/m', $buf, $desc_buf) |
&& (trim($desc_buf[1])!=trim($id_buf[1]))) { |
$this->sys->setDistribution(trim($desc_buf[1])); |
if (preg_match('/^DISTRIB_RELEASE="?([^"\r\n]+)/m', $buf, $vers_buf) |
if (preg_match('/^DISTRIB_RELEASE="?([^"\n]+)"?/m', $buf, $vers_buf) |
&& (trim($vers_buf[1])!=trim($desc_buf[1])) && strstr($vers_buf[1], ".")){ |
if (preg_match("/^(\d+)\.[0]+$/", trim($vers_buf[1]), $match_buf)) { |
$tofind = $match_buf[1]; |
1845,10 → 1432,10 |
} else { |
$this->sys->setDistribution(trim($id_buf[1])); |
} |
if (preg_match('/^DISTRIB_RELEASE="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
if (preg_match('/^DISTRIB_RELEASE="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} |
if (preg_match('/^DISTRIB_CODENAME="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
if (preg_match('/^DISTRIB_CODENAME="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." (".trim($vers_buf[1]).")"); |
} |
} |
1883,13 → 1470,13 |
$this->sys->setDistributionIcon($distro['Image']); |
} |
if (isset($distribution['Name'])) { |
if (($buf === null) || (trim($buf) == "")) { |
if (is_null($buf) || (trim($buf) == "")) { |
$this->sys->setDistribution($distribution['Name']); |
} else { |
$this->sys->setDistribution($distribution['Name']." ".trim($buf)); |
} |
} else { |
if (($buf === null) || (trim($buf) == "")) { |
if (is_null($buf) || (trim($buf) == "")) { |
$this->sys->setDistribution($section); |
} else { |
$this->sys->setDistribution(trim($buf)); |
1898,22 → 1485,22 |
if (isset($distribution['Files2'])) { |
foreach (preg_split("/;/", $distribution['Files2'], -1, PREG_SPLIT_NO_EMPTY) as $filename2) { |
if (CommonFunctions::fileexists($filename2) && CommonFunctions::rfts($filename2, $buf, 0, 4096, false)) { |
if (preg_match('/^majorversion="?([^"\r\n]+)/m', $buf, $maj_buf) |
&& preg_match('/^minorversion="?([^"\r\n]+)/m', $buf, $min_buf)) { |
if (preg_match('/^majorversion="?([^"\n]+)"?/m', $buf, $maj_buf) |
&& preg_match('/^minorversion="?([^"\n]+)"?/m', $buf, $min_buf)) { |
$distr2=$maj_buf[1].'.'.$min_buf[1]; |
if (preg_match('/^buildphase="?([^"\r\n]+)/m', $buf, $pha_buf) && ($pha_buf[1]!=="0")) { |
if (preg_match('/^buildphase="?([^"\n]+)"?/m', $buf, $pha_buf) && ($pha_buf[1]!=="0")) { |
$distr2.='.'.$pha_buf[1]; |
} |
if (preg_match('/^buildnumber="?([^"\r\n]+)/m', $buf, $num_buf)) { |
if (preg_match('/^buildnumber="?([^"\n]+)"?/m', $buf, $num_buf)) { |
$distr2.='-'.$num_buf[1]; |
} |
if (preg_match('/^builddate="?([^"\r\n]+)/m', $buf, $dat_buf)) { |
if (preg_match('/^builddate="?([^"\n]+)"?/m', $buf, $dat_buf)) { |
$distr2.=' ('.$dat_buf[1].')'; |
} |
$this->sys->setDistribution($this->sys->getDistribution()." ".$distr2); |
} else { |
$distr2=trim(substr($buf, 0, strpos($buf, "\n"))); |
if (($distr2 !== null) && ($distr2 != "")) { |
if (!is_null($distr2) && ($distr2 != "")) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".$distr2); |
} |
} |
1951,10 → 1538,10 |
} |
} elseif ((CommonFunctions::fileexists($filename="/etc/distro-release") |
&& CommonFunctions::rfts($filename, $buf, 1, 4096, false) |
&& ($buf !== null) && (trim($buf) != "")) |
&& !is_null($buf) && (trim($buf) != "")) |
|| (CommonFunctions::fileexists($filename="/etc/system-release") |
&& CommonFunctions::rfts($filename, $buf, 1, 4096, false) |
&& ($buf !== null) && (trim($buf) != ""))) { |
&& !is_null($buf) && (trim($buf) != ""))) { |
$this->sys->setDistribution(trim($buf)); |
if (preg_match('/^(\S+)\s*/', preg_replace('/^Red\s+/', 'Red', $buf), $id_buf) |
&& isset($list[trim($id_buf[1])]['Image'])) { |
1962,8 → 1549,8 |
} |
} elseif (CommonFunctions::fileexists($filename="/etc/solydxk/info") |
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false) |
&& preg_match('/^DISTRIB_ID="?([^"\r\n]+)/m', $buf, $id_buf)) { |
if (preg_match('/^DESCRIPTION="?([^"\r\n]+)/m', $buf, $desc_buf) |
&& preg_match('/^DISTRIB_ID="?([^"\n]+)"?/m', $buf, $id_buf)) { |
if (preg_match('/^DESCRIPTION="?([^"\n]+)"?/m', $buf, $desc_buf) |
&& (trim($desc_buf[1])!=trim($id_buf[1]))) { |
$this->sys->setDistribution(trim($desc_buf[1])); |
} else { |
1972,10 → 1559,10 |
} else { |
$this->sys->setDistribution(trim($id_buf[1])); |
} |
if (preg_match('/^RELEASE="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
if (preg_match('/^RELEASE="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} |
if (preg_match('/^CODENAME="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
if (preg_match('/^CODENAME="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." (".trim($vers_buf[1]).")"); |
} |
} |
1986,10 → 1573,10 |
} |
} elseif (CommonFunctions::fileexists($filename="/etc/os-release") |
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false) |
&& (preg_match('/^TAILS_VERSION_ID="?([^"\r\n]+)/m', $buf, $tid_buf) |
|| preg_match('/^NAME=["\']?([^"\'\r\n]+)/m', $buf, $id_buf))) { |
if (preg_match('/^TAILS_VERSION_ID="?([^"\r\n]+)/m', $buf, $tid_buf)) { |
if (preg_match('/^TAILS_PRODUCT_NAME="?([^"\r\n]+)/m', $buf, $desc_buf)) { |
&& (preg_match('/^TAILS_VERSION_ID="?([^"\n]+)"?/m', $buf, $tid_buf) |
|| preg_match('/^NAME="?([^"\n]+)"?/m', $buf, $id_buf))) { |
if (preg_match('/^TAILS_VERSION_ID="?([^"\n]+)"?/m', $buf, $tid_buf)) { |
if (preg_match('/^TAILS_PRODUCT_NAME="?([^"\n]+)"?/m', $buf, $desc_buf)) { |
$this->sys->setDistribution(trim($desc_buf[1])." ".trim($tid_buf[1])); |
} else { |
if (isset($list['Tails']['Name'])) { |
2000,8 → 1587,8 |
} |
$this->sys->setDistributionIcon($list['Tails']['Image']); |
} else { |
if (preg_match('/^PRETTY_NAME=["\']?([^"\'\r\n]+)/m', $buf, $desc_buf) |
&& !preg_match('/\$/', $desc_buf[1])) { // if is not defined by variable |
if (preg_match('/^PRETTY_NAME="?([^"\n]+)"?/m', $buf, $desc_buf) |
&& !preg_match('/\$/', $desc_buf[1])) { //if is not defined by variable |
$this->sys->setDistribution(trim($desc_buf[1])); |
} else { |
if (isset($list[trim($id_buf[1])]['Name'])) { |
2009,9 → 1596,9 |
} else { |
$this->sys->setDistribution(trim($id_buf[1])); |
} |
if (preg_match('/^VERSION=["\']?([^"\'\r\n]+)/m', $buf, $vers_buf)) { |
if (preg_match('/^VERSION="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} elseif (preg_match('/^VERSION_ID=["\']?([^"\'\r\n]+)/m', $buf, $vers_buf)) { |
} elseif (preg_match('/^VERSION_ID="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} |
} |
2027,13 → 1614,13 |
$this->sys->setDistributionIcon($list['Debian']['Image']); |
} |
if (isset($list['Debian']['Name'])) { |
if (($buf === null) || (trim($buf) == "")) { |
if (is_null($buf) || (trim($buf) == "")) { |
$this->sys->setDistribution($list['Debian']['Name']); |
} else { |
$this->sys->setDistribution($list['Debian']['Name']." ".trim($buf)); |
} |
} else { |
if (($buf === null) || (trim($buf) == "")) { |
if (is_null($buf) || (trim($buf) == "")) { |
$this->sys->setDistribution('Debian'); |
} else { |
$this->sys->setDistribution(trim($buf)); |
2070,13 → 1657,13 |
*/ |
protected function _processes() |
{ |
$process = CommonFunctions::findglob('/proc/*/status', GLOB_NOSORT); |
$process = glob('/proc/*/status', GLOB_NOSORT); |
if (is_array($process) && (($total = count($process)) > 0)) { |
$processes['*'] = 0; |
$buf = ""; |
for ($i = 0; $i < $total; $i++) { |
if (CommonFunctions::rfts($process[$i], $buf, 0, 4096, false)) { |
$processes['*']++; // current total |
$processes['*']++; //current total |
if (preg_match('/^State:\s+(\w)/m', $buf, $state)) { |
if (isset($processes[$state[1]])) { |
$processes[$state[1]]++; |
2087,7 → 1674,7 |
} |
} |
if (!($processes['*'] > 0)) { |
$processes['*'] = $processes[' '] = $total; // all unknown |
$processes['*'] = $processes[' '] = $total; //all unknown |
} |
$this->sys->setProcesses($processes); |
} |
2098,7 → 1685,7 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
2114,7 → 1701,6 |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->_machine(); |
$this->_cpuinfo(); |
$this->_virtualizer(); |
$this->_pci(); |
$this->_ide(); |
$this->_scsi(); |
2122,6 → 1708,9 |
$this->_usb(); |
$this->_i2c(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
2128,8 → 1717,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.OS.inc.php |
---|
106,7 → 106,7 |
//} elseif (CommonFunctions::executeProgram('uptime', '', $buf) && preg_match("/,\s+(\d+)\s+user[s]?,\s+load average[s]?:\s+(.*),\s+(.*),\s+(.*)$/", $buf, $ar_buf)) { |
$this->sys->setUsers($ar_buf[1]); |
} else { |
$processlist = CommonFunctions::findglob('/proc/*/cmdline', GLOB_NOSORT); |
$processlist = glob('/proc/*/cmdline', GLOB_NOSORT); |
if (is_array($processlist) && (($total = count($processlist)) > 0)) { |
$count = 0; |
$buf = ""; |
132,7 → 132,7 |
*/ |
protected function _ip() |
{ |
if (PSI_USE_VHOST && !defined('PSI_EMU_HOSTNAME')) { |
if ((PSI_USE_VHOST === true) && !defined('PSI_EMU_HOSTNAME')) { |
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) |
$dnsrec = dns_get_record($this->sys->getHostname(), DNS_AAAA); |
165,9 → 165,25 |
*/ |
protected function _dmimeminfo() |
{ |
$dmimd = CommonFunctions::readdmimemdata(); |
if (!empty($dmimd)) { |
foreach ($dmimd as $mem) { |
$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 = ''; |
205,7 → 221,7 |
$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['Maximum Voltage']) && |
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'; |
/web/acc/phpsysinfo/includes/os/class.OpenBSD.inc.php |
---|
41,6 → 41,18 |
} |
/** |
* UpTime |
* time the system is running |
* |
* @return void |
*/ |
private function _uptime() |
{ |
$a = $this->grabkey('kern.boottime'); |
$this->sys->setUptime(time() - $a); |
} |
/** |
* get network information |
* |
* @return void |
128,81 → 140,35 |
*/ |
protected function cpuinfo() |
{ |
$dev = new CpuDevice(); |
$dev->setModel($this->grabkey('hw.model')); |
$dev->setCpuSpeed($this->grabkey('hw.cpuspeed')); |
$was = false; |
$cpuarray = array(); |
foreach ($this->readdmesg() as $line) { |
if (preg_match("/^cpu([0-9])+: (.*)/", $line, $ar_buf)) { |
if (preg_match("/^cpu[0-9]+: (.*)/", $line, $ar_buf)) { |
$was = true; |
$ar_buf[2] = trim($ar_buf[2]); |
if (preg_match("/^(.+), ([\d\.]+) MHz/", $ar_buf[2], $ar_buf2)) { |
if (($model = trim($ar_buf2[1])) !== "") { |
$cpuarray[$ar_buf[1]]['model'] = $model; |
} |
if (($speed = trim($ar_buf2[2])) > 0) { |
$cpuarray[$ar_buf[1]]['speed'] = $speed; |
} |
} elseif (preg_match("/(\d+)([KM])B \S+ \S+ L[23] cache$/", $ar_buf[2], $ar_buf2)) { |
if (preg_match("/^cpu[0-9]+: (\d+)([KM])B (.*) L2 cache/", $line, $ar_buf2)) { |
if ($ar_buf2[2]=="M") { |
$cpuarray[$ar_buf[1]]['cache'] = $ar_buf2[1]*1024*1024; |
$dev->setCache($ar_buf2[1]*1024*1024); |
} elseif ($ar_buf2[2]=="K") { |
$cpuarray[$ar_buf[1]]['cache'] = $ar_buf2[1]*1024; |
$dev->setCache($ar_buf2[1]*1024); |
} |
} else { |
$feats = preg_split("/,/", strtolower($ar_buf[2]), -1, PREG_SPLIT_NO_EMPTY); |
$feats = preg_split("/,/", strtolower(trim($ar_buf[1])), -1, PREG_SPLIT_NO_EMPTY); |
foreach ($feats as $feat) { |
if (($feat=="vmx") || ($feat=="svm")) { |
$cpuarray[$ar_buf[1]]['virt'] = $feat; |
} elseif ($feat=="hv") { |
if (!isset($cpuarray[$ar_buf[1]]['virt'])) { |
$cpuarray[$ar_buf[1]]['virt'] = 'hypervisor'; |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$this->sys->setVirtualizer("hypervisor", false); |
} |
$dev->setVirt($feat); |
} |
} |
} |
} elseif (!preg_match("/^cpu[0-9]+|^mtrr: |^acpitimer[0-9]+: /", $line) && $was) { |
} elseif ($was) { |
break; |
} |
} |
$ncpu = $this->grabkey('hw.ncpu'); |
if (($ncpu === "") || !($ncpu >= 1)) { |
if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1))) |
$ncpu = 1; |
} |
$ncpu = max($ncpu, count($cpuarray)); |
$model = $this->grabkey('hw.model'); |
$speed = $this->grabkey('hw.cpuspeed'); |
$vendor = $this->grabkey('machdep.cpuvendor'); |
for ($cpu = 0 ; $cpu < $ncpu ; $cpu++) { |
$dev = new CpuDevice(); |
if (isset($cpuarray[$cpu]['model'])) { |
$dev->setModel($cpuarray[$cpu]['model']); |
} elseif ($model !== "") { |
$dev->setModel($model); |
} |
if (isset($cpuarray[$cpu]['speed'])) { |
$dev->setCpuSpeed($cpuarray[$cpu]['speed']); |
} elseif ($speed !== "") { |
$dev->setCpuSpeed($speed); |
} |
if (isset($cpuarray[$cpu]['cache'])) { |
$dev->setCache($cpuarray[$cpu]['cache']); |
} |
if (isset($cpuarray[$cpu]['virt'])) { |
$dev->setVirt($cpuarray[$cpu]['virt']); |
} |
if ($vendor !== "") { |
$dev->setVendorId($vendor); |
} |
if (($ncpu == 1) && PSI_LOAD_BAR) { |
$dev->setLoad($this->cpuusage()); |
} |
for ($ncpu ; $ncpu > 0 ; $ncpu--) { |
$this->sys->setCpus($dev); |
} |
} |
250,7 → 216,7 |
* |
* @see BSDCommon::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
257,6 → 223,7 |
parent::build(); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distroicon(); |
$this->_uptime(); |
$this->_processes(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
/web/acc/phpsysinfo/includes/os/class.SunOS.inc.php |
---|
44,34 → 44,34 |
if ($this->_prtconf === null) { |
$this->_prtconf = array(); |
if (CommonFunctions::executeProgram('prtconf', '-v', $buf, PSI_DEBUG) && ($buf!="")) { |
$blocks = preg_split('/\n(?= \S)/', $buf, -1, PREG_SPLIT_NO_EMPTY); |
$blocks = preg_split( '/\n(?= \S)/', $buf, -1, PREG_SPLIT_NO_EMPTY); |
if (!empty($blocks) && (count($blocks)>2)) { |
array_shift($blocks); |
foreach ($blocks as $block) { |
if (preg_match('/^ (\S+) /', $block, $ar_buf)) { |
if (preg_match('/^ (\S+) /',$block, $ar_buf)) { |
$group = trim($ar_buf[1], ','); |
$grouparr = array(); |
$blocks1 = preg_split('/\n(?= \S)/', $block, -1, PREG_SPLIT_NO_EMPTY); |
$blocks1 = preg_split( '/\n(?= \S)/', $block, -1, PREG_SPLIT_NO_EMPTY); |
if (!empty($blocks1) && count($blocks1)) { |
array_shift($blocks1); |
foreach ($blocks1 as $block1) { |
if (!preg_match('/^ name=\'([^\']+)\'/', $block1) |
&& preg_match('/^ (\S+) /', $block1, $ar_buf)) { |
if (!preg_match('/^ name=\'([^\']+)\'/',$block1) |
&& preg_match('/^ (\S+) /',$block1, $ar_buf)) { |
$device = trim($ar_buf[1], ','); |
$devicearr = array(); |
$blocks2 = preg_split('/\n(?= \S)/', $block1, -1, PREG_SPLIT_NO_EMPTY); |
$blocks2 = preg_split( '/\n(?= \S)/', $block1, -1, PREG_SPLIT_NO_EMPTY); |
if (!empty($blocks2) && count($blocks2)) { |
array_shift($blocks2); |
foreach ($blocks2 as $block2) { |
if (!preg_match('/^ name=\'([^\']+)\'/', $block2) |
&& preg_match('/^ (\S+) /', $block2, $ar_buf)) { |
if (!preg_match('/^ name=\'([^\']+)\'/',$block2) |
&& preg_match('/^ (\S+) /',$block2, $ar_buf)) { |
$subdev = trim($ar_buf[1], ','); |
$subdevarr = array(); |
$blocks3 = preg_split('/\n(?= \S)/', $block2, -1, PREG_SPLIT_NO_EMPTY); |
$blocks3 = preg_split( '/\n(?= \S)/', $block2, -1, PREG_SPLIT_NO_EMPTY); |
if (!empty($blocks3) && count($blocks3)) { |
array_shift($blocks3); |
foreach ($blocks3 as $block3) { |
if (preg_match('/^ name=\'([^\']+)\' [\s\S]+ value=\'?([^\']+)\'?/m', $block3, $ar_buf)) { |
if (preg_match('/^ name=\'([^\']+)\' [\s\S]+ value=\'?([^\']+)\'?/m',$block3, $ar_buf)) { |
if ($subdev==='Hardware') { |
$subdevarr[$ar_buf[1]] = $ar_buf[2]; |
$subdevarr['device'] = $device; |
128,7 → 128,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('uname', '-n', $result, PSI_DEBUG)) { |
454,11 → 454,11 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
$this->error->addWarning("The SunOS version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addError("WARN", "The SunOS version of phpSysInfo is a work in progress, some things currently don't work"); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distro(); |
$this->_hostname(); |
472,6 → 472,9 |
$this->_cpuinfo(); |
$this->_pci(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
478,8 → 481,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.WINNT.inc.php |
---|
28,18 → 28,11 |
class WINNT extends OS |
{ |
/** |
* holds codepage for chcp |
* |
* @var int |
*/ |
private static $_cp = null; |
/** |
* holds the data from WMI Win32_OperatingSystem |
* |
* @var array |
*/ |
private static $_Win32_OperatingSystem = null; |
private $_Win32_OperatingSystem = null; |
/** |
* holds the data from WMI Win32_ComputerSystem |
53,15 → 46,8 |
* |
* @var array |
*/ |
private static $_Win32_Processor = null; |
private $_Win32_Processor = null; |
/** |
* holds the data from WMI Win32_PhysicalMemory |
* |
* @var array |
*/ |
private static $_Win32_PhysicalMemory = null; |
/** |
* holds the data from WMI Win32_PerfFormattedData_PerfOS_Processor |
* |
81,7 → 67,7 |
* |
* @var Object |
*/ |
private static $_wmi = null; |
private $_wmi = null; |
/** |
* holds the COM object that we pull all the EnumKey and RegRead data from |
98,25 → 84,11 |
private $_ver = ""; |
/** |
* holds system manufacturer |
* |
* @var string |
*/ |
private $_Manufacturer = ""; |
/** |
* holds system model |
* |
* @var string |
*/ |
private $_Model = ""; |
/** |
* holds all devices, which are in the system |
* |
* @var array |
*/ |
private $_wmidevices = null; |
private $_wmidevices = array(); |
/** |
* holds all disks, which are in the system |
140,41 → 112,14 |
private $_syslang = null; |
/** |
* value of checking run as administrator |
* |
* @var boolean |
*/ |
private static $_asadmin = null; |
/** |
* returns codepage for chcp |
* |
* @return int |
*/ |
public static function getcp() |
{ |
return self::$_cp; |
} |
/** |
* returns the COM object that we pull WMI root\CIMv2 data from |
* |
* @return Object |
*/ |
public static function getcimv2wmi() |
{ |
return self::$_wmi; |
} |
/** |
* reads the data from WMI Win32_OperatingSystem |
* |
* @return array |
*/ |
public static function _get_Win32_OperatingSystem() |
private function _get_Win32_OperatingSystem() |
{ |
if (self::$_Win32_OperatingSystem === null) self::$_Win32_OperatingSystem = self::getWMI(self::$_wmi, 'Win32_OperatingSystem', array('CodeSet', 'Locale', 'LastBootUpTime', 'LocalDateTime', 'Version', 'ServicePackMajorVersion', 'Caption', 'TotalVisibleMemorySize', 'FreePhysicalMemory')); |
return self::$_Win32_OperatingSystem; |
if ($this->_Win32_OperatingSystem === null) $this->_Win32_OperatingSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_OperatingSystem', array('CodeSet', 'Locale', 'LastBootUpTime', 'LocalDateTime', 'Version', 'ServicePackMajorVersion', 'Caption', 'OSArchitecture', 'TotalVisibleMemorySize', 'FreePhysicalMemory')); |
return $this->_Win32_OperatingSystem; |
} |
/** |
184,7 → 129,7 |
*/ |
private function _get_Win32_ComputerSystem() |
{ |
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = self::getWMI(self::$_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', 'SystemFamily')); |
return $this->_Win32_ComputerSystem; |
} |
193,24 → 138,13 |
* |
* @return array |
*/ |
public static function _get_Win32_Processor() |
private function _get_Win32_Processor() |
{ |
if (self::$_Win32_Processor === null) self::$_Win32_Processor = self::getWMI(self::$_wmi, 'Win32_Processor', array('DeviceID', 'LoadPercentage', 'AddressWidth', 'Name', 'L2CacheSize', 'L3CacheSize', 'CurrentClockSpeed', 'ExtClock', 'NumberOfCores', 'NumberOfLogicalProcessors', 'MaxClockSpeed', 'Manufacturer', 'Architecture', 'Caption', 'CurrentVoltage')); |
return self::$_Win32_Processor; |
if ($this->_Win32_Processor === null) $this->_Win32_Processor = CommonFunctions::getWMI($this->_wmi, 'Win32_Processor', array('LoadPercentage', 'AddressWidth', 'Name', 'L2CacheSize', 'L3CacheSize', 'CurrentClockSpeed', 'ExtClock', 'NumberOfCores', 'NumberOfLogicalProcessors', 'MaxClockSpeed', 'Manufacturer')); |
return $this->_Win32_Processor; |
} |
/** |
* reads the data from WMI Win32_PhysicalMemory |
* |
* @return array |
*/ |
public static function _get_Win32_PhysicalMemory() |
{ |
if (self::$_Win32_PhysicalMemory === null) self::$_Win32_PhysicalMemory = self::getWMI(self::$_wmi, 'Win32_PhysicalMemory', array('PartNumber', 'DeviceLocator', 'Capacity', 'Manufacturer', 'SerialNumber', 'Speed', 'ConfiguredClockSpeed', 'ConfiguredVoltage', 'MemoryType', 'SMBIOSMemoryType', 'FormFactor', 'DataWidth', 'TotalWidth', 'BankLabel', 'MinVoltage', 'MaxVoltage')); |
return self::$_Win32_PhysicalMemory; |
} |
/** |
* reads the data from WMI Win32_PerfFormattedData_PerfOS_Processor |
* |
* @return array |
221,8 → 155,8 |
$this->_Win32_PerfFormattedData_PerfOS_Processor = array(); |
$buffer = $this->_get_Win32_OperatingSystem(); |
if ($buffer && isset($buffer[0]) && isset($buffer[0]['Version']) && version_compare($buffer[0]['Version'], "5.1", ">=")) { // minimal windows 2003 or windows XP |
$cpubuffer = self::getWMI(self::$_wmi, 'Win32_PerfFormattedData_PerfOS_Processor', array('Name', 'PercentProcessorTime')); |
foreach ($cpubuffer as $cpu) { |
$cpubuffer = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfFormattedData_PerfOS_Processor', array('Name', 'PercentProcessorTime')); |
if ($cpubuffer) foreach ($cpubuffer as $cpu) { |
if (isset($cpu['Name']) && isset($cpu['PercentProcessorTime'])) { |
$this->_Win32_PerfFormattedData_PerfOS_Processor['cpu'.$cpu['Name']] = $cpu['PercentProcessorTime']; |
} |
249,320 → 183,6 |
} |
/** |
* checks WINNT and 'run as Administrator' mode |
* |
* @return boolean |
*/ |
public static function isAdmin() |
{ |
if (self::$_asadmin == null) { |
if (PSI_OS == 'WINNT') { |
$strBuf = ''; |
CommonFunctions::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; |
} |
/** |
* function for getting a list of values in the specified context |
* optionally filter this list, based on the list from third parameter |
* |
* @param $wmi object holds the COM object that we pull the WMI data from |
* @param string $strClass name of the class where the values are stored |
* @param array $strValue filter out only needed values, if not set all values of the class are returned |
* |
* @return array content of the class stored in an array |
*/ |
public static function getWMI($wmi, $strClass, $strValue = array()) |
{ |
$arrData = array(); |
if (gettype($wmi) === "object") { |
$value = ""; |
try { |
$objWEBM = $wmi->Get($strClass); |
$arrProp = $objWEBM->Properties_; |
$arrWEBMCol = $objWEBM->Instances_(); |
foreach ($arrWEBMCol as $objItem) { |
if (is_array($arrProp)) { |
reset($arrProp); |
} |
$arrInstance = array(); |
foreach ($arrProp as $propItem) { |
$value = $objItem->{$propItem->Name}; //instead exploitable eval("\$value = \$objItem->".$propItem->Name.";"); |
if (empty($strValue)) { |
if (is_string($value)) $arrInstance[$propItem->Name] = trim($value); |
else $arrInstance[$propItem->Name] = $value; |
} else { |
if (in_array($propItem->Name, $strValue)) { |
if (is_string($value)) $arrInstance[$propItem->Name] = trim($value); |
else $arrInstance[$propItem->Name] = $value; |
} |
} |
} |
$arrData[] = $arrInstance; |
} |
} catch (Exception $e) { |
if (PSI_DEBUG && (($message = trim($e->getMessage())) !== "<b>Source:</b> SWbemServicesEx<br/><b>Description:</b> Not found")) { |
$error = PSI_Error::singleton(); |
$error->addError("getWMI()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $message))); |
} |
} |
} elseif ((gettype($wmi) === "string") && (PSI_OS == 'Linux')) { |
$delimeter = '@@@DELIM@@@'; |
if (CommonFunctions::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; |
} |
/** |
* readReg function |
* |
* @return boolean command successfull or not |
*/ |
public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true, $dword = false, $bits64 = false) |
{ |
$strBuffer = ''; |
if ($reg === false) { |
if (defined('PSI_EMU_HOSTNAME')) { |
return false; |
} |
$last = strrpos($strName, "\\"); |
$keyname = substr($strName, $last + 1); |
if ($bits64) { |
$param = ' /reg:64'; |
} else { |
$param = ''; |
} |
if ($dword) { |
$valtype = "DWORD"; |
} else { |
$valtype = "SZ|EXPAND_SZ"; |
} |
if (self::$_cp) { |
if (CommonFunctions::executeProgram('cmd', '/c chcp '.self::$_cp.' >nul & reg query "'.substr($strName, 0, $last).'" /v '.$keyname.$param.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_(".$valtype.")\s+(.+)\s*$/mi", $strBuf, $buffer2)) { |
if ($dword) { |
$strBuffer = strval(hexdec($buffer2[2])); |
} else { |
$strBuffer = $buffer2[2]; |
} |
} else { |
return false; |
} |
} else { |
if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.$param.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_(".$valtype.")\s+(.+)\s*$/mi", $strBuf, $buffer2)) { |
if ($dword) { |
$strBuffer = strval(hexdec($buffer2[2])); |
} else { |
$strBuffer = $buffer2[2]; |
} |
} else { |
return false; |
} |
} |
} elseif (gettype($reg) === "object") { |
$_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); |
$first = strpos($strName, "\\"); |
$last = strrpos($strName, "\\"); |
$hkey = substr($strName, 0, $first); |
if (isset($_hkey[$hkey])) { |
$sub_keys = new VARIANT(); |
try { |
if ($dword) { |
$reg->Get("StdRegProv")->GetDWORDValue(strval($_hkey[$hkey]), substr($strName, $first+1, $last-$first-1), substr($strName, $last+1), $sub_keys); |
} else { |
$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()))); |
} |
return false; |
} |
if (variant_get_type($sub_keys) !== VT_NULL) { |
$strBuffer = strval($sub_keys); |
} else { |
return false; |
} |
} else { |
return false; |
} |
} |
return true; |
} |
/** |
* enumKey function |
* |
* @return boolean command successfull or not |
*/ |
public static function enumKey($reg, $strName, &$arrBuffer, $booErrorRep = true) |
{ |
$arrBuffer = array(); |
if ($reg === false) { |
if (defined('PSI_EMU_HOSTNAME')) { |
return false; |
} |
if (self::$_cp) { |
if (CommonFunctions::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)) { |
foreach ($buffer2[1] as $sub_key) { |
$arrBuffer[] = trim($sub_key); |
} |
} else { |
return false; |
} |
} else { |
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); |
} |
} else { |
return false; |
} |
} |
} elseif (gettype($reg) === "object") { |
$_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); |
$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); |
} catch (Exception $e) { |
if ($booErrorRep) { |
$error = PSI_Error::singleton(); |
$error->addError("enumKey()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage())));; |
} |
return false; |
} |
if (variant_get_type($sub_keys) !== VT_NULL) { |
foreach ($sub_keys as $sub_key) { |
$arrBuffer[] = $sub_key; |
} |
} else { |
return false; |
} |
} else { |
return false; |
} |
} |
return true; |
} |
/** |
* initWMI function |
* |
* @return string, object or false |
*/ |
public static function initWMI($namespace, $booErrorRep = false) |
{ |
$wmi = false; |
if (self::$_wmi !== false) { // WMI not disabled |
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') && (PSI_SYSTEM_CODEPAGE != null) && ($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; |
} |
} |
} |
/** |
* build the global Error object and create the WMI connection |
*/ |
public function __construct($blockname = false) |
572,7 → 192,7 |
$this->_ver = $ver_value; |
} |
if (($this->_ver !== "") && preg_match("/ReactOS\r?\n\S+\s+.+/", $this->_ver)) { |
self::$_wmi = false; // No WMI info on ReactOS yet |
$this->_wmi = false; // No WMI info on ReactOS yet |
$this->_reg = false; // No EnumKey and ReadReg on ReactOS yet |
} else { |
if (PSI_OS == 'WINNT') { |
580,30 → 200,27 |
try { |
$objLocator = new COM('WbemScripting.SWbemLocator'); |
$wmi = $objLocator->ConnectServer('', 'root\CIMv2'); |
$buffer = self::getWMI($wmi, 'Win32_OperatingSystem', array('CodeSet')); |
$buffer = CommonFunctions::getWMI($wmi, 'Win32_OperatingSystem', array('CodeSet')); |
if (!$buffer) { |
$reg = $objLocator->ConnectServer('', 'root\default'); |
if (self::readReg($reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
if (CommonFunctions::readReg($reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
$buffer[0]['CodeSet'] = $strBuf; |
} |
} |
if ($buffer && isset($buffer[0]) && 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 = ''; |
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); |
} |
define('PSI_SYSTEM_CODEPAGE', 'windows-'.$codeset.$codename); |
} else { |
define('PSI_SYSTEM_CODEPAGE', null); |
if (PSI_DEBUG) { |
$this->error->addError("__construct()", "PhpSysInfo can not detect PSI_SYSTEM_CODEPAGE"); |
} |
} |
} catch (Exception $e) { |
define('PSI_SYSTEM_CODEPAGE', null); |
615,9 → 232,9 |
define('PSI_SYSTEM_CODEPAGE', null); |
} |
} |
self::$_wmi = self::initWMI('root\CIMv2', true); |
$this->_wmi = CommonFunctions::initWMI('root\CIMv2', true); |
if (PSI_OS == 'WINNT') { |
$this->_reg = self::initWMI('root\default', PSI_DEBUG); |
$this->_reg = CommonFunctions::initWMI('root\default', PSI_DEBUG); |
if (gettype($this->_reg) === "object") { |
$this->_reg->Security_->ImpersonationLevel = 3; |
} |
638,10 → 255,10 |
{ |
$buffer = $this->_get_Win32_OperatingSystem(); |
if (!$buffer) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
$buffer[0]['CodeSet'] = $strBuf; |
} |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Language\\Default", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Language\\Default", $strBuf, false)) { |
$buffer[0]['Locale'] = $strBuf; |
} |
} |
657,7 → 274,7 |
} else { |
$codename = ''; |
} |
self::$_cp = $codeset; |
CommonFunctions::setcp($codeset); |
$this->_codepage = 'windows-'.$codeset.$codename; |
} |
if (isset($buffer[0]['Locale']) && (($locale = hexdec($buffer[0]['Locale']))>0)) { |
684,76 → 301,37 |
*/ |
private function _devicelist($strType) |
{ |
if ($this->_wmidevices === null) { |
$this->_wmidevices = array(); |
if (empty($this->_wmidevices)) { |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
$this->_wmidevices = self::getWMI(self::$_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass')); |
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass')); |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) { |
$this->_wmidisks = self::getWMI(self::$_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size', 'SerialNumber')); |
$this->_wmidisks = CommonFunctions::getWMI($this->_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size', 'SerialNumber')); |
} else { |
$this->_wmidisks = self::getWMI(self::$_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size')); |
$this->_wmidisks = CommonFunctions::getWMI($this->_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size')); |
} |
} else { |
$this->_wmidevices = self::getWMI(self::$_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID')); |
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID')); |
} |
if (empty($this->_wmidevices)) { |
$lstdevs = array(); |
$services = array(); |
foreach (array('PCI', 'USB') as $type) { |
$hkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\".$type; |
if (self::enumKey($this->_reg, $hkey, $vendevs, false)) { |
foreach ($vendevs as $vendev) if (self::enumKey($this->_reg, $hkey."\\".$vendev, $ids, false)) { |
foreach ($ids as $id) { |
if ($type === 'PCI') { // enumerate all PCI devices |
$lstdevs[$type."\\".$vendev."\\".$id] = true; |
} elseif (self::readReg($this->_reg, $hkey."\\".$vendev."\\".$id."\\Service", $service, false)) { |
$services[$service] = true; // ever used USB services |
break; |
} |
} |
} |
} |
} |
$hkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services"; |
foreach ($services as $service=>$tmp) if (self::readReg($this->_reg, $hkey."\\".$service."\\Enum\\Count", $count, false, true) && ($count > 0)) { |
for ($i = 0; $i < $count; $i++) if (self::readReg($this->_reg, $hkey."\\".$service."\\Enum\\".$i, $id, false) && preg_match("/^USB/", $id)) { |
$lstdevs[$id] = true; // used USB devices |
} |
} |
$hkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\"; |
foreach ($lstdevs as $lstdev=>$tmp) { |
if (self::readReg($this->_reg, $hkey.$lstdev."\\DeviceDesc", $nameBuf, false)) { |
$namesplit = preg_split('/;/', $nameBuf, -1, PREG_SPLIT_NO_EMPTY); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && self::readReg($this->_reg, $hkey.$lstdev."\\Mfg", $mfgBuf, false)) { |
$mfgsplit = preg_split('/;/', $mfgBuf, -1, PREG_SPLIT_NO_EMPTY); |
$this->_wmidevices[] = array('Name'=>$namesplit[count($namesplit)-1], 'PNPDeviceID'=>$lstdev, 'Manufacturer'=>$mfgsplit[count($mfgsplit)-1]); |
} else { |
$this->_wmidevices[] = array('Name'=>$namesplit[count($namesplit)-1], 'PNPDeviceID'=>$lstdev); |
} |
} |
} |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\Scsi"; |
$id = 0; |
if (self::enumKey($this->_reg, $hkey, $portBuf, false)) { |
if (CommonFunctions::enumKey($this->_reg, $hkey, $portBuf, false)) { |
foreach ($portBuf as $scsiport) { |
if (self::enumKey($this->_reg, $hkey."\\".$scsiport, $busBuf, false)) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport, $busBuf, false)) { |
foreach ($busBuf as $scsibus) { |
if (self::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus, $tarBuf, false)) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus, $tarBuf, false)) { |
foreach ($tarBuf as $scsitar) if (!strncasecmp($scsitar, "Target Id ", strlen("Target Id "))) { |
if (self::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar, $logBuf, false)) { |
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 ((self::readReg($this->_reg, $hkey2."DeviceType", $typeBuf, false) || self::readReg($this->_reg, $hkey2."Type", $typeBuf, false)) |
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')) |
&& self::readReg($this->_reg, $hkey2."Identifier", $ideBuf, false)) { |
&& 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 |
&& self::readReg($this->_reg, $hkey2."SerialNumber", $serBuf, false) |
&& (CommonFunctions::readReg($this->_reg, $hkey2."SerialNumber", $serBuf, false)) |
&& (($serBuf=trim($serBuf)) !== "")) { |
$this->_wmidisks[] = array('PNPDeviceID'=>'SCSI\\'.$id, 'SerialNumber'=>$serBuf); |
} |
793,7 → 371,6 |
$device['Serial'] = null; |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) { |
if ($strType==='USB') { |
// if (preg_match('/\\\\([^\\\\][^&\\\\][^\\\\]+)$/', $device['PNPDeviceID'], $buf)) { // second character !== & |
if (preg_match('/\\\\(\w+)$/', $device['PNPDeviceID'], $buf)) { |
$device['Serial'] = $buf[1]; |
} |
823,11 → 400,11 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST && !defined('PSI_EMU_HOSTNAME')) { |
if ((PSI_USE_VHOST === true) && !defined('PSI_EMU_HOSTNAME')) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
$buffer = $this->_get_Win32_ComputerSystem(); |
if (!$buffer && self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\ComputerName", $strBuf, false) && (strlen($strBuf) > 0)) { |
if (!$buffer && CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\ComputerName", $strBuf, false) && (strlen($strBuf) > 0)) { |
$buffer[0]['Name'] = $strBuf; |
} |
if ($buffer) { |
860,44 → 437,6 |
} |
/** |
* Virtualizer info |
* |
* @return void |
*/ |
protected function _virtualizer() |
{ |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$cpuvirt = $this->sys->getVirtualizer(); // previous info from _cpuinfo() |
$vendor_array = array(); |
if ($this->_Model != "") { |
$vendor_array[] = $this->_Model; |
} |
if ($this->_Manufacturer != "") { |
if ($this->_Model != "") { |
$vendor_array[] = $this->_Manufacturer." ".$this->_Model; |
} else { |
$vendor_array[] = $this->_Manufacturer; |
} |
} |
$novm = true; |
if (count($vendor_array)>0) { |
$virt = CommonFunctions::decodevirtualizer($vendor_array); |
if ($virt !== null) { |
$this->sys->setVirtualizer($virt); |
$novm = false; |
} |
} |
if ($novm) { |
// Detect QEMU cpu |
if (isset($cpuvirt["cpuid:QEMU"])) { |
$this->sys->setVirtualizer('qemu'); // QEMU |
} |
} |
} |
} |
/** |
* UpTime |
* time the system is running |
* |
938,7 → 477,7 |
$result = $localtime - $boottime; |
$this->sys->setUptime($result); |
} elseif (!defined('PSI_EMU_HOSTNAME') && (substr($this->sys->getDistribution(), 0, 7)=="ReactOS") && CommonFunctions::executeProgram('uptime', '', $strBuf, false) && (strlen($strBuf) > 0) && preg_match("/^System Up Time:\s+(\d+) days, (\d+) Hours, (\d+) Minutes, (\d+) Seconds/", $strBuf, $ar_buf)) { |
} elseif (($this->sys->getDistribution()=="ReactOS") && CommonFunctions::executeProgram('uptime', '', $strBuf, false) && (strlen($strBuf) > 0) && preg_match("/^System Up Time:\s+(\d+) days, (\d+) Hours, (\d+) Minutes, (\d+) Seconds/", $strBuf, $ar_buf)) { |
$sec = $ar_buf[4]; |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
959,7 → 498,7 |
$users = count($lines)-1; |
} else { |
$users = 0; |
$buffer = self::getWMI(self::$_wmi, 'Win32_Process', array('Caption')); |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption')); |
foreach ($buffer as $process) { |
if (strtoupper($process['Caption']) == strtoupper('explorer.exe')) { |
$users++; |
979,50 → 518,19 |
$buffer = $this->_get_Win32_OperatingSystem(); |
if ($buffer) { |
$ver = $buffer[0]['Version']; |
if (($this->_ver !== "") && preg_match("/^Microsoft [^\[]*\s*\[\D*\s*(".$ver."\.\d+).*\]/", $this->_ver, $ar_temp)) { |
$kernel = $ar_temp[1]; |
} else { |
$kernel = $ver; |
} |
$kernel = $ver; |
if ($buffer[0]['ServicePackMajorVersion'] > 0) { |
$kernel .= ' SP'.$buffer[0]['ServicePackMajorVersion']; |
} |
if ($allCpus = $this->_get_Win32_Processor()) { |
$addresswidth = 0; |
if (isset($allCpus[0]['AddressWidth']) && (($addresswidth = $allCpus[0]['AddressWidth']) > 0)) { |
$kernel .= ' ('.$addresswidth.'-bit)'; |
} |
if (isset($allCpus[0]['Architecture'])) { |
switch ($allCpus[0]['Architecture']) { |
case 0: $kernel .= ' x86'; break; |
case 1: $kernel .= ' MIPS'; break; |
case 2: $kernel .= ' Alpha'; break; |
case 3: $kernel .= ' PowerPC'; break; |
case 5: $kernel .= ' ARM'; break; |
case 6: $kernel .= ' ia64'; break; |
case 9: if ($addresswidth == 32) { |
$kernel .= ' x86'; |
} else { |
$kernel .= ' x64'; |
} |
break; |
case 12: if ($addresswidth == 32) { |
$kernel .= ' ARM'; |
} else { |
$kernel .= ' ARM64'; |
} |
} |
} |
if (isset($buffer[0]['OSArchitecture']) && preg_match("/^(\d+)/", $buffer[0]['OSArchitecture'], $bits)) { |
$this->sys->setKernel($kernel.' ('.$bits[1].'-bit)'); |
} elseif (($allCpus = $this->_get_Win32_Processor()) && isset($allCpus[0]['AddressWidth'])) { |
$this->sys->setKernel($kernel.' ('.$allCpus[0]['AddressWidth'].'-bit)'); |
} else { |
$this->sys->setKernel($kernel); |
} |
$this->sys->setKernel($kernel); |
$distribution = $buffer[0]['Caption']; |
if (version_compare($ver, "10.0", ">=") && !preg_match('/server/i', $buffer[0]['Caption']) && ($list = @parse_ini_file(PSI_APP_ROOT."/data/osnames.ini", true))) { |
$karray = preg_split('/\./', $ver); |
if (isset($karray[2]) && isset($list['win10'][$karray[2]])) { |
$distribution .= ' ('.$list['win10'][$karray[2]].')'; |
} |
} |
$this->sys->setDistribution($distribution); |
$this->sys->setDistribution($buffer[0]['Caption']); |
if (version_compare($ver, "5.1", "<")) |
$icon = 'Win2000.png'; |
elseif (version_compare($ver, "5.1", ">=") && version_compare($ver, "6.0", "<")) |
1029,10 → 537,8 |
$icon = 'WinXP.png'; |
elseif (version_compare($ver, "6.0", ">=") && version_compare($ver, "6.2", "<")) |
$icon = 'WinVista.png'; |
elseif (version_compare($ver, "6.2", ">=") && version_compare($ver, "10.0.21996", "<")) |
else |
$icon = 'Win8.png'; |
else |
$icon = 'Win11.png'; |
$this->sys->setDistributionIcon($icon); |
} elseif ($this->_ver !== "") { |
if (preg_match("/ReactOS\r?\n\S+\s+(.+)/", $this->_ver, $ar_temp)) { |
1044,48 → 550,26 |
$this->sys->setKernel($ar_temp[1]); |
} |
$this->sys->setDistributionIcon('ReactOS.png'); |
} elseif (preg_match("/^(Microsoft [^\[]*)\s*\[\D*\s*([\.\d]+)\]/", $this->_ver, $ar_temp)) { |
$ver = $ar_temp[2]; |
$kernel = $ver; |
if (($this->_reg === false) && self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProductName", $strBuf, false, false, true) && (strlen($strBuf) > 0)) { // only if reg query via cmd |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows NT\\CurrentVersion\\ProductName", $tmpBuf, false)) { |
$kernel .= ' (64-bit)'; |
} |
} elseif (preg_match("/^(Microsoft [^\[]*)\s*\[\D*\s*(.+)\]/", $this->_ver, $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)) { |
$distribution = $strBuf; |
$this->sys->setDistribution($strBuf); |
} else { |
$distribution = "Microsoft ".$strBuf; |
$this->sys->setDistribution("Microsoft ".$strBuf); |
} |
} elseif (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProductName", $strBuf, false) && (strlen($strBuf) > 0)) { |
if (preg_match("/^Microsoft /", $strBuf)) { |
$distribution = $strBuf; |
} else { |
$distribution = "Microsoft ".$strBuf; |
} |
} else { |
$distribution = $ar_temp[1]; |
$this->sys->setDistribution($ar_temp[1]); |
} |
$kernel = $ar_temp[2]; |
$this->sys->setKernel($kernel); |
if (version_compare($ver, "10.0", ">=") && !preg_match('/server/i', $this->sys->getDistribution()) && ($list = @parse_ini_file(PSI_APP_ROOT."/data/osnames.ini", true))) { |
if (version_compare($ver, "10.0.21996", ">=") && version_compare($ver, "11.0", "<")) { |
$distribution = preg_replace("/Windows 10/", "Windows 11", $distribution); // fix Windows 11 detection |
} |
$karray = preg_split('/\./', $ver); |
if (isset($karray[2]) && isset($list['win10'][$karray[2]])) { |
$distribution .= ' ('.$list['win10'][$karray[2]].')'; |
} |
} |
$this->sys->setDistribution($distribution); |
if (version_compare($ver, "5.1", "<")) |
if ((($kernel[1] == '.') && ($kernel[0] <5)) || (substr($kernel, 0, 4) == '5.0.')) |
$icon = 'Win2000.png'; |
elseif (version_compare($ver, "5.1", ">=") && version_compare($ver, "6.0", "<")) |
$icon = 'WinXP.png'; |
elseif (version_compare($ver, "6.0", ">=") && version_compare($ver, "6.2", "<")) |
elseif ((substr($kernel, 0, 4) == '6.0.') || (substr($kernel, 0, 4) == '6.1.')) |
$icon = 'WinVista.png'; |
elseif (version_compare($ver, "6.2", ">=") && version_compare($ver, "10.0.21996", "<")) |
elseif ((substr($kernel, 0, 4) == '6.2.') || (substr($kernel, 0, 4) == '6.3.') || (substr($kernel, 0, 4) == '6.4.') || (substr($kernel, 0, 5) == '10.0.')) |
$icon = 'Win8.png'; |
else |
$icon = 'Win11.png'; |
$icon = 'WinXP.png'; |
$this->sys->setDistributionIcon($icon); |
} else { |
$this->sys->setDistribution("WINNT"); |
1140,24 → 624,21 |
private function _cpuinfo() |
{ |
$allCpus = $this->_get_Win32_Processor(); |
if (empty($allCpus)) { |
if (!$allCpus) { |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor"; |
if (self::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $coreCount) { |
if (self::readReg($this->_reg, $hkey."\\".$coreCount."\\ProcessorNameString", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\ProcessorNameString", $strBuf, false)) { |
$allCpus[$coreCount]['Name'] = $strBuf; |
} |
if (self::readReg($this->_reg, $hkey."\\".$coreCount."\\~MHz", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\~MHz", $strBuf, false)) { |
if (preg_match("/^0x([0-9a-f]+)$/i", $strBuf, $hexvalue)) { |
$allCpus[$coreCount]['CurrentClockSpeed'] = hexdec($hexvalue[1]); |
} |
} |
if (self::readReg($this->_reg, $hkey."\\".$coreCount."\\VendorIdentifier", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\VendorIdentifier", $strBuf, false)) { |
$allCpus[$coreCount]['Manufacturer'] = $strBuf; |
} |
if (self::readReg($this->_reg, $hkey."\\".$coreCount."\\Identifier", $strBuf, false)) { |
$allCpus[$coreCount]['Caption'] = $strBuf; |
} |
} |
} |
} |
1173,7 → 654,6 |
$globalcpus+=$cpuCount; |
} |
$cpulist = null; |
foreach ($allCpus as $oneCpu) { |
$cpuCount = 1; |
if (isset($oneCpu['NumberOfLogicalProcessors'])) { |
1186,62 → 666,15 |
if (isset($oneCpu['Name'])) $cpu->setModel($oneCpu['Name']); |
if (isset($oneCpu['L3CacheSize']) && ($oneCpu['L3CacheSize'] > 0)) { |
$cpu->setCache($oneCpu['L3CacheSize'] * 1024); |
} elseif (isset($oneCpu['L2CacheSize']) && ($oneCpu['L2CacheSize'] > 0)) { |
} elseif (isset($oneCpu['L2CacheSize'])) { |
$cpu->setCache($oneCpu['L2CacheSize'] * 1024); |
} |
if (isset($oneCpu['CurrentVoltage']) && ($oneCpu['CurrentVoltage'] > 0)) { |
$cpu->setVoltage($oneCpu['CurrentVoltage']/10); |
} |
if (isset($oneCpu['CurrentClockSpeed']) && ($oneCpu['CurrentClockSpeed'] > 0)) { |
if (isset($oneCpu['CurrentClockSpeed'])) { |
$cpu->setCpuSpeed($oneCpu['CurrentClockSpeed']); |
if (isset($oneCpu['MaxClockSpeed']) && ($oneCpu['CurrentClockSpeed'] <= $oneCpu['MaxClockSpeed'])) $cpu->setCpuSpeedMax($oneCpu['MaxClockSpeed']); |
if (isset($oneCpu['MaxClockSpeed']) && ($oneCpu['CurrentClockSpeed'] < $oneCpu['MaxClockSpeed'])) $cpu->setCpuSpeedMax($oneCpu['MaxClockSpeed']); |
} |
if (isset($oneCpu['ExtClock']) && ($oneCpu['ExtClock'] > 0)) { |
$cpu->setBusSpeed($oneCpu['ExtClock']); |
} |
if (isset($oneCpu['Manufacturer'])) { |
$cpumanufacturer = $oneCpu['Manufacturer']; |
$cpu->setVendorId($cpumanufacturer); |
if ($cpumanufacturer === "QEMU") { |
if (isset($oneCpu['Caption'])) { |
$impl = ''; |
if (preg_match('/^ARMv8 \(64-bit\) Family 8 Model ([0-9a-fA-F]+) Revision[ ]+([0-9a-fA-F]+)$/', $oneCpu['Caption'], $partvar)) { |
switch (strtolower($partvar[1])) { |
case '51': |
$impl = '0x0'; break; // Qemu |
case 'd03': |
case 'd07': |
case 'd08': |
$impl = '0x41'; break; // ARM Limited |
case '1': |
$impl = '0x46'; // Fujitsu Ltd. |
} |
} elseif (preg_match('/^ARM Family 7 Model ([0-9a-fA-F]+) Revision[ ]+([0-9a-fA-F]+)$/', $oneCpu['Caption'], $partvar)) { |
switch (strtolower($partvar[1])) { |
case 'c07': |
case 'c0f': |
$impl = '0x41'; // ARM Limited |
} |
} |
if ($impl !== '') { |
if ($cpulist === null) $cpulist = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true); |
if ($cpulist) { |
if ((isset($cpulist['cpu'][$cpufromlist = strtolower($impl.',0x'.$partvar[1].',0x'.$partvar[2])])) |
|| isset($cpulist['cpu'][$cpufromlist = strtolower($impl.',0x'.$partvar[1])])) { |
if (($cpumodel = $cpu->getModel()) !== '') { |
$cpu->setModel($cpumodel.' - '.$cpulist['cpu'][$cpufromlist]); |
} else { |
$cpu->setModel($cpulist['cpu'][$cpufromlist]); |
} |
} |
} |
} |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$this->sys->setVirtualizer("cpuid:QEMU", false); |
} |
} |
} |
if (isset($oneCpu['ExtClock'])) $cpu->setBusSpeed($oneCpu['ExtClock']); |
if (isset($oneCpu['Manufacturer'])) $cpu->setVendorId($oneCpu['Manufacturer']); |
if (PSI_LOAD_BAR) { |
if (($cpubuffer = $this->_get_Win32_PerfFormattedData_PerfOS_Processor()) && (count($cpubuffer) == ($globalcpus+1)) && isset($cpubuffer['cpu'.$i])) { |
$cpu->setLoad($cpubuffer['cpu'.$i]); |
1262,43 → 695,33 |
private function _machine() |
{ |
$buffer = $this->_get_Win32_ComputerSystem(); |
$bufferp = self::getWMI(self::$_wmi, 'Win32_BaseBoard', array('Product')); |
$bufferb = self::getWMI(self::$_wmi, 'Win32_BIOS', array('SMBIOSBIOSVersion', 'ReleaseDate')); |
$bufferp = CommonFunctions::getWMI($this->_wmi, 'Win32_BaseBoard', array('Product')); |
$bufferb = CommonFunctions::getWMI($this->_wmi, 'Win32_BIOS', array('SMBIOSBIOSVersion', 'ReleaseDate')); |
if (!$buffer) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\systemManufacturer", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\systemManufacturer", $strBuf, false)) { |
$buffer[0]['Manufacturer'] = $strBuf; |
} |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemProductName", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemProductName", $strBuf, false)) { |
$buffer[0]['Model'] = $strBuf; |
} |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemFamily", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemFamily", $strBuf, false)) { |
$buffer[0]['SystemFamily'] = $strBuf; |
} |
} |
if (!$bufferp) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BaseBoardProduct", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BaseBoardProduct", $strBuf, false)) { |
$bufferp[0]['Product'] = $strBuf; |
} |
} |
if (!$bufferb) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion", $strBuf, false)) { |
$bufferb[0]['SMBIOSBIOSVersion'] = $strBuf; |
} |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSReleaseDate", $strBuf, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSReleaseDate", $strBuf, false)) { |
$bufferb[0]['ReleaseDate'] = $strBuf; |
} |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
if (isset($buffer[0]['Manufacturer'])) { |
$this->_Manufacturer = $buffer[0]['Manufacturer']; |
} |
if (isset($buffer[0]['Model'])) { |
$this->_Model = $buffer[0]['Model']; |
} |
} |
$buf = ""; |
$model = ""; |
if ($buffer && isset($buffer[0])) { |
1409,25 → 832,25 |
*/ |
private function _network() |
{ |
if (self::$_wmi) { |
if ($this->_wmi) { |
$buffer = $this->_get_Win32_OperatingSystem(); |
if ($buffer && isset($buffer[0]) && isset($buffer[0]['Version']) && version_compare($buffer[0]['Version'], "6.2", ">=")) { // minimal windows 2012 or windows 8 |
$allDevices = self::getWMI(self::$_wmi, 'Win32_PerfRawData_Tcpip_NetworkAdapter', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth')); |
$allDevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfRawData_Tcpip_NetworkAdapter', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth')); |
} else { |
$allDevices = self::getWMI(self::$_wmi, 'Win32_PerfRawData_Tcpip_NetworkInterface', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth')); |
$allDevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfRawData_Tcpip_NetworkInterface', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth')); |
} |
if ($allDevices) { |
$aliases = array(); |
$hkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"; |
if (self::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $netID) { |
if (self::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\PnPInstanceId", $strInstanceID, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\".$strInstanceID."\\FriendlyName", $strName, false)) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\PnPInstanceId", $strInstanceID, false)) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\".$strInstanceID."\\FriendlyName", $strName, false)) { |
$cname = str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strName); //convert to canonical |
if (!isset($aliases[$cname])) { // duplicate checking |
$aliases[$cname]['id'] = $netID; |
$aliases[$cname]['name'] = $strName; |
if (self::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\Name", $strCName, false) |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\Name", $strCName, false) |
&& (str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strCName) !== $cname)) { |
$aliases[$cname]['netname'] = $strCName; |
} |
1441,10 → 864,10 |
$aliases2 = array(); |
$hkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards"; |
if (self::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $netCount) { |
if (self::readReg($this->_reg, $hkey."\\".$netCount."\\Description", $strName, false) |
&& self::readReg($this->_reg, $hkey."\\".$netCount."\\ServiceName", $strGUID, false)) { |
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 |
if (!isset($aliases2[$cname])) { // duplicate checking |
$aliases2[$cname]['id'] = $strGUID; |
1456,7 → 879,7 |
} |
} |
$allNetworkAdapterConfigurations = self::getWMI(self::$_wmi, 'Win32_NetworkAdapterConfiguration', array('SettingID', /*'Description',*/ 'MACAddress', 'IPAddress')); |
$allNetworkAdapterConfigurations = CommonFunctions::getWMI($this->_wmi, 'Win32_NetworkAdapterConfiguration', array('SettingID', /*'Description',*/ 'MACAddress', 'IPAddress')); |
foreach ($allDevices as $device) if (!preg_match('/^WAN Miniport \[/', $device['Name'])) { |
$dev = new NetDevice(); |
$name = $device['Name']; |
1480,11 → 903,11 |
elseif (preg_match('/\s-\s([^-]*)$/', $mininame, $ar_name)) |
$name=substr($mininame, 0, strlen($mininame)-strlen($ar_name[0])); |
$dev->setName($mininame); |
if (isset($NetworkAdapterConfiguration['MACAddress']) && trim($NetworkAdapterConfiguration['MACAddress']) !== "") $macexist = true; |
if (trim($NetworkAdapterConfiguration['MACAddress']) !== "") $macexist = true; |
if (defined('PSI_SHOW_NETWORK_INFOS') && PSI_SHOW_NETWORK_INFOS) { |
if (isset($ali[$name]['netname'])) $dev->setInfo(str_replace(';', ':', $ali[$name]['netname'])); |
if ((!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) |
&& $macexist) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').str_replace(':', '-', strtoupper(trim($NetworkAdapterConfiguration['MACAddress'])))); |
&& (trim($NetworkAdapterConfiguration['MACAddress']) !== "")) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').str_replace(':', '-', strtoupper($NetworkAdapterConfiguration['MACAddress']))); |
if (isset($NetworkAdapterConfiguration['IPAddress'])) |
foreach ($NetworkAdapterConfiguration['IPAddress'] as $ipaddres) |
if (($ipaddres != "0.0.0.0") && ($ipaddres != "::") && !preg_match('/^fe80::/i', $ipaddres)) |
1582,7 → 1005,7 |
*/ |
private function _memory() |
{ |
if (self::$_wmi) { |
if ($this->_wmi) { |
$buffer = $this->_get_Win32_OperatingSystem(); |
if ($buffer) { |
$this->sys->setMemTotal($buffer[0]['TotalVisibleMemorySize'] * 1024); |
1589,7 → 1012,7 |
$this->sys->setMemFree($buffer[0]['FreePhysicalMemory'] * 1024); |
$this->sys->setMemUsed($this->sys->getMemTotal() - $this->sys->getMemFree()); |
} |
$buffer = self::getWMI(self::$_wmi, 'Win32_PageFileUsage'); |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_PageFileUsage'); |
foreach ($buffer as $swapdevice) { |
$dev = new DiskDevice(); |
$dev->setName("SWAP"); |
1617,13 → 1040,11 |
{ |
$typearray = array('Unknown', 'No Root Directory', 'Removable Disk', 'Local Disk', 'Network Drive', 'Compact Disc', 'RAM Disk'); |
$floppyarray = array('Unknown', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', 'Other', 'HD', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '8 in.'); |
$buffer = self::getWMI(self::$_wmi, 'Win32_LogicalDisk', array('Name', 'Size', 'FreeSpace', 'FileSystem', 'DriveType', 'MediaType')); |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_LogicalDisk', array('Name', 'Size', 'FreeSpace', 'FileSystem', 'DriveType', 'MediaType')); |
foreach ($buffer as $filesystem) { |
$dev = new DiskDevice(); |
$dev->setMountPoint($filesystem['Name']); |
if (isset($filesystem['FileSystem'])) { |
$dev->setFsType($filesystem['FileSystem']); |
} |
$dev->setFsType($filesystem['FileSystem']); |
if ($filesystem['Size'] > 0) { |
$dev->setTotal($filesystem['Size']); |
$dev->setFree($filesystem['FreeSpace']); |
1636,19 → 1057,10 |
} |
$this->sys->setDiskDevices($dev); |
} |
if (!$buffer && !defined('PSI_EMU_HOSTNAME')) { |
$letters = array(); |
if (CommonFunctions::executeProgram('fsutil', 'fsinfo drives 2>nul', $out_value, false) && ($out_value !== '') && preg_match('/^Drives:\s*(.+)$/i', $out_value, $disks)) { |
$diskarr = preg_split('/ /', $disks[1], -1, PREG_SPLIT_NO_EMPTY); |
foreach ($diskarr as $disk) if (preg_match('/^(\w):\\\\$/', $disk, $diskletter)) { |
$letters[] = $diskletter[1]; |
} |
} |
if (count($letters) == 0) for ($letter='A'; $letter!='AA'; $letter++) { |
$letters[] = $letter; |
} |
if ((substr($this->sys->getDistribution(), 0, 7)=="ReactOS") && CommonFunctions::executeProgram('cmd', '/c free 2>nul', $out_value, false)) { |
foreach ($letters as $letter) if (CommonFunctions::executeProgram('cmd', '/c free '.$letter.': 2>nul', $out_value, false)) { |
if (!$buffer && ($this->sys->getDistribution()=="ReactOS")) { |
// test for command 'free' on current disk |
if (CommonFunctions::executeProgram('cmd', '/c free 2>nul', $out_value, true)) { |
for ($letter='A'; $letter!='AA'; $letter++) if (CommonFunctions::executeProgram('cmd', '/c free '.$letter.': 2>nul', $out_value, false)) { |
$values = preg_replace('/[^\d\n]/', '', $out_value); |
if (preg_match('/\n(\d+)\n(\d+)\n(\d+)$/', $values, $out_dig)) { |
$size = $out_dig[1]; |
1657,11 → 1069,7 |
if ($used + $free == $size) { |
$dev = new DiskDevice(); |
$dev->setMountPoint($letter.":"); |
if (CommonFunctions::executeProgram('fsutil', 'fsinfo volumeinfo '.$letter.':\ 2>nul', $out_value, false) && ($out_value !== '') && preg_match('/\nFile System Name\s*:\s*(\S+)/im', $out_value, $fsname)) { |
$dev->setFsType($fsname[1]); |
} else { |
$dev->setFsType('Unknown'); |
} |
$dev->setFsType('Unknown'); |
$dev->setName('Unknown'); |
$dev->setTotal($size); |
$dev->setUsed($used); |
1670,30 → 1078,6 |
} |
} |
} |
} else { |
if (substr($this->sys->getDistribution(), 0, 7)=="ReactOS") { |
$disksep = ':\\'; |
} else { |
$disksep = ':'; |
} |
foreach ($letters as $letter) { |
$size = disk_total_space($letter.':\\'); |
$free = disk_free_space($letter.':\\'); |
if (($size !== false) && ($free !== false) && ($size >= 0) && ($free >= 0) && ($size >= $free)) { |
$dev = new DiskDevice(); |
$dev->setMountPoint($letter.":"); |
if (CommonFunctions::executeProgram('fsutil', 'fsinfo volumeinfo '.$letter.$disksep.' 2>nul', $out_value, false) && ($out_value !== '') && preg_match('/\nFile System Name\s*:\s*(\S+)/im', $out_value, $fsname)) { |
$dev->setFsType($fsname[1]); |
} else { |
$dev->setFsType('Unknown'); |
} |
$dev->setName('Unknown'); |
$dev->setTotal($size); |
$dev->setUsed($size - $free); |
$dev->setFree($free); |
$this->sys->setDiskDevices($dev); |
} |
} |
} |
} |
} |
1730,7 → 1114,7 |
$processes['*'] = (count($lines)-1) - 3 ; //correction for process "qprocess *" |
} |
if ($processes['*'] <= 0) { |
$buffer = self::getWMI(self::$_wmi, 'Win32_Process', array('Caption')); |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption')); |
$processes['*'] = count($buffer); |
} |
$processes[' '] = $processes['*']; |
1744,11 → 1128,11 |
*/ |
private function _meminfo() |
{ |
$allMems = self::_get_Win32_PhysicalMemory(); |
$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 = self::getWMI(self::$_wmi, 'Win32_PhysicalMemoryArray', array('MemoryErrorCorrection')); |
$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) { |
1786,68 → 1170,68 |
$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'; |
// 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'; |
// 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))) { |
1864,30 → 1248,30 |
} |
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'; |
// 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)) { |
1920,13 → 1304,13 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
$this->_distro(); // share getDistribution() |
if (substr($this->sys->getDistribution(), 0, 7)=="ReactOS") { |
$this->error->addWarning("The ReactOS version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->_distro(); //share getDistribution() |
if ($this->sys->getDistribution()=="ReactOS") { |
$this->error->addError("WARN", "The ReactOS version of phpSysInfo is a work in progress, some things currently don't work"); |
} |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_hostname(); |
1935,21 → 1319,20 |
$this->_loadavg(); |
$this->_processes(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->_machine(); |
$this->_cpuinfo(); |
$this->_virtualizer(); |
$this->_meminfo(); |
$this->_hardware(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.AIX.inc.php |
---|
26,14 → 26,7 |
*/ |
class AIX extends OS |
{ |
/** |
* uptime command result. |
*/ |
private $_uptime = null; |
/** |
* prtconf command result. |
*/ |
private $_aixdata = array(); |
/** |
42,7 → 35,7 |
*/ |
private function _hostname() |
{ |
/* if (PSI_USE_VHOST) { |
/* if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('hostname', '', $ret)) { |
71,8 → 64,8 |
*/ |
private function _uptime() |
{ |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $buf, $ar_buf)) { |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
$days = $ar_buf[1]; |
88,8 → 81,8 |
*/ |
private function _loadavg() |
{ |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
} |
336,11 → 329,11 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
$this->error->addWarning("The AIX version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addError("WARN", "The AIX version of phpSysInfo is a work in progress, some things currently don't work"); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distro(); |
$this->_hostname(); |
356,6 → 349,9 |
$this->_scsi(); |
$this->_usb(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
362,8 → 358,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.Android.inc.php |
---|
179,7 → 179,7 |
if (($lines = $this->_get_buildprop()) && preg_match('/^ro\.build\.version\.release=([^\n]+)/m', $lines, $ar_buf)) { |
$buf = trim($ar_buf[1]); |
} |
if (($buf === null) || ($buf == "")) { |
if (is_null($buf) || ($buf == "")) { |
$this->sys->setDistribution('Android'); |
} else { |
if (preg_match('/^(\d+\.\d+)/', $buf, $ver) |
241,7 → 241,7 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
257,11 → 257,13 |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->_machine(); |
$this->_cpuinfo(); |
$this->_virtualizer(); |
$this->_pci(); |
$this->_usb(); |
$this->_i2c(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
268,8 → 270,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.DragonFly.inc.php |
---|
32,7 → 32,7 |
public function __construct($blockname = false) |
{ |
parent::__construct($blockname); |
$this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/\n/^CPU: (.*) \((.*)-MHz (.*)\)/"); // multiple regexp separated by \n |
$this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/"); |
$this->setCPURegExp2("/^(.*) at scsibus.*: <(.*)> .*/"); |
$this->setSCSIRegExp2("/^(da[0-9]+): (.*)MB /"); |
$this->setPCIRegExp1("/(.*): <(.*)>(.*) (pci|legacypci)[0-9]+$/"); |
40,6 → 40,19 |
} |
/** |
* UpTime |
* time the system is running |
* |
* @return void |
*/ |
private function _uptime() |
{ |
$a = $this->grabkey('kern.boottime'); |
preg_match("/sec = ([0-9]+)/", $a, $buf); |
$this->sys->setUptime(time() - $buf[1]); |
} |
/** |
* get network information |
* |
* @return void |
127,7 → 140,7 |
* |
* @see BSDCommon::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
134,6 → 147,7 |
parent::build(); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distroicon(); |
$this->_uptime(); |
$this->_processes(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
/web/acc/phpsysinfo/includes/os/class.HPUX.inc.php |
---|
27,11 → 27,6 |
class HPUX extends OS |
{ |
/** |
* uptime command result. |
*/ |
private $_uptime = null; |
/** |
* Virtual Host Name |
* |
* @return void |
38,7 → 33,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('hostname', '', $ret)) { |
67,8 → 62,8 |
*/ |
private function _uptime() |
{ |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) { |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
$days = $ar_buf[1]; |
85,8 → 80,8 |
*/ |
private function _loadavg() |
{ |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
} |
130,6 → 125,7 |
case 'bogomips': |
case 'cpu0bogo': |
$dev->setBogomips($arrBuff[1]); |
break; |
} |
} |
} |
362,7 → 358,7 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
381,6 → 377,9 |
$this->_scsi(); |
$this->_usb(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
387,8 → 386,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.Minix.inc.php |
---|
27,11 → 27,6 |
class Minix extends OS |
{ |
/** |
* uptime command result. |
*/ |
private $_uptime = null; |
/** |
* content of the syslog |
* |
* @var array |
99,6 → 94,7 |
break; |
case 'vendor_id': |
$dev->setVendorId($arrBuff[1]); |
break; |
} |
} |
} |
198,13 → 194,13 |
*/ |
private function _uptime() |
{ |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) day[s]?,\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+),/", $this->_uptime, $ar_buf)) { |
} elseif (preg_match("/up (\d+):(\d+),/", $buf, $ar_buf)) { |
$min = $ar_buf[2]; |
$hours = $ar_buf[1]; |
$this->sys->setUptime($hours * 3600 + $min * 60); |
220,8 → 216,8 |
*/ |
private function _loadavg() |
{ |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/load averages: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/load averages: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
} |
234,7 → 230,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('uname', '-n', $result, PSI_DEBUG)) { |
332,11 → 328,11 |
/** |
* get the information |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
$this->error->addWarning("The Minix version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addError("WARN", "The Minix version of phpSysInfo is a work in progress, some things currently don't work"); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distro(); |
$this->_hostname(); |
350,6 → 346,9 |
$this->_pci(); |
$this->_cpuinfo(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
356,8 → 355,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.NetBSD.inc.php |
---|
32,7 → 32,7 |
public function __construct($blockname = false) |
{ |
parent::__construct($blockname); |
//$this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/"); |
$this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/"); |
$this->setCPURegExp2("/user = (.*), nice = (.*), sys = (.*), intr = (.*), idle = (.*)/"); |
$this->setSCSIRegExp1("/^(.*) at scsibus.*: <(.*)> .*/"); |
$this->setSCSIRegExp2("/^(sd[0-9]+): (.*)([MG])B,/"); |
41,6 → 41,18 |
} |
/** |
* UpTime |
* time the system is running |
* |
* @return void |
*/ |
private function _uptime() |
{ |
$a = $this->grabkey('kern.boottime'); |
$this->sys->setUptime(time() - $a); |
} |
/** |
* get network information |
* |
* @return void |
136,77 → 148,6 |
} |
/** |
* CPU information |
* |
* @return void |
*/ |
protected function cpuinfo() |
{ |
$was = false; |
$cpuarray = array(); |
foreach ($this->readdmesg() as $line) { |
if (preg_match("/^cpu([0-9])+: (.*)/", $line, $ar_buf)) { |
$was = true; |
$ar_buf[2] = trim($ar_buf[2]); |
if (preg_match("/^(.+), ([\d\.]+) MHz/", $ar_buf[2], $ar_buf2)) { |
if (($model = trim($ar_buf2[1])) !== "") { |
$cpuarray[$ar_buf[1]]['model'] = $model; |
} |
if (($speed = trim($ar_buf2[2])) > 0) { |
$cpuarray[$ar_buf[1]]['speed'] = $speed; |
} |
} elseif (preg_match("/^L2 cache (\d+) ([KM])B /", $ar_buf[2], $ar_buf2)) { |
if ($ar_buf2[2]=="M") { |
$cpuarray[$ar_buf[1]]['cache'] = $ar_buf2[1]*1024*1024; |
} elseif ($ar_buf2[2]=="K") { |
$cpuarray[$ar_buf[1]]['cache'] = $ar_buf2[1]*1024; |
} |
} |
} elseif (!preg_match("/^cpu[0-9]+ /", $line) && $was) { |
break; |
} |
} |
$ncpu = $this->grabkey('hw.ncpu'); |
if (($ncpu === "") || !($ncpu >= 1)) { |
$ncpu = 1; |
} |
$ncpu = max($ncpu, count($cpuarray)); |
$model = $this->grabkey('machdep.cpu_brand'); |
$model2 = $this->grabkey('hw.model'); |
if ($cpuspeed = $this->grabkey('machdep.tsc_freq')) { |
$speed = round($cpuspeed / 1000000); |
} else { |
$speed = ""; |
} |
for ($cpu = 0 ; $cpu < $ncpu ; $cpu++) { |
$dev = new CpuDevice(); |
if (isset($cpuarray[$cpu]['model'])) { |
$dev->setModel($cpuarray[$cpu]['model']); |
} elseif ($model !== "") { |
$dev->setModel($model); |
} elseif ($model2 !== "") { |
$dev->setModel($model2); |
} |
if (isset($cpuarray[$cpu]['speed'])) { |
$dev->setCpuSpeed($cpuarray[$cpu]['speed']); |
} elseif ($speed !== "") { |
$dev->setCpuSpeed($speed); |
} |
if (isset($cpuarray[$cpu]['cache'])) { |
$dev->setCache($cpuarray[$cpu]['cache']); |
} |
if (($ncpu == 1) && PSI_LOAD_BAR) { |
$dev->setLoad($this->cpuusage()); |
} |
$this->sys->setCpus($dev); |
} |
} |
/** |
* get icon name |
* |
* @return void |
250,7 → 191,7 |
* |
* @see BSDCommon::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
257,6 → 198,7 |
parent::build(); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distroicon(); |
$this->_uptime(); |
$this->_processes(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
/web/acc/phpsysinfo/includes/os/class.QNX.inc.php |
---|
88,9 → 88,23 |
if (CommonFunctions::executeProgram('pidin', 'info', $buf) |
&& preg_match('/^.* BootTime:(.*)/', $buf, $bstart) |
&& CommonFunctions::executeProgram('date', '', $bstop)) { |
date_default_timezone_set('UTC'); |
/* default error handler */ |
if (function_exists('errorHandlerPsi')) { |
restore_error_handler(); |
} |
/* fatal errors only */ |
$old_err_rep = error_reporting(); |
error_reporting(E_ERROR); |
$uptime = strtotime($bstop)-strtotime($bstart[1]); |
if ($uptime > 0) $this->sys->setUptime($uptime); |
/* restore error level */ |
error_reporting($old_err_rep); |
/* restore error handler */ |
if (function_exists('errorHandlerPsi')) { |
set_error_handler('errorHandlerPsi'); |
} |
} |
} |
111,7 → 125,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST) { |
if (PSI_USE_VHOST === true) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('uname', '-n', $result, PSI_DEBUG)) { |
191,11 → 205,11 |
/** |
* get the information |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
$this->error->addWarning("The QNX version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addError("WARN", "The QNX version of phpSysInfo is a work in progress, some things currently don't work"); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distro(); |
$this->_hostname(); |
206,6 → 220,9 |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->_cpuinfo(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
212,8 → 229,5 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/output/class.Webpage.inc.php |
---|
28,7 → 28,7 |
/** |
* configured indexname |
* |
* @var string |
* @var String |
*/ |
private $_indexname; |
35,7 → 35,7 |
/** |
* configured language |
* |
* @var string |
* @var String |
*/ |
private $_language; |
42,7 → 42,7 |
/** |
* configured template |
* |
* @var string |
* @var String |
*/ |
private $_template; |
56,7 → 56,7 |
/** |
* configured bootstrap template |
* |
* @var string |
* @var String |
*/ |
private $_bootstrap_template; |
/web/acc/phpsysinfo/includes/output/class.WebpageXML.inc.php |
---|
174,8 → 174,8 |
*/ |
public function run() |
{ |
header('Cache-Control: no-cache, must-revalidate'); |
header('Content-Type: text/xml'); |
header("Cache-Control: no-cache, must-revalidate\n"); |
header("Content-Type: text/xml\n\n"); |
$xml = $this->_xml->getXml(); |
echo $xml->asXML(); |
} |
228,16 → 228,18 |
parent::__construct(); |
if (is_string($plugin) && ($plugin !== "")) { |
if (preg_match('/[^A-Za-z]/', $plugin)) { |
$this->_blockName = ' '; // mask wrong plugin name |
} elseif (($plugin = strtolower($plugin)) === "complete") { |
$plugin = strtolower($plugin); |
if ($plugin === "complete") { |
$this->_completeXML = true; |
} elseif (in_array($plugin, array('vitals','hardware','memory','filesystem','network','voltage','current','temperature','fans','power','other','ups'))) { |
$this->_blockName = $plugin; |
} elseif (in_array($plugin, CommonFunctions::getPlugins())) { |
$this->_pluginName = $plugin; |
} else { |
$this->_blockName = ' '; // disable all blocks |
$validblocks = array('vitals','hardware','memory','filesystem','network','voltage','current','temperature','fans','power','other','ups'); |
if (in_array($plugin, $validblocks)) { |
$this->_blockName = $plugin; |
} elseif (in_array($plugin, CommonFunctions::getPlugins())) { |
$this->_pluginName = $plugin; |
} else { |
$this->_blockName = ' '; //disable all blocks |
} |
} |
} |
$this->_prepare(); |
/web/acc/phpsysinfo/includes/output/class.WebpageXSLT.inc.php |
---|
49,7 → 49,7 |
$domxsl->load($xslfile); |
$xsltproc = new XSLTProcessor; |
$xsltproc->importStyleSheet($domxsl); |
header('Cache-Control: no-cache, must-revalidate'); |
header("Cache-Control: no-cache, must-revalidate\n"); |
echo $xsltproc->transformToXML($domxml); |
} |
} |
/web/acc/phpsysinfo/includes/to/class.System.inc.php |
---|
28,7 → 28,7 |
/** |
* name of the host where phpSysInfo runs |
* |
* @var string |
* @var String |
*/ |
private $_hostname = "localhost"; |
35,14 → 35,14 |
/** |
* ip of the host where phpSysInfo runs |
* |
* @var string |
* @var String |
*/ |
private $_ip = "127.0.0.1"; |
/** |
* detailed information about the kernel |
* detailed Information about the kernel |
* |
* @var string |
* @var String |
*/ |
private $_kernel = "Unknown"; |
49,7 → 49,7 |
/** |
* name of the distribution |
* |
* @var string |
* @var String |
*/ |
private $_distribution = "Unknown"; |
56,7 → 56,7 |
/** |
* icon of the distribution (must be available in phpSysInfo) |
* |
* @var string |
* @var String |
*/ |
private $_distributionIcon = "unknown.png"; |
63,7 → 63,7 |
/** |
* detailed Information about the machine name |
* |
* @var string |
* @var String |
*/ |
private $_machine = ""; |
70,7 → 70,7 |
/** |
* time in sec how long the system is running |
* |
* @var int |
* @var Integer |
*/ |
private $_uptime = 0; |
77,7 → 77,7 |
/** |
* count of users that are currently logged in |
* |
* @var int |
* @var Integer |
*/ |
private $_users = 0; |
84,7 → 84,7 |
/** |
* load of the system |
* |
* @var string |
* @var String |
*/ |
private $_load = ""; |
91,7 → 91,7 |
/** |
* load of the system in percent (all cpus, if more than one) |
* |
* @var int |
* @var Integer |
*/ |
private $_loadPercent = null; |
197,7 → 197,7 |
/** |
* free memory in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_memFree = 0; |
204,7 → 204,7 |
/** |
* total memory in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_memTotal = 0; |
211,7 → 211,7 |
/** |
* used memory in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_memUsed = 0; |
218,7 → 218,7 |
/** |
* used memory by applications in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_memApplication = null; |
225,7 → 225,7 |
/** |
* used memory for buffers in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_memBuffer = null; |
232,7 → 232,7 |
/** |
* used memory for cache in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_memCache = null; |
253,13 → 253,6 |
private $_processes = array(); |
/** |
* array with Virtualizer information |
* |
* @var array |
*/ |
private $_virtualizer = array(); |
/** |
* remove duplicate Entries and Count |
* |
* @param array $arrDev list of HWDevices |
298,7 → 291,7 |
* @see System::_memUsed |
* @see System::_memTotal |
* |
* @return int |
* @return Integer |
*/ |
public function getMemPercentUsed() |
{ |
315,7 → 308,7 |
* @see System::_memApplication |
* @see System::_memTotal |
* |
* @return int |
* @return Integer |
*/ |
public function getMemPercentApplication() |
{ |
336,7 → 329,7 |
* @see System::_memCache |
* @see System::_memTotal |
* |
* @return int |
* @return Integer |
*/ |
public function getMemPercentCache() |
{ |
361,7 → 354,7 |
* @see System::_memBuffer |
* @see System::_memTotal |
* |
* @return int |
* @return Integer |
*/ |
public function getMemPercentBuffer() |
{ |
392,7 → 385,7 |
* @see System::_swapDevices |
* @see DiskDevice::getFree() |
* |
* @return int |
* @return Integer |
*/ |
public function getSwapFree() |
{ |
414,7 → 407,7 |
* @see System::_swapDevices |
* @see DiskDevice::getTotal() |
* |
* @return int |
* @return Integer |
*/ |
public function getSwapTotal() |
{ |
436,7 → 429,7 |
* @see System::_swapDevices |
* @see DiskDevice::getUsed() |
* |
* @return int |
* @return Integer |
*/ |
public function getSwapUsed() |
{ |
458,7 → 451,7 |
* @see System::getSwapUsed() |
* @see System::getSwapTotal() |
* |
* @return int |
* @return Integer |
*/ |
public function getSwapPercentUsed() |
{ |
492,7 → 485,7 |
* |
* @see System::$_distribution |
* |
* @return void |
* @return Void |
*/ |
public function setDistribution($distribution) |
{ |
518,7 → 511,7 |
* |
* @see System::$_distributionIcon |
* |
* @return void |
* @return Void |
*/ |
public function setDistributionIcon($distributionIcon) |
{ |
544,7 → 537,7 |
* |
* @see System::$_hostname |
* |
* @return void |
* @return Void |
*/ |
public function setHostname($hostname) |
{ |
570,7 → 563,7 |
* |
* @see System::$_ip |
* |
* @return void |
* @return Void |
*/ |
public function setIp($ip) |
{ |
596,7 → 589,7 |
* |
* @see System::$_kernel |
* |
* @return void |
* @return Void |
*/ |
public function setKernel($kernel) |
{ |
622,7 → 615,7 |
* |
* @see System::$_load |
* |
* @return void |
* @return Void |
*/ |
public function setLoad($load) |
{ |
634,7 → 627,7 |
* |
* @see System::$_loadPercent |
* |
* @return int |
* @return Integer |
*/ |
public function getLoadPercent() |
{ |
644,11 → 637,11 |
/** |
* Sets $_loadPercent. |
* |
* @param int $loadPercent load percent |
* @param Integer $loadPercent load percent |
* |
* @see System::$_loadPercent |
* |
* @return void |
* @return Void |
*/ |
public function setLoadPercent($loadPercent) |
{ |
674,7 → 667,7 |
* |
* @see System::$_machine |
* |
* @return void |
* @return Void |
*/ |
public function setMachine($machine) |
{ |
686,7 → 679,7 |
* |
* @see System::$_uptime |
* |
* @return int |
* @return Integer |
*/ |
public function getUptime() |
{ |
700,7 → 693,7 |
* |
* @see System::$_uptime |
* |
* @return void |
* @return Void |
*/ |
public function setUptime($uptime) |
{ |
712,7 → 705,7 |
* |
* @see System::$_users |
* |
* @return int |
* @return Integer |
*/ |
public function getUsers() |
{ |
722,11 → 715,11 |
/** |
* Sets $_users. |
* |
* @param int $users user count |
* @param Integer $users user count |
* |
* @see System::$_users |
* |
* @return void |
* @return Void |
*/ |
public function setUsers($users) |
{ |
753,7 → 746,7 |
* @see System::$_cpus |
* @see CpuDevice |
* |
* @return void |
* @return Void |
*/ |
public function setCpus($cpus) |
{ |
784,7 → 777,7 |
* @see System::$_netDevices |
* @see NetDevice |
* |
* @return void |
* @return Void |
*/ |
public function setNetDevices($netDevices) |
{ |
811,7 → 804,7 |
* @see System::$_pciDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setPciDevices($pciDevices) |
{ |
838,7 → 831,7 |
* @see System::$_ideDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setIdeDevices($ideDevices) |
{ |
865,7 → 858,7 |
* @see System::$_scsiDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setScsiDevices($scsiDevices) |
{ |
892,7 → 885,7 |
* @see System::$_usbDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setUsbDevices($usbDevices) |
{ |
919,7 → 912,7 |
* @see System::$_tbDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setTbDevices($tbDevices) |
{ |
946,7 → 939,7 |
* @see System::$_i2cDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setI2cDevices($i2cDevices) |
{ |
973,7 → 966,7 |
* @see System::$_nvmeDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setNvmeDevices($nvmeDevices) |
{ |
1000,7 → 993,7 |
* @see System::$_memDevices |
* @see HWDevice |
* |
* @return void |
* @return Void |
*/ |
public function setMemDevices($memDevices) |
{ |
1039,7 → 1032,7 |
* |
* @see System::$_memApplication |
* |
* @return int |
* @return Integer |
*/ |
public function getMemApplication() |
{ |
1049,11 → 1042,11 |
/** |
* Sets $_memApplication. |
* |
* @param int $memApplication application memory |
* @param Integer $memApplication application memory |
* |
* @see System::$_memApplication |
* |
* @return void |
* @return Void |
*/ |
public function setMemApplication($memApplication) |
{ |
1065,7 → 1058,7 |
* |
* @see System::$_memBuffer |
* |
* @return int |
* @return Integer |
*/ |
public function getMemBuffer() |
{ |
1075,11 → 1068,11 |
/** |
* Sets $_memBuffer. |
* |
* @param int $memBuffer buffer memory |
* @param Integer $memBuffer buffer memory |
* |
* @see System::$_memBuffer |
* |
* @return void |
* @return Void |
*/ |
public function setMemBuffer($memBuffer) |
{ |
1091,7 → 1084,7 |
* |
* @see System::$_memCache |
* |
* @return int |
* @return Integer |
*/ |
public function getMemCache() |
{ |
1101,11 → 1094,11 |
/** |
* Sets $_memCache. |
* |
* @param int $memCache cache memory |
* @param Integer $memCache cache memory |
* |
* @see System::$_memCache |
* |
* @return void |
* @return Void |
*/ |
public function setMemCache($memCache) |
{ |
1117,7 → 1110,7 |
* |
* @see System::$_memFree |
* |
* @return int |
* @return Integer |
*/ |
public function getMemFree() |
{ |
1127,11 → 1120,11 |
/** |
* Sets $_memFree. |
* |
* @param int $memFree free memory |
* @param Integer $memFree free memory |
* |
* @see System::$_memFree |
* |
* @return void |
* @return Void |
*/ |
public function setMemFree($memFree) |
{ |
1143,7 → 1136,7 |
* |
* @see System::$_memTotal |
* |
* @return int |
* @return Integer |
*/ |
public function getMemTotal() |
{ |
1153,11 → 1146,11 |
/** |
* Sets $_memTotal. |
* |
* @param int $memTotal total memory |
* @param Integer $memTotal total memory |
* |
* @see System::$_memTotal |
* |
* @return void |
* @return Void |
*/ |
public function setMemTotal($memTotal) |
{ |
1169,7 → 1162,7 |
* |
* @see System::$_memUsed |
* |
* @return int |
* @return Integer |
*/ |
public function getMemUsed() |
{ |
1179,11 → 1172,11 |
/** |
* Sets $_memUsed. |
* |
* @param int $memUsed used memory |
* @param Integer $memUsed used memory |
* |
* @see System::$_memUsed |
* |
* @return void |
* @return Void |
*/ |
public function setMemUsed($memUsed) |
{ |
1210,7 → 1203,7 |
* @see System::$_swapDevices |
* @see DiskDevice |
* |
* @return void |
* @return Void |
*/ |
public function setSwapDevices($swapDevices) |
{ |
1236,7 → 1229,7 |
* |
* @see System::$_processes |
* |
* @return void |
* @return Void |
*/ |
public function setProcesses($processes) |
{ |
1247,38 → 1240,4 |
} |
*/ |
} |
/** |
* Returns $_virtualizer. |
* |
* @see System::$_virtualizer |
* |
* @return array |
*/ |
public function getVirtualizer() |
{ |
return $this->_virtualizer; |
} |
/** |
* Sets $_virtualizer. |
* |
* @param String $virtualizer virtualizername |
* @param Bool|String $value true, false or virtualizername to replace |
* |
* @see System::$_virtualizer |
* |
* @return void |
*/ |
public function setVirtualizer($virtualizer, $value = true) |
{ |
if (!isset($this->_virtualizer[$virtualizer])) { |
if (is_bool($value)) { |
$this->_virtualizer[$virtualizer] = $value; |
} else { // replace the virtualizer with another |
$this->_virtualizer[$virtualizer] = true; |
$this->_virtualizer[$value] = false; |
} |
} |
} |
} |
/web/acc/phpsysinfo/includes/to/device/class.DiskDevice.inc.php |
---|
28,7 → 28,7 |
/** |
* name of the disk device |
* |
* @var string |
* @var String |
*/ |
private $_name = ""; |
35,7 → 35,7 |
/** |
* type of the filesystem on the disk device |
* |
* @var string |
* @var String |
*/ |
private $_fsType = ""; |
42,7 → 42,7 |
/** |
* diskspace that is free in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_free = 0; |
49,7 → 49,7 |
/** |
* diskspace that is used in bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_used = 0; |
56,7 → 56,7 |
/** |
* total diskspace |
* |
* @var int |
* @var Integer |
*/ |
private $_total = 0; |
63,7 → 63,7 |
/** |
* mount point of the disk device if available |
* |
* @var string |
* @var String |
*/ |
private $_mountPoint = null; |
70,7 → 70,7 |
/** |
* additional options of the device, like mount options |
* |
* @var string |
* @var String |
*/ |
private $_options = null; |
77,7 → 77,7 |
/** |
* inodes usage in percent if available |
* |
* @var int |
* @var Integer |
*/ |
private $_percentInodesUsed = null; |
84,7 → 84,7 |
/** |
* ignore mode |
* |
* @var int |
* @var Integer |
*/ |
private $_ignore = 0; |
94,7 → 94,7 |
* @see DiskDevice::$_total |
* @see DiskDevice::$_used |
* |
* @return int |
* @return Integer |
*/ |
public function getPercentUsed() |
{ |
110,7 → 110,7 |
* |
* @see DiskDevice::$_PercentInodesUsed |
* |
* @return int |
* @return Integer |
*/ |
public function getPercentInodesUsed() |
{ |
120,11 → 120,11 |
/** |
* Sets $_PercentInodesUsed. |
* |
* @param int $percentInodesUsed inodes percent |
* @param Integer $percentInodesUsed inodes percent |
* |
* @see DiskDevice::$_PercentInodesUsed |
* |
* @return void |
* @return Void |
*/ |
public function setPercentInodesUsed($percentInodesUsed) |
{ |
136,7 → 136,7 |
* |
* @see DiskDevice::$_free |
* |
* @return int |
* @return Integer |
*/ |
public function getFree() |
{ |
146,11 → 146,11 |
/** |
* Sets $_free. |
* |
* @param int $free free bytes |
* @param Integer $free free bytes |
* |
* @see DiskDevice::$_free |
* |
* @return void |
* @return Void |
*/ |
public function setFree($free) |
{ |
162,7 → 162,7 |
* |
* @see DiskDevice::$_fsType |
* |
* @return string |
* @return String |
*/ |
public function getFsType() |
{ |
176,7 → 176,7 |
* |
* @see DiskDevice::$_fsType |
* |
* @return void |
* @return Void |
*/ |
public function setFsType($fsType) |
{ |
188,7 → 188,7 |
* |
* @see DiskDevice::$_mountPoint |
* |
* @return string |
* @return String |
*/ |
public function getMountPoint() |
{ |
198,11 → 198,11 |
/** |
* Sets $_mountPoint. |
* |
* @param string $mountPoint mountpoint |
* @param String $mountPoint mountpoint |
* |
* @see DiskDevice::$_mountPoint |
* |
* @return void |
* @return Void |
*/ |
public function setMountPoint($mountPoint) |
{ |
214,7 → 214,7 |
* |
* @see DiskDevice::$_name |
* |
* @return string |
* @return String |
*/ |
public function getName() |
{ |
224,11 → 224,11 |
/** |
* Sets $_name. |
* |
* @param string $name device name |
* @param String $name device name |
* |
* @see DiskDevice::$_name |
* |
* @return void |
* @return Void |
*/ |
public function setName($name) |
{ |
240,7 → 240,7 |
* |
* @see DiskDevice::$_options |
* |
* @return string |
* @return String |
*/ |
public function getOptions() |
{ |
250,11 → 250,11 |
/** |
* Sets $_options. |
* |
* @param string $options additional options |
* @param String $options additional options |
* |
* @see DiskDevice::$_options |
* |
* @return void |
* @return Void |
*/ |
public function setOptions($options) |
{ |
266,7 → 266,7 |
* |
* @see DiskDevice::$_total |
* |
* @return int |
* @return Integer |
*/ |
public function getTotal() |
{ |
276,11 → 276,11 |
/** |
* Sets $_total. |
* |
* @param int $total total bytes |
* @param Integer $total total bytes |
* |
* @see DiskDevice::$_total |
* |
* @return void |
* @return Void |
*/ |
public function setTotal($total) |
{ |
292,7 → 292,7 |
* |
* @see DiskDevice::$_used |
* |
* @return int |
* @return Integer |
*/ |
public function getUsed() |
{ |
302,11 → 302,11 |
/** |
* Sets $_used. |
* |
* @param int $used used bytes |
* @param Integer $used used bytes |
* |
* @see DiskDevice::$_used |
* |
* @return void |
* @return Void |
*/ |
public function setUsed($used) |
{ |
318,7 → 318,7 |
* |
* @see DiskDevice::$_ignore |
* |
* @return int |
* @return Integer |
*/ |
public function getIgnore() |
{ |
330,7 → 330,7 |
* |
* @see DiskDevice::$_ignore |
* |
* @return void |
* @return Void |
*/ |
public function setIgnore($ignore) |
{ |
/web/acc/phpsysinfo/includes/to/device/class.HWDevice.inc.php |
---|
28,7 → 28,7 |
/** |
* name of the device |
* |
* @var string |
* @var String |
*/ |
private $_name = ""; |
35,7 → 35,7 |
/** |
* capacity of the device, if not available it will be null |
* |
* @var int |
* @var Integer |
*/ |
private $_capacity = null; |
42,7 → 42,7 |
/** |
* manufacturer of the device, if not available it will be null |
* |
* @var int |
* @var Integer |
*/ |
private $_manufacturer = null; |
49,7 → 49,7 |
/** |
* product of the device, if not available it will be null |
* |
* @var int |
* @var Integer |
*/ |
private $_product = null; |
56,7 → 56,7 |
/** |
* serial number of the device, if not available it will be null |
* |
* @var string |
* @var String |
*/ |
private $_serial = null; |
77,7 → 77,7 |
/** |
* count of the device |
* |
* @var int |
* @var Integer |
*/ |
private $_count = 1; |
121,7 → 121,7 |
* |
* @see HWDevice::$_name |
* |
* @return void |
* @return Void |
*/ |
public function setName($name) |
{ |
147,7 → 147,7 |
* |
* @see HWDevice::$_manufacturer |
* |
* @return void |
* @return Void |
*/ |
public function setManufacturer($manufacturer) |
{ |
173,7 → 173,7 |
* |
* @see HWDevice::$_product |
* |
* @return void |
* @return Void |
*/ |
public function setProduct($product) |
{ |
199,7 → 199,7 |
* |
* @see HWDevice::$_serial |
* |
* @return void |
* @return Void |
*/ |
public function setSerial($serial) |
{ |
225,7 → 225,7 |
* |
* @see HWDevice::$_speed |
* |
* @return void |
* @return Void |
*/ |
public function setSpeed($speed) |
{ |
251,7 → 251,7 |
* |
* @see HWDevice::$_voltage |
* |
* @return void |
* @return Void |
*/ |
public function setVoltage($voltage) |
{ |
263,7 → 263,7 |
* |
* @see HWDevice::$_capacity |
* |
* @return int |
* @return Integer |
*/ |
public function getCapacity() |
{ |
273,11 → 273,11 |
/** |
* Sets $_capacity. |
* |
* @param int $capacity device capacity |
* @param Integer $capacity device capacity |
* |
* @see HWDevice::$_capacity |
* |
* @return void |
* @return Void |
*/ |
public function setCapacity($capacity) |
{ |
289,7 → 289,7 |
* |
* @see HWDevice::$_count |
* |
* @return int |
* @return Integer |
*/ |
public function getCount() |
{ |
299,11 → 299,11 |
/** |
* Sets $_count. |
* |
* @param int $count device count |
* @param Integer $count device count |
* |
* @see HWDevice::$_count |
* |
* @return void |
* @return Void |
*/ |
public function setCount($count) |
{ |
/web/acc/phpsysinfo/includes/to/device/class.SensorDevice.inc.php |
---|
28,7 → 28,7 |
/** |
* name of the sensor |
* |
* @var string |
* @var String |
*/ |
private $_name = ""; |
35,7 → 35,7 |
/** |
* current value of the sensor |
* |
* @var int |
* @var Integer |
*/ |
private $_value = 0; |
42,7 → 42,7 |
/** |
* maximum value of the sensor |
* |
* @var int |
* @var Integer |
*/ |
private $_max = null; |
49,7 → 49,7 |
/** |
* minimum value of the sensor |
* |
* @var int |
* @var Integer |
*/ |
private $_min = null; |
56,7 → 56,7 |
/** |
* event of the sensor |
* |
* @var string |
* @var String |
*/ |
private $_event = ""; |
63,7 → 63,7 |
/** |
* unit of values of the sensor |
* |
* @var string |
* @var String |
*/ |
private $_unit = ""; |
72,7 → 72,7 |
* |
* @see Sensor::$_max |
* |
* @return int |
* @return Integer |
*/ |
public function getMax() |
{ |
82,11 → 82,11 |
/** |
* Sets $_max. |
* |
* @param int $max maximum value |
* @param Integer $max maximum value |
* |
* @see Sensor::$_max |
* |
* @return void |
* @return Void |
*/ |
public function setMax($max) |
{ |
98,7 → 98,7 |
* |
* @see Sensor::$_min |
* |
* @return int |
* @return Integer |
*/ |
public function getMin() |
{ |
108,11 → 108,11 |
/** |
* Sets $_min. |
* |
* @param int $min minimum value |
* @param Integer $min minimum value |
* |
* @see Sensor::$_min |
* |
* @return void |
* @return Void |
*/ |
public function setMin($min) |
{ |
138,7 → 138,7 |
* |
* @see Sensor::$_name |
* |
* @return void |
* @return Void |
*/ |
public function setName($name) |
{ |
150,7 → 150,7 |
* |
* @see Sensor::$_value |
* |
* @return int |
* @return Integer |
*/ |
public function getValue() |
{ |
160,11 → 160,11 |
/** |
* Sets $_value. |
* |
* @param int $value current value |
* @param Integer $value current value |
* |
* @see Sensor::$_value |
* |
* @return void |
* @return Void |
*/ |
public function setValue($value) |
{ |
190,7 → 190,7 |
* |
* @see Sensor::$_event |
* |
* @return void |
* @return Void |
*/ |
public function setEvent($event) |
{ |
216,7 → 216,7 |
* |
* @see Sensor::$_unit |
* |
* @return void |
* @return Void |
*/ |
public function setUnit($unit) |
{ |
/web/acc/phpsysinfo/includes/to/device/class.CpuDevice.inc.php |
---|
28,21 → 28,14 |
/** |
* model of the cpu |
* |
* @var string |
* @var String |
*/ |
private $_model = ""; |
/** |
* cpu voltage |
* |
* @var Float |
*/ |
private $_voltage = 0; |
/** |
* speed of the cpu in hertz |
* |
* @var int |
* @var Integer |
*/ |
private $_cpuSpeed = 0; |
49,7 → 42,7 |
/** |
* max speed of the cpu in hertz |
* |
* @var int |
* @var Integer |
*/ |
private $_cpuSpeedMax = 0; |
56,7 → 49,7 |
/** |
* min speed of the cpu in hertz |
* |
* @var int |
* @var Integer |
*/ |
private $_cpuSpeedMin = 0; |
63,7 → 56,7 |
/** |
* cache size in bytes, if available |
* |
* @var int |
* @var Integer |
*/ |
private $_cache = null; |
70,7 → 63,7 |
/** |
* virtualization, if available |
* |
* @var string |
* @var String |
*/ |
private $_virt = null; |
77,7 → 70,7 |
/** |
* busspeed in hertz, if available |
* |
* @var int |
* @var Integer |
*/ |
private $_busSpeed = null; |
84,7 → 77,7 |
/** |
* bogomips of the cpu, if available |
* |
* @var int |
* @var Integer |
*/ |
private $_bogomips = null; |
91,7 → 84,7 |
/** |
* temperature of the cpu, if available |
* |
* @var int |
* @var Integer |
*/ |
private $_temp = null; |
98,7 → 91,7 |
/** |
* vendorid, if available |
* |
* @var string |
* @var String |
*/ |
private $_vendorid = null; |
105,7 → 98,7 |
/** |
* current load in percent of the cpu, if available |
* |
* @var int |
* @var Integer |
*/ |
private $_load = null; |
128,7 → 121,7 |
* |
* @see Cpu::$_model |
* |
* @return void |
* @return Void |
*/ |
public function setModel($model) |
{ |
136,37 → 129,11 |
} |
/** |
* Returns $_voltage. |
* |
* @see Cpu::$_voltage |
* |
* @return Float |
*/ |
public function getVoltage() |
{ |
return $this->_voltage; |
} |
/** |
* Sets $_voltage. |
* |
* @param int $voltage voltage |
* |
* @see Cpu::$_voltage |
* |
* @return void |
*/ |
public function setVoltage($voltage) |
{ |
$this->_voltage = $voltage; |
} |
/** |
* Returns $_cpuSpeed. |
* |
* @see Cpu::$_cpuSpeed |
* |
* @return int |
* @return Integer |
*/ |
public function getCpuSpeed() |
{ |
176,11 → 143,11 |
/** |
* Sets $_cpuSpeed. |
* |
* @param int $cpuSpeed cpuspeed |
* @param Integer $cpuSpeed cpuspeed |
* |
* @see Cpu::$_cpuSpeed |
* |
* @return void |
* @return Void |
*/ |
public function setCpuSpeed($cpuSpeed) |
{ |
192,7 → 159,7 |
* |
* @see Cpu::$_cpuSpeedMAx |
* |
* @return int |
* @return Integer |
*/ |
public function getCpuSpeedMax() |
{ |
202,11 → 169,11 |
/** |
* Sets $_cpuSpeedMax. |
* |
* @param int $cpuSpeedMax cpuspeedmax |
* @param Integer $cpuSpeedMax cpuspeedmax |
* |
* @see Cpu::$_cpuSpeedMax |
* |
* @return void |
* @return Void |
*/ |
public function setCpuSpeedMax($cpuSpeedMax) |
{ |
218,7 → 185,7 |
* |
* @see Cpu::$_cpuSpeedMin |
* |
* @return int |
* @return Integer |
*/ |
public function getCpuSpeedMin() |
{ |
228,11 → 195,11 |
/** |
* Sets $_cpuSpeedMin. |
* |
* @param int $cpuSpeedMin cpuspeedmin |
* @param Integer $cpuSpeedMin cpuspeedmin |
* |
* @see Cpu::$_cpuSpeedMin |
* |
* @return void |
* @return Void |
*/ |
public function setCpuSpeedMin($cpuSpeedMin) |
{ |
244,7 → 211,7 |
* |
* @see Cpu::$_cache |
* |
* @return int |
* @return Integer |
*/ |
public function getCache() |
{ |
254,11 → 221,11 |
/** |
* Sets $_cache. |
* |
* @param int $cache cache size |
* @param Integer $cache cache size |
* |
* @see Cpu::$_cache |
* |
* @return void |
* @return Void |
*/ |
public function setCache($cache) |
{ |
284,7 → 251,7 |
* |
* @see Cpu::$_virt |
* |
* @return void |
* @return Void |
*/ |
public function setVirt($virt) |
{ |
296,7 → 263,7 |
* |
* @see Cpu::$_busSpeed |
* |
* @return int |
* @return Integer |
*/ |
public function getBusSpeed() |
{ |
306,11 → 273,11 |
/** |
* Sets $_busSpeed. |
* |
* @param int $busSpeed busspeed |
* @param Integer $busSpeed busspeed |
* |
* @see Cpu::$_busSpeed |
* |
* @return void |
* @return Void |
*/ |
public function setBusSpeed($busSpeed) |
{ |
322,7 → 289,7 |
* |
* @see Cpu::$_bogomips |
* |
* @return int |
* @return Integer |
*/ |
public function getBogomips() |
{ |
332,11 → 299,11 |
/** |
* Sets $_bogomips. |
* |
* @param int $bogomips bogompis |
* @param Integer $bogomips bogompis |
* |
* @see Cpu::$_bogomips |
* |
* @return void |
* @return Void |
*/ |
public function setBogomips($bogomips) |
{ |
348,7 → 315,7 |
* |
* @see Cpu::$_temp |
* |
* @return int |
* @return Integer |
*/ |
/* |
public function getTemp() |
360,11 → 327,11 |
/** |
* Sets $_temp. |
* |
* @param int $temp temperature |
* @param Integer $temp temperature |
* |
* @see Cpu::$_temp |
* |
* @return void |
* @return Void |
*/ |
/* |
public function setTemp($temp) |
392,11 → 359,11 |
* |
* @see Cpu::$_vendorid |
* |
* @return void |
* @return Void |
*/ |
public function setVendorId($vendorid) |
{ |
$this->_vendorid = trim(preg_replace('/[\s!]/', '', $vendorid)); |
$this->_vendorid = $vendorid; |
} |
/** |
404,7 → 371,7 |
* |
* @see CpuDevice::$_load |
* |
* @return int |
* @return Integer |
*/ |
public function getLoad() |
{ |
414,11 → 381,11 |
/** |
* Sets $_load. |
* |
* @param int $load load percent |
* @param Integer $load load percent |
* |
* @see CpuDevice::$_load |
* |
* @return void |
* @return Void |
*/ |
public function setLoad($load) |
{ |
/web/acc/phpsysinfo/includes/to/device/class.NetDevice.inc.php |
---|
28,7 → 28,7 |
/** |
* name of the device |
* |
* @var string |
* @var String |
*/ |
private $_name = ""; |
35,7 → 35,7 |
/** |
* transmitted bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_txBytes = 0; |
42,7 → 42,7 |
/** |
* received bytes |
* |
* @var int |
* @var Integer |
*/ |
private $_rxBytes = 0; |
49,7 → 49,7 |
/** |
* counted error packages |
* |
* @var int |
* @var Integer |
*/ |
private $_errors = 0; |
56,7 → 56,7 |
/** |
* counted droped packages |
* |
* @var int |
* @var Integer |
*/ |
private $_drops = 0; |
63,7 → 63,7 |
/** |
* string with info |
* |
* @var string |
* @var String |
*/ |
private $_info = null; |
72,7 → 72,7 |
* |
* @see NetDevice::$_drops |
* |
* @return int |
* @return Integer |
*/ |
public function getDrops() |
{ |
82,11 → 82,11 |
/** |
* Sets $_drops. |
* |
* @param int $drops dropped packages |
* @param Integer $drops dropped packages |
* |
* @see NetDevice::$_drops |
* |
* @return void |
* @return Void |
*/ |
public function setDrops($drops) |
{ |
98,7 → 98,7 |
* |
* @see NetDevice::$_errors |
* |
* @return int |
* @return Integer |
*/ |
public function getErrors() |
{ |
108,11 → 108,11 |
/** |
* Sets $_errors. |
* |
* @param int $errors error packages |
* @param Integer $errors error packages |
* |
* @see NetDevice::$_errors |
* |
* @return void |
* @return Void |
*/ |
public function setErrors($errors) |
{ |
138,7 → 138,7 |
* |
* @see NetDevice::$_name |
* |
* @return void |
* @return Void |
*/ |
public function setName($name) |
{ |
150,7 → 150,7 |
* |
* @see NetDevice::$_rxBytes |
* |
* @return int |
* @return Integer |
*/ |
public function getRxBytes() |
{ |
160,11 → 160,11 |
/** |
* Sets $_rxBytes. |
* |
* @param int $rxBytes received bytes |
* @param Integer $rxBytes received bytes |
* |
* @see NetDevice::$_rxBytes |
* |
* @return void |
* @return Void |
*/ |
public function setRxBytes($rxBytes) |
{ |
176,7 → 176,7 |
* |
* @see NetDevice::$_txBytes |
* |
* @return int |
* @return Integer |
*/ |
public function getTxBytes() |
{ |
186,11 → 186,11 |
/** |
* Sets $_txBytes. |
* |
* @param int $txBytes transmitted bytes |
* @param Integer $txBytes transmitted bytes |
* |
* @see NetDevice::$_txBytes |
* |
* @return void |
* @return Void |
*/ |
public function setTxBytes($txBytes) |
{ |
216,7 → 216,7 |
* |
* @see NetDevice::$_info |
* |
* @return void |
* @return Void |
*/ |
public function setInfo($info) |
{ |
/web/acc/phpsysinfo/includes/to/device/class.UPSDevice.inc.php |
---|
28,7 → 28,7 |
/** |
* name of the ups |
* |
* @var string |
* @var String |
*/ |
private $_name = ""; |
35,7 → 35,7 |
/** |
* model of the ups |
* |
* @var string |
* @var String |
*/ |
private $_model = ""; |
42,7 → 42,7 |
/** |
* mode of the ups |
* |
* @var string |
* @var String |
*/ |
private $_mode = ""; |
49,7 → 49,7 |
/** |
* last start time |
* |
* @var string |
* @var String |
*/ |
private $_startTime = ""; |
56,7 → 56,7 |
/** |
* status of the ups |
* |
* @var string |
* @var String |
*/ |
private $_status = ""; |
63,7 → 63,7 |
/** |
* temperature of the ups |
* |
* @var int |
* @var Integer |
*/ |
private $_temperatur = null; |
70,7 → 70,7 |
/** |
* outages count |
* |
* @var int |
* @var Integer |
*/ |
private $_outages = null; |
77,7 → 77,7 |
/** |
* date of last outtage |
* |
* @var string |
* @var String |
*/ |
private $_lastOutage = null; |
84,7 → 84,7 |
/** |
* date of last outage finish |
* |
* @var string |
* @var String |
*/ |
private $_lastOutageFinish = null; |
91,7 → 91,7 |
/** |
* line volt |
* |
* @var int |
* @var Integer |
*/ |
private $_lineVoltage = null; |
98,7 → 98,7 |
/** |
* line freq |
* |
* @var int |
* @var Integer |
*/ |
private $_lineFrequency = null; |
105,7 → 105,7 |
/** |
* current load of the ups in percent |
* |
* @var int |
* @var Integer |
*/ |
private $_load = null; |
112,7 → 112,7 |
/** |
* battery installation date |
* |
* @var string |
* @var String |
*/ |
private $_batteryDate = null; |
119,7 → 119,7 |
/** |
* current battery volt |
* |
* @var int |
* @var Integer |
*/ |
private $_batteryVoltage = null; |
126,7 → 126,7 |
/** |
* current charge in percent of the battery |
* |
* @var int |
* @var Integer |
*/ |
private $_batterCharge = null; |
133,18 → 133,11 |
/** |
* time left |
* |
* @var string |
* @var String |
*/ |
private $_timeLeft = null; |
/** |
* beeper enabled or disabled |
* |
* @var string |
*/ |
private $_beeperStatus = null; |
/** |
* Returns $_batterCharge. |
* |
* @see UPSDevice::$_batterCharge |
159,7 → 152,7 |
/** |
* Sets $_batterCharge. |
* |
* @param int $batterCharge battery charge |
* @param Integer $batterCharge battery charge |
* |
* @see UPSDevice::$_batterCharge |
* |
189,7 → 182,7 |
* |
* @see UPSDevice::$_batteryDate |
* |
* @return void |
* @return Void |
*/ |
public function setBatteryDate($batteryDate) |
{ |
201,7 → 194,7 |
* |
* @see UPSDevice::$_batteryVoltage |
* |
* @return int |
* @return Integer |
*/ |
public function getBatteryVoltage() |
{ |
211,11 → 204,11 |
/** |
* Sets $_batteryVoltage. |
* |
* @param int $batteryVoltage battery volt |
* @param Integer $batteryVoltage battery volt |
* |
* @see UPSDevice::$_batteryVoltage |
* |
* @return void |
* @return Void |
*/ |
public function setBatteryVoltage($batteryVoltage) |
{ |
241,7 → 234,7 |
* |
* @see UPSDevice::$lastOutage |
* |
* @return void |
* @return Void |
*/ |
public function setLastOutage($lastOutage) |
{ |
267,7 → 260,7 |
* |
* @see UPSDevice::$_lastOutageFinish |
* |
* @return void |
* @return Void |
*/ |
public function setLastOutageFinish($lastOutageFinish) |
{ |
279,7 → 272,7 |
* |
* @see UPSDevice::$_lineVoltage |
* |
* @return int |
* @return Integer |
*/ |
public function getLineVoltage() |
{ |
289,11 → 282,11 |
/** |
* Sets $_lineVoltage. |
* |
* @param int $lineVoltage line voltage |
* @param Integer $lineVoltage line voltage |
* |
* @see UPSDevice::$_lineVoltage |
* |
* @return void |
* @return Void |
*/ |
public function setLineVoltage($lineVoltage) |
{ |
305,7 → 298,7 |
* |
* @see UPSDevice::$_lineFrequency |
* |
* @return int |
* @return Integer |
*/ |
public function getLineFrequency() |
{ |
315,11 → 308,11 |
/** |
* Sets $_lineFrequency. |
* |
* @param int $lineFrequency line frequency |
* @param Integer $lineFrequency line frequency |
* |
* @see UPSDevice::$_lineFrequency |
* |
* @return void |
* @return Void |
*/ |
public function setLineFrequency($lineFrequency) |
{ |
331,7 → 324,7 |
* |
* @see UPSDevice::$_load |
* |
* @return int |
* @return Integer |
*/ |
public function getLoad() |
{ |
341,11 → 334,11 |
/** |
* Sets $_load. |
* |
* @param int $load current load |
* @param Integer $load current load |
* |
* @see UPSDevice::$_load |
* |
* @return void |
* @return Void |
*/ |
public function setLoad($load) |
{ |
371,7 → 364,7 |
* |
* @see UPSDevice::$_mode |
* |
* @return void |
* @return Void |
*/ |
public function setMode($mode) |
{ |
397,7 → 390,7 |
* |
* @see UPSDevice::$_model |
* |
* @return void |
* @return Void |
*/ |
public function setModel($model) |
{ |
423,7 → 416,7 |
* |
* @see UPSDevice::$_name |
* |
* @return void |
* @return Void |
*/ |
public function setName($name) |
{ |
435,7 → 428,7 |
* |
* @see UPSDevice::$_outages |
* |
* @return int |
* @return Integer |
*/ |
public function getOutages() |
{ |
445,11 → 438,11 |
/** |
* Sets $_outages. |
* |
* @param int $outages outages count |
* @param Integer $outages outages count |
* |
* @see UPSDevice::$_outages |
* |
* @return void |
* @return Void |
*/ |
public function setOutages($outages) |
{ |
475,7 → 468,7 |
* |
* @see UPSDevice::$_startTime |
* |
* @return void |
* @return Void |
*/ |
public function setStartTime($startTime) |
{ |
501,7 → 494,7 |
* |
* @see UPSDevice::$_status |
* |
* @return void |
* @return Void |
*/ |
public function setStatus($status) |
{ |
513,7 → 506,7 |
* |
* @see UPSDevice::$_temperatur |
* |
* @return int |
* @return Integer |
*/ |
public function getTemperatur() |
{ |
523,11 → 516,11 |
/** |
* Sets $_temperatur. |
* |
* @param int $temperatur temperature |
* @param Integer $temperatur temperature |
* |
* @see UPSDevice::$_temperatur |
* |
* @return void |
* @return Void |
*/ |
public function setTemperatur($temperatur) |
{ |
553,36 → 546,10 |
* |
* @see UPSDevice::$_timeLeft |
* |
* @return void |
* @return Void |
*/ |
public function setTimeLeft($timeLeft) |
{ |
$this->_timeLeft = $timeLeft; |
} |
/** |
* Returns $_beeperStatus. |
* |
* @see UPSDevice::$_beeperStatus |
* |
* @return String |
*/ |
public function getBeeperStatus() |
{ |
return $this->_beeperStatus; |
} |
/** |
* Sets $_beeperStatus. |
* |
* @param String $beeperStatus beeper status |
* |
* @see UPSDevice::$_beeperStatus |
* |
* @return void |
*/ |
public function setBeeperStatus($beeperStatus) |
{ |
$this->_beeperStatus = $beeperStatus; |
} |
} |
/web/acc/phpsysinfo/includes/ups/class.apcupsd.inc.php |
---|
39,54 → 39,27 |
public function __construct() |
{ |
parent::__construct(); |
if (!defined('PSI_UPS_APCUPSD_ACCESS')) { |
define('PSI_UPS_APCUPSD_ACCESS', false); |
} |
switch (strtolower(PSI_UPS_APCUPSD_ACCESS)) { |
case 'data': |
if (defined('PSI_UPS_APCUPSD_LIST') && is_string(PSI_UPS_APCUPSD_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_APCUPSD_LIST)) { |
$upss = eval(PSI_UPS_APCUPSD_LIST); |
} else { |
$upss = array(PSI_UPS_APCUPSD_LIST); |
} |
if (defined('PSI_UPS_APCUPSD_LIST') && is_string(PSI_UPS_APCUPSD_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_APCUPSD_LIST)) { |
$upses = eval(PSI_UPS_APCUPSD_LIST); |
} else { |
$upss = array('UPS'); |
$upses = array(PSI_UPS_APCUPSD_LIST); |
} |
$un = 0; |
foreach ($upss as $ups) { |
$temp = ""; |
CommonFunctions::rftsdata("upsapcupsd{$un}.tmp", $temp); |
foreach ($upses as $ups) { |
CommonFunctions::executeProgram('apcaccess', 'status '.trim($ups), $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
$un++; |
} |
break; |
default: |
if (defined('PSI_UPS_APCUPSD_LIST') && is_string(PSI_UPS_APCUPSD_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_APCUPSD_LIST)) { |
$upses = eval(PSI_UPS_APCUPSD_LIST); |
} else { |
$upses = array(PSI_UPS_APCUPSD_LIST); |
} |
foreach ($upses as $ups) { |
$temp = ""; |
CommonFunctions::executeProgram('apcaccess', 'status '.trim($ups), $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
} |
} 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); |
} |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
} 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); |
} |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
} |
} |
93,7 → 66,7 |
/** |
* parse the input and store data in resultset for xml generation |
* |
* @return void |
* @return Void |
*/ |
private function _info() |
{ |
170,7 → 143,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.nut.inc.php |
---|
40,64 → 40,35 |
public function __construct() |
{ |
parent::__construct(); |
if (!defined('PSI_UPS_NUT_ACCESS')) { |
define('PSI_UPS_NUT_ACCESS', false); |
} |
switch (strtolower(PSI_UPS_NUT_ACCESS)) { |
case 'data': |
if (defined('PSI_UPS_NUT_LIST') && is_string(PSI_UPS_NUT_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_NUT_LIST)) { |
$upss = eval(PSI_UPS_NUT_LIST); |
} else { |
$upss = array(PSI_UPS_NUT_LIST); |
} |
if (defined('PSI_UPS_NUT_LIST') && is_string(PSI_UPS_NUT_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_NUT_LIST)) { |
$upses = eval(PSI_UPS_NUT_LIST); |
} else { |
$upss = array('UPS'); |
$upses = array(PSI_UPS_NUT_LIST); |
} |
$un = 0; |
foreach ($upss as $ups) { |
$temp = ""; |
CommonFunctions::rftsdata("upsnut{$un}.tmp", $temp); |
if (! empty($temp)) { |
$this->_output[$ups] = $temp; |
} |
$un++; |
} |
break; |
default: |
if (defined('PSI_UPS_NUT_LIST') && is_string(PSI_UPS_NUT_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_NUT_LIST)) { |
$upses = eval(PSI_UPS_NUT_LIST); |
} else { |
$upses = array(PSI_UPS_NUT_LIST); |
} |
foreach ($upses as $ups) { |
CommonFunctions::executeProgram('upsc', '-l '.trim($ups), $output, PSI_DEBUG); |
$ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($ups_names as $ups_name) { |
$upsname = trim($ups_name).'@'.trim($ups); |
$temp = ""; |
CommonFunctions::executeProgram('upsc', $upsname, $temp, PSI_DEBUG); |
if (! empty($temp)) { |
$this->_output[$upsname] = $temp; |
} |
} |
} |
} 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); |
} |
foreach ($upses as $ups) { |
CommonFunctions::executeProgram('upsc', '-l '.trim($ups), $output, PSI_DEBUG); |
$ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($ups_names as $ups_name) { |
$temp = ""; |
CommonFunctions::executeProgram('upsc', trim($ups_name), $temp, PSI_DEBUG); |
CommonFunctions::executeProgram('upsc', trim($ups_name).'@'.trim($ups), $temp, PSI_DEBUG); |
if (! empty($temp)) { |
$this->_output[trim($ups_name)] = $temp; |
$this->_output[trim($ups_name).'@'.trim($ups)] = $temp; |
} |
} |
} |
} 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); |
} |
$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); |
if (! empty($temp)) { |
$this->_output[trim($ups_name)] = $temp; |
} |
} |
} |
} |
128,9 → 99,6 |
if (isset($ups_data['ups.status'])) { |
$dev->setStatus($ups_data['ups.status']); |
} |
if (isset($ups_data['ups.beeper.status'])) { |
$dev->setBeeperStatus($ups_data['ups.beeper.status']); |
} |
//Line |
if (isset($ups_data['input.voltage'])) { |
169,7 → 137,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.pmset.inc.php |
---|
38,11 → 38,8 |
public function __construct() |
{ |
parent::__construct(); |
if (defined('PSI_UPS_PMSET_ACCESS') && (strtolower(trim(PSI_UPS_PMSET_ACCESS))==='data')) { |
if (CommonFunctions::rftsdata('upspmset.tmp', $temp)) { |
$this->_output[] = $temp; |
} |
} elseif (PSI_OS == 'Darwin') { |
if (PSI_OS == 'Darwin') { |
$temp = ""; |
if (CommonFunctions::executeProgram('pmset', '-g batt', $temp) && !empty($temp)) { |
$this->_output[] = $temp; |
} |
92,7 → 89,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.powersoftplus.inc.php |
---|
38,12 → 38,7 |
public function __construct() |
{ |
parent::__construct(); |
if (defined('PSI_UPS_POWERSOFTPLUS_ACCESS') && (strtolower(trim(PSI_UPS_POWERSOFTPLUS_ACCESS))==='data')) { |
CommonFunctions::rftsdata('upspowersoftplus.tmp', $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
} elseif (PSI_OS == 'Linux') { |
if (PSI_OS == 'Linux') { |
CommonFunctions::executeProgram('powersoftplus', '-p', $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
54,7 → 49,7 |
/** |
* parse the input and store data in resultset for xml generation |
* |
* @return void |
* @return Void |
*/ |
private function _info() |
{ |
76,11 → 71,11 |
if (preg_match('/^Current UPS state\s*:\s*(.*)$/m', $ups, $data)) { |
$dev->setStatus(trim($data[1])); |
} |
if (preg_match('/^Output load\s*:\s*(.*)\s\[\%\]\r?$/m', $ups, $data)) { |
if (preg_match('/^Output load\s*:\s*(.*)\s\[\%\]$/m', $ups, $data)) { |
$load = trim($data[1]); |
} |
//wrong Output load issue |
if (($load == 0) && ($maxpwr != 0) && preg_match('/^Effective power\s*:\s*(.*)\s\[W\]\r?$/m', $ups, $data)) { |
if (($load == 0) && ($maxpwr != 0) && preg_match('/^Effective power\s*:\s*(.*)\s\[W\]$/m', $ups, $data)) { |
$load = 100.0*trim($data[1])/$maxpwr; |
} |
if ($load != null) { |
87,7 → 82,7 |
$dev->setLoad($load); |
} |
// Battery |
if (preg_match('/^Battery voltage\s*:\s*(.*)\s\[Volt\]\r?$/m', $ups, $data)) { |
if (preg_match('/^Battery voltage\s*:\s*(.*)\s\[Volt\]$/m', $ups, $data)) { |
$dev->setBatteryVoltage(trim($data[1])); |
} |
if (preg_match('/^Battery state\s*:\s*(.*)$/m', $ups, $data)) { |
98,10 → 93,10 |
} |
} |
// Line |
if (preg_match('/^Input voltage\s*:\s*(.*)\s\[Volt\]\r?$/m', $ups, $data)) { |
if (preg_match('/^Input voltage\s*:\s*(.*)\s\[Volt\]$/m', $ups, $data)) { |
$dev->setLineVoltage(trim($data[1])); |
} |
if (preg_match('/^Input frequency\s*:\s*(.*)\s\[Hz\]\r?$/m', $ups, $data)) { |
if (preg_match('/^Input frequency\s*:\s*(.*)\s\[Hz\]$/m', $ups, $data)) { |
$dev->setLineFrequency(trim($data[1])); |
} |
$this->upsinfo->setUpsDevices($dev); |
113,7 → 108,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.snmpups.inc.php |
---|
39,30 → 39,7 |
public function __construct() |
{ |
parent::__construct(); |
if (!defined('PSI_UPS_SNMPUPS_ACCESS')) { |
define('PSI_UPS_SNMPUPS_ACCESS', 'php-snmp'); |
} |
switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) { |
case 'data': |
if (defined('PSI_UPS_SNMPUPS_LIST') && is_string(PSI_UPS_SNMPUPS_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_SNMPUPS_LIST)) { |
$upss = eval(PSI_UPS_SNMPUPS_LIST); |
} else { |
$upss = array(PSI_UPS_SNMPUPS_LIST); |
} |
} else { |
$upss = array('UPS'); |
} |
$un = 0; |
foreach ($upss as $ups) { |
$temp = ""; |
CommonFunctions::rftsdata("upssnmpups{$un}.tmp", $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
} |
$un++; |
} |
break; |
case 'command': |
if (defined('PSI_UPS_SNMPUPS_LIST') && is_string(PSI_UPS_SNMPUPS_LIST)) { |
if (preg_match(ARRAY_EXP, PSI_UPS_SNMPUPS_LIST)) { |
71,7 → 48,6 |
$upss = array(PSI_UPS_SNMPUPS_LIST); |
} |
foreach ($upss as $ups) { |
$buffer = ""; |
CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.1", $buffer, PSI_DEBUG); |
if (strlen($buffer) > 0) { |
$this->_output[$ups] = $buffer; |
140,12 → 116,11 |
foreach ($bufferarr2 as $id=>$string) { |
$buffer .= $id." = ".$string."\n"; |
} |
} |
if (! empty($bufferarr3)) { |
foreach ($bufferarr3 as $id=>$string) { |
$buffer .= $id." = ".$string."\n"; |
} |
} |
} } |
if (! empty($bufferarr4)) { |
foreach ($bufferarr4 as $id=>$string) { |
$buffer .= $id." = ".$string."\n"; |
160,6 → 135,7 |
break; |
default: |
$this->error->addError("switch(PSI_UPS_SNMPUPS_ACCESS)", "Bad SNMPups configuration in phpsysinfo.ini"); |
break; |
} |
} |
166,7 → 142,7 |
/** |
* parse the input and store data in resultset for xml generation |
* |
* @return void |
* @return Void |
*/ |
private function _info() |
{ |
187,28 → 163,44 |
} |
if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.4\.1\.1\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
switch (trim($data[1])) { |
case 1: $status = "Unknown"; break; |
case 2: $status = "On Line"; break; |
case 3: $status = "On Battery"; break; |
case 4: $status = "On Smart Boost"; break; |
case 5: $status = "Timed Sleeping"; break; |
case 6: $status = "Software Bypass"; break; |
case 7: $status = "Off"; break; |
case 8: $status = "Rebooting"; break; |
case 9: $status = "Switched Bypass"; break; |
case 10:$status = "Hardware Failure Bypass"; break; |
case 11:$status = "Sleeping Until Power Returns"; break; |
case 12:$status = "On Smart Trim"; break; |
default: $status = "Unknown state (".trim($data[1]).")"; |
case 1: $status = "Unknown"; |
break; |
case 2: $status = "On Line"; |
break; |
case 3: $status = "On Battery"; |
break; |
case 4: $status = "On Smart Boost"; |
break; |
case 5: $status = "Timed Sleeping"; |
break; |
case 6: $status = "Software Bypass"; |
break; |
case 7: $status = "Off"; |
break; |
case 8: $status = "Rebooting"; |
break; |
case 9: $status = "Switched Bypass"; |
break; |
case 10:$status = "Hardware Failure Bypass"; |
break; |
case 11:$status = "Sleeping Until Power Returns"; |
break; |
case 12:$status = "On Smart Trim"; |
break; |
default: $status = "Unknown state (".trim($data[1]).")"; |
break; |
} |
} |
if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.1\.1\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
$batstat = ""; |
switch (trim($data[1])) { |
case 1: $batstat = "Battery Unknown"; break; |
case 2: break; |
case 3: $batstat = "Battery Low"; break; |
default: $batstat = "Battery Unknown (".trim($data[1]).")"; |
case 1: $batstat = "Battery Unknown"; |
break; |
case 2: break; |
case 3: $batstat = "Battery Low"; |
break; |
default: $batstat = "Battery Unknown (".trim($data[1]).")"; |
break; |
} |
if ($batstat !== "") { |
if ($status !== "") { |
221,9 → 213,11 |
if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.4\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
$batstat = ""; |
switch (trim($data[1])) { |
case 1: break; |
case 2: $batstat = "Replace Battery"; break; |
default: $batstat = "Replace Battery (".trim($data[1]).")"; |
case 1: break; |
case 2: $batstat = "Replace Battery"; |
break; |
default: $batstat = "Replace Battery (".trim($data[1]).")"; |
break; |
} |
if ($batstat !== "") { |
if ($status !== "") { |
283,7 → 277,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return void |
* @return Void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/xml/class.XML.inc.php |
---|
189,18 → 189,7 |
} |
} |
foreach ($this->_sys->getNetDevices() as $dev) { |
if (defined('PSI_HIDE_NETWORK_INTERFACE_REGEX') && PSI_HIDE_NETWORK_INTERFACE_REGEX) { |
$hide = false; |
foreach ($hideDevices as $hidedev) { |
if (preg_match('/^'.$hidedev.'$/', trim($dev->getName()))) { |
$hide = true; |
break; |
} |
} |
} else { |
$hide =in_array(trim($dev->getName()), $hideDevices); |
} |
if (!$hide) { |
if (!in_array(trim($dev->getName()), $hideDevices)) { |
$device = $network->addChild('NetDevice'); |
$device->addAttribute('Name', $dev->getName()); |
$device->addAttribute('RxBytes', $dev->getRxBytes()); |
221,50 → 210,9 |
private function _buildHardware() |
{ |
$hardware = $this->_xml->addChild('Hardware'); |
if (($machine = $this->_sys->getMachine()) != "") { |
if ((preg_match('/^(.* (.*\/.*\/.*))\/(.*\/.*\/.*)(, BIOS .*)$/', $machine, $mbuf) |
|| preg_match('/^(.* (.*\/.*))\/(.*\/.*)(, BIOS .*)$/', $machine, $mbuf) |
|| preg_match('/^(.* (.*))\/(.*)(, BIOS .*)$/', $machine, $mbuf) |
|| preg_match('/^((.*\/.*\/.*))\/(.*\/.*\/.*)(, BIOS .*)$/', $machine, $mbuf) |
|| preg_match('/^((.*\/.*))\/(.*\/.*)(, BIOS .*)$/', $machine, $mbuf) |
|| preg_match('/^((.*))\/(.*)(, BIOS .*)$/', $machine, $mbuf)) |
&& ($mbuf[2] === $mbuf[3])) { // find duplicates |
$machine = $mbuf[1].$mbuf[4]; // minimized machine name |
} |
$machine = trim(preg_replace("/^\s*\/?,?/", "", $machine)); // remove leading slash and comma |
if ($machine != "") { |
$hardware->addAttribute('Name', $machine); |
} |
if ($this->_sys->getMachine() != "") { |
$hardware->addAttribute('Name', $this->_sys->getMachine()); |
} |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { |
$virt = $this->_sys->getVirtualizer(); |
$first = true; |
$virtstring = ""; |
foreach ($virt as $virtkey=>$virtvalue) if ($virtvalue) { |
if ($first) { |
$first = false; |
} else { |
$virtstring .= ", "; |
} |
if ($virtkey === 'microsoft') { |
$virtstring .= 'hyper-v'; |
} elseif ($virtkey === 'kvm') { |
$virtstring .= 'qemu-kvm'; |
} elseif ($virtkey === 'oracle') { |
$virtstring .= 'virtualbox'; |
} elseif ($virtkey === 'zvm') { |
$virtstring .= 'z/vm'; |
} else { |
$virtstring .= $virtkey; |
} |
} |
if ($virtstring !== "") { |
$hardware->addAttribute('Virtualizer', $virtstring); |
} |
} |
$cpu = null; |
$vendortab = null; |
foreach ($this->_sys->getCpus() as $oneCpu) { |
271,18 → 219,13 |
if ($cpu === null) $cpu = $hardware->addChild('CPU'); |
$tmp = $cpu->addChild('CpuCore'); |
$tmp->addAttribute('Model', $oneCpu->getModel()); |
if ($oneCpu->getVoltage() > 0) { |
$tmp->addAttribute('Voltage', $oneCpu->getVoltage()); |
if ($oneCpu->getCpuSpeed() !== 0) { |
$tmp->addAttribute('CpuSpeed', max($oneCpu->getCpuSpeed(), 0)); |
} |
if ($oneCpu->getCpuSpeed() > 0) { |
$tmp->addAttribute('CpuSpeed', $oneCpu->getCpuSpeed()); |
} elseif ($oneCpu->getCpuSpeed() == -1) { |
$tmp->addAttribute('CpuSpeed', 0); // core stopped |
} |
if ($oneCpu->getCpuSpeedMax() > 0) { |
if ($oneCpu->getCpuSpeedMax() !== 0) { |
$tmp->addAttribute('CpuSpeedMax', $oneCpu->getCpuSpeedMax()); |
} |
if ($oneCpu->getCpuSpeedMin() > 0) { |
if ($oneCpu->getCpuSpeedMin() !== 0) { |
$tmp->addAttribute('CpuSpeedMin', $oneCpu->getCpuSpeedMin()); |
} |
/* |
301,7 → 244,7 |
} |
if ($oneCpu->getVendorId() !== null) { |
if ($vendortab === null) $vendortab = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true); |
$shortvendorid = $oneCpu->getVendorId(); |
$shortvendorid = preg_replace('/[\s!]/', '', $oneCpu->getVendorId()); |
if ($vendortab && ($shortvendorid != "") && isset($vendortab['manufacturer'][$shortvendorid])) { |
$tmp->addAttribute('Manufacturer', $vendortab['manufacturer'][$shortvendorid]); |
} |
499,9 → 442,9 |
* |
* @param SimpleXmlExtended $mount Xml-Element |
* @param DiskDevice $dev DiskDevice |
* @param int $i counter |
* @param Integer $i counter |
* |
* @return void |
* @return Void |
*/ |
private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i) |
{ |
519,12 → 462,12 |
$mount->addAttribute('Inodes', $dev->getPercentInodesUsed()); |
} |
if ($dev->getIgnore() > 0) $mount->addAttribute('Ignore', $dev->getIgnore()); |
if (PSI_SHOW_MOUNT_OPTION) { |
if (PSI_SHOW_MOUNT_OPTION === true) { |
if ($dev->getOptions() !== null) { |
$mount->addAttribute('MountOptions', preg_replace("/,/", ", ", $dev->getOptions())); |
} |
} |
if (PSI_SHOW_MOUNT_POINT && ($dev->getMountPoint() !== null)) { |
if (PSI_SHOW_MOUNT_POINT === true) { |
$mount->addAttribute('MountPoint', $dev->getMountPoint()); |
} |
} |
537,6 → 480,7 |
private function _buildFilesystems() |
{ |
$hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreTotal = $ignoreUsage = $ignoreThreshold = array(); |
$i = 1; |
if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) { |
if (preg_match(ARRAY_EXP, PSI_HIDE_MOUNTS)) { |
$hideMounts = eval(PSI_HIDE_MOUNTS); |
591,7 → 535,6 |
} |
} |
$fs = $this->_xml->addChild('FileSystem'); |
$i = 1; |
foreach ($this->_sys->getDiskDevices() as $disk) { |
if (!in_array($disk->getMountPoint(), $hideMounts, true) && !in_array($disk->getFsType(), $hideFstypes, true) && !in_array($disk->getName(), $hideDisks, true)) { |
$mount = $fs->addChild('Mount'); |
631,13 → 574,11 |
$item = $temp->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
$alarm = false; |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
$alarm = true; |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && ($dev->getEvent() !== "") && (((strtolower($dev->getEvent())) !== "alarm") || $alarm || ($dev->getValue() == 0))) { |
$item->addAttribute('Event', ucfirst(strtolower($dev->getEvent()))); |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
} |
648,16 → 589,14 |
$item = $fan->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
$alarm = false; |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
$alarm = true; |
} |
if ($dev->getUnit() !== "") { |
$item->addAttribute('Unit', $dev->getUnit()); |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && ($dev->getEvent() !== "") && (((strtolower($dev->getEvent())) !== "alarm") || $alarm || ($dev->getValue() == 0))) { |
$item->addAttribute('Event', ucfirst(strtolower($dev->getEvent()))); |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
} |
668,19 → 607,16 |
$item = $volt->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
$alarm = false; |
if (($dev->getMin() === null) || ($dev->getMin() != 0) || ($dev->getMax() === null) || ($dev->getMax() != 0)) { |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
$alarm = true; |
} |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
$alarm = true; |
} |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && ($dev->getEvent() !== "") && (((strtolower($dev->getEvent())) !== "alarm") || $alarm || ($dev->getValue() == 0))) { |
$item->addAttribute('Event', ucfirst(strtolower($dev->getEvent()))); |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
} |
691,13 → 627,11 |
$item = $power->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
$alarm = false; |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
$alarm = true; |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && ($dev->getEvent() !== "") && (((strtolower($dev->getEvent())) !== "alarm") || $alarm || ($dev->getValue() == 0))) { |
$item->addAttribute('Event', ucfirst(strtolower($dev->getEvent()))); |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
} |
708,19 → 642,16 |
$item = $current->addChild('Item'); |
$item->addAttribute('Label', $dev->getName()); |
$item->addAttribute('Value', $dev->getValue()); |
$alarm = false; |
if (($dev->getMin() === null) || ($dev->getMin() != 0) || ($dev->getMax() === null) || ($dev->getMax() != 0)) { |
if ($dev->getMin() !== null) { |
$item->addAttribute('Min', $dev->getMin()); |
$alarm = true; |
} |
if ($dev->getMax() !== null) { |
$item->addAttribute('Max', $dev->getMax()); |
$alarm = true; |
} |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && ($dev->getEvent() !== "") && (((strtolower($dev->getEvent())) !== "alarm") || $alarm || ($dev->getValue() == 0))) { |
$item->addAttribute('Event', ucfirst(strtolower($dev->getEvent()))); |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
} |
} |
735,7 → 666,7 |
$item->addAttribute('Unit', $dev->getUnit()); |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', ucfirst(strtolower($dev->getEvent()))); |
$item->addAttribute('Event', $dev->getEvent()); |
} |
} |
} |
750,7 → 681,7 |
private function _buildUpsinfo() |
{ |
$upsinfo = $this->_xml->addChild('UPSInfo'); |
if (!defined('PSI_EMU_HOSTNAME') && defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) { |
if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) { |
$upsinfo->addAttribute('ApcupsdCgiLinks', true); |
} |
if (sizeof(unserialize(PSI_UPSINFO))>0) { |
770,9 → 701,6 |
$item->addAttribute('StartTime', $ups->getStartTime()); |
} |
$item->addAttribute('Status', $ups->getStatus()); |
if ($ups->getBeeperStatus() !== null) { |
$item->addAttribute('BeeperStatus', $ups->getBeeperStatus()); |
} |
if ($ups->getTemperatur() !== null) { |
$item->addAttribute('Temperature', $ups->getTemperatur()); |
} |
820,10 → 748,10 |
{ |
if (($this->_plugin == '') || $this->_complete_request) { |
if ($this->_sys === null) { |
if (PSI_DEBUG) { |
if (PSI_DEBUG === true) { |
// unstable version check |
if (!is_numeric(substr(PSI_VERSION, -1))) { |
$this->_errors->addWarning("This is an unstable version of phpSysInfo, some things may not work correctly"); |
$this->_errors->addError("WARN", "This is an unstable version of phpSysInfo, some things may not work correctly"); |
} |
// Safe mode check |
843,7 → 771,7 |
$this->_errors->addError("WARN", "PhpSysInfo requires '.' inside the 'include_path' in php.ini"); |
} |
// popen mode check |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) { |
$this->_errors->addError("WARN", "Installed version of PHP does not support proc_open() function, popen() is used"); |
} |
} |
926,7 → 854,7 |
$options->addAttribute('byteFormat', defined('PSI_BYTE_FORMAT') ? strtolower(PSI_BYTE_FORMAT) : 'auto_binary'); |
$options->addAttribute('datetimeFormat', defined('PSI_DATETIME_FORMAT') ? strtolower(PSI_DATETIME_FORMAT) : 'utc'); |
if (defined('PSI_REFRESH')) { |
$options->addAttribute('refresh', max(intval(PSI_REFRESH), 0)); |
$options->addAttribute('refresh', max(intval(PSI_REFRESH), 0)); |
} else { |
$options->addAttribute('refresh', 60000); |
} |
/web/acc/phpsysinfo/includes/xml/class.SimpleXMLExtended.inc.php |
---|
28,7 → 28,7 |
/** |
* store the encoding that is used for conversation to utf8 |
* |
* @var string base encoding |
* @var String base encoding |
*/ |
private $_encoding = null; |
139,7 → 139,7 |
* @param String $name name of the attribute |
* @param String $value value of the attribute |
* |
* @return void |
* @return Void |
*/ |
public function addAttribute($name, $value) |
{ |
157,7 → 157,7 |
* |
* @param SimpleXMLElement $new_child child that should be appended |
* |
* @return void |
* @return Void |
*/ |
public function combinexml(SimpleXMLElement $new_child) |
{ |
176,7 → 176,7 |
*/ |
private function _toUTF8($str) |
{ |
$str = trim(preg_replace('/[\x00-\x09\x0b-\x1F]/', ' ', strval($str))); //remove nonprintable characters |
$str = trim(preg_replace('/[\x00-\x09\x0b-\x1F]/', ' ', $str)); //remove nonprintable characters |
if ($this->_encoding != null) { |
if (strcasecmp($this->_encoding, "UTF-8") == 0) { |
return $str; |
/web/acc/phpsysinfo/js/jQuery/jquery.js |
---|
1,5 → 1,5 |
/*! |
* jQuery JavaScript Library v1.12.4-ff3fix-ff2fix-CVE_2015_9251fix-CVE_2019_11358fix |
* jQuery JavaScript Library v1.12.4-ff3fix-ff2fix |
* http://jquery.com/ |
* |
* Includes Sizzle.js |
209,9 → 209,8 |
src = target[ name ]; |
copy = options[ name ]; |
// Prevent Object.prototype pollution |
// Prevent never-ending loop |
if ( name === "__proto__" || target === copy ) { |
if ( target === copy ) { |
continue; |
} |
10446,13 → 10445,9 |
} |
} ); |
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) |
jQuery.ajaxPrefilter( function( s ) { |
if ( s.crossDomain ) { |
s.contents.script = false; |
} |
} ); |
var oldCallbacks = [], |
rjsonp = /(=)\?(?=&|$)|\?\?/; |
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo.js |
---|
176,10 → 176,9 |
* generate a span tag |
* @param {Number} id translation id in the xml file |
* @param {String} [plugin] name of the plugin for which the tag should be generated |
* @param {String} [defaultvalue] default value |
* @return {String} string which contains generated span tag for translation string |
*/ |
function genlang(id, plugin, defaultvalue) { |
function genlang(id, plugin) { |
var html = "", idString = "", plugname = "", |
langarrId = current_language + "_"; |
207,9 → 206,7 |
if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) { |
html += langarr[langarrId][idString]; |
} else if (defaultvalue !== undefined) { |
html += defaultvalue; |
} |
} |
html += "</span>"; |
633,23 → 630,7 |
* @param {jQuery} xml phpSysInfo-XML |
*/ |
function refreshVitals(xml) { |
var hostname = "", ip = "", stripid = 0; |
function setAndStrip(id, value) { |
if (value !== "") { |
$(id).html(value); |
if (stripid%2 === 1) { |
$(id).closest('tr').addClass('even'); |
} else { |
$(id).closest('tr').removeClass('even'); |
} |
$(id).closest('tr').css("display", ""); |
stripid++; |
} else { |
$(id).closest('tr').css("display", "none"); |
} |
} |
var hostname = "", ip = ""; |
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('vitals', blocks) < 0))) { |
$("#vitals").remove(); |
$("Vitals", xml).each(function getVitals(id) { |
691,15 → 672,27 |
} |
if ($(this).attr("SysLang") !== undefined) { |
syslang = $(this).attr("SysLang"); |
document.getElementById("s_syslang_tr").style.display=''; |
} |
if ($(this).attr("CodePage") !== undefined) { |
codepage = $(this).attr("CodePage"); |
if ($(this).attr("SysLang") !== undefined) { |
document.getElementById("s_codepage_tr1").style.display=''; |
} else { |
document.getElementById("s_codepage_tr2").style.display=''; |
} |
} |
//processes |
if ($(this).attr("Processes") !== undefined) { |
processes = parseInt($(this).attr("Processes"), 10); |
if ((($(this).attr("CodePage") !== undefined) && ($(this).attr("SysLang") === undefined)) || |
(($(this).attr("CodePage") === undefined) && ($(this).attr("SysLang") !== undefined))) { |
document.getElementById("s_processes_tr1").style.display=''; |
} else { |
document.getElementById("s_processes_tr2").style.display=''; |
} |
} |
if ($(this).attr("ProcessesRunning") !== undefined) { |
prunning = parseInt($(this).attr("ProcessesRunning"), 10); |
722,41 → 715,47 |
document.title = "System information: " + hostname + " (" + ip + ")"; |
$("#s_hostname_title").html(hostname); |
$("#s_ip_title").html(ip); |
setAndStrip("#s_hostname", hostname); |
setAndStrip("#s_ip", ip); |
setAndStrip("#s_kernel", kernel); |
setAndStrip("#s_distro", "<img src='./gfx/images/" + icon + "' alt='Icon' title='' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' /> " + distro); //onload IE6 PNG fix |
setAndStrip("#s_os", "<img src='./gfx/images/" + os + ".png' alt='OSIcon' title='' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' /> " + os); //onload IE6 PNG fix |
setAndStrip("#s_uptime", uptime); |
$("#s_ip_title").html(ip); |
$("#s_hostname").html(hostname); |
$("#s_ip").html(ip); |
$("#s_kernel").html(kernel); |
$("#s_distro").html("<img src='./gfx/images/" + icon + "' alt='Icon' title='' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' /> " + distro); //onload IE6 PNG fix |
$("#s_os").html("<img src='./gfx/images/" + os + ".png' alt='OSIcon' title='' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' /> " + os); //onload IE6 PNG fix |
$("#s_uptime").html(uptime); |
if ((datetimeFormat !== undefined) && (datetimeFormat.toLowerCase() === "locale")) { |
setAndStrip("#s_lastboot", lastboot.toLocaleString()); |
$("#s_lastboot").html(lastboot.toLocaleString()); |
} else { |
if (typeof(lastboot.toUTCString)==="function") { |
setAndStrip("#s_lastboot", lastboot.toUTCString()); |
$("#s_lastboot").html(lastboot.toUTCString()); |
} else { |
//deprecated |
setAndStrip("#s_lastboot", lastboot.toGMTString()); |
$("#s_lastboot").html(lastboot.toGMTString()); |
} |
} |
setAndStrip("#s_users", users); |
setAndStrip("#s_loadavg", loadavg); |
setAndStrip("#s_syslang", syslang); |
setAndStrip("#s_codepage", codepage); |
setAndStrip("#s_processes", processes); |
if ((processes > 0) && (prunning || psleeping || pstopped || pzombie || pwaiting || pother)) { |
$("#s_processes").append(" ("); |
$("#s_users").html(users); |
$("#s_loadavg").html(loadavg); |
$("#s_syslang").html(syslang); |
$("#s_codepage_1").html(codepage); |
$("#s_codepage_2").html(codepage); |
$("#s_processes_1").html(processes); |
$("#s_processes_2").html(processes); |
if (prunning || psleeping || pstopped || pzombie || pwaiting || pother) { |
$("#s_processes_1").append(" ("); |
$("#s_processes_2").append(" ("); |
var typelist = {running:111,sleeping:112,stopped:113,zombie:114,waiting:115,other:116}; |
for (var proc_type in typelist) { |
if (eval("p" + proc_type)) { |
if (not_first) { |
$("#s_processes").append(", "); |
$("#s_processes_1").append(", "); |
$("#s_processes_2").append(", "); |
} |
$("#s_processes").append(eval("p" + proc_type) + " " + genlang(typelist[proc_type])); |
$("#s_processes_1").append(eval("p" + proc_type) + " " + genlang(typelist[proc_type])); |
$("#s_processes_2").append(eval("p" + proc_type) + " " + genlang(typelist[proc_type])); |
not_first = true; |
} |
} |
$("#s_processes").append(") "); |
$("#s_processes_1").append(") "); |
$("#s_processes_2").append(") "); |
} |
}); |
} |
772,10 → 771,9 |
function fillCpu(xml, tree, rootposition, collapsed) { |
var cpucount = 0, html = ""; |
$("Hardware CPU CpuCore", xml).each(function getCpuCore(cpuCoreId) { |
var model = "", speed = 0, voltage = 0, bus = 0, cache = 0, bogo = 0, temp = 0, load = 0, speedmax = 0, speedmin = 0, cpucoreposition = 0, virt = "", manufacturer = ""; |
var model = "", speed = 0, bus = 0, cache = 0, bogo = 0, temp = 0, load = 0, speedmax = 0, speedmin = 0, cpucoreposition = 0, virt = "", manufacturer = ""; |
cpucount++; |
model = $(this).attr("Model"); |
voltage = $(this).attr("Voltage"); |
speed = parseInt($(this).attr("CpuSpeed"), 10); |
speedmax = parseInt($(this).attr("CpuSpeedMax"), 10); |
speedmin = parseInt($(this).attr("CpuSpeedMin"), 10); |
823,10 → 821,6 |
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(14) + ":</span></div></td><td>" + formatHertz(bus) + "</td></tr>\n"; |
tree.push(cpucoreposition); |
} |
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(cpucoreposition); |
} |
if (!isNaN(bogo)) { |
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(16) + ":</span></div></td><td>" + bogo.toString() + "</td></tr>\n"; |
tree.push(cpucoreposition); |
937,7 → 931,7 |
return; |
} |
var html = "", tree = [], closed = [], index = 0, machine = "", virtualizer = ""; |
var html = "", tree = [], closed = [], index = 0, machine = ""; |
$("#hardware").empty(); |
html += "<h2>" + genlang(10) + "</h2>\n"; |
html += " <div style=\"overflow-x:auto;\">\n"; |
947,10 → 941,6 |
$("Hardware", xml).each(function getMachine(id) { |
machine = $(this).attr("Name"); |
}); |
$("Hardware", xml).each(function getVirtualizer(id) { |
virtualizer = $(this).attr("Virtualizer"); |
}); |
if ((machine !== undefined) && (machine !== "")) { |
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(107) + "</span></div></td></tr>\n"; |
html += "<tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespan\">" + machine + "</span></div></td></tr>\n"; |
957,11 → 947,6 |
tree.push(tree.push(0)); |
} |
if ((virtualizer !== undefined) && (virtualizer !== "")) { |
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(134) + "</span></div></td></tr>\n"; |
html += "<tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespan\">" + virtualizer + "</span></div></td></tr>\n"; |
tree.push(tree.push(0)); |
} |
if (countCpu(xml)) { |
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(11) + "</span></div></td></tr>\n"; |
html += fillCpu(xml, tree, tree.push(0), closed); |
1275,9 → 1260,6 |
if (!isNaN(inodes)) { |
inodes_text = "<span style=\"font-style:italic\"> (" + inodes.toString() + "%)</span>"; |
} |
if (type === undefined) { |
type = ""; |
} |
if (!isNaN(ignore) && (ignore > 0) && showTotals) { |
if (ignore >= 3) { |
1570,13 → 1552,12 |
$("#ups").empty(); |
$("UPSInfo UPS", xml).each(function getUps(id) { |
var name = "", model = "", mode = "", start_time = "", upsstatus = "", beeperstatus = "", temperature = "", outages_count = "", last_outage = "", last_outage_finish = "", line_voltage = "", line_frequency = "", load_percent = "", battery_date = "", battery_voltage = "", battery_charge_percent = "", time_left_minutes = ""; |
var name = "", model = "", mode = "", start_time = "", upsstatus = "", temperature = "", outages_count = "", last_outage = "", last_outage_finish = "", line_voltage = "", line_frequency = "", load_percent = "", battery_date = "", battery_voltage = "", battery_charge_percent = "", time_left_minutes = ""; |
name = $(this).attr("Name"); |
model = $(this).attr("Model"); |
mode = $(this).attr("Mode"); |
start_time = $(this).attr("StartTime"); |
upsstatus = $(this).attr("Status"); |
beeperstatus = $(this).attr("BeeperStatus"); |
temperature = $(this).attr("Temperature"); |
outages_count = $(this).attr("OutagesCount"); |
1608,10 → 1589,6 |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(73) + "</span></div></td><td>" + upsstatus + "</td></tr>\n"; |
tree.push(index); |
} |
if (beeperstatus !== undefined) { |
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(133) + "</span></div></td><td>" + beeperstatus + "</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"; |
tree.push(index); |
1924,7 → 1901,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 { |
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js |
---|
106,10 → 106,9 |
* generate a span tag |
* @param {Number} id translation id in the xml file |
* @param {String} [plugin] name of the plugin for which the tag should be generated |
* @param {String} [defaultvalue] default value |
* @return {String} string which contains generated span tag for translation string |
*/ |
function genlang(id, plugin, defaultvalue) { |
function genlang(id, plugin) { |
var html = "", idString = "", plugname = "", |
langarrId = current_language + "_"; |
138,8 → 137,6 |
if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) { |
html += langarr[langarrId][idString]; |
} else if (defaultvalue !== undefined) { |
html += defaultvalue; |
} |
html += "</span>"; |
623,38 → 620,36 |
var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0; |
var not_first = false; |
processes = parseInt(this.Processes, 10); |
if (processes > 0) { |
if (this.ProcessesRunning !== undefined) { |
p111 = parseInt(this.ProcessesRunning, 10); |
} |
if (this.ProcessesSleeping !== undefined) { |
p112 = parseInt(this.ProcessesSleeping, 10); |
} |
if (this.ProcessesStopped !== undefined) { |
p113 = parseInt(this.ProcessesStopped, 10); |
} |
if (this.ProcessesZombie !== undefined) { |
p114 = parseInt(this.ProcessesZombie, 10); |
} |
if (this.ProcessesWaiting !== undefined) { |
p115 = parseInt(this.ProcessesWaiting, 10); |
} |
if (this.ProcessesOther !== undefined) { |
p116 = parseInt(this.ProcessesOther, 10); |
} |
if (p111 || p112 || p113 || p114 || p115 || p116) { |
processes += " ("; |
for (var proc_type in {111:0,112:1,113:2,114:3,115:4,116:5}) { |
if (eval("p" + proc_type)) { |
if (not_first) { |
processes += ", "; |
} |
processes += eval("p" + proc_type) + String.fromCharCode(160) + genlang(proc_type); |
not_first = true; |
if (this.ProcessesRunning !== undefined) { |
p111 = parseInt(this.ProcessesRunning, 10); |
} |
if (this.ProcessesSleeping !== undefined) { |
p112 = parseInt(this.ProcessesSleeping, 10); |
} |
if (this.ProcessesStopped !== undefined) { |
p113 = parseInt(this.ProcessesStopped, 10); |
} |
if (this.ProcessesZombie !== undefined) { |
p114 = parseInt(this.ProcessesZombie, 10); |
} |
if (this.ProcessesWaiting !== undefined) { |
p115 = parseInt(this.ProcessesWaiting, 10); |
} |
if (this.ProcessesOther !== undefined) { |
p116 = parseInt(this.ProcessesOther, 10); |
} |
if (p111 || p112 || p113 || p114 || p115 || p116) { |
processes += " ("; |
for (var proc_type in {111:0,112:1,113:2,114:3,115:4,116:5}) { |
if (eval("p" + proc_type)) { |
if (not_first) { |
processes += ", "; |
} |
processes += eval("p" + proc_type) + String.fromCharCode(160) + genlang(proc_type); |
not_first = true; |
} |
processes += ")"; |
} |
processes += ")"; |
} |
return processes; |
} |
723,11 → 718,6 |
return formatTemp(this.Cputemp, data.Options["@attributes"].tempFormat); |
} |
}, |
Voltage: { |
html: function() { |
return round(this.Voltage, 2) + ' V'; |
} |
}, |
Bogomips: { |
text: function () { |
return parseInt(this.Bogomips, 10); |
792,22 → 782,14 |
var html=""; |
if (data.Hardware["@attributes"] !== undefined) { |
if (data.Hardware["@attributes"].Name !== undefined) { |
html+="<tr id=\"hardware-Machine\">"; |
html+="<th style=\"width:8%;\">"+genlang(107)+"</th>"; //Machine |
html+="<td colspan=\"2\"><span data-bind=\"Name\"></span></td>"; |
html+="</tr>"; |
} |
if (data.Hardware["@attributes"].Virtualizer !== undefined) { |
html+="<tr id=\"hardware-Virtualizer\">"; |
html+="<th style=\"width:8%;\">"+genlang(134)+"</th>"; //Virtualizer |
html+="<td colspan=\"2\"><span data-bind=\"Virtualizer\"></span></td>"; |
html+="</tr>"; |
} |
if ((data.Hardware["@attributes"] !== undefined) && (data.Hardware["@attributes"].Name !== undefined)) { |
html+="<tr id=\"hardware-Machine\">"; |
html+="<th style=\"width:8%;\">"+genlang(107)+"</th>"; //Machine |
html+="<td colspan=\"2\"><span data-bind=\"Name\"></span></td>"; |
html+="</tr>"; |
} |
var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Voltage:52,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9}; |
var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9}; |
try { |
datas = items(data.Hardware.CPU.CpuCore); |
for (i = 0; i < datas.length; i++) { |
886,13 → 868,8 |
$("#hardware-data").empty().append(html); |
if (data.Hardware["@attributes"] !== undefined) { |
if (data.Hardware["@attributes"].Name !== undefined) { |
$('#hardware-Machine').render(data.Hardware["@attributes"]); |
} |
if (data.Hardware["@attributes"].Virtualizer !== undefined) { |
$('#hardware-Virtualizer').render(data.Hardware["@attributes"]); |
} |
if ((data.Hardware["@attributes"] !== undefined) && (data.Hardware["@attributes"].Name !== undefined)) { |
$('#hardware-Machine').render(data.Hardware["@attributes"]); |
} |
try { |
1621,7 → 1598,7 |
if ((data.UPSInfo !== undefined) && (items(data.UPSInfo.UPS).length > 0)) { |
var html=""; |
var paramlist = {Model:70,StartTime:72,Status:73,BeeperStatus:133,Temperature:84,OutagesCount:74,LastOutage:75,LastOutageFinish:76,LineVoltage:77,LineFrequency:108,LoadPercent:78,BatteryDate:104,BatteryVoltage:79,BatteryChargePercent:80,TimeLeftMinutes:81}; |
var paramlist = {Model:70,StartTime:72,Status:73,Temperature:84,OutagesCount:74,LastOutage:75,LastOutageFinish:76,LineVoltage:77,LineFrequency:108,LoadPercent:78,BatteryDate:104,BatteryVoltage:79,BatteryChargePercent:80,TimeLeftMinutes:81}; |
try { |
datas = items(data.UPSInfo.UPS); |
/web/acc/phpsysinfo/language/ar.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ast.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/bg.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ca.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/cz.xml |
---|
136,7 → 136,7 |
<exp>Kapacita</exp> |
</expression> |
<expression id="044" name="template"> |
<exp>Šablona vzhledu</exp> |
<exp>Téma vzhledu</exp> |
</expression> |
<expression id="045" name="language"> |
<exp>Jazyk</exp> |
295,64 → 295,64 |
<exp>B</exp> |
</expression> |
<expression id="097" name="syslang"> |
<exp>Systémový jazyk</exp> |
<exp>System Language</exp> |
</expression> |
<expression id="098" name="codepage"> |
<exp>Znaková stránka</exp> |
<exp>Code Page</exp> |
</expression> |
<expression id="099" name="details"> |
<exp>Podrobnosti</exp> |
<exp>Details</exp> |
</expression> |
<expression id="100" name="cpuspeedMax"> |
<exp>Nejvyšší frekvence CPU</exp> |
<exp>CPU Speed Max</exp> |
</expression> |
<expression id="101" name="cpuspeedMin"> |
<exp>Nejnižší frekvence CPU</exp> |
<exp>CPU Speed Min</exp> |
</expression> |
<expression id="102" name="power"> |
<exp>Výkon</exp> |
<exp>Power</exp> |
</expression> |
<expression id="103" name="power_mark"> |
<exp>W</exp> |
</expression> |
<expression id="104" name="ups_battery_date"> |
<exp>Datum baterie</exp> |
<exp>Battery date</exp> |
</expression> |
<expression id="105" name="current"> |
<exp>Proud</exp> |
<exp>Current</exp> |
</expression> |
<expression id="106" name="current_mark"> |
<exp>A</exp> |
</expression> |
<expression id="107" name="machine"> |
<exp>Zařízení</exp> |
<exp>Machine</exp> |
</expression> |
<expression id="108" name="ups_line_frequency"> |
<exp>Frekvence sítě</exp> |
<exp>Line frequency</exp> |
</expression> |
<expression id="109" name="Hz"> |
<exp>Hz</exp> |
</expression> |
<expression id="110" name="Processes"> |
<exp>Procesy</exp> |
<exp>Processes</exp> |
</expression> |
<expression id="111" name="ProcessesRunning"> |
<exp>aktivní</exp> |
<exp>running</exp> |
</expression> |
<expression id="112" name="ProcessesSleeping"> |
<exp>neaktivní</exp> |
<exp>sleeping</exp> |
</expression> |
<expression id="113" name="ProcessesStopped"> |
<exp>zastavené</exp> |
<exp>stopped</exp> |
</expression> |
<expression id="114" name="ProcessesZombie"> |
<exp>zombie</exp> |
</expression> |
<expression id="115" name="ProcessesWaiting"> |
<exp>čekající</exp> |
<exp>waiting</exp> |
</expression> |
<expression id="116" name="ProcessesOther"> |
<exp>ostatní</exp> |
<exp>other</exp> |
</expression> |
<expression id="117" name="tb"> |
<exp>TB zařízení</exp> |
361,22 → 361,22 |
<exp>I2C zařízení</exp> |
</expression> |
<expression id="119" name="no_processors"> |
<exp>Počet procesorů</exp> |
<exp>Number of processors</exp> |
</expression> |
<expression id="120" name="no_devices"> |
<exp>Počet zařízení</exp> |
<exp>Number of devices</exp> |
</expression> |
<expression id="121" name="other"> |
<exp>Ostatní</exp> |
<exp>Other</exp> |
</expression> |
<expression id="122" name="manufacturer"> |
<exp>Výrobce</exp> |
<exp>Manufacturer</exp> |
</expression> |
<expression id="123" name="product"> |
<exp>Produkt</exp> |
<exp>Product</exp> |
</expression> |
<expression id="124" name="serial"> |
<exp>Sériové číslo</exp> |
<exp>Serial number</exp> |
</expression> |
<expression id="125" name="memfree"> |
<exp>Volné</exp> |
385,16 → 385,16 |
<exp>NVMe zařízení</exp> |
</expression> |
<expression id="127" name="os"> |
<exp>Typ OS</exp> |
<exp>OS Type</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Počet paměťových čipů</exp> |
<exp>Number of memory chips</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Rychlost</exp> |
<exp>Speed</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Paměťové čipy</exp> |
<exp>Memory Chips</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Stav pípáku</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/da.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/de.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/en.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/es.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/et.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/fa.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/fi.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/fr.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/gl.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/gr.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Κατάσταση Βομβητή</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/he.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/hr.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/hu.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/id.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/is.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/it.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ja.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ko.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/nl.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/no.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/pl.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Status brzęczka</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Wirtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/pt-br.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/pt-pt.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ro.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/ru.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/sk.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/sl.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/sv.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/th.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/tr.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/tw.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/uk.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/language/zh.xml |
---|
402,10 → 402,4 |
<expression id="132" name="gtps"> |
<exp>GT/s</exp> |
</expression> |
<expression id="133" name="ups_beeper_status"> |
<exp>Beeper status</exp> |
</expression> |
<expression id="134" name="virtualizer"> |
<exp>Virtualizer</exp> |
</expression> |
</tns:translation> |
/web/acc/phpsysinfo/phpsysinfo.ini |
---|
75,11 → 75,6 |
; |
;SNMP_RETRY=0 |
; Root path of the system |
; Example : ROOTFS="/rootfs" |
; |
;ROOTFS="/" |
; 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 |
108,7 → 103,7 |
; - 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.tmp contents |
; - Viewer - show output of any command or file viewer.txt contents |
; |
PLUGINS=false |
149,7 → 144,7 |
; Show or hide template picklist |
; |
SHOW_PICKLIST_TEMPLATE=true |
SHOW_PICKLIST_TEMPLATE=false |
; Show CPU list expanded |
167,24 → 162,11 |
SHOW_MEMORY_INFOS_EXPANDED=false |
; Show virtualizer info for Linux, Android and WinNT |
; |
SHOW_VIRTUALIZER_INFO=true |
; Hide loader for frontend "bootstrap" |
; |
HIDE_BOOTSTRAP_LOADER=false |
HIDE_BOOTSTRAP_LOADER=true |
; Increase the body width for the "dynamic" frontend by pixels. The value should be even |
; - 0 : disabled |
; - 200 : wider by 200px |
; Default is 0 pixels |
; |
INCREASE_WIDTH=0 |
; Define the interval for refreshing data in ms |
; - 0 : disabled |
; - 1000 : 1 second |
196,7 → 178,7 |
; Show a graph for current cpuload |
; - true : displayed, but it's a performance hit (because we have to wait to get a value, 1 second) |
; - "compact" : displayed like above but in compact mode |
; - false : will not be displayed (also in Load Averages field) |
; - false : will not be displayed |
; |
LOAD_BAR=true |
269,7 → 251,7 |
; - HWSensors http://www.openbsd.org/ (OpenBSD) |
; - MBMon http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/download.html (FreeBSD/Linux/NetBSD/OpenBSD) |
; - MBM5 http://mbm.livewiredev.com/ (data from file data/MBM5.csv - WinNT) |
; - CpuMem No addon tool neded (FreeBSD/Linux/WinNT or others but with the dmidecode utility installed) |
; - Coretemp No addon tool neded (FreeBSD/Linux) |
; - 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) |
335,12 → 317,13 |
; - true : display used inodes in percent |
; - false : hide them |
; |
SHOW_INODES=true |
SHOW_INODES=false |
; Hide mounts |
; Example : HIDE_MOUNTS="/home,/usr" |
; |
; HIDE_MOUNTS="/dev,/dev/shm,/run,/run/user/0,/sys/fs/cgroup" |
HIDE_MOUNTS="" |
406,13 → 389,6 |
HIDE_NETWORK_INTERFACE="lo,tun0" |
; Use a regular expression in the name of a hidden network interface (e.g. HIDE_NETWORK_INTERFACE="docker.*") |
; - true : use a regular expression |
; - false : do not use a regular expression |
; |
HIDE_NETWORK_INTERFACE_REGEX=false |
; Show network interfaces infos for Linux, Android, FreeBSD, NetBSD, OpenBSD, Haiku, Darwin, SunOS, Minix, QNX and WinNT |
; Example : SHOW_NETWORK_INFOS=true |
; |
451,9 → 427,9 |
; We support the following programs so far |
; - Apcupsd http://www.apcupsd.com/ |
; - Nut http://www.networkupstools.org/ |
; - SNMPups monitoring via Simple Network Management Protocol (SNMP) |
; - PowerSoftPlus http://ever.eu/ |
; - pmset based on the result of the command "pmset -g batt" on Darwin system |
; - SNMPups monitoring via Simple Network Management Protocol (SNMP) |
; |
; Example: If you want to use Apcupsd : UPS_PROGRAM="Apcupsd" |
; If you want to use Apcupsd and Nut : UPS_PROGRAM="Apcupsd,Nut" |
462,7 → 438,7 |
; Apcupsd supports multiple UPSes |
; You can specify comma delimited list in the form <hostname>:<port> or <ip>:<port>. The defaults are: "127.0.0.1:3551" |
; You can specify comma delimited list in the form <hostname>:<port> or <ip>:<port>. The defaults are: 127.0.0.1:3551 |
; See the following parameters in apcupsd.conf: NETSERVER, NISIP, NISPORT |
; It uses the defaults if not specified. |
; |
469,14 → 445,6 |
UPS_APCUPSD_LIST=false |
; define how to access the Apcupsd data |
; - "command" execute apcaccess command |
; - "data" for reading data from file data/upsapcupsd{ups_number}.tmp |
; content is the output from "apcaccess status" |
; |
UPS_APCUPSD_ACCESS=false |
; Apcupsd has a CGI monitoring utility called apcupsd-cgi |
; You can set the parameter below to true if you have it installed - this will add apcupsd-cgi links to the UPS tree |
; |
484,7 → 452,7 |
; Nut supports multiple UPSes |
; You can specify comma delimited list in the form <hostname>:<port> or <ip>:<port>. The defaults are: "127.0.0.1:3493" |
; You can specify comma delimited list in the form <hostname>:<port> or <ip>:<port>. The defaults are: 127.0.0.1:3493 |
; See the following parameters in upsd.conf: LISTEN |
; It uses the defaults if not specified. |
; |
491,14 → 459,6 |
UPS_NUT_LIST=false |
; define how to access the Nut data |
; - "command" execute upsc command |
; - "data" for reading data from file data/upsnut{ups_number}.tmp |
; content is the output from "upsc {upsname}" |
; |
UPS_NUT_ACCESS="command" |
; SNMPups supports multiple UPSes |
; You can specify comma delimited list in the form <hostname>:<port> or <ip>:<port>. The default port is 161 |
; List must be specified. |
509,32 → 469,10 |
; define how to access the SNMP data |
; - "php-snmp" execute php snmprealwalk function (php-snmp module must be installed) |
; - "command" execute snmpwalk command |
; - "data" for reading data from file data/upssnmpups{ups_number}.tmp |
; content is the output from: |
; "snmpwalk -Ona -c public -v 1 -r 0 -t 3 {upsaddress} .1.3.6.1.4.1.318.1.1.1.1>upssnmpups{ups_number}.tmp |
; snmpwalk -Ona -c public -v 1 -r 0 -t 3 {upsaddress} .1.3.6.1.4.1.318.1.1.1.2>>upssnmpups{ups_number}.tmp |
; snmpwalk -Ona -c public -v 1 -r 0 -t 3 {upsaddress} .1.3.6.1.4.1.318.1.1.1.3>>upssnmpups{ups_number}.tmp |
; snmpwalk -Ona -c public -v 1 -r 0 -t 3 {upsaddress} .1.3.6.1.4.1.318.1.1.1.4>>upssnmpups{ups_number}.tmp" |
; |
UPS_SNMPUPS_ACCESS="php-snmp" |
; define how to access the PowerSoftPlus data |
; - "command" execute powersoftplus command |
; - "data" for reading data from file data/upspowersoftplus.tmp |
; content is the output from "powersoftplus -p" |
; |
UPS_POWERSOFTPLUS_ACCESS="command" |
; define how to access the pmset data |
; - "command" execute pmset command |
; - "data" for reading data from file data/upspmset.tmp |
; content is the output from "pmset -g batt" |
; |
UPS_PMSET_ACCESS="command" |
; ******************************** |
; MISC PARAMETERS |
; ******************************** |
541,7 → 479,7 |
; define how to access the dmidecode data |
; - "data" read data from file data/dmidecode.tmp; content is the output from "dmidecode -t 17") |
; - "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! |
568,7 → 506,7 |
; LMSensors motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'sensors' command |
; - ACCESS="data" //read data from file data/lmsensors.tmp |
; - ACCESS="data" //read data from file data/lmsensors.txt |
; |
ACCESS="command" |
576,7 → 514,7 |
; Healthd motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'healthdc' command |
; - ACCESS="data" //read data from file data/healthd.tmp |
; - ACCESS="data" //read data from file data/healthd.txt |
; |
ACCESS="command" |
584,7 → 522,7 |
; MBMon motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'mbmon -c 1 -r' command |
; - ACCESS="data" //read data from file data/mbmon.tmp |
; - ACCESS="data" //read data from file data/mbmon.txt |
; - ACCESS="tcp" //read data from mbmon deamon (localhost:411) |
; |
ACCESS="command" |
594,7 → 532,7 |
; |
; - ACCESS="command" //read data from 'ipmitool sensor -v' command |
; //if access error execute first: chmod 666 /dev/ipmi0 |
; - ACCESS="data" //read data from file data/ipmitool.tmp |
; - ACCESS="data" //read data from file data/ipmitool.txt |
; |
ACCESS="command" |
602,7 → 540,7 |
; FreeIPMI motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'ipmi-sensors --output-sensor-thresholds' program |
; - ACCESS="data" //read data from file data/freeipmi.tmp |
; - ACCESS="data" //read data from file data/freeipmi.txt |
; |
ACCESS="command" |
611,7 → 549,7 |
; |
; - ACCESS="command" //read data from 'ipmiutil sensor -stw' command |
; //if access error execute first: chmod 666 /dev/ipmi0 |
; - ACCESS="data" //read data from file data/ipmiutil.tmp |
; - ACCESS="data" //read data from file data/ipmiutil.txt |
; |
ACCESS="command" |
619,7 → 557,7 |
; 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.tmp (output from: "ipmicfg -sdr>ipmicfg.tmp; ipmicfg -psfruinfo>>ipmicfg.tmp") |
; - ACCESS="data" //read data from file data/ipmicfg.txt (output from: ipmicfg -sdr>ipmicfg.txt; ipmicfg -psfruinfo>>ipmicfg.txt) |
; |
ACCESS="command" |
634,7 → 572,7 |
; K8Temp motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'k8temp' command |
; - ACCESS="data" //read data from file data/k8temp.tmp |
; - ACCESS="data" //read data from file data/k8temp.txt |
; |
ACCESS="command" |
641,8 → 579,8 |
[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.tmp (output of WinNT command "wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CriticalTripPoint,CurrentTemperature,InstanceName") |
; - 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" |
650,7 → 588,7 |
; SpeedFan motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'speedfanget' command |
; - ACCESS="data" //read data from file data/speedfan.tmp |
; - ACCESS="data" //read data from file data/speedfan.txt |
; |
ACCESS="command" |
658,7 → 596,7 |
; NvidiaSMI motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'nvidia-smi -q' command |
; - ACCESS="data" //read data from file data/nvidiasmi.tmp |
; - ACCESS="data" //read data from file data/nvidiasmi.txt |
; |
ACCESS="command" |
684,7 → 622,7 |
; on FreeBSD read data from 'acpiconf -i batt' command |
; on OpenBSD read data from 'sysctl hw.sensors.acpibat0' command |
; - "data" (a file must be available in the data directory of the phpsysinfo installation |
; with the filename "bat_info.tmp" and "bat_state.tmp"; content is the output |
; with the filename "bat_info.txt" and "bat_state.txt"; content is the output |
; from "cat /proc/acpi/battery/BAT0/info" and "cat /proc/acpi/battery/BAT0/state") |
; |
ACCESS="command" |
712,9 → 650,9 |
; - 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) |
; - 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) |
; - 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 |
722,8 → 660,8 |
; - "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.tmp" or "raiddmraid.tmp" or "raidmegactl.tmp" or "raidmegasasctl.tmp" |
; or "raidmegaclisas-status.tmp" or "raidgraid.tmp" or "raidzpool.tmp" or "raididrac{device_number}.tmp") |
; 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") |
; |
ACCESS="command" |
745,10 → 683,10 |
; PS Plugin configuration |
; define how to access the ps statistic data |
; - "command" ps command is run everytime the block gets refreshed or build / on WinNT |
; - "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.tmp"; 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,pcpu,args") |
; |
ACCESS="command" |
774,14 → 712,14 |
; 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 |
; / 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.tmp"; content is the output from |
; 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> |
; |
ACCESS="command" |
; Regular expression search in the process name (e.g. "ddclient.*") for non-WinNT systems |
; Regular expression search in the process name (e.g. "ddclient.*") |
; - true : Regular expression search (used pgrep command) |
; - false : Normal search (used pidof command) |
; |
789,7 → 727,7 |
; controls which processes are checked if they are running |
; |
; string contains a list of process names that are checked, names are seperated by a comma (on WinNT names must end with '.exe') |
; string contains a list of process names that are checked, names are seperated by a comma (on WINNT names must end with '.exe') |
; |
PROCESSES="mysqld, sshd, explorer.exe" |
799,7 → 737,7 |
; define how to access the repquota statistic data |
; - "command" repquota 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 "quotas.tmp"; content is the output from "repquota -au") |
; - "data" (a file must be available in the data directory of the phpsysinfo installation with the filename "quotas.txt"; content is the output from "repquota -au") |
; |
ACCESS="command" |
816,7 → 754,7 |
; Second method: |
; 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}.tmp"; |
; 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}") |
; - "wmi" information is retrieved everytime through WMI (WinNT only) |
852,12 → 790,12 |
; - "php-snmp" execute php snmprealwalk function (php-snmp module must be installed) |
; - "command" execute snmpwalk command |
; - "data" a file must be available in the data directory of the |
; phpsysinfo installation with the filename "snmppinfo{printer_number}.tmp"; |
; phpsysinfo installation with the filename "snmppinfo{printer_number}.txt"; |
; content is the output from: |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.2.1.1.5 > snmppinfo{printer_number}.tmp |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.4.1.367.3.2.1.2.24.1.1 >> snmppinfo{printer_number}.tmp |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.2.1.43.11.1.1 >> snmppinfo{printer_number}.tmp |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.2.1.43.18.1.1 >> snmppinfo{printer_number}.tmp |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.2.1.1.5 > snmppinfo{printer_number}.txt |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.4.1.367.3.2.1.2.24.1.1 >> snmppinfo{printer_number}.txt |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.2.1.43.11.1.1 >> snmppinfo{printer_number}.txt |
; LANG=C LC_ALL=C snmpwalk -On -c public -v 1 -r 0 -t 3 {printer_address} .1.3.6.1.2.1.43.18.1.1 >> snmppinfo{printer_number}.txt |
; |
ACCESS="php-snmp" |
898,7 → 836,7 |
; if access error try execute first: chmod 4755 /usr/bin/uprecords |
; This method is not recommended for safety reasons! |
; - "data" (a file must be available in the data directory of the phpsysinfo installation |
; with the filename "uprecords.tmp"; content is the output from "TZ=GMT uprecords -a -w") |
; with the filename "uprecords.txt"; content is the output from "TZ=GMT uprecords -a -w") |
; |
ACCESS="command" |
923,7 → 861,7 |
; 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.tmp") |
; - "data" (a file must be available in the data directory of the phpsysinfo installation with the filename "viewer.txt") |
; |
ACCESS="command" |
946,7 → 884,7 |
; define how to access the psstatus statistic data |
; - "command" ping 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 "pingtest.tmp") |
; with the filename "pingtest.txt") |
; |
ACCESS="command" |
977,7 → 915,7 |
; define how to access the ps statistic data |
; - "command" information is retrieved through WMI |
; - "data" (a file must be available in the data directory of the phpsysinfo installation |
; with the filename "hyperv.tmp") |
; with the filename "hyperv.txt") |
; |
ACCESS="command" |
987,6 → 925,6 |
; define how to access the docker statistic data |
; - "command" docker 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 "docker.tmp"; content is the output from "docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}'") |
; with the filename "docker.txt"; content is the output from "docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}'") |
; |
ACCESS="command" |
/web/acc/phpsysinfo/read_config.php |
---|
3,7 → 3,7 |
/** |
* phpSysInfo version |
*/ |
define('PSI_VERSION', '3.4.1'); |
define('PSI_VERSION', '3.3.4'); |
/** |
* phpSysInfo configuration |
*/ |
100,37 → 100,26 |
define('PSI_VERSION_STRING', PSI_VERSION); |
} |
if (defined('PSI_ROOTFS') && is_string(PSI_ROOTFS) && (PSI_ROOTFS !== '') && (PSI_ROOTFS !== '/')) { |
$rootfs = PSI_ROOTFS; |
if ($rootfs[0] === '/') { |
define('PSI_ROOT_FILESYSTEM', $rootfs); |
} else { |
define('PSI_ROOT_FILESYSTEM', ''); |
} |
} else { |
define('PSI_ROOT_FILESYSTEM', ''); |
} |
if (!defined('PSI_OS')) { //if not overloaded in phpsysinfo.ini |
/* get Linux code page */ |
if (PHP_OS == 'Linux') { |
if (file_exists($fname = PSI_ROOT_FILESYSTEM.'/etc/sysconfig/i18n') |
|| file_exists($fname = PSI_ROOT_FILESYSTEM.'/etc/default/locale') |
|| file_exists($fname = PSI_ROOT_FILESYSTEM.'/etc/locale.conf') |
|| file_exists($fname = PSI_ROOT_FILESYSTEM.'/etc/sysconfig/language') |
|| file_exists($fname = PSI_ROOT_FILESYSTEM.'/etc/profile.d/lang.sh') |
|| file_exists($fname = PSI_ROOT_FILESYSTEM.'/etc/profile.d/i18n.sh') |
|| file_exists($fname = PSI_ROOT_FILESYSTEM.'/etc/profile')) { |
if (file_exists($fname = '/etc/sysconfig/i18n') |
|| file_exists($fname = '/etc/default/locale') |
|| 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 { |
$contents = false; |
if (file_exists(PSI_ROOT_FILESYSTEM.'/system/build.prop')) { //Android |
if (file_exists('/system/build.prop')) { //Android |
define('PSI_OS', 'Android'); |
if ((PSI_ROOT_FILESYSTEM === '') && function_exists('exec') && @exec('uname -o 2>/dev/null', $unameo) && (sizeof($unameo)>0) && (($unameo0 = trim($unameo[0])) != "")) { |
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 ((PSI_ROOT_FILESYSTEM === '') && !defined('PSI_MODE_POPEN')) { //if not overloaded in phpsysinfo.ini |
if (!function_exists("proc_open")) { //proc_open function test by executing 'pwd' bbbmand |
if (!defined('PSI_MODE_POPEN')) { //if not overloaded in phpsysinfo.ini |
if (!function_exists("proc_open")) { //proc_open function test by executing 'pwd' command |
define('PSI_MODE_POPEN', true); //use popen() function - no stderr error handling (but with problems with timeout) |
} else { |
$out = ''; |
162,7 → 151,7 |
} |
} |
if (($out === null) || (trim($out) == "") || (substr(trim($out), 0, 1) != "/")) { |
if (is_null($out) || (trim($out) == "") || (substr(trim($out), 0, 1) != "/")) { |
define('PSI_MODE_POPEN', true); |
} |
fclose($pipes[0]); |
181,10 → 170,10 |
|| preg_match('/^RC_(LANG="?[^"\n]*"?)/m', $contents, $matches) |
|| preg_match('/^\s*export (LANG="?[^"\n]*"?)/m', $contents, $matches))) { |
if (!defined('PSI_SYSTEM_CODEPAGE')) { |
if (file_exists($vtfname = PSI_ROOT_FILESYSTEM.'/sys/module/vt/parameters/default_utf8') |
if (file_exists($vtfname = '/sys/module/vt/parameters/default_utf8') |
&& (trim(@file_get_contents($vtfname)) === "1")) { |
define('PSI_SYSTEM_CODEPAGE', 'UTF-8'); |
} elseif ((PSI_ROOT_FILESYSTEM === '') && function_exists('exec') && @exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) { //if not overloaded in phpsysinfo.ini |
} elseif (function_exists('exec') && @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]); |
193,7 → 182,7 |
} |
} |
} |
if ((PSI_ROOT_FILESYSTEM === '') && !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') && function_exists('exec') && @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 = ""; |
213,11 → 202,11 |
} |
} elseif (PHP_OS == 'Haiku') { |
if (!(defined('PSI_SYSTEM_CODEPAGE') && defined('PSI_SYSTEM_LANG')) //also if both not overloaded in phpsysinfo.ini |
&& (PSI_ROOT_FILESYSTEM === '') && function_exists('exec') && @exec('locale --message 2>/dev/null', $lines)) { |
&& function_exists('exec') && @exec('locale --message 2>/dev/null', $lines)) { |
foreach ($lines as $line) { |
if (preg_match('/^"?([^\."]*)\.?([^"]*)/', $line, $matches2)) { |
if (!defined('PSI_SYSTEM_CODEPAGE') && isset($matches2[2]) && ($matches2[2] !== null) && (trim($matches2[2]) != "")) { //also if not overloaded in phpsysinfo.ini |
if (!defined('PSI_SYSTEM_CODEPAGE') && isset($matches2[2]) && !is_null($matches2[2]) && (trim($matches2[2]) != "")) { //also if not overloaded in phpsysinfo.ini |
define('PSI_SYSTEM_CODEPAGE', $matches2[2]); |
} |
239,7 → 228,7 |
} |
} elseif (PHP_OS == 'Darwin') { |
if (!defined('PSI_SYSTEM_LANG') //if not overloaded in phpsysinfo.ini |
&& (PSI_ROOT_FILESYSTEM === '') && function_exists('exec') && @exec('defaults read /Library/Preferences/.GlobalPreferences AppleLocale 2>/dev/null', $lines)) { |
&& function_exists('exec') && @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]])) { |
/web/acc/phpsysinfo/templates/html/index_dynamic.html |
---|
112,7 → 112,7 |
<div id="vitals" class="halfsize"> |
<h2><span class="lang_002">System vitals</span></h2> |
<div style="overflow-x:auto;"> |
<table id="vitalsTable" style="border-collapse:collapse;"> |
<table class="stripeMe" id="vitalsTable" style="border-collapse:collapse;"> |
<tr> |
<td style="width:160px;"><span class="lang_003">Hostname</span></td> |
<td><span id="s_hostname"></span></td> |
149,18 → 149,26 |
<td style="width:160px;"><span class="lang_009">Load Averages</span></td> |
<td><span id="s_loadavg"></span></td> |
</tr> |
<tr> |
<tr style="display:none;" id="s_syslang_tr"> |
<td style="width:160px;"><span class="lang_097">System Language</span></td> |
<td><span id="s_syslang"></span></td> |
</tr> |
<tr> |
<tr style="display:none;" id="s_codepage_tr1"> |
<td style="width:160px;"><span class="lang_098">Code Page</span></td> |
<td><span id="s_codepage"></span></td> |
<td><span id="s_codepage_1"></span></td> |
</tr> |
<tr> |
<tr style="display:none;" id="s_codepage_tr2"> |
<td style="width:160px;"><span class="lang_098">Code Page</span></td> |
<td><span id="s_codepage_2"></span></td> |
</tr> |
<tr style="display:none;" id="s_processes_tr1"> |
<td style="width:160px;"><span class="lang_110">Processes</span></td> |
<td><span id="s_processes"></span></td> |
<td><span id="s_processes_1"></span></td> |
</tr> |
<tr style="display:none;" id="s_processes_tr2"> |
<td style="width:160px;"><span class="lang_110">Processes</span></td> |
<td><span id="s_processes_2"></span></td> |
</tr> |
</table> |
</div> |
</div> |
/web/acc/phpsysinfo/xml.php |
---|
1,4 → 1,5 |
<?php |
header('Access-Control-Allow-Origin: *'); |
/** |
* generate the xml |
* |
13,8 → 14,6 |
* @link http://phpsysinfo.sourceforge.net |
*/ |
header('Access-Control-Allow-Origin: *'); |
/** |
* application root path |
* |
29,22 → 28,28 |
} else { |
// check what xml part should be generated |
if (isset($_GET['plugin'])) { |
$output = new WebpageXML($_GET['plugin']); |
if (($_GET['plugin'] !== "") && !preg_match('/[^A-Za-z]/', $_GET['plugin'])) { |
$output = new WebpageXML($_GET['plugin']); |
} else { |
unset($output); |
} |
} else { |
$output = new WebpageXML(); |
} |
// generate output in proper type |
if (isset($_GET['json']) || isset($_GET['jsonp'])) { |
header('Cache-Control: no-cache, must-revalidate'); |
$json = $output->getJsonString(); |
if (isset($_GET['jsonp'])) { |
header('Content-Type: application/javascript'); |
echo(!preg_match('/[^\w\?]/', $_GET['callback'])?$_GET['callback']:'') . '('.$json.')'; |
// if $output is correct generate output in proper type |
if (isset($output) && is_object($output)) { |
if (isset($_GET['json']) || isset($_GET['jsonp'])) { |
header("Cache-Control: no-cache, must-revalidate\n"); |
$json = $output->getJsonString(); |
if (isset($_GET['jsonp'])) { |
header("Content-Type: application/javascript\n\n"); |
echo (!preg_match('/[^\w\?]/', $_GET['callback'])?$_GET['callback']:'') . '('.$json.')'; |
} else { |
header("Content-Type: application/json\n\n"); |
echo $json; |
} |
} else { |
header('Content-Type: application/json'); |
echo $json; |
$output->run(); |
} |
} else { |
$output->run(); |
} |
} |
/web/acc/phpsysinfo/CODE_OF_CONDUCT.md |
---|
0,0 → 1,46 |
# Contributor Covenant Code of Conduct |
## Our Pledge |
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. |
## Our Standards |
Examples of behavior that contributes to creating a positive environment include: |
* Using welcoming and inclusive language |
* Being respectful of differing viewpoints and experiences |
* Gracefully accepting constructive criticism |
* Focusing on what is best for the community |
* Showing empathy towards other community members |
Examples of unacceptable behavior by participants include: |
* The use of sexualized language or imagery and unwelcome sexual attention or advances |
* Trolling, insulting/derogatory comments, and personal or political attacks |
* Public or private harassment |
* Publishing others' private information, such as a physical or electronic address, without explicit permission |
* Other conduct which could reasonably be considered inappropriate in a professional setting |
## Our Responsibilities |
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. |
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. |
## Scope |
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. |
## Enforcement |
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [phpsysinfo@yahoo.com](mailto:phpsysinfo@yahoo.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. |
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. |
## Attribution |
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] |
[homepage]: http://contributor-covenant.org |
[version]: http://contributor-covenant.org/version/1/4/ |
/web/acc/phpsysinfo/CONTRIBUTING.md |
---|
0,0 → 1,7 |
# Contributing to phpSysInfo |
First time contributing to phpSysInfo? Read our [Code of Conduct](https://github.com/phpsysinfo/phpsysinfo/blob/master/CODE_OF_CONDUCT.md). |
### Propose a feature |
If you have a great idea or want to help out, just create a pull request with your change proposal |
in the [phpSysInfo](https://github.com/phpsysinfo/phpsysinfo) repository. |
/web/acc/phpsysinfo/ISSUE_TEMPLATE.md |
---|
0,0 → 1,16 |
# Issue template |
First make sure you've read the README.md file completely, especially the |
"INSTALLATION AND CONFIGURATION" section. If it still doesn't work then |
you can: |
Ask for help or submit a bug on Github (https://github.com/phpsysinfo/phpsysinfo/issues) |
***!! If you have any problems, please set `DEBUG` to true in `phpsysinfo.ini` |
and include any error messages in your bug report / help request !!*** |
OTHER NOTES |
----------- |
If you have a great idea or want to help out, just create a pull request with your change proposal |
in the [phpSysInfo](https://github.com/phpsysinfo/phpsysinfo) repository. |
/web/acc/phpsysinfo/index.php |
---|
55,8 → 55,8 |
case "json": |
$webpage = new WebpageXML("complete"); |
$json = $webpage->getJsonString(); |
header('Cache-Control: no-cache, must-revalidate'); |
header('Content-Type: application/json'); |
header("Cache-Control: no-cache, must-revalidate\n"); |
header("Content-Type: application/json\n\n"); |
echo $json; |
break; |
case "bootstrap": |
89,5 → 89,7 |
default: |
$tpl = new Template("/templates/html/index_all.html"); |
echo $tpl->fetch(); |
break; |
} |
break; |
} |
/web/acc/phpsysinfo/js.php |
---|
46,33 → 46,40 |
$scriptmin = $script.'.min.js'; |
$compression = false; |
header('content-type: application/x-javascript'); |
header("content-type: application/x-javascript"); |
if ((!defined("PSI_DEBUG") || (PSI_DEBUG !== true)) && defined("PSI_JS_COMPRESSION")) { |
$compression = strtolower(PSI_JS_COMPRESSION); |
} |
switch ($compression) { |
case "normal": |
if (file_exists($scriptmin) && is_readable($scriptmin)) { |
echo file_get_contents($scriptmin); |
} elseif (file_exists($scriptjs) && is_readable($scriptjs)) { |
$packer = new JavaScriptPacker(file_get_contents($scriptjs)); |
echo $packer->pack(); |
} |
break; |
case "none": |
if (file_exists($scriptjs) && is_readable($scriptjs)) { |
$packer = new JavaScriptPacker(file_get_contents($scriptjs), 0); |
echo $packer->pack(); |
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) { |
echo file_get_contents($scriptmin); |
} |
break; |
default: |
if (file_exists($scriptjs) && is_readable($scriptjs)) { |
echo file_get_contents($scriptjs); |
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) { |
echo file_get_contents($scriptmin); |
} |
case "normal": |
if (file_exists($scriptmin) && is_readable($scriptmin)) { |
$filecontent = file_get_contents($scriptmin); |
echo $filecontent; |
} elseif (file_exists($scriptjs) && is_readable($scriptjs)) { |
$filecontent = file_get_contents($scriptjs); |
$packer = new JavaScriptPacker($filecontent); |
echo $packer->pack(); |
} |
break; |
case "none": |
if (file_exists($scriptjs) && is_readable($scriptjs)) { |
$filecontent = file_get_contents($scriptjs); |
$packer = new JavaScriptPacker($filecontent, 0); |
echo $packer->pack(); |
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) { |
$filecontent = file_get_contents($scriptmin); |
echo $filecontent; |
} |
break; |
default: |
if (file_exists($scriptjs) && is_readable($scriptjs)) { |
$filecontent = file_get_contents($scriptjs); |
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) { |
$filecontent = file_get_contents($scriptmin); |
} else break; |
echo $filecontent; |
break; |
} |
} |
/web/email_registration_front.php |
---|
94,8 → 94,8 |
success: function(data){ |
if (data.match("success")) { |
status.html(data).fadeIn(400); |
alert("Encore une dernière étape!\n\nUn mot de passe temporaire vient d'être envoyé à votre adresse électronique.\n\nVérifier vos spams ou courriers indésirables, si vous ne voyez pas ce mail dans votre boîte de réception.\n\nSi vous ne recevez pas le mail dans les 24 heures contactez votre administrateur.") |
document.location.href="index.php"; |
alert("Encore une dernière étape!\n\nUn mot de passe temporaire vient de vous être envoyé à votre adresse électronique.\n Veuillez changer votre mot de passe.\n\n(Pensez à vérifier vos spams ou courriers indésirables, si vous ne voyez pas ce mail dans votre boîte de réception).\n\nSi vous ne recevez pas le mail dans les 24 heures contactez votre administrateur.") |
document.location.href="index.php"; |
} else { |
console.log(data); |
alert("Une erreur s'est produite.\n\nVeuillez renouveler votre inscription ou contacter votre administrateur."); |
/web/email_registration_back.php |
---|
50,8 → 50,6 |
fclose($file_conf); |
$whiteDomain = explode(" ", strtolower(trim($conf['MAIL_WHITEDOMAIN']))); |
$adminMail = $conf['MAIL_ADMIN']; |
$typeMail = $conf['MAIL_TYPE']; |
$fromMail = $conf['MAIL_ADDR']; |
/**************************************** |
* Choice of language * |
311,11 → 309,7 |
$domain = $conf["DOMAIN"]; |
$hostname = $conf["HOSTNAME"]; |
$to = $Fmail; |
if ($typeMail == "3") { // using an existing @mail |
$from = $fromMail; } |
else { |
$from = "administrator"; |
} |
$from = "administrator"; |
$subject = $l_subject; |
$message = "<!DOCTYPE html> |
<html> |
339,8 → 333,7 |
$header .= "Content-type: text/html; charset=utf-8\n"; |
if(mail($to, $subject, $message, $header)){ |
echo "<center>success : <b>Vous y êtes presque ! $l_user '$login' $l_created</b></center><br />"; |
echo "<center>success : <b>Un email contenant vos informations de connexion vient d'être envoyé.</b></center><br />"; |
echo "Info : to = $to ; header = $header<br />"; |
echo "<center>success : <b>Un email contenant vos informations de connexion vient de vous être envoyé.</b></center><br />"; |
// Creation of the email for the administrator (if enabled) |
if (!empty($adminMail)){ |
$to = $adminMail; |