HomePHP Page 9 - Retrieving System Information With patSysinfo
Link Zone - PHP
Linux file structure contains within it a special area called /proc. Now, some believe that there's black magic in that directory. For those who know better than to fear the /proc, there awaits much good magic, in the form of server info. Looking for a way to retrieve real-time server information and display it to users in your Web application? Today's your lucky day! Take a look at the patSysinfo PHP class, which lets you do that and a whole lot more.
That's about it for the moment. In this article, I introduced you to the patSysinfo class, which is designed primarily to assist you in the reading of real-time system information on a Linux system. I showed you how to use built-in class methods to retrieve the system's uptime, load average, host name and IP address, and how to obtain the kernel version and CPU speed. I also showed you to how to retrieve real-time information on memory usage, running processes and the list of processes using the most CPU power. Finally, I wrapped things up with a look at the functions that retrieve the list of devices attached to the system, and the list of mounted file systems.
If you'd like to learn more about patSysinfo and its related tools, you should take a look at the following links:
Note: All examples in this article have been tested on Linux/i586 with PHP 4.3.2, Apache 1.3.23 and patSysinfo 1.7. Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article.
Note: Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article.