私のphpコード
$last_line = system('service airtime-media-monitor status');
echo $last_line;
私のブラウザの表示
AIRTIME_STATUS_URL = [1;32mhttp://localhost:80/api/status/format/json/api_key/%%api_key%%[0m
AIRTIME_SERVER_RESPONDING = [1;32mOK[0m
KERNEL_VERSION = [1;32m2.6.32-21-generic[0m
MACHINE_ARCHITECTURE = [1;32mi686[0m
TOTAL_MEMORY_MBYTES = [1;32m2051244[0m
TOTAL_SWAP_MBYTES = [1;32mUNKNOWN[0m
AIRTIME_VERSION = [1;32m2.3.1[0m
OS = [1;32mUbuntu 10.04 LTS i686[0m
CPU = [1;32mIntel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz[0m
WEB_SERVER = [1;32mApache/2.2.14 (Ubuntu)[0m
PLAYOUT_ENGINE_PROCESS_ID = [1;32m1195[0m
PLAYOUT_ENGINE_RUNNING_SECONDS = [1;32m121517[0m
PLAYOUT_ENGINE_MEM_PERC = [1;32m0.5%[0m
PLAYOUT_ENGINE_CPU_PERC = [1;32m0.4%[0m
LIQUIDSOAP_PROCESS_ID = [1;32m4362[0m
LIQUIDSOAP_RUNNING_SECONDS = [1;32m4564[0m
LIQUIDSOAP_MEM_PERC = [1;32m0.7%[0m
LIQUIDSOAP_CPU_PERC = [1;32m11.4%[0m
MEDIA_MONITOR_PROCESS_ID = [1;32m1489[0m
MEDIA_MONITOR_RUNNING_SECONDS = [1;32m121509[0m
MEDIA_MONITOR_MEM_PERC = [1;32m0.5%[0m
MEDIA_MONITOR_CPU_PERC = [1;32m0.0%[0m
-- Your installation of Airtime looks OK!
-- Your installation of Airtime looks OK!null
これは、コマンドが実際にこれを表示する方法です
AIRTIME_STATUS_URL = http://localhost:80/api/status/format/json/api_key/%%api_key%%
AIRTIME_SERVER_RESPONDING = OK
KERNEL_VERSION = 2.6.32-21-generic
MACHINE_ARCHITECTURE = i686
TOTAL_MEMORY_MBYTES = 2051244
TOTAL_SWAP_MBYTES = UNKNOWN
AIRTIME_VERSION = 2.3.1
OS = Ubuntu 10.04 LTS i686
CPU = Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
WEB_SERVER = Apache/2.2.14 (Ubuntu)
PLAYOUT_ENGINE_PROCESS_ID = 1195
PLAYOUT_ENGINE_RUNNING_SECONDS = 121187
PLAYOUT_ENGINE_MEM_PERC = 0.5%
PLAYOUT_ENGINE_CPU_PERC = 0.0%
LIQUIDSOAP_PROCESS_ID = 4362
LIQUIDSOAP_RUNNING_SECONDS = 4234
LIQUIDSOAP_MEM_PERC = 0.7%
LIQUIDSOAP_CPU_PERC = 11.4%
MEDIA_MONITOR_PROCESS_ID = 1489
MEDIA_MONITOR_RUNNING_SECONDS = 121179
MEDIA_MONITOR_MEM_PERC = 0.5%
MEDIA_MONITOR_CPU_PERC = 0.0%
-- Your installation of Airtime looks OK!
質問 : システム関数の問題は何ですか? コマンドによって表示されるように Web ブラウザーがエコーすることを期待しているため、残りの値はどこから来ているのでしょうか? どうすれば修正できますか?
PS:PHPページとコマンドを数秒間隔で実行したため、値が少しずれていることに注意してください