/web/acc/phpsysinfo/CODE_OF_CONDUCT.md |
---|
File deleted |
/web/acc/phpsysinfo/ISSUE_TEMPLATE.md |
---|
File deleted |
/web/acc/phpsysinfo/CONTRIBUTING.md |
---|
File deleted |
/web/acc/phpsysinfo/CHANGELOG.md |
---|
3,6 → 3,26 |
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-2021, Mieczyslaw Nalewaj ([github.com/namiltd](https://github.com/namiltd), [sf.net/users/namiltd](https://sf.net/users/namiltd)) |
* Copyright (c), 2009-2022, 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 / 2016 / 2019 |
- Windows 2000 / XP / 2003 / Vista / 2008 / 7 / 2011 / 2012 / 8 / 8.1 / 10 / 10 IoT / 2016 / 2019 / 2022 / 11 |
- Android |
#### Platforms currently in progress: |
69,7 → 69,7 |
#### Docker container installation |
- `sudo docker build -t phpsysinfo github.com/phpsysinfo/phpsysinfo` |
- `sudo docker build -t phpsysinfo github.com/phpsysinfo/phpsysinfo#main` |
- `sudo docker run -i -p 8080:80 -t phpsysinfo` |
- go to http://localhost:8080/phpsysinfo/ |
/web/acc/phpsysinfo/data/.htaccess |
---|
1,3 → 1,4 |
# 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,6 → 33,8 |
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 |
102,6 → 104,10 |
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,4 → 1,7 |
[cpu] |
; Qemu |
0x0,0x51="QEMU TCG" |
; Ampere Computing |
;0xc0 |
49,12 → 52,21 |
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" |
62,11 → 74,18 |
0x42,0x516="Vulcan/ThunderX2 T99p1" |
; Cavium Inc. - ('C') cores. |
0x43,0x0a0="ThunderX" |
0x43,0x0a1="ThunderX T88" |
0x43,0x0a2="ThunderX T81" |
0x43,0x0a3="ThunderX T83" |
0x43,0x0af="ThunderX2 T99" |
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" |
; DEC - Digital Equipment Corporation |
0x44,0xa10="SA110" |
75,6 → 94,10 |
; Fujitsu Ltd. |
0x46,0x1="A64FX" |
; HiSilicon Technologies, Inc. |
0x48,0xd01="TSV110" |
0x48,0xd40="Cortex-A76" |
; Infineon Technologies AG |
;0x49 |
82,31 → 105,36 |
;0x4d |
; NVIDIA Corporation |
0x4e,0x000="Denver" |
0x4e,0x003="Denver 2" |
0x4e,0x0="Denver" |
0x4e,0x3="Denver 2" |
; APM - Applied Micro Circuits Corporation - ('P') cores. |
0x50,0x000="xgene1" |
0x50,0x0="xgene1" |
; Qualcomm Inc. - ('Q') cores. |
0x51,0x00f="Scorpion" |
0x51,0x02d="Scorpion" |
0x51,0x04d="Krait" |
0x51,0x06f="Krait" |
0x51,0xf="Scorpion" |
0x51,0x2d="Scorpion" |
0x51,0x4d="Krait" |
0x51,0x6f="Krait" |
0x51,0x201="Kryo Silver" |
0x51,0x205="Kryo Gold" |
0x51,0x211="Kryo Silver" |
0x51,0x800="Kryo 260/280 Gold (Cortex-A73)" |
0x51,0x801="Kryo 260/280 Silver (Cortex-A53)" |
0x51,0x802="Kryo 385 Gold (Cortex-A75)" |
0x51,0x803="Kryo 385 Silver (Cortex-A55)" |
0x51,0x804="Kryo 485 Gold" |
0x51,0x805="Kryo 485 Silver" |
0x51,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,0xc00="Falkor" |
0x51,0xc01="Saphira" |
; Samsung ('S') cores. |
0x53,0x001="exynos-m1" |
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" |
; Texas Instruments |
0x54,0x925="TI925" |
171,10 → 199,11 |
Shanghai="Zhaoxin" |
UMCUMCUMC="UMC" |
VIAVIAVIA="VIA" |
Vortex86SoC="Vortex" |
Vortex86SoC="DM&P Vortex" |
E2KMACHINE="MCST Elbrus" |
GenuineAO486="ao486 soft CPU" |
bhyvebhyve="bhyve" |
KVMKVMKVM="KVM" |
E2KMACHINE="MCST Elbrus" |
MicrosoftHv="Microsoft Hyper-V" |
lrpepyhvr="Parallels" |
VMwareVMware="VMware" |
182,4 → 211,6 |
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,6 → 97,11 |
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" |
127,13 → 132,50 |
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" |
;wrong in "/etc/os-release" Manjaro |
;wrong in "/etc/manjaro-release" Manjaro |
;wrong in "/etc/arch-release" Manjaro |
;wrong in "/etc/arch-release" Arch |
[Netrunner] |
Image = "Netrunner.png" |
155,35 → 197,44 |
[Manjaro Linux] |
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" |
[ManjaroLinux] |
[Manjaro-ARM] |
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"" |
[Arch Linux ARM] |
Image = "Arch.png" |
[void] |
Image = "Void.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] |
[Arch Linux ARM] |
Image = "Arch.png" |
;detected in "lsb_release -a" |
;detected in "/etc/lsb-release" |
;detected in "/etc/os-release" |
[Cobalt] |
Image = "Cobalt.png" |
397,6 → 448,37 |
;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" |
411,6 → 493,13 |
;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" |
459,6 → 548,18 |
;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" |
579,6 → 680,10 |
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" |
620,6 → 725,10 |
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" |
627,6 → 736,14 |
;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" |
680,7 → 797,50 |
;detected in "/etc/redhat-release" |
;detected in "/etc/system-release" |
; at the end because some distros may also have the same files (like SMEServer) |
[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) |
[CentOS] |
Image = "CentOS.png" |
Files = "/etc/centos-release" |
877,11 → 1037,27 |
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" |
; at the end because some distros may also have the same files (like openSUSE) |
[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) |
[SUSE LINUX] |
Image = "SUSE.png" |
Mode = "Analyse" |
1006,7 → 1182,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) |
; 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) |
[RedHat] |
Image = "RedHat.png" |
Mode = "Analyse" |
1013,6 → 1189,10 |
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,3 → 42,21 |
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,6 → 33,8 |
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/Alma.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Arco.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Artix.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/EndeavourOS.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/EuroLinux.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Garuda.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/JingOS.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/KDEneon.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Linuxfx.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/NethServer.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Omarine.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Rocky.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Virtuozzo.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/gfx/images/Win11.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/acc/phpsysinfo/includes/class.CommonFunctions.inc.php |
---|
26,48 → 26,12 |
class CommonFunctions |
{ |
/** |
* holds codepage for chcp |
* holds dmi memory data |
* |
* @var integer |
* @var array |
*/ |
private static $_cp = null; |
private static $_dmimd = 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)=="+"))) { |
177,7 → 141,7 |
continue; |
} |
$strProgrammpath = $strPathS.$strProgram; |
if (is_executable($strProgrammpath) || ((PSI_OS == 'WINNT') && (strtolower($path_parts['extension']) == 'py'))) { |
if (is_executable($strProgrammpath) || ((PSI_OS == 'WINNT') && (strtolower($path_parts['extension']) == 'py') && is_file($strProgrammpath))) { |
return $strProgrammpath; |
} |
} |
195,7 → 159,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 integer $timeout timeout value in seconds (default value is PSI_EXEC_TIMEOUT_INT) |
* @param int $timeout timeout value in seconds (default value is PSI_EXEC_TIMEOUT_INT) |
* |
* @return boolean command successfull or not |
*/ |
216,6 → 180,11 |
} |
} |
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]; |
281,7 → 250,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 === true) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
if (PSI_OS == 'WINNT') { |
$process = $pipes[1] = popen($strSet.$strProgram.$strArgs." 2>nul", "r"); |
} else { |
292,7 → 261,7 |
} |
if (is_resource($process)) { |
$te = self::_timeoutfgets($pipes, $strBuffer, $strError, $timeout); |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
$return_value = pclose($pipes[1]); |
} else { |
fclose($pipes[0]); |
382,8 → 351,8 |
* |
* @param string $strFileName name of the file which should be read |
* @param string &$strRet content of the file (reference) |
* @param integer $intLines control how many lines should be read |
* @param integer $intBytes control how many bytes of each line should be read |
* @param int $intLines control how many lines should be read |
* @param int $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 |
405,12 → 374,18 |
} |
} |
if (PSI_ROOT_FILESYSTEM !== '') { |
$rfsinfo = "[".PSI_ROOT_FILESYSTEM."]"; |
} else { |
$rfsinfo = ''; |
} |
$strFile = ""; |
$intCurLine = 1; |
$error = PSI_Error::singleton(); |
if (file_exists($strFileName)) { |
if (is_readable($strFileName)) { |
if ($fd = fopen($strFileName, 'r')) { |
if (file_exists(PSI_ROOT_FILESYSTEM.$strFileName)) { |
if (is_readable(PSI_ROOT_FILESYSTEM.$strFileName)) { |
if ($fd = fopen(PSI_ROOT_FILESYSTEM.$strFileName, 'r')) { |
while (!feof($fd)) { |
$strFile .= fgets($fd, $intBytes); |
if ($intLines <= $intCurLine && $intLines != 0) { |
430,7 → 405,7 |
} |
} else { |
if ($booErrorRep) { |
$error->addError('fopen('.$strFileName.')', 'file can not read by phpsysinfo'); |
$error->addError('fopen('.$rfsinfo.$strFileName.')', 'file can not read by phpsysinfo'); |
} |
return false; |
437,7 → 412,7 |
} |
} else { |
if ($booErrorRep) { |
$error->addError('fopen('.$strFileName.')', 'file permission error'); |
$error->addError('fopen('.$rfsinfo.$strFileName.')', 'file permission error'); |
} |
return false; |
444,7 → 419,7 |
} |
} else { |
if ($booErrorRep) { |
$error->addError('file_exists('.$strFileName.')', 'the file does not exist on your machine'); |
$error->addError('file_exists('.$rfsinfo.$strFileName.')', 'the file does not exist on your machine'); |
} |
return false; |
454,6 → 429,72 |
} |
/** |
* 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 |
475,7 → 516,7 |
} |
} |
$exists = file_exists($strFileName); |
$exists = file_exists(PSI_ROOT_FILESYSTEM.$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); |
534,7 → 575,7 |
*/ |
public static function checkForExtensions($arrExt = array()) |
{ |
if (defined('PSI_SYSTEM_CODEPAGE') && ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0))) |
if (defined('PSI_SYSTEM_CODEPAGE') && (PSI_SYSTEM_CODEPAGE !== null) && ((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'); |
556,7 → 597,7 |
$text .= " </Error>\n"; |
$text .= "</phpsysinfo>"; |
if ($error) { |
header("Content-Type: text/xml\n\n"); |
header('Content-Type: text/xml'); |
echo $text; |
die(); |
} |
568,7 → 609,7 |
* @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 |
* @param int $timeout timeout value in seconds |
* |
* @return boolean timeout expired or not |
*/ |
578,7 → 619,7 |
$e = null; |
$te = false; |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN === true) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
$pipe2 = false; |
} else { |
$pipe2 = true; |
614,96 → 655,6 |
} |
/** |
* 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 |
732,177 → 683,94 |
} |
/** |
* readReg function |
* get virtualizer from dmi data |
* |
* @return boolean command successfull or not |
* @return string|null |
*/ |
public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true) |
public static function decodevirtualizer($vendor_data) |
{ |
$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 (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; |
} |
$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($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]; |
} |
} 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; |
return null; |
} |
if (variant_get_type($sub_keys) !== VT_NULL) { |
$strBuffer = strval($sub_keys); |
} else { |
return false; |
} |
} else { |
return false; |
} |
} |
return true; |
} |
/** |
* enumKey function |
* readdmimemdata function |
* |
* @return boolean command successfull or not |
* @return array |
*/ |
public static function enumKey($reg, $strName, &$arrBuffer, $booErrorRep = true) |
public static function readdmimemdata() |
{ |
$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 ((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); |
} |
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($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; |
} |
} 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); |
if (!empty($mem)) { |
self::$_dmimd[] = $mem; |
} |
} 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; |
return self::$_dmimd; |
} |
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; |
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 |
---|
117,7 → 117,7 |
$mount_parm[] = $parm; |
} |
} |
} elseif (CommonFunctions::rfts("/etc/mtab", $mount)) { |
} elseif (CommonFunctions::rfts(((PSI_ROOT_FILESYSTEM === '')||(PHP_OS !== 'Linux'))?"/etc/mtab":"/proc/1/mounts", $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\n"); |
header("Content-Type: text/xml\n\n"); |
header('Cache-Control: no-cache, must-revalidate'); |
header('Content-Type: text/xml'); |
echo $xml->getSimpleXmlElement()->asXML(); |
exit(); |
} |
/web/acc/phpsysinfo/includes/js/class.JavaScriptPacker.inc.php |
---|
159,7 → 159,8 |
{ |
$parser = new ParseMaster(); |
// replace: $name -> n, $$name -> na |
$parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/', |
$parser->add( |
'/((\\x24+)([a-zA-Z$_]+))(\\d*)/', |
array('fn' => '_replace_name') |
); |
// replace: _name -> _0, double-underscore (__name) is ignored |
169,7 → 170,8 |
// quick ref |
$encoded = $keywords['encoded']; |
$parser->add($regexp, |
$parser->add( |
$regexp, |
array( |
'fn' => '_replace_encoded', |
'data' => $encoded |
194,7 → 196,8 |
$encoded = $keywords['encoded']; |
// encode |
$parser->add($regexp, |
$parser->add( |
$regexp, |
array( |
'fn' => '_replace_encoded', |
'data' => $encoded |
/web/acc/phpsysinfo/includes/mb/class.coretemp.inc.php |
---|
File deleted |
/web/acc/phpsysinfo/includes/mb/class.cpumem.inc.php |
---|
0,0 → 1,96 |
<?php |
/** |
* cpumem sensor class, getting hardware sensors information of CPU and memory |
* |
* 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 CpuMem extends Hwmon |
{ |
/** |
* get the information |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return void |
*/ |
public function build() |
{ |
if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) { |
$hwpaths = CommonFunctions::findglob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) > 0)) { |
$hwpaths2 = CommonFunctions::findglob("/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); |
} |
} |
} elseif ((PSI_OS == 'WINNT') || defined('PSI_EMU_HOSTNAME')) { |
$allCpus = WINNT::_get_Win32_Processor(); |
foreach ($allCpus as $oneCpu) if (isset($oneCpu['CurrentVoltage']) && ($oneCpu['CurrentVoltage'] > 0)) { |
$dev = new SensorDevice(); |
$dev->setName($oneCpu['DeviceID']); |
$dev->setValue($oneCpu['CurrentVoltage']/10); |
$this->mbinfo->setMbVolt($dev); |
} |
$allMems = WINNT::_get_Win32_PhysicalMemory(); |
$counter = 0; |
foreach ($allMems as $oneMem) if (isset($oneMem['ConfiguredVoltage']) && ($oneMem['ConfiguredVoltage'] > 0)) { |
$dev = new SensorDevice(); |
$dev->setName('Mem'.($counter++)); |
$dev->setValue($oneMem['ConfiguredVoltage']/1000); |
if (isset($oneMem['MaxVoltage']) && ($oneMem['MaxVoltage'] > 0)) { |
$dev->setMax($oneMem['MaxVoltage']/1000); |
} |
if (isset($oneMem['MinVoltage']) && ($oneMem['MinVoltage'] > 0)) { |
$dev->setMin($oneMem['MinVoltage']/1000); |
} |
$this->mbinfo->setMbVolt($dev); |
} |
} |
if ((PSI_OS != 'WINNT') && !defined('PSI_EMU_HOSTNAME')) { |
$dmimd = CommonFunctions::readdmimemdata(); |
$counter = 0; |
foreach ($dmimd as $mem) { |
if (isset($mem['Size']) && preg_match('/^(\d+)\s(M|G)B$/', $mem['Size'], $size) && ($size[1] > 0) |
&& isset($mem['Configured Voltage']) && preg_match('/^([\d\.]+)\sV$/', $mem['Configured Voltage'], $voltage) && ($voltage[1] > 0)) { |
$dev = new SensorDevice(); |
$dev->setName('Mem'.($counter++)); |
$dev->setValue($voltage[1]); |
if (isset($mem['Minimum Voltage']) && preg_match('/^([\d\.]+)\sV$/', $mem['Minimum Voltage'], $minv) && ($minv[1] > 0)) { |
$dev->setMin($minv[1]); |
} |
if (isset($mem['Maximum Voltage']) && preg_match('/^([\d\.]+)\sV$/', $mem['Maximum Voltage'], $maxv) && ($maxv[1] > 0)) { |
$dev->setMax($maxv[1]); |
} |
$this->mbinfo->setMbVolt($dev); |
} |
} |
} |
} |
} |
/web/acc/phpsysinfo/includes/mb/class.freeipmi.inc.php |
---|
33,13 → 33,12 |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/freeipmi.txt', $lines)) { |
if (CommonFunctions::rftsdata('freeipmi.tmp', $lines)) { |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_freeipmi] ACCESS'); |
break; |
} |
} |
173,7 → 172,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.hddtemp.inc.php |
---|
90,7 → 90,6 |
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) { |
115,7 → 114,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::rfts(PSI_APP_ROOT.'/data/healthd.txt', $lines)) { |
if (CommonFunctions::rftsdata('healthd.tmp', $lines)) { |
$lines0 = preg_split("/\n/", $lines, 1, PREG_SPLIT_NO_EMPTY); |
if (count($lines0) == 1) { |
$this->_values = preg_split("/\t+/", $lines0[0]); |
46,7 → 46,6 |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_healthd] ACCESS'); |
break; |
} |
} |
146,7 → 145,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 = glob($hwpath."temp*_input", GLOB_NOSORT); |
$sensor = CommonFunctions::findglob($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 = glob($hwpath."in*_input", GLOB_NOSORT); |
$sensor = CommonFunctions::findglob($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 = glob($hwpath."fan*_input", GLOB_NOSORT); |
$sensor = CommonFunctions::findglob($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 = glob($hwpath."power*_input", GLOB_NOSORT); |
$sensor = CommonFunctions::findglob($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 = glob($hwpath."curr*_input", GLOB_NOSORT); |
$sensor = CommonFunctions::findglob($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 = glob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT); |
$hwpaths = CommonFunctions::findglob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) > 0)) { |
$hwpaths2 = glob("/sys/class/hwmon/hwmon*/device/", GLOB_NOSORT); |
$hwpaths2 = CommonFunctions::findglob("/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,13 → 40,12 |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ipmicfg.txt', $lines)) { |
if (CommonFunctions::rftsdata('ipmicfg.tmp', $lines)) { |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_ipmicfg] ACCESS'); |
break; |
} |
} |
225,7 → 224,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.ipmitool.inc.php |
---|
33,11 → 33,10 |
CommonFunctions::executeProgram('ipmitool', 'sensor -v', $lines); |
break; |
case 'data': |
CommonFunctions::rfts(PSI_APP_ROOT.'/data/ipmitool.txt', $lines); |
CommonFunctions::rftsdata('ipmitool.tmp', $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') |
126,7 → 125,6 |
$sens['Sensor Type (Discrete)'] = ''; |
$sens['State'] = $buffer[1]; |
} |
break; |
} |
$this->_buf[] = $sens; |
} |
306,7 → 304,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.ipmiutil.inc.php |
---|
33,13 → 33,12 |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ipmiutil.txt', $lines)) { |
if (CommonFunctions::rftsdata('ipmiutil.tmp', $lines)) { |
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_ipmiutil] ACCESS'); |
break; |
} |
} |
230,6 → 229,7 |
$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)); |
241,6 → 241,9 |
} else { |
$dev->setValue($buffer5); |
} |
} else { |
$dev->setValue($buffer5); |
} |
$this->mbinfo->setMbOther($dev); |
} |
} |
251,7 → 254,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.k8temp.inc.php |
---|
34,13 → 34,12 |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/k8temp.txt', $lines)) { |
if (CommonFunctions::rftsdata('k8temp.tmp', $lines)) { |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_k8temp] ACCESS'); |
break; |
} |
} |
71,7 → 70,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.lmsensors.inc.php |
---|
33,11 → 33,10 |
CommonFunctions::executeProgram("sensors", "", $lines); |
break; |
case 'data': |
CommonFunctions::rfts(PSI_APP_ROOT.'/data/lmsensors.txt', $lines); |
CommonFunctions::rftsdata('lmsensors.tmp', $lines); |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_lmsensors] ACCESS'); |
break; |
} |
if (trim($lines) !== "") { |
74,15 → 73,23 |
; |
} 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$/", $line, $data); |
preg_match("/^(.+):(.+).C\r?$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+).?$/", trim($value), $newvalue)) { |
$data[$key] = 0+trim($newvalue[1]); |
$data[$key] = floatval($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
139,8 → 146,8 |
} elseif (isset($data[4]) && $data[2] <= $data[4]) { |
$dev->setMax($data[4]); |
} |
if (preg_match("/\sALARM\s*$/", $line) || preg_match("/\sALARM\s+sensor\s+=/", $line)) { |
$dev->setEvent("Alarm"); |
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]); |
} |
$this->mbinfo->setMbTemp($dev); |
} |
171,15 → 178,23 |
; |
} 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$/", $line, $data); |
preg_match("/^(.+):(.+) RPM\r?$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+).?$/", trim($value), $newvalue)) { |
$data[$key] = 0+trim($newvalue[1]); |
$data[$key] = floatval($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
190,8 → 205,8 |
if (isset($data[4])) { |
$dev->setMin(trim($data[4])); |
} |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
} |
$this->mbinfo->setMbFan($dev); |
} |
220,16 → 235,22 |
; |
} 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$/", $line, $data); |
preg_match("/^(.+):(.+) V\r?$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+)$/", trim($value), $newvalue)) { |
$data[$key] = 0+trim($newvalue[1]); |
$data[$key] = floatval($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
243,8 → 264,8 |
if (isset($data[6])) { |
$dev->setMax($data[6]); |
} |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
} |
$this->mbinfo->setMbVolt($dev); |
} |
274,19 → 295,27 |
; |
} 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$/", $line, $data); |
preg_match("/^(.+):(.+) W\r?$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
if (preg_match("/^\+?(-?[0-9\.]+).?$/", trim($value), $newvalue)) { |
$data[$key] = 0+trim($newvalue[1]); |
$data[$key] = floatval($newvalue[1]); |
} else { |
$data[$key] = trim($value); |
} |
303,8 → 332,8 |
if (isset($data[4]) && $data[2] <= $data[4]) { |
$dev->setMax($data[4]); |
} |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
} |
$this->mbinfo->setMbPower($dev); |
} |
333,10 → 362,16 |
; |
} 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$/", $line, $data); |
preg_match("/^(.+):(.+) A\r?$/", $line, $data); |
} |
if (count($data)>2) { |
foreach ($data as $key=>$value) { |
355,8 → 390,8 |
if (isset($data[6])) { |
$dev->setMax($data[6]); |
} |
if (preg_match("/\sALARM\s*$/", $line)) { |
$dev->setEvent("Alarm"); |
if (preg_match("/\s(ALARM)\s*$/", $line, $evbuf) || (($evbuf[1] = $dev->getValue()) === 'FAULT')) { |
$dev->setEvent($evbuf[1]); |
} |
$this->mbinfo->setMbCurrent($dev); |
} |
381,8 → 416,8 |
} |
} |
$data = array(); |
preg_match("/^(.+):\s*([^\-\+\d\s].+)$/", $line, $data); |
if ((count($data)>2) && ($data[1]!=="Adapter")) { |
preg_match("/^(.+):\s*([^\-\+\d\s].+)\r?$/", $line, $data); |
if ((count($data)>2) && ($data[1]!=="Adapter") && !preg_match("/^FAULT/", $data[2])) { |
$dev = new SensorDevice(); |
$dev->setName($data[1].$sname); |
if (preg_match("/(.*\s*)ALARM\s*$/", $data[2], $aldata)) { |
405,7 → 440,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::rfts(PSI_APP_ROOT."/data/MBM5.csv", $buffer); |
CommonFunctions::rftsdata("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,13 → 45,12 |
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/mbmon.txt', $lines)) { |
if (CommonFunctions::rftsdata('mbmon.tmp', $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,13 → 43,12 |
$this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY); |
break; |
case 'data': |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/nvidiasmi.txt', $lines)) { |
if (CommonFunctions::rftsdata('nvidiasmi.tmp', $lines)) { |
$this->_gpus = preg_split("/^(?=GPU )/m", $lines, -1, PREG_SPLIT_NO_EMPTY); |
} |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_nvidiasmi] ACCESS'); |
break; |
} |
} |
58,7 → 57,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
132,7 → 131,6 |
$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 = CommonFunctions::initWMI('root\OpenHardwareMonitor', true); |
$_wmi = WINNT::initWMI('root\OpenHardwareMonitor', true); |
if ($_wmi) { |
$tmpbuf = CommonFunctions::getWMI($_wmi, 'Sensor', array('Parent', 'Name', 'SensorType', 'Value')); |
$tmpbuf = WINNT::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 (!is_null($temp) && (($temp = trim($temp)) != "")) { |
if (($temp !== null) && (($temp = trim($temp)) != "")) { |
$dev = new SensorDevice(); |
$dev->setName("CPU 1"); |
$dev->setValue($temp / 1000); |
if (!is_null($temp_max) && (($temp_max = trim($temp_max)) != "") && ($temp_max > 0)) { |
if (($temp_max !== null) && (($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) && !is_null($volt) && (($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) && ($volt !== null) && (($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) && !is_null($current) && (($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) && ($current !== null) && (($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::rfts(PSI_APP_ROOT.'/data/speedfan.txt', $buffer) && (strlen($buffer) > 0)) { |
if (CommonFunctions::rftsdata('speedfan.tmp', $buffer) && (strlen($buffer) > 0)) { |
if (preg_match("/^Temperatures:\s+(.+)$/m", $buffer, $out)) { |
$this->_filecontent["temp"] = $out[1]; |
} |
52,7 → 52,6 |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_speedfan] ACCESS'); |
break; |
} |
} |
115,7 → 114,7 |
* |
* @see PSI_Interface_Sensor::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/mb/class.thermalzone.inc.php |
---|
30,18 → 30,24 |
switch (defined('PSI_SENSOR_THERMALZONE_ACCESS')?strtolower(PSI_SENSOR_THERMALZONE_ACCESS):'command') { |
case 'command': |
if ((PSI_OS == 'WINNT') || defined('PSI_EMU_HOSTNAME')) { |
if (defined('PSI_EMU_HOSTNAME') || CommonFunctions::isAdmin()) { |
$_wmi = CommonFunctions::initWMI('root\WMI', true); |
if (defined('PSI_EMU_HOSTNAME') || WINNT::isAdmin()) { |
$_wmi = WINNT::initWMI('root\WMI', true); |
if ($_wmi) { |
$this->_buf = CommonFunctions::getWMI($_wmi, 'MSAcpi_ThermalZoneTemperature', array('InstanceName', 'CriticalTripPoint', 'CurrentTemperature')); |
$this->_buf = WINNT::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)"); |
} |
} |
} |
break; |
case 'data': |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::rfts(PSI_APP_ROOT.'/data/thermalzone.txt', $lines, 0, 4096, false)) { //output of "wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CriticalTripPoint,CurrentTemperature,InstanceName" |
if (!defined('PSI_EMU_HOSTNAME') && CommonFunctions::rftsdata('thermalzone.tmp', $lines)) { //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++) { |
54,7 → 60,6 |
break; |
default: |
$this->error->addConfigError('__construct()', '[sensor_thermalzone] ACCESS'); |
break; |
} |
} |
81,15 → 86,27 |
$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 = glob('/sys/class/thermal/thermal_zone*/'); |
$thermalzones = CommonFunctions::findglob('/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) && !is_null($temp) && (($temp = trim($temp)) != "")) { |
if (CommonFunctions::rfts($thermalzonetemp, $temp, 1, 4096, false) && ($temp !== null) && (($temp = trim($temp)) != "")) { |
if ($temp >= 1000) { |
$div = 1000; |
} elseif ($temp >= 200) { |
104,7 → 121,7 |
$dev->setValue($temp); |
$temp_type = null; |
if (CommonFunctions::rfts($thermalzone.'type', $temp_type, 1, 4096, false) && !is_null($temp_type) && (($temp_type = trim($temp_type)) != "")) { |
if (CommonFunctions::rfts($thermalzone.'type', $temp_type, 1, 4096, false) && ($temp_type !== null) && (($temp_type = trim($temp_type)) != "")) { |
$dev->setName($temp_type); |
} else { |
$dev->setName("ThermalZone"); |
111,7 → 128,7 |
} |
$temp_max = null; |
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)) { |
if (CommonFunctions::rfts($thermalzone.'trip_point_0_temp', $temp_max, 1, 4096, false) && ($temp_max !== null) && (($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); |
125,10 → 142,10 |
} |
} |
if ($notwas) { |
$thermalzones = glob('/proc/acpi/thermal_zone/TH*/temperature'); |
$thermalzones = (PSI_ROOT_FILESYSTEM.'/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) && !is_null($temp) && (($temp = trim($temp)) != "")) { |
if (CommonFunctions::rfts($thermalzone, $temp, 1, 4096, false) && ($temp !== null) && (($temp = trim($temp)) != "")) { |
$dev = new SensorDevice(); |
if (preg_match("/^\/proc\/acpi\/thermal_zone\/(.+)\/temperature$/", $thermalzone, $name)) { |
$dev->setName("ThermalZone ".$name[1]); |
148,7 → 165,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 = glob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT); |
$hwpaths = CommonFunctions::findglob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT); |
if (is_array($hwpaths) && (count($hwpaths) == 1)) { |
$hwpaths2 = glob("/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon*/", GLOB_NOSORT); |
$hwpaths2 = CommonFunctions::findglob("/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.AIX.inc.php |
---|
26,7 → 26,14 |
*/ |
class AIX extends OS |
{ |
/** |
* uptime command result. |
*/ |
private $_uptime = null; |
/** |
* prtconf command result. |
*/ |
private $_aixdata = array(); |
/** |
35,7 → 42,7 |
*/ |
private function _hostname() |
{ |
/* if (PSI_USE_VHOST === true) { |
/* if (PSI_USE_VHOST) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('hostname', '', $ret)) { |
64,8 → 71,8 |
*/ |
private function _uptime() |
{ |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $buf, $ar_buf)) { |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
$days = $ar_buf[1]; |
81,8 → 88,8 |
*/ |
private function _loadavg() |
{ |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
} |
329,11 → 336,11 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
$this->error->addError("WARN", "The AIX version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addWarning("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(); |
349,9 → 356,6 |
$this->_scsi(); |
$this->_usb(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
358,5 → 362,8 |
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 (is_null($buf) || ($buf == "")) { |
if (($buf === null) || ($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,13 → 257,11 |
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(); |
} |
270,5 → 268,8 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.BSDCommon.inc.php |
---|
28,6 → 28,11 |
abstract class BSDCommon extends OS |
{ |
/** |
* Assoc array of all CPUs loads. |
*/ |
private $_cpu_loads = null; |
/** |
* content of the syslog |
* |
* @var array |
210,7 → 215,7 |
*/ |
protected function hostname() |
{ |
if (PSI_USE_VHOST === true) { |
if (PSI_USE_VHOST) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('hostname', '', $buf, PSI_DEBUG)) { |
236,18 → 241,40 |
} |
/** |
* Processor Load |
* optionally create a loadbar |
* Virtualizer info |
* |
* @return void |
*/ |
protected function loadavg() |
private function virtualizer() |
{ |
$s = $this->grabkey('vm.loadavg'); |
$s = preg_replace('/{ /', '', $s); |
$s = preg_replace('/ }/', '', $s); |
$this->sys->setLoad($s); |
if (PSI_LOAD_BAR) { |
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(); |
if (PSI_OS != 'Darwin') { |
if ($fd = $this->grabkey('kern.cp_time')) { |
// Find out the CPU load |
262,13 → 289,17 |
if (preg_match($this->_CPURegExp2, $fd, $res) && (sizeof($res) > 4)) { |
$load2 = $res[2] + $res[3] + $res[4]; |
$total2 = $res[2] + $res[3] + $res[4] + $res[5]; |
$this->sys->setLoadPercent((100 * ($load2 - $load)) / ($total2 - $total)); |
if ($total2 != $total) { |
$this->_cpu_loads['cpu'] = (100 * ($load2 - $load)) / ($total2 - $total); |
} else { |
$this->_cpu_loads['cpu'] = 0; |
} |
} |
} |
} |
} else { |
$ncpu = $this->grabkey('hw.ncpu'); |
if (!is_null($ncpu) && (trim($ncpu) != "") && ($ncpu >= 1) && CommonFunctions::executeProgram('ps', "-A -o %cpu", $pstable, false) && !empty($pstable)) { |
if (($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); |
276,14 → 307,38 |
foreach ($pslines as $psline) { |
$sum+=trim($psline); |
} |
$this->sys->setLoadPercent(min($sum/$ncpu, 100)); |
$this->_cpu_loads['cpu'] = 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 |
291,47 → 346,55 |
protected function cpuinfo() |
{ |
$dev = new CpuDevice(); |
if (PSI_OS == 'NetBSD') { |
if ($model = $this->grabkey('machdep.cpu_brand')) { |
$dev->setModel($model); |
$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 ($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) { |
if (preg_match($this->_CPURegExp1, $line, $ar_buf) && (sizeof($ar_buf) > 2)) { |
$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; |
} |
} |
} else { |
if (preg_match("/ Origin| Features/", $line, $ar_buf)) { |
if (preg_match("/ Features2[ ]*=.*<(.*)>/", $line, $ar_buf)) { |
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)) { |
$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); |
break 2; |
} 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; |
} |
} |
} |
} else break; |
} |
} |
$ncpu = $this->grabkey('hw.ncpu'); |
if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1))) |
if (($ncpu === "") || !($ncpu >= 1)) { |
$ncpu = 1; |
} |
if (($ncpu == 1) && PSI_LOAD_BAR) { |
$dev->setLoad($this->cpuusage()); |
} |
for ($ncpu ; $ncpu > 0 ; $ncpu--) { |
$this->sys->setCpus($dev); |
} |
338,6 → 401,99 |
} |
/** |
* 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 |
* |
658,11 → 814,34 |
} |
/** |
* 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() |
{ |
672,9 → 851,12 |
$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,25 → 90,6 |
} |
/** |
* 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 |
119,9 → 100,9 |
if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) { |
$dev->setModel(preg_replace('/Processor type: /', '', $buf)); |
$buf=$this->grabkey('hw.model'); |
if (!is_null($buf) && (trim($buf) != "")) { |
if (($buf !== null) && (trim($buf) != "")) { |
$this->sys->setMachine(trim($buf)); |
if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ModelTranslation.txt', $buffer)) { |
if (CommonFunctions::rftsdata('ModelTranslation.txt', $buffer)) { |
$buffer = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($buffer as $line) { |
$ar_buf = preg_split("/:/", $line, 3); |
134,12 → 115,12 |
} |
} |
$buf=$this->grabkey('machdep.cpu.brand_string'); |
if (!is_null($buf) && (trim($buf) != "") && |
if (($buf !== null) && (trim($buf) != "") && |
((trim($buf) != "i486 (Intel 80486)") || ($dev->getModel() == ""))) { |
$dev->setModel(trim($buf)); |
} |
$buf=$this->grabkey('machdep.cpu.features'); |
if (!is_null($buf) && (trim($buf) != "")) { |
if (($buf !== null) && (trim($buf) != "")) { |
if (preg_match("/ VMX/", $buf)) { |
$dev->setVirt("vmx"); |
} elseif (preg_match("/ SVM/", $buf)) { |
151,17 → 132,21 |
$dev->setBusSpeed(round($this->grabkey('hw.busfrequency') / 1000000)); |
$bufn=$this->grabkey('hw.cpufrequency_min'); |
$bufx=$this->grabkey('hw.cpufrequency_max'); |
if (!is_null($bufn) && (trim($bufn) != "") && !is_null($bufx) && (trim($bufx) != "") && ($bufn != $bufx)) { |
if (($bufn !== null) && (trim($bufn) != "") && ($bufx !== null) && (trim($bufx) != "") && ($bufn != $bufx)) { |
$dev->setCpuSpeedMin(round($bufn / 1000000)); |
$dev->setCpuSpeedMax(round($bufx / 1000000)); |
} |
$buf=$this->grabkey('hw.l2cachesize'); |
if (!is_null($buf) && (trim($buf) != "")) { |
if ($buf !== "") { |
$dev->setCache(round($buf)); |
} |
$ncpu = $this->grabkey('hw.ncpu'); |
if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1))) |
if (($ncpu === "") || !($ncpu >= 1)) { |
$ncpu = 1; |
} |
if (($ncpu == 1) && PSI_LOAD_BAR) { |
$dev->setLoad($this->cpuusage()); |
} |
for ($ncpu ; $ncpu > 0 ; $ncpu--) { |
$this->sys->setCpus($dev); |
} |
422,8 → 407,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]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") && |
isset($distro_tmp[1]) && !is_null($distro_tmp[1]) && (trim($distro_tmp[1]) != "")) { |
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]) != "")) { |
$distro_arr[trim($info_tmp[0])] = trim($info_tmp[1]); |
} |
} |
485,13 → 470,12 |
* |
* @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.DragonFly.inc.php |
---|
32,7 → 32,7 |
public function __construct($blockname = false) |
{ |
parent::__construct($blockname); |
$this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/"); |
$this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/\n/^CPU: (.*) \((.*)-MHz (.*)\)/"); // multiple regexp separated by \n |
$this->setCPURegExp2("/^(.*) at scsibus.*: <(.*)> .*/"); |
$this->setSCSIRegExp2("/^(da[0-9]+): (.*)MB /"); |
$this->setPCIRegExp1("/(.*): <(.*)>(.*) (pci|legacypci)[0-9]+$/"); |
40,19 → 40,6 |
} |
/** |
* 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 |
140,7 → 127,7 |
* |
* @see BSDCommon::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
147,7 → 134,6 |
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.FreeBSD.inc.php |
---|
42,19 → 42,6 |
} |
/** |
* 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 |
195,7 → 182,7 |
* |
* @see BSDCommon::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
202,14 → 189,13 |
parent::build(); |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_distroicon(); |
$this->_uptime(); |
$this->_processes(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memoryadditional(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memoryadditional(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.HPUX.inc.php |
---|
27,6 → 27,11 |
class HPUX extends OS |
{ |
/** |
* uptime command result. |
*/ |
private $_uptime = null; |
/** |
* Virtual Host Name |
* |
* @return void |
33,7 → 38,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST === true) { |
if (PSI_USE_VHOST) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('hostname', '', $ret)) { |
62,8 → 67,8 |
*/ |
private function _uptime() |
{ |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) { |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
$days = $ar_buf[1]; |
80,8 → 85,8 |
*/ |
private function _loadavg() |
{ |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
} |
125,7 → 130,6 |
case 'bogomips': |
case 'cpu0bogo': |
$dev->setBogomips($arrBuff[1]); |
break; |
} |
} |
} |
358,7 → 362,7 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
377,9 → 381,6 |
$this->_scsi(); |
$this->_usb(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
386,5 → 387,8 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
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 === true) { |
if (PSI_USE_VHOST) { |
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->addError("WARN", "The Haiku version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addWarning("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,9 → 387,6 |
$this->_pci(); |
$this->_usb(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
396,5 → 393,8 |
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,36 → 27,157 |
class Linux extends OS |
{ |
/** |
* Uptime command result. |
*/ |
private $_uptime = null; |
/** |
* Assoc array of all CPUs loads. |
*/ |
private $_cpu_loads = null; |
/** |
* Machine |
* Version string. |
*/ |
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 void |
* @return array |
*/ |
private function _machine() |
private function _get_dmesg_info() |
{ |
$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 = ""; |
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]); |
} |
} |
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]); |
} |
} |
} |
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; |
} |
} |
$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)!="")) { |
$machine = 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)!="")) { |
$product = 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)!="")) { |
$board = 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); |
} |
63,21 → 184,76 |
if (CommonFunctions::rfts('/sys/devices/virtual/dmi/id/bios_date', $buf, 1, 4096, false) && (trim($buf)!="")) { |
$bios = trim($bios." ".trim($buf)); |
} |
if ($product != "") { |
$machine .= " ".$product; |
if ($bios != "") { |
if (isset($this->_machine_info['machine'])) { |
$this->_machine_info['machine'] .= ", BIOS ".$bios; |
} else { |
$this->_machine_info['machine'] = "BIOS ".$bios; |
} |
if ($board != "") { |
$machine .= "/".$board; |
} |
if ($bios != "") { |
$machine .= ", BIOS ".$bios; |
} |
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 ($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 (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; |
} |
} |
} |
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)'; |
} |
} |
} |
} |
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 (CommonFunctions::fileexists($filename="/etc/config/uLinux.conf") // QNAP detection |
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false) |
&& preg_match("/^Rsync\sModel\s*=\s*QNAP/m", $buf) |
84,7 → 260,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]; |
91,7 → 267,7 |
} |
} |
if ($machine != "") { |
if ($machine !== "") { |
$this->sys->setMachine($machine); |
} |
} |
103,7 → 279,7 |
*/ |
protected function _hostname() |
{ |
if (PSI_USE_VHOST === true) { |
if (PSI_USE_VHOST) { |
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'))) { |
115,7 → 291,6 |
} elseif (CommonFunctions::executeProgram('hostname', '', $ret)) { |
$this->sys->setHostname($ret); |
} |
} |
} |
126,44 → 301,218 |
*/ |
private function _kernel() |
{ |
$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 (($verBuf = $this->_get_kernel_string()) != "") { |
$this->sys->setKernel($verBuf); |
} |
} |
if (CommonFunctions::executeProgram($uname, '-m', $strBuf, PSI_DEBUG)) { |
$result .= ' '.$strBuf; |
/** |
* Virtualizer info |
* |
* @return void |
*/ |
protected function _virtualizer() |
{ |
if (!defined('PSI_SHOW_VIRTUALIZER_INFO') || !PSI_SHOW_VIRTUALIZER_INFO) { |
return; |
} |
} 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)'; |
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 |
} |
if ($result != "") { |
} |
if (CommonFunctions::executeProgram('systemd-detect-virt', '-c', $resultc, false) && ($resultc !== "") && ($resultc !== "none")) { |
$this->sys->setVirtualizer($resultc); |
} |
} 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; |
} |
} |
// 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 (CommonFunctions::rfts('/proc/self/cgroup', $strBuf2, 0, 4096, false)) { |
if (preg_match('/:\/lxc\//m', $strBuf2)) { |
$result .= ' [lxc]'; |
$this->sys->setVirtualizer('lxc'); // Linux container |
} elseif (preg_match('/:\/docker\//m', $strBuf2)) { |
$result .= ' [docker]'; |
$this->sys->setVirtualizer('docker'); // Docker |
} elseif (preg_match('/:\/system\.slice\/docker\-/m', $strBuf2)) { |
$result .= ' [docker]'; |
$this->sys->setVirtualizer('docker'); // 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); |
} |
} |
/** |
* UpTime |
176,21 → 525,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 (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) day[s]?,[ ]+(\d+):(\d+),/", $buf, $ar_buf)) { |
} elseif (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) day[s]?,[ ]+(\d+):(\d+),/", $this->_uptime, $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,/", $buf, $ar_buf)) { |
} elseif (preg_match("/up (\d+) day[s]?,[ ]+(\d+) min,/", $this->_uptime, $ar_buf)) { |
$min = $ar_buf[2]; |
$days = $ar_buf[1]; |
$this->sys->setUptime($days * 86400 + $min * 60); |
} elseif (preg_match("/up[ ]+(\d+):(\d+),/", $buf, $ar_buf)) { |
} elseif (preg_match("/up[ ]+(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
$min = $ar_buf[2]; |
$hours = $ar_buf[1]; |
$this->sys->setUptime($hours * 3600 + $min * 60); |
} elseif (preg_match("/up[ ]+(\d+) min,/", $buf, $ar_buf)) { |
} elseif (preg_match("/up[ ]+(\d+) min,/", $this->_uptime, $ar_buf)) { |
$min = $ar_buf[1]; |
$this->sys->setUptime($min * 60); |
} |
210,7 → 559,7 |
// don't need the extra values, only first three |
unset($result[3]); |
$this->sys->setLoad(implode(' ', $result)); |
} elseif (CommonFunctions::executeProgram('uptime', '', $buf) && preg_match("/load average: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
} elseif ((($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) && preg_match("/load average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
if (PSI_LOAD_BAR) { |
223,11 → 572,11 |
* |
* @param String $cpuline cpu for which load should be meassured |
* |
* @return Integer |
* @return int |
*/ |
protected function _parseProcStat($cpuline) |
{ |
if (is_null($this->_cpu_loads)) { |
if ($this->_cpu_loads === null) { |
$this->_cpu_loads = array(); |
$cpu_tmp = array(); |
295,6 → 644,7 |
protected function _cpuinfo() |
{ |
if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) { |
$cpulist = null; |
$raslist = null; |
318,6 → 668,7 |
$_arch = null; |
$_impl = null; |
$_part = null; |
$_vari = null; |
$_hard = null; |
$_revi = null; |
$_cpus = null; |
340,6 → 691,9 |
case 'cpu part': |
$_part = $arrBuff1; |
break; |
case 'cpu variant': |
$_vari = $arrBuff1; |
break; |
case 'hardware': |
$_hard = $arrBuff1; |
break; |
361,9 → 715,9 |
break; |
case 'vendor_id': |
$_vend = $arrBuff1; |
break; |
case 'cpu': |
$procname = $arrBuff1; |
break; |
} |
} |
} |
377,6 → 731,7 |
$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) { |
386,7 → 741,7 |
case 'processor': |
$proc = $arrBuff1; |
if (is_numeric($proc)) { |
if (strlen($procname)>0) { |
if (($procname !== null) && (strlen($procname)>0)) { |
$dev->setModel($procname); |
} |
} else { |
434,9 → 789,15 |
$dev->setVirt("vmx"); |
} elseif (preg_match("/ svm/", $arrBuff1)) { |
$dev->setVirt("svm"); |
} elseif (preg_match("/ hypervisor/", $arrBuff1)) { |
} |
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': |
455,15 → 816,21 |
case 'cpu part': |
$part = $arrBuff1; |
break; |
case 'cpu variant': |
$vari = $arrBuff1; |
break; |
case 'vendor_id': |
$dev->setVendorId($arrBuff1); |
break; |
if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO && preg_match('/^User Mode Linux/', $arrBuff1)) { |
$this->sys->setVirtualizer("cpuid:UserModeLinux", false); |
} |
} |
} |
} |
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 |
478,7 → 845,7 |
// sparc64 specific code ends |
// XScale detection code |
if (($arch === "5TE") && ($dev->getBogomips() != null)) { |
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 |
496,9 → 863,12 |
} |
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; |
} |
561,11 → 931,12 |
$this->sys->setMachine($_hard); |
} |
if ($cpulist === null) $cpulist = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true); |
if ($cpulist && (isset($cpulist['cpu'][$cpuimplpart = strtolower($impl.','.$part)]))) { |
if ($cpulist && (((($vari !== null) && isset($cpulist['cpu'][$cpufromlist = strtolower($impl.','.$part.','.$vari)])) |
|| isset($cpulist['cpu'][$cpufromlist = strtolower($impl.','.$part)])))) { |
if (($cpumodel = $dev->getModel()) !== '') { |
$dev->setModel($cpumodel.' - '.$cpulist['cpu'][$cpuimplpart]); |
$dev->setModel($cpumodel.' - '.$cpulist['cpu'][$cpufromlist]); |
} else { |
$dev->setModel($cpulist['cpu'][$cpuimplpart]); |
$dev->setModel($cpulist['cpu'][$cpufromlist]); |
} |
} |
} elseif (($_hard !== null) && ($this->sys->getMachine() === '')) { // other hardware |
572,15 → 943,23 |
$this->sys->setMachine($_hard); |
} |
if ($dev->getModel() === "") { |
$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 ($cpumodel === "") { |
if (($vendid = $dev->getVendorId()) !== "") { |
$dev->setModel($vendid); |
} else { |
$dev->setModel("unknown"); |
} |
} |
$cpucount++; |
$this->sys->setCpus($dev); |
} |
} |
$cpudevices = glob('/sys/devices/system/cpu/cpu*/uevent', GLOB_NOSORT); |
$cpudevices = CommonFunctions::findglob('/sys/devices/system/cpu/cpu*/uevent', GLOB_NOSORT); |
if (is_array($cpudevices) && (($cpustopped = count($cpudevices)-$cpucount) > 0)) { |
for (; $cpustopped > 0; $cpustopped--) { |
$dev = new CpuDevice(); |
629,7 → 1008,7 |
} |
} |
} else { |
$pcidevices = glob('/sys/bus/pci/devices/*/uevent', GLOB_NOSORT); |
$pcidevices = CommonFunctions::findglob('/sys/bus/pci/devices/*/uevent', GLOB_NOSORT); |
if (is_array($pcidevices) && (($total = count($pcidevices)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) { |
717,7 → 1096,7 |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS |
&& ($dev_type[1]==='Direct-Access')) { |
$sizelist = glob('/sys/bus/scsi/devices/'.intval($scsiid[1]).':'.intval($scsiid[2]).':'.intval($scsiid[3]).':'.intval($scsiid[4]).'/*/*/size', GLOB_NOSORT); |
$sizelist = CommonFunctions::findglob('/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++) { |
759,7 → 1138,7 |
} |
} |
$usbdevices = glob('/sys/bus/usb/devices/*/idProduct', GLOB_NOSORT); |
$usbdevices = CommonFunctions::findglob('/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 |
818,7 → 1197,6 |
&& !preg_match('/\W/', trim($value2))) { |
$usbarray[$devnum]['serial'] = trim($value2); |
} |
break; |
} |
} |
} |
901,7 → 1279,7 |
*/ |
protected function _i2c() |
{ |
$i2cdevices = glob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT); |
$i2cdevices = CommonFunctions::findglob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT); |
if (is_array($i2cdevices) && (($total = count($i2cdevices)) > 0)) { |
$buf = ""; |
for ($i = 0; $i < $total; $i++) { |
974,7 → 1352,6 |
break; |
case 'PB': |
$dev->setCapacity(1000*1000*1000*1000*1000*$tmpbuf[1]); |
break; |
} |
} |
} |
1026,7 → 1403,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') { // empty |
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 = ""; |
} |
} |
1120,7 → 1497,12 |
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 (!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 = ""; |
} |
} |
} 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]); |
1265,6 → 1647,8 |
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)) { |
1275,11 → 1659,15 |
$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)) { |
1295,6 → 1683,13 |
$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); |
} |
} |
} |
1342,17 → 1737,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("/\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("/\r?\n/", $distro_info, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($distro_tmp as $info) { |
$info_tmp = preg_split('/:/', $info, 2); |
if (isset($distro_tmp[0]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "") && |
isset($distro_tmp[1]) && !is_null($distro_tmp[1]) && (trim($distro_tmp[1]) != "")) { |
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]) != "")) { |
$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]) && !is_null($distro_tmp[0]) && (trim($distro_tmp[0]) != "")) { |
if (isset($distro_tmp[0]) && ($distro_tmp[0] !== null) && (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'])) { |
1360,9 → 1755,13 |
} |
} |
} 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*"?([^"\n]+)"?\s*$/', $distro['Description'], $name_tmp)) { |
$distro['Description'] = $name_tmp[1]; |
&& preg_match('/^NAME=\s*"?([^"\r\n]+)"?\s*$/', $distro['Description'], $name_tmp)) { |
$distro['Description'] = trim($name_tmp[1]); |
} |
if (isset($distro['Description']) |
&& ($distro['Description'] != "n/a") |
1381,7 → 1780,8 |
$this->sys->setDistribution($this->sys->getDistribution()." ".$distro['Release']); |
} |
} |
} elseif (isset($distro['Distributor ID']) && ($distro['Distributor ID'] != "n/a")) { |
} 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']); |
1389,16 → 1789,29 |
if (isset($distro['Codename']) && ($distro['Codename'] != "n/a")) { |
$this->sys->setDistribution($this->sys->getDistribution()." (".$distro['Codename'].")"); |
} |
} |
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($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($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 { |
/* default error handler */ |
if (function_exists('errorHandlerPsi')) { |
1411,11 → 1824,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="?([^"\n]+)"?/m', $buf, $id_buf)) { |
if (preg_match('/^DISTRIB_DESCRIPTION="?([^"\n]+)"?/m', $buf, $desc_buf) |
&& preg_match('/^DISTRIB_ID="?([^"\r\n]+)/m', $buf, $id_buf)) { |
if (preg_match('/^DISTRIB_DESCRIPTION="?([^"\r\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="?([^"\n]+)"?/m', $buf, $vers_buf) |
if (preg_match('/^DISTRIB_RELEASE="?([^"\r\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]; |
1432,10 → 1845,10 |
} else { |
$this->sys->setDistribution(trim($id_buf[1])); |
} |
if (preg_match('/^DISTRIB_RELEASE="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
if (preg_match('/^DISTRIB_RELEASE="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} |
if (preg_match('/^DISTRIB_CODENAME="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
if (preg_match('/^DISTRIB_CODENAME="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." (".trim($vers_buf[1]).")"); |
} |
} |
1470,13 → 1883,13 |
$this->sys->setDistributionIcon($distro['Image']); |
} |
if (isset($distribution['Name'])) { |
if (is_null($buf) || (trim($buf) == "")) { |
if (($buf === null) || (trim($buf) == "")) { |
$this->sys->setDistribution($distribution['Name']); |
} else { |
$this->sys->setDistribution($distribution['Name']." ".trim($buf)); |
} |
} else { |
if (is_null($buf) || (trim($buf) == "")) { |
if (($buf === null) || (trim($buf) == "")) { |
$this->sys->setDistribution($section); |
} else { |
$this->sys->setDistribution(trim($buf)); |
1485,22 → 1898,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="?([^"\n]+)"?/m', $buf, $maj_buf) |
&& preg_match('/^minorversion="?([^"\n]+)"?/m', $buf, $min_buf)) { |
if (preg_match('/^majorversion="?([^"\r\n]+)/m', $buf, $maj_buf) |
&& preg_match('/^minorversion="?([^"\r\n]+)/m', $buf, $min_buf)) { |
$distr2=$maj_buf[1].'.'.$min_buf[1]; |
if (preg_match('/^buildphase="?([^"\n]+)"?/m', $buf, $pha_buf) && ($pha_buf[1]!=="0")) { |
if (preg_match('/^buildphase="?([^"\r\n]+)/m', $buf, $pha_buf) && ($pha_buf[1]!=="0")) { |
$distr2.='.'.$pha_buf[1]; |
} |
if (preg_match('/^buildnumber="?([^"\n]+)"?/m', $buf, $num_buf)) { |
if (preg_match('/^buildnumber="?([^"\r\n]+)/m', $buf, $num_buf)) { |
$distr2.='-'.$num_buf[1]; |
} |
if (preg_match('/^builddate="?([^"\n]+)"?/m', $buf, $dat_buf)) { |
if (preg_match('/^builddate="?([^"\r\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 (!is_null($distr2) && ($distr2 != "")) { |
if (($distr2 !== null) && ($distr2 != "")) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".$distr2); |
} |
} |
1538,10 → 1951,10 |
} |
} elseif ((CommonFunctions::fileexists($filename="/etc/distro-release") |
&& CommonFunctions::rfts($filename, $buf, 1, 4096, false) |
&& !is_null($buf) && (trim($buf) != "")) |
&& ($buf !== null) && (trim($buf) != "")) |
|| (CommonFunctions::fileexists($filename="/etc/system-release") |
&& CommonFunctions::rfts($filename, $buf, 1, 4096, false) |
&& !is_null($buf) && (trim($buf) != ""))) { |
&& ($buf !== null) && (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'])) { |
1549,8 → 1962,8 |
} |
} elseif (CommonFunctions::fileexists($filename="/etc/solydxk/info") |
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false) |
&& preg_match('/^DISTRIB_ID="?([^"\n]+)"?/m', $buf, $id_buf)) { |
if (preg_match('/^DESCRIPTION="?([^"\n]+)"?/m', $buf, $desc_buf) |
&& preg_match('/^DISTRIB_ID="?([^"\r\n]+)/m', $buf, $id_buf)) { |
if (preg_match('/^DESCRIPTION="?([^"\r\n]+)/m', $buf, $desc_buf) |
&& (trim($desc_buf[1])!=trim($id_buf[1]))) { |
$this->sys->setDistribution(trim($desc_buf[1])); |
} else { |
1559,10 → 1972,10 |
} else { |
$this->sys->setDistribution(trim($id_buf[1])); |
} |
if (preg_match('/^RELEASE="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
if (preg_match('/^RELEASE="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} |
if (preg_match('/^CODENAME="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
if (preg_match('/^CODENAME="?([^"\r\n]+)/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." (".trim($vers_buf[1]).")"); |
} |
} |
1573,10 → 1986,10 |
} |
} elseif (CommonFunctions::fileexists($filename="/etc/os-release") |
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false) |
&& (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)) { |
&& (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)) { |
$this->sys->setDistribution(trim($desc_buf[1])." ".trim($tid_buf[1])); |
} else { |
if (isset($list['Tails']['Name'])) { |
1587,7 → 2000,7 |
} |
$this->sys->setDistributionIcon($list['Tails']['Image']); |
} else { |
if (preg_match('/^PRETTY_NAME="?([^"\n]+)"?/m', $buf, $desc_buf) |
if (preg_match('/^PRETTY_NAME=["\']?([^"\'\r\n]+)/m', $buf, $desc_buf) |
&& !preg_match('/\$/', $desc_buf[1])) { //if is not defined by variable |
$this->sys->setDistribution(trim($desc_buf[1])); |
} else { |
1596,9 → 2009,9 |
} else { |
$this->sys->setDistribution(trim($id_buf[1])); |
} |
if (preg_match('/^VERSION="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
if (preg_match('/^VERSION=["\']?([^"\'\r\n]+)/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} elseif (preg_match('/^VERSION_ID="?([^"\n]+)"?/m', $buf, $vers_buf)) { |
} elseif (preg_match('/^VERSION_ID=["\']?([^"\'\r\n]+)/m', $buf, $vers_buf)) { |
$this->sys->setDistribution($this->sys->getDistribution()." ".trim($vers_buf[1])); |
} |
} |
1614,13 → 2027,13 |
$this->sys->setDistributionIcon($list['Debian']['Image']); |
} |
if (isset($list['Debian']['Name'])) { |
if (is_null($buf) || (trim($buf) == "")) { |
if (($buf === null) || (trim($buf) == "")) { |
$this->sys->setDistribution($list['Debian']['Name']); |
} else { |
$this->sys->setDistribution($list['Debian']['Name']." ".trim($buf)); |
} |
} else { |
if (is_null($buf) || (trim($buf) == "")) { |
if (($buf === null) || (trim($buf) == "")) { |
$this->sys->setDistribution('Debian'); |
} else { |
$this->sys->setDistribution(trim($buf)); |
1657,7 → 2070,7 |
*/ |
protected function _processes() |
{ |
$process = glob('/proc/*/status', GLOB_NOSORT); |
$process = CommonFunctions::findglob('/proc/*/status', GLOB_NOSORT); |
if (is_array($process) && (($total = count($process)) > 0)) { |
$processes['*'] = 0; |
$buf = ""; |
1685,7 → 2098,7 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
1701,6 → 2114,7 |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->_machine(); |
$this->_cpuinfo(); |
$this->_virtualizer(); |
$this->_pci(); |
$this->_ide(); |
$this->_scsi(); |
1708,9 → 2122,6 |
$this->_usb(); |
$this->_i2c(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
1717,5 → 2128,8 |
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,6 → 27,11 |
class Minix extends OS |
{ |
/** |
* uptime command result. |
*/ |
private $_uptime = null; |
/** |
* content of the syslog |
* |
* @var array |
94,7 → 99,6 |
break; |
case 'vendor_id': |
$dev->setVendorId($arrBuff[1]); |
break; |
} |
} |
} |
194,13 → 198,13 |
*/ |
private function _uptime() |
{ |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $buf, $ar_buf)) { |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
$days = $ar_buf[1]; |
$this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60); |
} elseif (preg_match("/up (\d+):(\d+),/", $buf, $ar_buf)) { |
} elseif (preg_match("/up (\d+):(\d+),/", $this->_uptime, $ar_buf)) { |
$min = $ar_buf[2]; |
$hours = $ar_buf[1]; |
$this->sys->setUptime($hours * 3600 + $min * 60); |
216,8 → 220,8 |
*/ |
private function _loadavg() |
{ |
if (CommonFunctions::executeProgram('uptime', '', $buf)) { |
if (preg_match("/load averages: (.*), (.*), (.*)$/", $buf, $ar_buf)) { |
if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) { |
if (preg_match("/load averages: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) { |
$this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]); |
} |
} |
230,7 → 234,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST === true) { |
if (PSI_USE_VHOST) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('uname', '-n', $result, PSI_DEBUG)) { |
328,11 → 332,11 |
/** |
* get the information |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
$this->error->addError("WARN", "The Minix version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addWarning("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(); |
346,9 → 350,6 |
$this->_pci(); |
$this->_cpuinfo(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
355,5 → 356,8 |
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,18 → 41,6 |
} |
/** |
* 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 |
148,6 → 136,77 |
} |
/** |
* 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 |
191,7 → 250,7 |
* |
* @see BSDCommon::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
198,7 → 257,6 |
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.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 = glob('/proc/*/cmdline', GLOB_NOSORT); |
$processlist = CommonFunctions::findglob('/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 === true) && !defined('PSI_EMU_HOSTNAME')) { |
if (PSI_USE_VHOST && !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,25 → 165,9 |
*/ |
protected function _dmimeminfo() |
{ |
$banks = array(); |
$buffer = ''; |
if (defined('PSI_DMIDECODE_ACCESS') && (strtolower(PSI_DMIDECODE_ACCESS)=="data")) { |
CommonFunctions::rfts(PSI_APP_ROOT.'/data/dmidecode.txt', $buffer); |
} elseif (CommonFunctions::_findProgram('dmidecode')) { |
CommonFunctions::executeProgram('dmidecode', '-t 17', $buffer, PSI_DEBUG); |
} |
if (!empty($buffer)) { |
$banks = preg_split('/^(?=Handle\s)/m', $buffer, -1, PREG_SPLIT_NO_EMPTY); |
foreach ($banks as $bank) if (preg_match('/^Handle\s/', $bank)) { |
$lines = preg_split("/\n/", $bank, -1, PREG_SPLIT_NO_EMPTY); |
$mem = array(); |
foreach ($lines as $line) if (preg_match('/^\s+([^:]+):(.+)/' ,$line, $params)) { |
if (preg_match('/^0x([A-F\d]+)/', $params2 = trim($params[2]), $buff)) { |
$mem[trim($params[1])] = trim($buff[1]); |
} elseif ($params2 != '') { |
$mem[trim($params[1])] = $params2; |
} |
} |
$dmimd = CommonFunctions::readdmimemdata(); |
if (!empty($dmimd)) { |
foreach ($dmimd as $mem) { |
if (isset($mem['Size']) && preg_match('/^(\d+)\s(M|G)B$/', $mem['Size'], $size) && ($size[1] > 0)) { |
$dev = new HWDevice(); |
$name = ''; |
221,7 → 205,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['Total Width']) && |
if (isset($mem['Minimum Voltage']) && isset($mem['Maximum Voltage']) && |
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,18 → 41,6 |
} |
/** |
* 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 |
140,35 → 128,81 |
*/ |
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; |
if (preg_match("/^cpu[0-9]+: (\d+)([KM])B (.*) L2 cache/", $line, $ar_buf2)) { |
$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 ($ar_buf2[2]=="M") { |
$dev->setCache($ar_buf2[1]*1024*1024); |
$cpuarray[$ar_buf[1]]['cache'] = $ar_buf2[1]*1024*1024; |
} elseif ($ar_buf2[2]=="K") { |
$dev->setCache($ar_buf2[1]*1024); |
$cpuarray[$ar_buf[1]]['cache'] = $ar_buf2[1]*1024; |
} |
} else { |
$feats = preg_split("/,/", strtolower(trim($ar_buf[1])), -1, PREG_SPLIT_NO_EMPTY); |
$feats = preg_split("/,/", strtolower($ar_buf[2]), -1, PREG_SPLIT_NO_EMPTY); |
foreach ($feats as $feat) { |
if (($feat=="vmx") || ($feat=="svm")) { |
$dev->setVirt($feat); |
$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); |
} |
} |
} elseif ($was) { |
} |
} |
} elseif (!preg_match("/^cpu[0-9]+|^mtrr: |^acpitimer[0-9]+: /", $line) && $was) { |
break; |
} |
} |
$ncpu = $this->grabkey('hw.ncpu'); |
if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1))) |
if (($ncpu === "") || !($ncpu >= 1)) { |
$ncpu = 1; |
for ($ncpu ; $ncpu > 0 ; $ncpu--) { |
} |
$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()); |
} |
$this->sys->setCpus($dev); |
} |
} |
216,7 → 250,7 |
* |
* @see BSDCommon::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
223,7 → 257,6 |
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,25 → 88,11 |
if (CommonFunctions::executeProgram('pidin', 'info', $buf) |
&& preg_match('/^.* BootTime:(.*)/', $buf, $bstart) |
&& CommonFunctions::executeProgram('date', '', $bstop)) { |
/* default error handler */ |
if (function_exists('errorHandlerPsi')) { |
restore_error_handler(); |
} |
/* fatal errors only */ |
$old_err_rep = error_reporting(); |
error_reporting(E_ERROR); |
date_default_timezone_set('UTC'); |
$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'); |
} |
} |
} |
/** |
* Number of Users |
125,7 → 111,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST === true) { |
if (PSI_USE_VHOST) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
if (CommonFunctions::executeProgram('uname', '-n', $result, PSI_DEBUG)) { |
205,11 → 191,11 |
/** |
* get the information |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
$this->error->addError("WARN", "The QNX version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addWarning("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(); |
220,9 → 206,6 |
if (!$this->blockname || $this->blockname==='hardware') { |
$this->_cpuinfo(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
229,5 → 212,8 |
if (!$this->blockname || $this->blockname==='filesystem') { |
$this->_filesystems(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
} |
} |
/web/acc/phpsysinfo/includes/os/class.SunOS.inc.php |
---|
128,7 → 128,7 |
*/ |
private function _hostname() |
{ |
if (PSI_USE_VHOST === true) { |
if (PSI_USE_VHOST) { |
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->addError("WARN", "The SunOS version of phpSysInfo is a work in progress, some things currently don't work"); |
$this->error->addWarning("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,9 → 472,6 |
$this->_cpuinfo(); |
$this->_pci(); |
} |
if (!$this->blockname || $this->blockname==='network') { |
$this->_network(); |
} |
if (!$this->blockname || $this->blockname==='memory') { |
$this->_memory(); |
} |
481,5 → 478,8 |
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,11 → 28,18 |
class WINNT extends OS |
{ |
/** |
* holds codepage for chcp |
* |
* @var int |
*/ |
private static $_cp = null; |
/** |
* holds the data from WMI Win32_OperatingSystem |
* |
* @var array |
*/ |
private $_Win32_OperatingSystem = null; |
private static $_Win32_OperatingSystem = null; |
/** |
* holds the data from WMI Win32_ComputerSystem |
46,9 → 53,16 |
* |
* @var array |
*/ |
private $_Win32_Processor = null; |
private static $_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 |
* |
* @var array |
67,7 → 81,7 |
* |
* @var Object |
*/ |
private $_wmi = null; |
private static $_wmi = null; |
/** |
* holds the COM object that we pull all the EnumKey and RegRead data from |
84,11 → 98,25 |
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 = array(); |
private $_wmidevices = null; |
/** |
* holds all disks, which are in the system |
112,14 → 140,41 |
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 |
*/ |
private function _get_Win32_OperatingSystem() |
public static function _get_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; |
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; |
} |
/** |
129,7 → 184,7 |
*/ |
private function _get_Win32_ComputerSystem() |
{ |
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model', 'SystemFamily')); |
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = self::getWMI(self::$_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model', 'SystemFamily')); |
return $this->_Win32_ComputerSystem; |
} |
138,13 → 193,24 |
* |
* @return array |
*/ |
private function _get_Win32_Processor() |
public static function _get_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; |
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; |
} |
/** |
* 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 |
155,8 → 221,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 = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfFormattedData_PerfOS_Processor', array('Name', 'PercentProcessorTime')); |
if ($cpubuffer) foreach ($cpubuffer as $cpu) { |
$cpubuffer = self::getWMI(self::$_wmi, 'Win32_PerfFormattedData_PerfOS_Processor', array('Name', 'PercentProcessorTime')); |
foreach ($cpubuffer as $cpu) { |
if (isset($cpu['Name']) && isset($cpu['PercentProcessorTime'])) { |
$this->_Win32_PerfFormattedData_PerfOS_Processor['cpu'.$cpu['Name']] = $cpu['PercentProcessorTime']; |
} |
183,6 → 249,320 |
} |
/** |
* 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) |
192,7 → 572,7 |
$this->_ver = $ver_value; |
} |
if (($this->_ver !== "") && preg_match("/ReactOS\r?\n\S+\s+.+/", $this->_ver)) { |
$this->_wmi = false; // No WMI info on ReactOS yet |
self::$_wmi = false; // No WMI info on ReactOS yet |
$this->_reg = false; // No EnumKey and ReadReg on ReactOS yet |
} else { |
if (PSI_OS == 'WINNT') { |
200,15 → 580,14 |
try { |
$objLocator = new COM('WbemScripting.SWbemLocator'); |
$wmi = $objLocator->ConnectServer('', 'root\CIMv2'); |
$buffer = CommonFunctions::getWMI($wmi, 'Win32_OperatingSystem', array('CodeSet')); |
$buffer = self::getWMI($wmi, 'Win32_OperatingSystem', array('CodeSet')); |
if (!$buffer) { |
$reg = $objLocator->ConnectServer('', 'root\default'); |
if (CommonFunctions::readReg($reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
if (self::readReg($reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
$buffer[0]['CodeSet'] = $strBuf; |
} |
} |
if ($buffer && isset($buffer[0])) { |
if (isset($buffer[0]['CodeSet'])) { |
if ($buffer && isset($buffer[0]) && isset($buffer[0]['CodeSet'])) { |
$codeset = $buffer[0]['CodeSet']; |
if ($codeset == 932) { |
$codename = ' (SJIS)'; |
220,6 → 599,10 |
$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) { |
232,9 → 615,9 |
define('PSI_SYSTEM_CODEPAGE', null); |
} |
} |
$this->_wmi = CommonFunctions::initWMI('root\CIMv2', true); |
self::$_wmi = self::initWMI('root\CIMv2', true); |
if (PSI_OS == 'WINNT') { |
$this->_reg = CommonFunctions::initWMI('root\default', PSI_DEBUG); |
$this->_reg = self::initWMI('root\default', PSI_DEBUG); |
if (gettype($this->_reg) === "object") { |
$this->_reg->Security_->ImpersonationLevel = 3; |
} |
255,10 → 638,10 |
{ |
$buffer = $this->_get_Win32_OperatingSystem(); |
if (!$buffer) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) { |
$buffer[0]['CodeSet'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Language\\Default", $strBuf, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Language\\Default", $strBuf, false)) { |
$buffer[0]['Locale'] = $strBuf; |
} |
} |
274,7 → 657,7 |
} else { |
$codename = ''; |
} |
CommonFunctions::setcp($codeset); |
self::$_cp = $codeset; |
$this->_codepage = 'windows-'.$codeset.$codename; |
} |
if (isset($buffer[0]['Locale']) && (($locale = hexdec($buffer[0]['Locale']))>0)) { |
301,37 → 684,76 |
*/ |
private function _devicelist($strType) |
{ |
if (empty($this->_wmidevices)) { |
if ($this->_wmidevices === null) { |
$this->_wmidevices = array(); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass')); |
$this->_wmidevices = self::getWMI(self::$_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass')); |
if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL) { |
$this->_wmidisks = CommonFunctions::getWMI($this->_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size', 'SerialNumber')); |
$this->_wmidisks = self::getWMI(self::$_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size', 'SerialNumber')); |
} else { |
$this->_wmidisks = CommonFunctions::getWMI($this->_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size')); |
$this->_wmidisks = self::getWMI(self::$_wmi, 'Win32_DiskDrive', array('PNPDeviceID', 'Size')); |
} |
} else { |
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID')); |
$this->_wmidevices = self::getWMI(self::$_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 (CommonFunctions::enumKey($this->_reg, $hkey, $portBuf, false)) { |
if (self::enumKey($this->_reg, $hkey, $portBuf, false)) { |
foreach ($portBuf as $scsiport) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport, $busBuf, false)) { |
if (self::enumKey($this->_reg, $hkey."\\".$scsiport, $busBuf, false)) { |
foreach ($busBuf as $scsibus) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus, $tarBuf, false)) { |
if (self::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus, $tarBuf, false)) { |
foreach ($tarBuf as $scsitar) if (!strncasecmp($scsitar, "Target Id ", strlen("Target Id "))) { |
if (CommonFunctions::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar, $logBuf, false)) { |
if (self::enumKey($this->_reg, $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar, $logBuf, false)) { |
foreach ($logBuf as $scsilog) if (!strncasecmp($scsilog, "Logical Unit Id ", strlen("Logical Unit Id "))) { |
$hkey2 = $hkey."\\".$scsiport."\\".$scsibus."\\".$scsitar."\\".$scsilog."\\"; |
if ((CommonFunctions::readReg($this->_reg, $hkey2."DeviceType", $typeBuf, false) || CommonFunctions::readReg($this->_reg, $hkey2."Type", $typeBuf, false)) |
if ((self::readReg($this->_reg, $hkey2."DeviceType", $typeBuf, false) || self::readReg($this->_reg, $hkey2."Type", $typeBuf, false)) |
&& (($typeBuf=strtolower(trim($typeBuf))) !== "")) { |
if ((($typeBuf == 'diskperipheral') || ($typeBuf == 'cdromperipheral')) |
&& CommonFunctions::readReg($this->_reg, $hkey2."Identifier", $ideBuf, false)) { |
&& self::readReg($this->_reg, $hkey2."Identifier", $ideBuf, false)) { |
$this->_wmidevices[] = array('Name'=>$ideBuf, 'PNPDeviceID'=>'SCSI\\'.$id); |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL |
&& (CommonFunctions::readReg($this->_reg, $hkey2."SerialNumber", $serBuf, false)) |
&& self::readReg($this->_reg, $hkey2."SerialNumber", $serBuf, false) |
&& (($serBuf=trim($serBuf)) !== "")) { |
$this->_wmidisks[] = array('PNPDeviceID'=>'SCSI\\'.$id, 'SerialNumber'=>$serBuf); |
} |
371,6 → 793,7 |
$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]; |
} |
400,11 → 823,11 |
*/ |
private function _hostname() |
{ |
if ((PSI_USE_VHOST === true) && !defined('PSI_EMU_HOSTNAME')) { |
if (PSI_USE_VHOST && !defined('PSI_EMU_HOSTNAME')) { |
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm); |
} else { |
$buffer = $this->_get_Win32_ComputerSystem(); |
if (!$buffer && CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\ComputerName", $strBuf, false) && (strlen($strBuf) > 0)) { |
if (!$buffer && self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\ComputerName", $strBuf, false) && (strlen($strBuf) > 0)) { |
$buffer[0]['Name'] = $strBuf; |
} |
if ($buffer) { |
437,6 → 860,44 |
} |
/** |
* 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 |
* |
477,7 → 938,7 |
$result = $localtime - $boottime; |
$this->sys->setUptime($result); |
} 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)) { |
} 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)) { |
$sec = $ar_buf[4]; |
$min = $ar_buf[3]; |
$hours = $ar_buf[2]; |
498,7 → 959,7 |
$users = count($lines)-1; |
} else { |
$users = 0; |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption')); |
$buffer = self::getWMI(self::$_wmi, 'Win32_Process', array('Caption')); |
foreach ($buffer as $process) { |
if (strtoupper($process['Caption']) == strtoupper('explorer.exe')) { |
$users++; |
518,19 → 979,50 |
$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; |
} |
if ($buffer[0]['ServicePackMajorVersion'] > 0) { |
$kernel .= ' SP'.$buffer[0]['ServicePackMajorVersion']; |
} |
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)'); |
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'; |
} |
} |
} |
} |
$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($buffer[0]['Caption']); |
} |
$this->sys->setDistribution($distribution); |
if (version_compare($ver, "5.1", "<")) |
$icon = 'Win2000.png'; |
elseif (version_compare($ver, "5.1", ">=") && version_compare($ver, "6.0", "<")) |
537,8 → 1029,10 |
$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", "<")) |
$icon = 'Win8.png'; |
else |
$icon = 'Win8.png'; |
$icon = 'Win11.png'; |
$this->sys->setDistributionIcon($icon); |
} elseif ($this->_ver !== "") { |
if (preg_match("/ReactOS\r?\n\S+\s+(.+)/", $this->_ver, $ar_temp)) { |
550,26 → 1044,48 |
$this->sys->setKernel($ar_temp[1]); |
} |
$this->sys->setDistributionIcon('ReactOS.png'); |
} 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)) { |
} 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)'; |
} |
if (preg_match("/^Microsoft /", $strBuf)) { |
$this->sys->setDistribution($strBuf); |
$distribution = $strBuf; |
} else { |
$this->sys->setDistribution("Microsoft ".$strBuf); |
$distribution = "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 { |
$this->sys->setDistribution($ar_temp[1]); |
$distribution = "Microsoft ".$strBuf; |
} |
$kernel = $ar_temp[2]; |
} else { |
$distribution = $ar_temp[1]; |
} |
$this->sys->setKernel($kernel); |
if ((($kernel[1] == '.') && ($kernel[0] <5)) || (substr($kernel, 0, 4) == '5.0.')) |
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", "<")) |
$icon = 'Win2000.png'; |
elseif ((substr($kernel, 0, 4) == '6.0.') || (substr($kernel, 0, 4) == '6.1.')) |
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", "<")) |
$icon = 'WinVista.png'; |
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.')) |
elseif (version_compare($ver, "6.2", ">=") && version_compare($ver, "10.0.21996", "<")) |
$icon = 'Win8.png'; |
else |
$icon = 'WinXP.png'; |
$icon = 'Win11.png'; |
$this->sys->setDistributionIcon($icon); |
} else { |
$this->sys->setDistribution("WINNT"); |
624,24 → 1140,27 |
private function _cpuinfo() |
{ |
$allCpus = $this->_get_Win32_Processor(); |
if (!$allCpus) { |
if (empty($allCpus)) { |
$hkey = "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor"; |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (self::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $coreCount) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\ProcessorNameString", $strBuf, false)) { |
if (self::readReg($this->_reg, $hkey."\\".$coreCount."\\ProcessorNameString", $strBuf, false)) { |
$allCpus[$coreCount]['Name'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\~MHz", $strBuf, false)) { |
if (self::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 (CommonFunctions::readReg($this->_reg, $hkey."\\".$coreCount."\\VendorIdentifier", $strBuf, false)) { |
if (self::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; |
} |
} |
} |
} |
$globalcpus = 0; |
foreach ($allCpus as $oneCpu) { |
654,6 → 1173,7 |
$globalcpus+=$cpuCount; |
} |
$cpulist = null; |
foreach ($allCpus as $oneCpu) { |
$cpuCount = 1; |
if (isset($oneCpu['NumberOfLogicalProcessors'])) { |
666,15 → 1186,62 |
if (isset($oneCpu['Name'])) $cpu->setModel($oneCpu['Name']); |
if (isset($oneCpu['L3CacheSize']) && ($oneCpu['L3CacheSize'] > 0)) { |
$cpu->setCache($oneCpu['L3CacheSize'] * 1024); |
} elseif (isset($oneCpu['L2CacheSize'])) { |
} elseif (isset($oneCpu['L2CacheSize']) && ($oneCpu['L2CacheSize'] > 0)) { |
$cpu->setCache($oneCpu['L2CacheSize'] * 1024); |
} |
if (isset($oneCpu['CurrentClockSpeed'])) { |
if (isset($oneCpu['CurrentVoltage']) && ($oneCpu['CurrentVoltage'] > 0)) { |
$cpu->setVoltage($oneCpu['CurrentVoltage']/10); |
} |
if (isset($oneCpu['CurrentClockSpeed']) && ($oneCpu['CurrentClockSpeed'] > 0)) { |
$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'])) $cpu->setBusSpeed($oneCpu['ExtClock']); |
if (isset($oneCpu['Manufacturer'])) $cpu->setVendorId($oneCpu['Manufacturer']); |
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 (PSI_LOAD_BAR) { |
if (($cpubuffer = $this->_get_Win32_PerfFormattedData_PerfOS_Processor()) && (count($cpubuffer) == ($globalcpus+1)) && isset($cpubuffer['cpu'.$i])) { |
$cpu->setLoad($cpubuffer['cpu'.$i]); |
695,33 → 1262,43 |
private function _machine() |
{ |
$buffer = $this->_get_Win32_ComputerSystem(); |
$bufferp = CommonFunctions::getWMI($this->_wmi, 'Win32_BaseBoard', array('Product')); |
$bufferb = CommonFunctions::getWMI($this->_wmi, 'Win32_BIOS', array('SMBIOSBIOSVersion', 'ReleaseDate')); |
$bufferp = self::getWMI(self::$_wmi, 'Win32_BaseBoard', array('Product')); |
$bufferb = self::getWMI(self::$_wmi, 'Win32_BIOS', array('SMBIOSBIOSVersion', 'ReleaseDate')); |
if (!$buffer) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\systemManufacturer", $strBuf, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\systemManufacturer", $strBuf, false)) { |
$buffer[0]['Manufacturer'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemProductName", $strBuf, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemProductName", $strBuf, false)) { |
$buffer[0]['Model'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemFamily", $strBuf, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemFamily", $strBuf, false)) { |
$buffer[0]['SystemFamily'] = $strBuf; |
} |
} |
if (!$bufferp) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BaseBoardProduct", $strBuf, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BaseBoardProduct", $strBuf, false)) { |
$bufferp[0]['Product'] = $strBuf; |
} |
} |
if (!$bufferb) { |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion", $strBuf, false)) { |
if (self::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion", $strBuf, false)) { |
$bufferb[0]['SMBIOSBIOSVersion'] = $strBuf; |
} |
if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSReleaseDate", $strBuf, false)) { |
if (self::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])) { |
832,25 → 1409,25 |
*/ |
private function _network() |
{ |
if ($this->_wmi) { |
if (self::$_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 = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfRawData_Tcpip_NetworkAdapter', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth')); |
$allDevices = self::getWMI(self::$_wmi, 'Win32_PerfRawData_Tcpip_NetworkAdapter', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth')); |
} else { |
$allDevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfRawData_Tcpip_NetworkInterface', array('Name', 'BytesSentPersec', 'BytesTotalPersec', 'BytesReceivedPersec', 'PacketsReceivedErrors', 'PacketsReceivedDiscarded', 'CurrentBandwidth')); |
$allDevices = self::getWMI(self::$_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 (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (self::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $netID) { |
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)) { |
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)) { |
$cname = str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strName); //convert to canonical |
if (!isset($aliases[$cname])) { // duplicate checking |
$aliases[$cname]['id'] = $netID; |
$aliases[$cname]['name'] = $strName; |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\Name", $strCName, false) |
if (self::readReg($this->_reg, $hkey."\\".$netID."\\Connection\\Name", $strCName, false) |
&& (str_replace(array('(', ')', '#', '/'), array('[', ']', '_', '_'), $strCName) !== $cname)) { |
$aliases[$cname]['netname'] = $strCName; |
} |
864,10 → 1441,10 |
$aliases2 = array(); |
$hkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards"; |
if (CommonFunctions::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
if (self::enumKey($this->_reg, $hkey, $arrBuf, false)) { |
foreach ($arrBuf as $netCount) { |
if (CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\Description", $strName, false) |
&& CommonFunctions::readReg($this->_reg, $hkey."\\".$netCount."\\ServiceName", $strGUID, false)) { |
if (self::readReg($this->_reg, $hkey."\\".$netCount."\\Description", $strName, false) |
&& self::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; |
879,7 → 1456,7 |
} |
} |
$allNetworkAdapterConfigurations = CommonFunctions::getWMI($this->_wmi, 'Win32_NetworkAdapterConfiguration', array('SettingID', /*'Description',*/ 'MACAddress', 'IPAddress')); |
$allNetworkAdapterConfigurations = self::getWMI(self::$_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']; |
903,11 → 1480,11 |
elseif (preg_match('/\s-\s([^-]*)$/', $mininame, $ar_name)) |
$name=substr($mininame, 0, strlen($mininame)-strlen($ar_name[0])); |
$dev->setName($mininame); |
if (trim($NetworkAdapterConfiguration['MACAddress']) !== "") $macexist = true; |
if (isset($NetworkAdapterConfiguration['MACAddress']) && 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) |
&& (trim($NetworkAdapterConfiguration['MACAddress']) !== "")) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').str_replace(':', '-', strtoupper($NetworkAdapterConfiguration['MACAddress']))); |
&& $macexist) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').str_replace(':', '-', strtoupper(trim($NetworkAdapterConfiguration['MACAddress'])))); |
if (isset($NetworkAdapterConfiguration['IPAddress'])) |
foreach ($NetworkAdapterConfiguration['IPAddress'] as $ipaddres) |
if (($ipaddres != "0.0.0.0") && ($ipaddres != "::") && !preg_match('/^fe80::/i', $ipaddres)) |
1005,7 → 1582,7 |
*/ |
private function _memory() |
{ |
if ($this->_wmi) { |
if (self::$_wmi) { |
$buffer = $this->_get_Win32_OperatingSystem(); |
if ($buffer) { |
$this->sys->setMemTotal($buffer[0]['TotalVisibleMemorySize'] * 1024); |
1012,7 → 1589,7 |
$this->sys->setMemFree($buffer[0]['FreePhysicalMemory'] * 1024); |
$this->sys->setMemUsed($this->sys->getMemTotal() - $this->sys->getMemFree()); |
} |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_PageFileUsage'); |
$buffer = self::getWMI(self::$_wmi, 'Win32_PageFileUsage'); |
foreach ($buffer as $swapdevice) { |
$dev = new DiskDevice(); |
$dev->setName("SWAP"); |
1040,11 → 1617,13 |
{ |
$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 = CommonFunctions::getWMI($this->_wmi, 'Win32_LogicalDisk', array('Name', 'Size', 'FreeSpace', 'FileSystem', 'DriveType', 'MediaType')); |
$buffer = self::getWMI(self::$_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']); |
} |
if ($filesystem['Size'] > 0) { |
$dev->setTotal($filesystem['Size']); |
$dev->setFree($filesystem['FreeSpace']); |
1057,10 → 1636,19 |
} |
$this->sys->setDiskDevices($dev); |
} |
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)) { |
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)) { |
$values = preg_replace('/[^\d\n]/', '', $out_value); |
if (preg_match('/\n(\d+)\n(\d+)\n(\d+)$/', $values, $out_dig)) { |
$size = $out_dig[1]; |
1069,7 → 1657,11 |
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->setName('Unknown'); |
$dev->setTotal($size); |
$dev->setUsed($used); |
1078,9 → 1670,33 |
} |
} |
} |
} 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); |
} |
} |
} |
} |
} |
/** |
* get os specific encoding |
1114,7 → 1730,7 |
$processes['*'] = (count($lines)-1) - 3 ; //correction for process "qprocess *" |
} |
if ($processes['*'] <= 0) { |
$buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption')); |
$buffer = self::getWMI(self::$_wmi, 'Win32_Process', array('Caption')); |
$processes['*'] = count($buffer); |
} |
$processes[' '] = $processes['*']; |
1128,11 → 1744,11 |
*/ |
private function _meminfo() |
{ |
$allMems = CommonFunctions::getWMI($this->_wmi, 'Win32_PhysicalMemory', array('PartNumber', 'DeviceLocator', 'Capacity', 'Manufacturer', 'SerialNumber', 'Speed', 'ConfiguredClockSpeed', 'ConfiguredVoltage', 'MemoryType', 'SMBIOSMemoryType', 'FormFactor', 'DataWidth', 'TotalWidth', 'BankLabel', 'MinVoltage', 'MaxVoltage')); |
$allMems = self::_get_Win32_PhysicalMemory(); |
if ($allMems) { |
$reg = false; |
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) { |
$arrMems = CommonFunctions::getWMI($this->_wmi, 'Win32_PhysicalMemoryArray', array('MemoryErrorCorrection')); |
$arrMems = self::getWMI(self::$_wmi, 'Win32_PhysicalMemoryArray', array('MemoryErrorCorrection')); |
$reg = (count($arrMems) == 1) && isset($arrMems[0]['MemoryErrorCorrection']) && ($arrMems[0]['MemoryErrorCorrection'] == 6); |
} |
foreach ($allMems as $mem) { |
1195,7 → 1811,7 |
case 22: $memtype = 'DDR2 FB-DIMM'; break; |
case 24: $memtype = 'DDR3'; break; |
case 25: $memtype = 'FBD2'; break; |
case 26: $memtype = 'DDR4'; break; |
case 26: $memtype = 'DDR4'; |
} |
} elseif (isset($mem['SMBIOSMemoryType'])) { |
switch ($mem['SMBIOSMemoryType']) { |
1231,7 → 1847,7 |
case 32: $memtype = 'Logical non-volatile device'; break; |
case 33: $memtype = 'HBM2'; break; |
case 34: $memtype = 'DDR5'; break; |
case 35: $memtype = 'LPDDR5'; break; |
case 35: $memtype = 'LPDDR5'; |
} |
} |
if (isset($mem['Speed']) && (($speed = $mem['Speed']) > 0) && (preg_match('/^(DDR\d*)(.*)/', $memtype, $dr) || preg_match('/^(SDR)AM(.*)/', $memtype, $dr))) { |
1271,7 → 1887,7 |
case 20: $memtype .= ' PLCC'; break; |
case 21: $memtype .= ' BGA'; break; |
case 22: $memtype .= ' FPBGA'; break; |
case 23: $memtype .= ' LGA'; break; |
case 23: $memtype .= ' LGA'; |
} |
} |
if (isset($mem['DataWidth']) && isset($mem['TotalWidth']) && (($dataw = $mem['DataWidth']) > 0) && (($totalw = $mem['TotalWidth']) > 0) && ($dataw < $totalw)) { |
1304,13 → 1920,13 |
* |
* @see PSI_Interface_OS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
$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 (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"); |
} |
if (!$this->blockname || $this->blockname==='vitals') { |
$this->_hostname(); |
1319,20 → 1935,21 |
$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==='memory') { |
$this->_memory(); |
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\n"); |
header("Content-Type: text/xml\n\n"); |
header('Cache-Control: no-cache, must-revalidate'); |
header('Content-Type: text/xml'); |
$xml = $this->_xml->getXml(); |
echo $xml->asXML(); |
} |
228,12 → 228,11 |
parent::__construct(); |
if (is_string($plugin) && ($plugin !== "")) { |
$plugin = strtolower($plugin); |
if ($plugin === "complete") { |
if (preg_match('/[^A-Za-z]/', $plugin)) { |
$this->_blockName = ' '; // mask wrong plugin name |
} elseif (($plugin = strtolower($plugin)) === "complete") { |
$this->_completeXML = true; |
} else { |
$validblocks = array('vitals','hardware','memory','filesystem','network','voltage','current','temperature','fans','power','other','ups'); |
if (in_array($plugin, $validblocks)) { |
} 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; |
241,7 → 240,6 |
$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\n"); |
header('Cache-Control: no-cache, must-revalidate'); |
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 Integer |
* @var int |
*/ |
private $_uptime = 0; |
77,7 → 77,7 |
/** |
* count of users that are currently logged in |
* |
* @var Integer |
* @var int |
*/ |
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 Integer |
* @var int |
*/ |
private $_loadPercent = null; |
197,7 → 197,7 |
/** |
* free memory in bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_memFree = 0; |
204,7 → 204,7 |
/** |
* total memory in bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_memTotal = 0; |
211,7 → 211,7 |
/** |
* used memory in bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_memUsed = 0; |
218,7 → 218,7 |
/** |
* used memory by applications in bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_memApplication = null; |
225,7 → 225,7 |
/** |
* used memory for buffers in bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_memBuffer = null; |
232,7 → 232,7 |
/** |
* used memory for cache in bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_memCache = null; |
253,6 → 253,13 |
private $_processes = array(); |
/** |
* array with Virtualizer information |
* |
* @var array |
*/ |
private $_virtualizer = array(); |
/** |
* remove duplicate Entries and Count |
* |
* @param array $arrDev list of HWDevices |
291,7 → 298,7 |
* @see System::_memUsed |
* @see System::_memTotal |
* |
* @return Integer |
* @return int |
*/ |
public function getMemPercentUsed() |
{ |
308,7 → 315,7 |
* @see System::_memApplication |
* @see System::_memTotal |
* |
* @return Integer |
* @return int |
*/ |
public function getMemPercentApplication() |
{ |
329,7 → 336,7 |
* @see System::_memCache |
* @see System::_memTotal |
* |
* @return Integer |
* @return int |
*/ |
public function getMemPercentCache() |
{ |
354,7 → 361,7 |
* @see System::_memBuffer |
* @see System::_memTotal |
* |
* @return Integer |
* @return int |
*/ |
public function getMemPercentBuffer() |
{ |
385,7 → 392,7 |
* @see System::_swapDevices |
* @see DiskDevice::getFree() |
* |
* @return Integer |
* @return int |
*/ |
public function getSwapFree() |
{ |
407,7 → 414,7 |
* @see System::_swapDevices |
* @see DiskDevice::getTotal() |
* |
* @return Integer |
* @return int |
*/ |
public function getSwapTotal() |
{ |
429,7 → 436,7 |
* @see System::_swapDevices |
* @see DiskDevice::getUsed() |
* |
* @return Integer |
* @return int |
*/ |
public function getSwapUsed() |
{ |
451,7 → 458,7 |
* @see System::getSwapUsed() |
* @see System::getSwapTotal() |
* |
* @return Integer |
* @return int |
*/ |
public function getSwapPercentUsed() |
{ |
485,7 → 492,7 |
* |
* @see System::$_distribution |
* |
* @return Void |
* @return void |
*/ |
public function setDistribution($distribution) |
{ |
511,7 → 518,7 |
* |
* @see System::$_distributionIcon |
* |
* @return Void |
* @return void |
*/ |
public function setDistributionIcon($distributionIcon) |
{ |
537,7 → 544,7 |
* |
* @see System::$_hostname |
* |
* @return Void |
* @return void |
*/ |
public function setHostname($hostname) |
{ |
563,7 → 570,7 |
* |
* @see System::$_ip |
* |
* @return Void |
* @return void |
*/ |
public function setIp($ip) |
{ |
589,7 → 596,7 |
* |
* @see System::$_kernel |
* |
* @return Void |
* @return void |
*/ |
public function setKernel($kernel) |
{ |
615,7 → 622,7 |
* |
* @see System::$_load |
* |
* @return Void |
* @return void |
*/ |
public function setLoad($load) |
{ |
627,7 → 634,7 |
* |
* @see System::$_loadPercent |
* |
* @return Integer |
* @return int |
*/ |
public function getLoadPercent() |
{ |
637,11 → 644,11 |
/** |
* Sets $_loadPercent. |
* |
* @param Integer $loadPercent load percent |
* @param int $loadPercent load percent |
* |
* @see System::$_loadPercent |
* |
* @return Void |
* @return void |
*/ |
public function setLoadPercent($loadPercent) |
{ |
667,7 → 674,7 |
* |
* @see System::$_machine |
* |
* @return Void |
* @return void |
*/ |
public function setMachine($machine) |
{ |
679,7 → 686,7 |
* |
* @see System::$_uptime |
* |
* @return Integer |
* @return int |
*/ |
public function getUptime() |
{ |
693,7 → 700,7 |
* |
* @see System::$_uptime |
* |
* @return Void |
* @return void |
*/ |
public function setUptime($uptime) |
{ |
705,7 → 712,7 |
* |
* @see System::$_users |
* |
* @return Integer |
* @return int |
*/ |
public function getUsers() |
{ |
715,11 → 722,11 |
/** |
* Sets $_users. |
* |
* @param Integer $users user count |
* @param int $users user count |
* |
* @see System::$_users |
* |
* @return Void |
* @return void |
*/ |
public function setUsers($users) |
{ |
746,7 → 753,7 |
* @see System::$_cpus |
* @see CpuDevice |
* |
* @return Void |
* @return void |
*/ |
public function setCpus($cpus) |
{ |
777,7 → 784,7 |
* @see System::$_netDevices |
* @see NetDevice |
* |
* @return Void |
* @return void |
*/ |
public function setNetDevices($netDevices) |
{ |
804,7 → 811,7 |
* @see System::$_pciDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setPciDevices($pciDevices) |
{ |
831,7 → 838,7 |
* @see System::$_ideDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setIdeDevices($ideDevices) |
{ |
858,7 → 865,7 |
* @see System::$_scsiDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setScsiDevices($scsiDevices) |
{ |
885,7 → 892,7 |
* @see System::$_usbDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setUsbDevices($usbDevices) |
{ |
912,7 → 919,7 |
* @see System::$_tbDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setTbDevices($tbDevices) |
{ |
939,7 → 946,7 |
* @see System::$_i2cDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setI2cDevices($i2cDevices) |
{ |
966,7 → 973,7 |
* @see System::$_nvmeDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setNvmeDevices($nvmeDevices) |
{ |
993,7 → 1000,7 |
* @see System::$_memDevices |
* @see HWDevice |
* |
* @return Void |
* @return void |
*/ |
public function setMemDevices($memDevices) |
{ |
1032,7 → 1039,7 |
* |
* @see System::$_memApplication |
* |
* @return Integer |
* @return int |
*/ |
public function getMemApplication() |
{ |
1042,11 → 1049,11 |
/** |
* Sets $_memApplication. |
* |
* @param Integer $memApplication application memory |
* @param int $memApplication application memory |
* |
* @see System::$_memApplication |
* |
* @return Void |
* @return void |
*/ |
public function setMemApplication($memApplication) |
{ |
1058,7 → 1065,7 |
* |
* @see System::$_memBuffer |
* |
* @return Integer |
* @return int |
*/ |
public function getMemBuffer() |
{ |
1068,11 → 1075,11 |
/** |
* Sets $_memBuffer. |
* |
* @param Integer $memBuffer buffer memory |
* @param int $memBuffer buffer memory |
* |
* @see System::$_memBuffer |
* |
* @return Void |
* @return void |
*/ |
public function setMemBuffer($memBuffer) |
{ |
1084,7 → 1091,7 |
* |
* @see System::$_memCache |
* |
* @return Integer |
* @return int |
*/ |
public function getMemCache() |
{ |
1094,11 → 1101,11 |
/** |
* Sets $_memCache. |
* |
* @param Integer $memCache cache memory |
* @param int $memCache cache memory |
* |
* @see System::$_memCache |
* |
* @return Void |
* @return void |
*/ |
public function setMemCache($memCache) |
{ |
1110,7 → 1117,7 |
* |
* @see System::$_memFree |
* |
* @return Integer |
* @return int |
*/ |
public function getMemFree() |
{ |
1120,11 → 1127,11 |
/** |
* Sets $_memFree. |
* |
* @param Integer $memFree free memory |
* @param int $memFree free memory |
* |
* @see System::$_memFree |
* |
* @return Void |
* @return void |
*/ |
public function setMemFree($memFree) |
{ |
1136,7 → 1143,7 |
* |
* @see System::$_memTotal |
* |
* @return Integer |
* @return int |
*/ |
public function getMemTotal() |
{ |
1146,11 → 1153,11 |
/** |
* Sets $_memTotal. |
* |
* @param Integer $memTotal total memory |
* @param int $memTotal total memory |
* |
* @see System::$_memTotal |
* |
* @return Void |
* @return void |
*/ |
public function setMemTotal($memTotal) |
{ |
1162,7 → 1169,7 |
* |
* @see System::$_memUsed |
* |
* @return Integer |
* @return int |
*/ |
public function getMemUsed() |
{ |
1172,11 → 1179,11 |
/** |
* Sets $_memUsed. |
* |
* @param Integer $memUsed used memory |
* @param int $memUsed used memory |
* |
* @see System::$_memUsed |
* |
* @return Void |
* @return void |
*/ |
public function setMemUsed($memUsed) |
{ |
1203,7 → 1210,7 |
* @see System::$_swapDevices |
* @see DiskDevice |
* |
* @return Void |
* @return void |
*/ |
public function setSwapDevices($swapDevices) |
{ |
1229,7 → 1236,7 |
* |
* @see System::$_processes |
* |
* @return Void |
* @return void |
*/ |
public function setProcesses($processes) |
{ |
1240,4 → 1247,38 |
} |
*/ |
} |
/** |
* 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.CpuDevice.inc.php |
---|
28,14 → 28,21 |
/** |
* model of the cpu |
* |
* @var String |
* @var string |
*/ |
private $_model = ""; |
/** |
* cpu voltage |
* |
* @var Float |
*/ |
private $_voltage = 0; |
/** |
* speed of the cpu in hertz |
* |
* @var Integer |
* @var int |
*/ |
private $_cpuSpeed = 0; |
42,7 → 49,7 |
/** |
* max speed of the cpu in hertz |
* |
* @var Integer |
* @var int |
*/ |
private $_cpuSpeedMax = 0; |
49,7 → 56,7 |
/** |
* min speed of the cpu in hertz |
* |
* @var Integer |
* @var int |
*/ |
private $_cpuSpeedMin = 0; |
56,7 → 63,7 |
/** |
* cache size in bytes, if available |
* |
* @var Integer |
* @var int |
*/ |
private $_cache = null; |
63,7 → 70,7 |
/** |
* virtualization, if available |
* |
* @var String |
* @var string |
*/ |
private $_virt = null; |
70,7 → 77,7 |
/** |
* busspeed in hertz, if available |
* |
* @var Integer |
* @var int |
*/ |
private $_busSpeed = null; |
77,7 → 84,7 |
/** |
* bogomips of the cpu, if available |
* |
* @var Integer |
* @var int |
*/ |
private $_bogomips = null; |
84,7 → 91,7 |
/** |
* temperature of the cpu, if available |
* |
* @var Integer |
* @var int |
*/ |
private $_temp = null; |
91,7 → 98,7 |
/** |
* vendorid, if available |
* |
* @var String |
* @var string |
*/ |
private $_vendorid = null; |
98,7 → 105,7 |
/** |
* current load in percent of the cpu, if available |
* |
* @var Integer |
* @var int |
*/ |
private $_load = null; |
121,7 → 128,7 |
* |
* @see Cpu::$_model |
* |
* @return Void |
* @return void |
*/ |
public function setModel($model) |
{ |
129,11 → 136,37 |
} |
/** |
* 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 Integer |
* @return int |
*/ |
public function getCpuSpeed() |
{ |
143,11 → 176,11 |
/** |
* Sets $_cpuSpeed. |
* |
* @param Integer $cpuSpeed cpuspeed |
* @param int $cpuSpeed cpuspeed |
* |
* @see Cpu::$_cpuSpeed |
* |
* @return Void |
* @return void |
*/ |
public function setCpuSpeed($cpuSpeed) |
{ |
159,7 → 192,7 |
* |
* @see Cpu::$_cpuSpeedMAx |
* |
* @return Integer |
* @return int |
*/ |
public function getCpuSpeedMax() |
{ |
169,11 → 202,11 |
/** |
* Sets $_cpuSpeedMax. |
* |
* @param Integer $cpuSpeedMax cpuspeedmax |
* @param int $cpuSpeedMax cpuspeedmax |
* |
* @see Cpu::$_cpuSpeedMax |
* |
* @return Void |
* @return void |
*/ |
public function setCpuSpeedMax($cpuSpeedMax) |
{ |
185,7 → 218,7 |
* |
* @see Cpu::$_cpuSpeedMin |
* |
* @return Integer |
* @return int |
*/ |
public function getCpuSpeedMin() |
{ |
195,11 → 228,11 |
/** |
* Sets $_cpuSpeedMin. |
* |
* @param Integer $cpuSpeedMin cpuspeedmin |
* @param int $cpuSpeedMin cpuspeedmin |
* |
* @see Cpu::$_cpuSpeedMin |
* |
* @return Void |
* @return void |
*/ |
public function setCpuSpeedMin($cpuSpeedMin) |
{ |
211,7 → 244,7 |
* |
* @see Cpu::$_cache |
* |
* @return Integer |
* @return int |
*/ |
public function getCache() |
{ |
221,11 → 254,11 |
/** |
* Sets $_cache. |
* |
* @param Integer $cache cache size |
* @param int $cache cache size |
* |
* @see Cpu::$_cache |
* |
* @return Void |
* @return void |
*/ |
public function setCache($cache) |
{ |
251,7 → 284,7 |
* |
* @see Cpu::$_virt |
* |
* @return Void |
* @return void |
*/ |
public function setVirt($virt) |
{ |
263,7 → 296,7 |
* |
* @see Cpu::$_busSpeed |
* |
* @return Integer |
* @return int |
*/ |
public function getBusSpeed() |
{ |
273,11 → 306,11 |
/** |
* Sets $_busSpeed. |
* |
* @param Integer $busSpeed busspeed |
* @param int $busSpeed busspeed |
* |
* @see Cpu::$_busSpeed |
* |
* @return Void |
* @return void |
*/ |
public function setBusSpeed($busSpeed) |
{ |
289,7 → 322,7 |
* |
* @see Cpu::$_bogomips |
* |
* @return Integer |
* @return int |
*/ |
public function getBogomips() |
{ |
299,11 → 332,11 |
/** |
* Sets $_bogomips. |
* |
* @param Integer $bogomips bogompis |
* @param int $bogomips bogompis |
* |
* @see Cpu::$_bogomips |
* |
* @return Void |
* @return void |
*/ |
public function setBogomips($bogomips) |
{ |
315,7 → 348,7 |
* |
* @see Cpu::$_temp |
* |
* @return Integer |
* @return int |
*/ |
/* |
public function getTemp() |
327,11 → 360,11 |
/** |
* Sets $_temp. |
* |
* @param Integer $temp temperature |
* @param int $temp temperature |
* |
* @see Cpu::$_temp |
* |
* @return Void |
* @return void |
*/ |
/* |
public function setTemp($temp) |
359,11 → 392,11 |
* |
* @see Cpu::$_vendorid |
* |
* @return Void |
* @return void |
*/ |
public function setVendorId($vendorid) |
{ |
$this->_vendorid = $vendorid; |
$this->_vendorid = trim(preg_replace('/[\s!]/', '', $vendorid)); |
} |
/** |
371,7 → 404,7 |
* |
* @see CpuDevice::$_load |
* |
* @return Integer |
* @return int |
*/ |
public function getLoad() |
{ |
381,11 → 414,11 |
/** |
* Sets $_load. |
* |
* @param Integer $load load percent |
* @param int $load load percent |
* |
* @see CpuDevice::$_load |
* |
* @return Void |
* @return void |
*/ |
public function setLoad($load) |
{ |
/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 Integer |
* @var int |
*/ |
private $_free = 0; |
49,7 → 49,7 |
/** |
* diskspace that is used in bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_used = 0; |
56,7 → 56,7 |
/** |
* total diskspace |
* |
* @var Integer |
* @var int |
*/ |
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 Integer |
* @var int |
*/ |
private $_percentInodesUsed = null; |
84,7 → 84,7 |
/** |
* ignore mode |
* |
* @var Integer |
* @var int |
*/ |
private $_ignore = 0; |
94,7 → 94,7 |
* @see DiskDevice::$_total |
* @see DiskDevice::$_used |
* |
* @return Integer |
* @return int |
*/ |
public function getPercentUsed() |
{ |
110,7 → 110,7 |
* |
* @see DiskDevice::$_PercentInodesUsed |
* |
* @return Integer |
* @return int |
*/ |
public function getPercentInodesUsed() |
{ |
120,11 → 120,11 |
/** |
* Sets $_PercentInodesUsed. |
* |
* @param Integer $percentInodesUsed inodes percent |
* @param int $percentInodesUsed inodes percent |
* |
* @see DiskDevice::$_PercentInodesUsed |
* |
* @return Void |
* @return void |
*/ |
public function setPercentInodesUsed($percentInodesUsed) |
{ |
136,7 → 136,7 |
* |
* @see DiskDevice::$_free |
* |
* @return Integer |
* @return int |
*/ |
public function getFree() |
{ |
146,11 → 146,11 |
/** |
* Sets $_free. |
* |
* @param Integer $free free bytes |
* @param int $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 Integer |
* @return int |
*/ |
public function getTotal() |
{ |
276,11 → 276,11 |
/** |
* Sets $_total. |
* |
* @param Integer $total total bytes |
* @param int $total total bytes |
* |
* @see DiskDevice::$_total |
* |
* @return Void |
* @return void |
*/ |
public function setTotal($total) |
{ |
292,7 → 292,7 |
* |
* @see DiskDevice::$_used |
* |
* @return Integer |
* @return int |
*/ |
public function getUsed() |
{ |
302,11 → 302,11 |
/** |
* Sets $_used. |
* |
* @param Integer $used used bytes |
* @param int $used used bytes |
* |
* @see DiskDevice::$_used |
* |
* @return Void |
* @return void |
*/ |
public function setUsed($used) |
{ |
318,7 → 318,7 |
* |
* @see DiskDevice::$_ignore |
* |
* @return Integer |
* @return int |
*/ |
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 Integer |
* @var int |
*/ |
private $_capacity = null; |
42,7 → 42,7 |
/** |
* manufacturer of the device, if not available it will be null |
* |
* @var Integer |
* @var int |
*/ |
private $_manufacturer = null; |
49,7 → 49,7 |
/** |
* product of the device, if not available it will be null |
* |
* @var Integer |
* @var int |
*/ |
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 Integer |
* @var int |
*/ |
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 Integer |
* @return int |
*/ |
public function getCapacity() |
{ |
273,11 → 273,11 |
/** |
* Sets $_capacity. |
* |
* @param Integer $capacity device capacity |
* @param int $capacity device capacity |
* |
* @see HWDevice::$_capacity |
* |
* @return Void |
* @return void |
*/ |
public function setCapacity($capacity) |
{ |
289,7 → 289,7 |
* |
* @see HWDevice::$_count |
* |
* @return Integer |
* @return int |
*/ |
public function getCount() |
{ |
299,11 → 299,11 |
/** |
* Sets $_count. |
* |
* @param Integer $count device count |
* @param int $count device count |
* |
* @see HWDevice::$_count |
* |
* @return Void |
* @return void |
*/ |
public function setCount($count) |
{ |
/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 Integer |
* @var int |
*/ |
private $_txBytes = 0; |
42,7 → 42,7 |
/** |
* received bytes |
* |
* @var Integer |
* @var int |
*/ |
private $_rxBytes = 0; |
49,7 → 49,7 |
/** |
* counted error packages |
* |
* @var Integer |
* @var int |
*/ |
private $_errors = 0; |
56,7 → 56,7 |
/** |
* counted droped packages |
* |
* @var Integer |
* @var int |
*/ |
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 Integer |
* @return int |
*/ |
public function getDrops() |
{ |
82,11 → 82,11 |
/** |
* Sets $_drops. |
* |
* @param Integer $drops dropped packages |
* @param int $drops dropped packages |
* |
* @see NetDevice::$_drops |
* |
* @return Void |
* @return void |
*/ |
public function setDrops($drops) |
{ |
98,7 → 98,7 |
* |
* @see NetDevice::$_errors |
* |
* @return Integer |
* @return int |
*/ |
public function getErrors() |
{ |
108,11 → 108,11 |
/** |
* Sets $_errors. |
* |
* @param Integer $errors error packages |
* @param int $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 Integer |
* @return int |
*/ |
public function getRxBytes() |
{ |
160,11 → 160,11 |
/** |
* Sets $_rxBytes. |
* |
* @param Integer $rxBytes received bytes |
* @param int $rxBytes received bytes |
* |
* @see NetDevice::$_rxBytes |
* |
* @return Void |
* @return void |
*/ |
public function setRxBytes($rxBytes) |
{ |
176,7 → 176,7 |
* |
* @see NetDevice::$_txBytes |
* |
* @return Integer |
* @return int |
*/ |
public function getTxBytes() |
{ |
186,11 → 186,11 |
/** |
* Sets $_txBytes. |
* |
* @param Integer $txBytes transmitted bytes |
* @param int $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.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 Integer |
* @var int |
*/ |
private $_value = 0; |
42,7 → 42,7 |
/** |
* maximum value of the sensor |
* |
* @var Integer |
* @var int |
*/ |
private $_max = null; |
49,7 → 49,7 |
/** |
* minimum value of the sensor |
* |
* @var Integer |
* @var int |
*/ |
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 Integer |
* @return int |
*/ |
public function getMax() |
{ |
82,11 → 82,11 |
/** |
* Sets $_max. |
* |
* @param Integer $max maximum value |
* @param int $max maximum value |
* |
* @see Sensor::$_max |
* |
* @return Void |
* @return void |
*/ |
public function setMax($max) |
{ |
98,7 → 98,7 |
* |
* @see Sensor::$_min |
* |
* @return Integer |
* @return int |
*/ |
public function getMin() |
{ |
108,11 → 108,11 |
/** |
* Sets $_min. |
* |
* @param Integer $min minimum value |
* @param int $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 Integer |
* @return int |
*/ |
public function getValue() |
{ |
160,11 → 160,11 |
/** |
* Sets $_value. |
* |
* @param Integer $value current value |
* @param int $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.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 Integer |
* @var int |
*/ |
private $_temperatur = null; |
70,7 → 70,7 |
/** |
* outages count |
* |
* @var Integer |
* @var int |
*/ |
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 Integer |
* @var int |
*/ |
private $_lineVoltage = null; |
98,7 → 98,7 |
/** |
* line freq |
* |
* @var Integer |
* @var int |
*/ |
private $_lineFrequency = null; |
105,7 → 105,7 |
/** |
* current load of the ups in percent |
* |
* @var Integer |
* @var int |
*/ |
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 Integer |
* @var int |
*/ |
private $_batteryVoltage = null; |
126,7 → 126,7 |
/** |
* current charge in percent of the battery |
* |
* @var Integer |
* @var int |
*/ |
private $_batterCharge = null; |
133,11 → 133,18 |
/** |
* time left |
* |
* @var String |
* @var string |
*/ |
private $_timeLeft = null; |
/** |
* beeper enabled or disabled |
* |
* @var string |
*/ |
private $_beeperStatus = null; |
/** |
* Returns $_batterCharge. |
* |
* @see UPSDevice::$_batterCharge |
152,7 → 159,7 |
/** |
* Sets $_batterCharge. |
* |
* @param Integer $batterCharge battery charge |
* @param int $batterCharge battery charge |
* |
* @see UPSDevice::$_batterCharge |
* |
182,7 → 189,7 |
* |
* @see UPSDevice::$_batteryDate |
* |
* @return Void |
* @return void |
*/ |
public function setBatteryDate($batteryDate) |
{ |
194,7 → 201,7 |
* |
* @see UPSDevice::$_batteryVoltage |
* |
* @return Integer |
* @return int |
*/ |
public function getBatteryVoltage() |
{ |
204,11 → 211,11 |
/** |
* Sets $_batteryVoltage. |
* |
* @param Integer $batteryVoltage battery volt |
* @param int $batteryVoltage battery volt |
* |
* @see UPSDevice::$_batteryVoltage |
* |
* @return Void |
* @return void |
*/ |
public function setBatteryVoltage($batteryVoltage) |
{ |
234,7 → 241,7 |
* |
* @see UPSDevice::$lastOutage |
* |
* @return Void |
* @return void |
*/ |
public function setLastOutage($lastOutage) |
{ |
260,7 → 267,7 |
* |
* @see UPSDevice::$_lastOutageFinish |
* |
* @return Void |
* @return void |
*/ |
public function setLastOutageFinish($lastOutageFinish) |
{ |
272,7 → 279,7 |
* |
* @see UPSDevice::$_lineVoltage |
* |
* @return Integer |
* @return int |
*/ |
public function getLineVoltage() |
{ |
282,11 → 289,11 |
/** |
* Sets $_lineVoltage. |
* |
* @param Integer $lineVoltage line voltage |
* @param int $lineVoltage line voltage |
* |
* @see UPSDevice::$_lineVoltage |
* |
* @return Void |
* @return void |
*/ |
public function setLineVoltage($lineVoltage) |
{ |
298,7 → 305,7 |
* |
* @see UPSDevice::$_lineFrequency |
* |
* @return Integer |
* @return int |
*/ |
public function getLineFrequency() |
{ |
308,11 → 315,11 |
/** |
* Sets $_lineFrequency. |
* |
* @param Integer $lineFrequency line frequency |
* @param int $lineFrequency line frequency |
* |
* @see UPSDevice::$_lineFrequency |
* |
* @return Void |
* @return void |
*/ |
public function setLineFrequency($lineFrequency) |
{ |
324,7 → 331,7 |
* |
* @see UPSDevice::$_load |
* |
* @return Integer |
* @return int |
*/ |
public function getLoad() |
{ |
334,11 → 341,11 |
/** |
* Sets $_load. |
* |
* @param Integer $load current load |
* @param int $load current load |
* |
* @see UPSDevice::$_load |
* |
* @return Void |
* @return void |
*/ |
public function setLoad($load) |
{ |
364,7 → 371,7 |
* |
* @see UPSDevice::$_mode |
* |
* @return Void |
* @return void |
*/ |
public function setMode($mode) |
{ |
390,7 → 397,7 |
* |
* @see UPSDevice::$_model |
* |
* @return Void |
* @return void |
*/ |
public function setModel($model) |
{ |
416,7 → 423,7 |
* |
* @see UPSDevice::$_name |
* |
* @return Void |
* @return void |
*/ |
public function setName($name) |
{ |
428,7 → 435,7 |
* |
* @see UPSDevice::$_outages |
* |
* @return Integer |
* @return int |
*/ |
public function getOutages() |
{ |
438,11 → 445,11 |
/** |
* Sets $_outages. |
* |
* @param Integer $outages outages count |
* @param int $outages outages count |
* |
* @see UPSDevice::$_outages |
* |
* @return Void |
* @return void |
*/ |
public function setOutages($outages) |
{ |
468,7 → 475,7 |
* |
* @see UPSDevice::$_startTime |
* |
* @return Void |
* @return void |
*/ |
public function setStartTime($startTime) |
{ |
494,7 → 501,7 |
* |
* @see UPSDevice::$_status |
* |
* @return Void |
* @return void |
*/ |
public function setStatus($status) |
{ |
506,7 → 513,7 |
* |
* @see UPSDevice::$_temperatur |
* |
* @return Integer |
* @return int |
*/ |
public function getTemperatur() |
{ |
516,11 → 523,11 |
/** |
* Sets $_temperatur. |
* |
* @param Integer $temperatur temperature |
* @param int $temperatur temperature |
* |
* @see UPSDevice::$_temperatur |
* |
* @return Void |
* @return void |
*/ |
public function setTemperatur($temperatur) |
{ |
546,10 → 553,36 |
* |
* @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,13 → 39,39 |
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); |
} |
} else { |
$upss = array('UPS'); |
} |
$un = 0; |
foreach ($upss as $ups) { |
$temp = ""; |
CommonFunctions::rftsdata("upsapcupsd{$un}.tmp", $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; |
62,11 → 88,12 |
} |
} |
} |
} |
/** |
* parse the input and store data in resultset for xml generation |
* |
* @return Void |
* @return void |
*/ |
private function _info() |
{ |
143,7 → 170,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.nut.inc.php |
---|
40,8 → 40,33 |
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); |
} |
} else { |
$upss = array('UPS'); |
} |
$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); |
50,9 → 75,11 |
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) { |
CommonFunctions::executeProgram('upsc', trim($ups_name).'@'.trim($ups), $temp, PSI_DEBUG); |
$upsname = trim($ups_name).'@'.trim($ups); |
$temp = ""; |
CommonFunctions::executeProgram('upsc', $upsname, $temp, PSI_DEBUG); |
if (! empty($temp)) { |
$this->_output[trim($ups_name).'@'.trim($ups)] = $temp; |
$this->_output[$upsname] = $temp; |
} |
} |
} |
64,6 → 91,7 |
} |
$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); |
if (! empty($temp)) { |
$this->_output[trim($ups_name)] = $temp; |
71,6 → 99,7 |
} |
} |
} |
} |
/** |
* parse the input and store data in resultset for xml generation |
99,6 → 128,9 |
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'])) { |
137,7 → 169,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.pmset.inc.php |
---|
38,8 → 38,11 |
public function __construct() |
{ |
parent::__construct(); |
if (PSI_OS == 'Darwin') { |
$temp = ""; |
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 (CommonFunctions::executeProgram('pmset', '-g batt', $temp) && !empty($temp)) { |
$this->_output[] = $temp; |
} |
89,7 → 92,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.powersoftplus.inc.php |
---|
38,7 → 38,12 |
public function __construct() |
{ |
parent::__construct(); |
if (PSI_OS == 'Linux') { |
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') { |
CommonFunctions::executeProgram('powersoftplus', '-p', $temp); |
if (! empty($temp)) { |
$this->_output[] = $temp; |
49,7 → 54,7 |
/** |
* parse the input and store data in resultset for xml generation |
* |
* @return Void |
* @return void |
*/ |
private function _info() |
{ |
71,11 → 76,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\[\%\]$/m', $ups, $data)) { |
if (preg_match('/^Output load\s*:\s*(.*)\s\[\%\]\r?$/m', $ups, $data)) { |
$load = trim($data[1]); |
} |
//wrong Output load issue |
if (($load == 0) && ($maxpwr != 0) && preg_match('/^Effective power\s*:\s*(.*)\s\[W\]$/m', $ups, $data)) { |
if (($load == 0) && ($maxpwr != 0) && preg_match('/^Effective power\s*:\s*(.*)\s\[W\]\r?$/m', $ups, $data)) { |
$load = 100.0*trim($data[1])/$maxpwr; |
} |
if ($load != null) { |
82,7 → 87,7 |
$dev->setLoad($load); |
} |
// Battery |
if (preg_match('/^Battery voltage\s*:\s*(.*)\s\[Volt\]$/m', $ups, $data)) { |
if (preg_match('/^Battery voltage\s*:\s*(.*)\s\[Volt\]\r?$/m', $ups, $data)) { |
$dev->setBatteryVoltage(trim($data[1])); |
} |
if (preg_match('/^Battery state\s*:\s*(.*)$/m', $ups, $data)) { |
93,10 → 98,10 |
} |
} |
// Line |
if (preg_match('/^Input voltage\s*:\s*(.*)\s\[Volt\]$/m', $ups, $data)) { |
if (preg_match('/^Input voltage\s*:\s*(.*)\s\[Volt\]\r?$/m', $ups, $data)) { |
$dev->setLineVoltage(trim($data[1])); |
} |
if (preg_match('/^Input frequency\s*:\s*(.*)\s\[Hz\]$/m', $ups, $data)) { |
if (preg_match('/^Input frequency\s*:\s*(.*)\s\[Hz\]\r?$/m', $ups, $data)) { |
$dev->setLineFrequency(trim($data[1])); |
} |
$this->upsinfo->setUpsDevices($dev); |
108,7 → 113,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/web/acc/phpsysinfo/includes/ups/class.snmpups.inc.php |
---|
39,7 → 39,30 |
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)) { |
48,6 → 71,7 |
$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; |
116,11 → 140,12 |
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"; |
135,7 → 160,6 |
break; |
default: |
$this->error->addError("switch(PSI_UPS_SNMPUPS_ACCESS)", "Bad SNMPups configuration in phpsysinfo.ini"); |
break; |
} |
} |
142,7 → 166,7 |
/** |
* parse the input and store data in resultset for xml generation |
* |
* @return Void |
* @return void |
*/ |
private function _info() |
{ |
163,44 → 187,28 |
} |
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; |
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 1: $batstat = "Battery Unknown"; break; |
case 2: break; |
case 3: $batstat = "Battery Low"; |
break; |
case 3: $batstat = "Battery Low"; break; |
default: $batstat = "Battery Unknown (".trim($data[1]).")"; |
break; |
} |
if ($batstat !== "") { |
if ($status !== "") { |
214,10 → 222,8 |
$batstat = ""; |
switch (trim($data[1])) { |
case 1: break; |
case 2: $batstat = "Replace Battery"; |
break; |
case 2: $batstat = "Replace Battery"; break; |
default: $batstat = "Replace Battery (".trim($data[1]).")"; |
break; |
} |
if ($batstat !== "") { |
if ($status !== "") { |
277,7 → 283,7 |
* |
* @see PSI_Interface_UPS::build() |
* |
* @return Void |
* @return void |
*/ |
public function build() |
{ |
/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]/', ' ', $str)); //remove nonprintable characters |
$str = trim(preg_replace('/[\x00-\x09\x0b-\x1F]/', ' ', strval($str))); //remove nonprintable characters |
if ($this->_encoding != null) { |
if (strcasecmp($this->_encoding, "UTF-8") == 0) { |
return $str; |
/web/acc/phpsysinfo/includes/xml/class.XML.inc.php |
---|
189,7 → 189,18 |
} |
} |
foreach ($this->_sys->getNetDevices() as $dev) { |
if (!in_array(trim($dev->getName()), $hideDevices)) { |
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) { |
$device = $network->addChild('NetDevice'); |
$device->addAttribute('Name', $dev->getName()); |
$device->addAttribute('RxBytes', $dev->getRxBytes()); |
210,9 → 221,50 |
private function _buildHardware() |
{ |
$hardware = $this->_xml->addChild('Hardware'); |
if ($this->_sys->getMachine() != "") { |
$hardware->addAttribute('Name', $this->_sys->getMachine()); |
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 (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) { |
219,13 → 271,18 |
if ($cpu === null) $cpu = $hardware->addChild('CPU'); |
$tmp = $cpu->addChild('CpuCore'); |
$tmp->addAttribute('Model', $oneCpu->getModel()); |
if ($oneCpu->getCpuSpeed() !== 0) { |
$tmp->addAttribute('CpuSpeed', max($oneCpu->getCpuSpeed(), 0)); |
if ($oneCpu->getVoltage() > 0) { |
$tmp->addAttribute('Voltage', $oneCpu->getVoltage()); |
} |
if ($oneCpu->getCpuSpeedMax() !== 0) { |
if ($oneCpu->getCpuSpeed() > 0) { |
$tmp->addAttribute('CpuSpeed', $oneCpu->getCpuSpeed()); |
} elseif ($oneCpu->getCpuSpeed() == -1) { |
$tmp->addAttribute('CpuSpeed', 0); // core stopped |
} |
if ($oneCpu->getCpuSpeedMax() > 0) { |
$tmp->addAttribute('CpuSpeedMax', $oneCpu->getCpuSpeedMax()); |
} |
if ($oneCpu->getCpuSpeedMin() !== 0) { |
if ($oneCpu->getCpuSpeedMin() > 0) { |
$tmp->addAttribute('CpuSpeedMin', $oneCpu->getCpuSpeedMin()); |
} |
/* |
244,7 → 301,7 |
} |
if ($oneCpu->getVendorId() !== null) { |
if ($vendortab === null) $vendortab = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true); |
$shortvendorid = preg_replace('/[\s!]/', '', $oneCpu->getVendorId()); |
$shortvendorid = $oneCpu->getVendorId(); |
if ($vendortab && ($shortvendorid != "") && isset($vendortab['manufacturer'][$shortvendorid])) { |
$tmp->addAttribute('Manufacturer', $vendortab['manufacturer'][$shortvendorid]); |
} |
442,9 → 499,9 |
* |
* @param SimpleXmlExtended $mount Xml-Element |
* @param DiskDevice $dev DiskDevice |
* @param Integer $i counter |
* @param int $i counter |
* |
* @return Void |
* @return void |
*/ |
private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i) |
{ |
462,12 → 519,12 |
$mount->addAttribute('Inodes', $dev->getPercentInodesUsed()); |
} |
if ($dev->getIgnore() > 0) $mount->addAttribute('Ignore', $dev->getIgnore()); |
if (PSI_SHOW_MOUNT_OPTION === true) { |
if (PSI_SHOW_MOUNT_OPTION) { |
if ($dev->getOptions() !== null) { |
$mount->addAttribute('MountOptions', preg_replace("/,/", ", ", $dev->getOptions())); |
} |
} |
if (PSI_SHOW_MOUNT_POINT === true) { |
if (PSI_SHOW_MOUNT_POINT && ($dev->getMountPoint() !== null)) { |
$mount->addAttribute('MountPoint', $dev->getMountPoint()); |
} |
} |
480,7 → 537,6 |
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); |
535,6 → 591,7 |
} |
} |
$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'); |
574,11 → 631,13 |
$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() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
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()))); |
} |
} |
589,14 → 648,16 |
$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() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
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()))); |
} |
} |
607,16 → 668,19 |
$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() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
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()))); |
} |
} |
627,11 → 691,13 |
$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() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
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()))); |
} |
} |
642,16 → 708,19 |
$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() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
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()))); |
} |
} |
666,7 → 735,7 |
$item->addAttribute('Unit', $dev->getUnit()); |
} |
if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") { |
$item->addAttribute('Event', $dev->getEvent()); |
$item->addAttribute('Event', ucfirst(strtolower($dev->getEvent()))); |
} |
} |
} |
681,7 → 750,7 |
private function _buildUpsinfo() |
{ |
$upsinfo = $this->_xml->addChild('UPSInfo'); |
if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) { |
if (!defined('PSI_EMU_HOSTNAME') && defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) { |
$upsinfo->addAttribute('ApcupsdCgiLinks', true); |
} |
if (sizeof(unserialize(PSI_UPSINFO))>0) { |
701,6 → 770,9 |
$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()); |
} |
748,10 → 820,10 |
{ |
if (($this->_plugin == '') || $this->_complete_request) { |
if ($this->_sys === null) { |
if (PSI_DEBUG === true) { |
if (PSI_DEBUG) { |
// unstable version check |
if (!is_numeric(substr(PSI_VERSION, -1))) { |
$this->_errors->addError("WARN", "This is an unstable version of phpSysInfo, some things may not work correctly"); |
$this->_errors->addWarning("This is an unstable version of phpSysInfo, some things may not work correctly"); |
} |
// Safe mode check |
771,7 → 843,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 === true) { |
if (defined("PSI_MODE_POPEN") && PSI_MODE_POPEN) { |
$this->_errors->addError("WARN", "Installed version of PHP does not support proc_open() function, popen() is used"); |
} |
} |
/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\n"); |
header("Content-Type: application/json\n\n"); |
header('Cache-Control: no-cache, must-revalidate'); |
header('Content-Type: application/json'); |
echo $json; |
break; |
case "bootstrap": |
89,7 → 89,5 |
default: |
$tpl = new Template("/templates/html/index_all.html"); |
echo $tpl->fetch(); |
break; |
} |
break; |
} |
/web/acc/phpsysinfo/js/jQuery/jquery.js |
---|
1,5 → 1,5 |
/*! |
* jQuery JavaScript Library v1.12.4-ff3fix-ff2fix |
* jQuery JavaScript Library v1.12.4-ff3fix-ff2fix-CVE_2015_9251fix-CVE_2019_11358fix |
* http://jquery.com/ |
* |
* Includes Sizzle.js |
209,8 → 209,9 |
src = target[ name ]; |
copy = options[ name ]; |
// Prevent Object.prototype pollution |
// Prevent never-ending loop |
if ( target === copy ) { |
if ( name === "__proto__" || target === copy ) { |
continue; |
} |
10445,9 → 10446,13 |
} |
} ); |
// 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,9 → 176,10 |
* 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) { |
function genlang(id, plugin, defaultvalue) { |
var html = "", idString = "", plugname = "", |
langarrId = current_language + "_"; |
206,6 → 207,8 |
if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) { |
html += langarr[langarrId][idString]; |
} else if (defaultvalue !== undefined) { |
html += defaultvalue; |
} |
html += "</span>"; |
630,7 → 633,23 |
* @param {jQuery} xml phpSysInfo-XML |
*/ |
function refreshVitals(xml) { |
var hostname = "", ip = ""; |
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"); |
} |
} |
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('vitals', blocks) < 0))) { |
$("#vitals").remove(); |
$("Vitals", xml).each(function getVitals(id) { |
672,28 → 691,16 |
} |
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); |
} |
716,46 → 723,40 |
document.title = "System information: " + hostname + " (" + ip + ")"; |
$("#s_hostname_title").html(hostname); |
$("#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); |
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); |
if ((datetimeFormat !== undefined) && (datetimeFormat.toLowerCase() === "locale")) { |
$("#s_lastboot").html(lastboot.toLocaleString()); |
setAndStrip("#s_lastboot", lastboot.toLocaleString()); |
} else { |
if (typeof(lastboot.toUTCString)==="function") { |
$("#s_lastboot").html(lastboot.toUTCString()); |
setAndStrip("#s_lastboot", lastboot.toUTCString()); |
} else { |
//deprecated |
$("#s_lastboot").html(lastboot.toGMTString()); |
setAndStrip("#s_lastboot", lastboot.toGMTString()); |
} |
} |
$("#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(" ("); |
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(" ("); |
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_1").append(", "); |
$("#s_processes_2").append(", "); |
$("#s_processes").append(", "); |
} |
$("#s_processes_1").append(eval("p" + proc_type) + " " + genlang(typelist[proc_type])); |
$("#s_processes_2").append(eval("p" + proc_type) + " " + genlang(typelist[proc_type])); |
$("#s_processes").append(eval("p" + proc_type) + " " + genlang(typelist[proc_type])); |
not_first = true; |
} |
} |
$("#s_processes_1").append(") "); |
$("#s_processes_2").append(") "); |
$("#s_processes").append(") "); |
} |
}); |
} |
771,9 → 772,10 |
function fillCpu(xml, tree, rootposition, collapsed) { |
var cpucount = 0, html = ""; |
$("Hardware CPU CpuCore", xml).each(function getCpuCore(cpuCoreId) { |
var model = "", speed = 0, bus = 0, cache = 0, bogo = 0, temp = 0, load = 0, speedmax = 0, speedmin = 0, cpucoreposition = 0, virt = "", manufacturer = ""; |
var model = "", speed = 0, voltage = 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); |
821,6 → 823,10 |
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); |
931,7 → 937,7 |
return; |
} |
var html = "", tree = [], closed = [], index = 0, machine = ""; |
var html = "", tree = [], closed = [], index = 0, machine = "", virtualizer = ""; |
$("#hardware").empty(); |
html += "<h2>" + genlang(10) + "</h2>\n"; |
html += " <div style=\"overflow-x:auto;\">\n"; |
941,6 → 947,10 |
$("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"; |
947,6 → 957,11 |
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); |
1260,6 → 1275,9 |
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) { |
1552,12 → 1570,13 |
$("#ups").empty(); |
$("UPSInfo UPS", xml).each(function getUps(id) { |
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 = ""; |
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 = ""; |
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"); |
1589,6 → 1608,10 |
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); |
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js |
---|
106,9 → 106,10 |
* 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) { |
function genlang(id, plugin, defaultvalue) { |
var html = "", idString = "", plugname = "", |
langarrId = current_language + "_"; |
137,6 → 138,8 |
if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) { |
html += langarr[langarrId][idString]; |
} else if (defaultvalue !== undefined) { |
html += defaultvalue; |
} |
html += "</span>"; |
620,6 → 623,7 |
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); |
} |
651,6 → 655,7 |
} |
processes += ")"; |
} |
} |
return processes; |
} |
} |
718,6 → 723,11 |
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); |
782,14 → 792,22 |
var html=""; |
if ((data.Hardware["@attributes"] !== undefined) && (data.Hardware["@attributes"].Name !== undefined)) { |
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>"; |
} |
} |
var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9}; |
var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Voltage:52,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9}; |
try { |
datas = items(data.Hardware.CPU.CpuCore); |
for (i = 0; i < datas.length; i++) { |
868,9 → 886,14 |
$("#hardware-data").empty().append(html); |
if ((data.Hardware["@attributes"] !== undefined) && (data.Hardware["@attributes"].Name !== undefined)) { |
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"]); |
} |
} |
try { |
datas = items(data.Hardware.CPU.CpuCore); |
1598,7 → 1621,7 |
if ((data.UPSInfo !== undefined) && (items(data.UPSInfo.UPS).length > 0)) { |
var html=""; |
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}; |
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}; |
try { |
datas = items(data.UPSInfo.UPS); |
/web/acc/phpsysinfo/js.php |
---|
46,7 → 46,7 |
$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); |
54,32 → 54,25 |
switch ($compression) { |
case "normal": |
if (file_exists($scriptmin) && is_readable($scriptmin)) { |
$filecontent = file_get_contents($scriptmin); |
echo $filecontent; |
echo file_get_contents($scriptmin); |
} elseif (file_exists($scriptjs) && is_readable($scriptjs)) { |
$filecontent = file_get_contents($scriptjs); |
$packer = new JavaScriptPacker($filecontent); |
$packer = new JavaScriptPacker(file_get_contents($scriptjs)); |
echo $packer->pack(); |
} |
break; |
case "none": |
if (file_exists($scriptjs) && is_readable($scriptjs)) { |
$filecontent = file_get_contents($scriptjs); |
$packer = new JavaScriptPacker($filecontent, 0); |
$packer = new JavaScriptPacker(file_get_contents($scriptjs), 0); |
echo $packer->pack(); |
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) { |
$filecontent = file_get_contents($scriptmin); |
echo $filecontent; |
echo file_get_contents($scriptmin); |
} |
break; |
default: |
if (file_exists($scriptjs) && is_readable($scriptjs)) { |
$filecontent = file_get_contents($scriptjs); |
echo file_get_contents($scriptjs); |
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) { |
$filecontent = file_get_contents($scriptmin); |
} else break; |
echo $filecontent; |
break; |
echo file_get_contents($scriptmin); |
} |
} |
} |
/web/acc/phpsysinfo/language/ar.xml |
---|
402,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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>Téma vzhledu</exp> |
<exp>Šablona 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>System Language</exp> |
<exp>Systémový jazyk</exp> |
</expression> |
<expression id="098" name="codepage"> |
<exp>Code Page</exp> |
<exp>Znaková stránka</exp> |
</expression> |
<expression id="099" name="details"> |
<exp>Details</exp> |
<exp>Podrobnosti</exp> |
</expression> |
<expression id="100" name="cpuspeedMax"> |
<exp>CPU Speed Max</exp> |
<exp>Nejvyšší frekvence CPU</exp> |
</expression> |
<expression id="101" name="cpuspeedMin"> |
<exp>CPU Speed Min</exp> |
<exp>Nejnižší frekvence CPU</exp> |
</expression> |
<expression id="102" name="power"> |
<exp>Power</exp> |
<exp>Výkon</exp> |
</expression> |
<expression id="103" name="power_mark"> |
<exp>W</exp> |
</expression> |
<expression id="104" name="ups_battery_date"> |
<exp>Battery date</exp> |
<exp>Datum baterie</exp> |
</expression> |
<expression id="105" name="current"> |
<exp>Current</exp> |
<exp>Proud</exp> |
</expression> |
<expression id="106" name="current_mark"> |
<exp>A</exp> |
</expression> |
<expression id="107" name="machine"> |
<exp>Machine</exp> |
<exp>Zařízení</exp> |
</expression> |
<expression id="108" name="ups_line_frequency"> |
<exp>Line frequency</exp> |
<exp>Frekvence sítě</exp> |
</expression> |
<expression id="109" name="Hz"> |
<exp>Hz</exp> |
</expression> |
<expression id="110" name="Processes"> |
<exp>Processes</exp> |
<exp>Procesy</exp> |
</expression> |
<expression id="111" name="ProcessesRunning"> |
<exp>running</exp> |
<exp>aktivní</exp> |
</expression> |
<expression id="112" name="ProcessesSleeping"> |
<exp>sleeping</exp> |
<exp>neaktivní</exp> |
</expression> |
<expression id="113" name="ProcessesStopped"> |
<exp>stopped</exp> |
<exp>zastavené</exp> |
</expression> |
<expression id="114" name="ProcessesZombie"> |
<exp>zombie</exp> |
</expression> |
<expression id="115" name="ProcessesWaiting"> |
<exp>waiting</exp> |
<exp>čekající</exp> |
</expression> |
<expression id="116" name="ProcessesOther"> |
<exp>other</exp> |
<exp>ostatní</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>Number of processors</exp> |
<exp>Počet procesorů</exp> |
</expression> |
<expression id="120" name="no_devices"> |
<exp>Number of devices</exp> |
<exp>Počet zařízení</exp> |
</expression> |
<expression id="121" name="other"> |
<exp>Other</exp> |
<exp>Ostatní</exp> |
</expression> |
<expression id="122" name="manufacturer"> |
<exp>Manufacturer</exp> |
<exp>Výrobce</exp> |
</expression> |
<expression id="123" name="product"> |
<exp>Product</exp> |
<exp>Produkt</exp> |
</expression> |
<expression id="124" name="serial"> |
<exp>Serial number</exp> |
<exp>Sériové číslo</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>OS Type</exp> |
<exp>Typ OS</exp> |
</expression> |
<expression id="128" name="no_memories"> |
<exp>Number of memory chips</exp> |
<exp>Počet paměťových čipů</exp> |
</expression> |
<expression id="129" name="speed"> |
<exp>Speed</exp> |
<exp>Rychlost</exp> |
</expression> |
<expression id="130" name="mem"> |
<exp>Memory Chips</exp> |
<exp>Paměťové čipy</exp> |
</expression> |
<expression id="131" name="mtps"> |
<exp>MT/s</exp> |
402,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,4 → 402,10 |
<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,6 → 75,11 |
; |
;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 |
103,7 → 108,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.txt contents |
; - Viewer - show output of any command or file viewer.tmp contents |
; |
PLUGINS=false |
144,7 → 149,7 |
; Show or hide template picklist |
; |
SHOW_PICKLIST_TEMPLATE=false |
SHOW_PICKLIST_TEMPLATE=true |
; Show CPU list expanded |
162,11 → 167,24 |
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=true |
HIDE_BOOTSTRAP_LOADER=false |
; 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 |
178,7 → 196,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 |
; - false : will not be displayed (also in Load Averages field) |
; |
LOAD_BAR=true |
251,7 → 269,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) |
; - Coretemp No addon tool neded (FreeBSD/Linux) |
; - CpuMem No addon tool neded (FreeBSD/Linux/WinNT or others but with the dmidecode utility installed) |
; - 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) |
317,13 → 335,12 |
; - true : display used inodes in percent |
; - false : hide them |
; |
SHOW_INODES=false |
SHOW_INODES=true |
; Hide mounts |
; Example : HIDE_MOUNTS="/home,/usr" |
; |
; HIDE_MOUNTS="/dev,/dev/shm,/run,/run/user/0,/sys/fs/cgroup" |
HIDE_MOUNTS="" |
389,6 → 406,13 |
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 |
; |
427,9 → 451,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" |
438,7 → 462,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. |
; |
445,6 → 469,14 |
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 |
; |
452,7 → 484,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. |
; |
459,6 → 491,14 |
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. |
469,10 → 509,32 |
; 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 |
; ******************************** |
479,7 → 541,7 |
; define how to access the dmidecode data |
; - "data" read data from file data/dmidecode.txt |
; - "data" read data from file data/dmidecode.tmp; content is the output from "dmidecode -t 17") |
; - "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! |
506,7 → 568,7 |
; LMSensors motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'sensors' command |
; - ACCESS="data" //read data from file data/lmsensors.txt |
; - ACCESS="data" //read data from file data/lmsensors.tmp |
; |
ACCESS="command" |
514,7 → 576,7 |
; Healthd motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'healthdc' command |
; - ACCESS="data" //read data from file data/healthd.txt |
; - ACCESS="data" //read data from file data/healthd.tmp |
; |
ACCESS="command" |
522,7 → 584,7 |
; MBMon motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'mbmon -c 1 -r' command |
; - ACCESS="data" //read data from file data/mbmon.txt |
; - ACCESS="data" //read data from file data/mbmon.tmp |
; - ACCESS="tcp" //read data from mbmon deamon (localhost:411) |
; |
ACCESS="command" |
532,7 → 594,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.txt |
; - ACCESS="data" //read data from file data/ipmitool.tmp |
; |
ACCESS="command" |
540,7 → 602,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.txt |
; - ACCESS="data" //read data from file data/freeipmi.tmp |
; |
ACCESS="command" |
549,7 → 611,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.txt |
; - ACCESS="data" //read data from file data/ipmiutil.tmp |
; |
ACCESS="command" |
557,7 → 619,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.txt (output from: ipmicfg -sdr>ipmicfg.txt; ipmicfg -psfruinfo>>ipmicfg.txt) |
; - ACCESS="data" //read data from file data/ipmicfg.tmp (output from: "ipmicfg -sdr>ipmicfg.tmp; ipmicfg -psfruinfo>>ipmicfg.tmp") |
; |
ACCESS="command" |
572,7 → 634,7 |
; K8Temp motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'k8temp' command |
; - ACCESS="data" //read data from file data/k8temp.txt |
; - ACCESS="data" //read data from file data/k8temp.tmp |
; |
ACCESS="command" |
579,8 → 641,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.txt (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.tmp (output of WinNT command "wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CriticalTripPoint,CurrentTemperature,InstanceName") |
; |
ACCESS="command" |
588,7 → 650,7 |
; SpeedFan motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'speedfanget' command |
; - ACCESS="data" //read data from file data/speedfan.txt |
; - ACCESS="data" //read data from file data/speedfan.tmp |
; |
ACCESS="command" |
596,7 → 658,7 |
; NvidiaSMI motherboard monitoring program configuration |
; |
; - ACCESS="command" //read data from 'nvidia-smi -q' command |
; - ACCESS="data" //read data from file data/nvidiasmi.txt |
; - ACCESS="data" //read data from file data/nvidiasmi.tmp |
; |
ACCESS="command" |
622,7 → 684,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.txt" and "bat_state.txt"; content is the output |
; with the filename "bat_info.tmp" and "bat_state.tmp"; content is the output |
; from "cat /proc/acpi/battery/BAT0/info" and "cat /proc/acpi/battery/BAT0/state") |
; |
ACCESS="command" |
650,9 → 712,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 |
660,8 → 722,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.txt" or "raiddmraid.txt" or "raidmegactl.txt" or "raidmegasasctl.txt" |
; or "raidmegaclisas-status.txt" or "raidgraid.txt" or "raidzpool.txt" or "raididrac{device_number}.txt") |
; with the filename "raidmdstat.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") |
; |
ACCESS="command" |
683,10 → 745,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.txt"; content is the output from "ps -axo pid,ppid,pmem,pcpu,args") |
; with the filename "ps.tmp"; content is the output from "ps -axo pid,ppid,pmem,pcpu,args") |
; |
ACCESS="command" |
712,14 → 774,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.txt"; content is the output from |
; with the filename "psstatus.tmp"; 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.*") |
; Regular expression search in the process name (e.g. "ddclient.*") for non-WinNT systems |
; - true : Regular expression search (used pgrep command) |
; - false : Normal search (used pidof command) |
; |
727,7 → 789,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" |
737,7 → 799,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.txt"; 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.tmp"; content is the output from "repquota -au") |
; |
ACCESS="command" |
754,7 → 816,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}.txt"; |
; phpsysinfo installation with the filename "smart{disk_number}.tmp"; |
; 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) |
790,12 → 852,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}.txt"; |
; phpsysinfo installation with the filename "snmppinfo{printer_number}.tmp"; |
; 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}.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 |
; 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 |
; |
ACCESS="php-snmp" |
836,7 → 898,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.txt"; content is the output from "TZ=GMT uprecords -a -w") |
; with the filename "uprecords.tmp"; content is the output from "TZ=GMT uprecords -a -w") |
; |
ACCESS="command" |
861,7 → 923,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.txt") |
; - "data" (a file must be available in the data directory of the phpsysinfo installation with the filename "viewer.tmp") |
; |
ACCESS="command" |
884,7 → 946,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.txt") |
; with the filename "pingtest.tmp") |
; |
ACCESS="command" |
915,7 → 977,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.txt") |
; with the filename "hyperv.tmp") |
; |
ACCESS="command" |
925,6 → 987,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.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}}'") |
; 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}}'") |
; |
ACCESS="command" |
/web/acc/phpsysinfo/read_config.php |
---|
3,7 → 3,7 |
/** |
* phpSysInfo version |
*/ |
define('PSI_VERSION', '3.3.4'); |
define('PSI_VERSION', '3.4.1'); |
/** |
* phpSysInfo configuration |
*/ |
100,26 → 100,37 |
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 = '/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')) { |
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')) { |
$contents = @file_get_contents($fname); |
} else { |
$contents = false; |
if (file_exists('/system/build.prop')) { //Android |
if (file_exists(PSI_ROOT_FILESYSTEM.'/system/build.prop')) { //Android |
define('PSI_OS', 'Android'); |
if (function_exists('exec') && @exec('uname -o 2>/dev/null', $unameo) && (sizeof($unameo)>0) && (($unameo0 = trim($unameo[0])) != "")) { |
if ((PSI_ROOT_FILESYSTEM === '') && 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 (!defined('PSI_MODE_POPEN')) { //if not overloaded in phpsysinfo.ini |
if (!function_exists("proc_open")) { //proc_open function test by executing 'pwd' command |
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 |
define('PSI_MODE_POPEN', true); //use popen() function - no stderr error handling (but with problems with timeout) |
} else { |
$out = ''; |
151,7 → 162,7 |
} |
} |
if (is_null($out) || (trim($out) == "") || (substr(trim($out), 0, 1) != "/")) { |
if (($out === null) || (trim($out) == "") || (substr(trim($out), 0, 1) != "/")) { |
define('PSI_MODE_POPEN', true); |
} |
fclose($pipes[0]); |
170,10 → 181,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 = '/sys/module/vt/parameters/default_utf8') |
if (file_exists($vtfname = PSI_ROOT_FILESYSTEM.'/sys/module/vt/parameters/default_utf8') |
&& (trim(@file_get_contents($vtfname)) === "1")) { |
define('PSI_SYSTEM_CODEPAGE', 'UTF-8'); |
} elseif (function_exists('exec') && @exec($matches[1].' locale -k LC_CTYPE 2>/dev/null', $lines)) { //if not overloaded in phpsysinfo.ini |
} elseif ((PSI_ROOT_FILESYSTEM === '') && 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]); |
182,7 → 193,7 |
} |
} |
} |
if (!defined('PSI_SYSTEM_LANG') && function_exists('exec') && @exec($matches[1].' locale 2>/dev/null', $lines2)) { //also if not overloaded in phpsysinfo.ini |
if ((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 |
foreach ($lines2 as $line) { |
if (preg_match('/^LC_MESSAGES="?([^\."@]*)/', $line, $matches2)) { |
$lang = ""; |
202,11 → 213,11 |
} |
} elseif (PHP_OS == 'Haiku') { |
if (!(defined('PSI_SYSTEM_CODEPAGE') && defined('PSI_SYSTEM_LANG')) //also if both not overloaded in phpsysinfo.ini |
&& function_exists('exec') && @exec('locale --message 2>/dev/null', $lines)) { |
&& (PSI_ROOT_FILESYSTEM === '') && 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]) && !is_null($matches2[2]) && (trim($matches2[2]) != "")) { //also if not overloaded in phpsysinfo.ini |
if (!defined('PSI_SYSTEM_CODEPAGE') && isset($matches2[2]) && ($matches2[2] !== null) && (trim($matches2[2]) != "")) { //also if not overloaded in phpsysinfo.ini |
define('PSI_SYSTEM_CODEPAGE', $matches2[2]); |
} |
228,7 → 239,7 |
} |
} elseif (PHP_OS == 'Darwin') { |
if (!defined('PSI_SYSTEM_LANG') //if not overloaded in phpsysinfo.ini |
&& function_exists('exec') && @exec('defaults read /Library/Preferences/.GlobalPreferences AppleLocale 2>/dev/null', $lines)) { |
&& (PSI_ROOT_FILESYSTEM === '') && 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 class="stripeMe" id="vitalsTable" style="border-collapse:collapse;"> |
<table 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,26 → 149,18 |
<td style="width:160px;"><span class="lang_009">Load Averages</span></td> |
<td><span id="s_loadavg"></span></td> |
</tr> |
<tr style="display:none;" id="s_syslang_tr"> |
<tr> |
<td style="width:160px;"><span class="lang_097">System Language</span></td> |
<td><span id="s_syslang"></span></td> |
</tr> |
<tr style="display:none;" id="s_codepage_tr1"> |
<tr> |
<td style="width:160px;"><span class="lang_098">Code Page</span></td> |
<td><span id="s_codepage_1"></span></td> |
<td><span id="s_codepage"></span></td> |
</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"> |
<tr> |
<td style="width:160px;"><span class="lang_110">Processes</span></td> |
<td><span id="s_processes_1"></span></td> |
<td><span id="s_processes"></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,5 → 1,4 |
<?php |
header('Access-Control-Allow-Origin: *'); |
/** |
* generate the xml |
* |
14,6 → 13,8 |
* @link http://phpsysinfo.sourceforge.net |
*/ |
header('Access-Control-Allow-Origin: *'); |
/** |
* application root path |
* |
28,24 → 29,19 |
} else { |
// check what xml part should be generated |
if (isset($_GET['plugin'])) { |
if (($_GET['plugin'] !== "") && !preg_match('/[^A-Za-z]/', $_GET['plugin'])) { |
$output = new WebpageXML($_GET['plugin']); |
} else { |
unset($output); |
} |
} else { |
$output = new WebpageXML(); |
} |
// if $output is correct generate output in proper type |
if (isset($output) && is_object($output)) { |
// generate output in proper type |
if (isset($_GET['json']) || isset($_GET['jsonp'])) { |
header("Cache-Control: no-cache, must-revalidate\n"); |
header('Cache-Control: no-cache, must-revalidate'); |
$json = $output->getJsonString(); |
if (isset($_GET['jsonp'])) { |
header("Content-Type: application/javascript\n\n"); |
header('Content-Type: application/javascript'); |
echo (!preg_match('/[^\w\?]/', $_GET['callback'])?$_GET['callback']:'') . '('.$json.')'; |
} else { |
header("Content-Type: application/json\n\n"); |
header('Content-Type: application/json'); |
echo $json; |
} |
} else { |
52,4 → 48,3 |
$output->run(); |
} |
} |
} |
/web/email_registration_back.php |
---|
50,6 → 50,8 |
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 * |
309,7 → 311,11 |
$domain = $conf["DOMAIN"]; |
$hostname = $conf["HOSTNAME"]; |
$to = $Fmail; |
if ($typeMail == "3") { // using an existing @mail |
$from = $fromMail; } |
else { |
$from = "administrator"; |
} |
$subject = $l_subject; |
$message = "<!DOCTYPE html> |
<html> |
333,7 → 339,8 |
$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 de vous être envoyé.</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 />"; |
// Creation of the email for the administrator (if enabled) |
if (!empty($adminMail)){ |
$to = $adminMail; |
/web/email_registration_front.php |
---|
94,7 → 94,7 |
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 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.") |
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"; |
} else { |
console.log(data); |