System specific information gathering
| From: | Vidyut Luther | Date: | Fri, 22 Jul 2005 05:57:21 +0000 |
| Subject: | System specific information gathering | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-219183@lists.php.net to get a copy of this message | ||
Hello,
I have a question on how to get Server side system specific information via PHP, or just general direction on how to parse some of the information found in /proc
For example, I want to be able to display the system uptime.. number of users logged in, and load average.
In the shell, I just do uptime, and it gives me all that information
[vluther@terrence proc]$ uptime
00:47:42 up 15 days, 7:07, 7 users, load average: 0.44, 0.41, 0.39
Now i can always do a split on , and then based on that parse out the info, or I could cat /proc/uptime and /proc/loadavg
For the number of users I can do w -h | wc -l
I can call all these commands via the system() function, but my question is, is there a better way of obtaining such info ?
http://us2.php.net/manual/en/ref.info.php doesn't seem to offer much, except for the php_uname() function.
I just want to be able to display system information like uptime, on some of my web pages. Any help is appreciated.