Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pobieranie danych z wyniku polecenia
alpin19
post
Post #1





Grupa: Zarejestrowani
Postów: 50
Pomógł: 0
Dołączył: 9.02.2005

Ostrzeżenie: (0%)
-----


Witam
Mam taki problem.

Chcę zbudować nieduży frontend dla lm_sensors w php.
Program ten działa na koncie użytkownika więc nie muszę stosować sudo.

1. Program z poziomu php uruchamiany przez exec, czyli:
  1. <?php
  2. exec(sensors);
  3. ?>


2. Wynik polecenia w konsoli wyświetla się w następujący sposób:
Kod
[alpin19@localhost alpin19]$ sensors
w83627hf-isa-0290
Adapter: ISA adapter
VCore 1:   +1.58 V  (min =  +0.00 V, max =  +4.08 V)
VCore 2:   +1.66 V  (min =  +0.00 V, max =  +4.08 V)
+3.3V:     +2.72 V  (min =  +2.82 V, max =  +3.79 V)
+5V:       +4.68 V  (min =  +4.44 V, max =  +5.21 V)
+12V:     +12.77 V  (min = +14.96 V, max =  +8.82 V)
-12V:     -13.27 V  (min =  -9.48 V, max =  -1.01 V)
-5V:       -5.80 V  (min =  +3.59 V, max =  +0.63 V)
V5SB:      +5.40 V  (min =  +2.61 V, max =  +5.81 V)
VBat:      +2.93 V  (min =  +2.46 V, max =  +3.66 V)
fan1:     2667 RPM  (min = 8437 RPM, div = 2)
fan2:        0 RPM  (min = 225000 RPM, div = 2)
fan3:     4115 RPM  (min = 1048 RPM, div = 8)
temp1:       +34°C  (high =  -127°C, hyst =   -55°C)   sensor = thermistor
temp2:     +47.5°C  (high =   +60°C, hyst =   +55°C)   sensor = thermistor
temp3:     +36.0°C  (high =   +60°C, hyst =   +55°C)   sensor = thermistor
vid:      +0.000 V
alarms:
beep_enable:
          Sound alarm disabled


Zastanawiam się teraz jak wyciągnąć z tego wartości: temp1, temp2 i temp3 oraz wyświetlić je na stronie ?


--------------------
Początkujący PHP'owicz....
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 07:38