getting system stats via php
phpSysInfo is a nicely done, easy to install PHP interface for getting system information on hardware, network, memory, and file system utilization.
Even though their site approaches a level of bad in line with some of the worst, the software is still worth a try. There’s a sourceforge page and it’s corresponding download page.
It even comes with a set of templates, including one called “aq” that mildly resembles the most awesome desktop operating system of today.
Instructions, for anyone who might need them, to follow.
First, enable PHP in your Apache installation if it’s not already.
sudo sed -i .bak0 \\ -e '/#LoadModule php4_module/s/#//' /etc/httpd/httpd.conf sudo sed -i .bak1 \\ -e '/#AddModule mod_php4.c/s/#//' /etc/httpd/httpd.conf sudo apachectl restart
Then, download and untar the phpSysInfo files.
curl -O http://surfnet.dl.sourceforge.net/sourceforge/phpsysinfo/phpsysinfo-2.5.1.tar.gz tar zxvf phpsysinfo-2.5.1.tar.gz
Finally, move the files into a web-readable location and copy the default config file.
mv phpsysinfo ~/Sites/ cp ~/Sites/phpsysinfo/config.php.new \\ ~/Sites/phpsysinfo/config.php
You should be able to browse to your system and get back it’s statistics using something to the effect of http://localhost/~user/phpsysinfo/?template=aq. If you feel inclined to remove the “Darwin version… work in progress” message, edit phpsysinfo/includes/os/class.Darwin.inc.php accordingly.
sed -i .bak -e '/work in progress/d' \\ ~/Sites/phpsysinfo/includes/os/class.Darwin.inc.php
