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

February 20th, 2006 at 11:06 am
Nice walkthrough. I changed the default template in config.php from classic to aq to simply get it to default to aq each time.
We use this as quick n’ dirty disk and load monitoring on the servers at my new job at the place where I signed a piece of paper that said I can’t tell people where I work.
~jeff
February 20th, 2006 at 11:16 am
And hey, I CAUGHT THAT