Page 1 of 1

System stats on a website?

Posted: Sat Feb 16, 2013 2:59 pm
by thejrcrafter
Hi,
ive got a basic lamp server with lighttpd. i would like a /admin page that shows the amount of free ram on the pi, etc. how would i do this? would i need to somehow run a python script on the site?
thanks

Re: System stats on a website?

Posted: Sat Feb 16, 2013 3:39 pm
by randrade

Re: System stats on a website?

Posted: Sat Feb 16, 2013 3:44 pm
by Keschy
you could try this:
http://derkev.in/rpisysinfoscript/

simply extract the zip file in your lighttpd-www-directory

Re: System stats on a website?

Posted: Tue Feb 19, 2013 5:23 pm
by adream
the one i'm using here http://93.97.163.97:81/livestatus/status.php is quite good although the temp reading isn't working at the moment

Re: System stats on a website?

Posted: Wed Feb 20, 2013 2:36 am
by 65coupei6
adream: Care to share the source of your live stats?

Re: System stats on a website?

Posted: Wed Feb 20, 2013 3:44 am
by tonyhughes
The Server Utils section of Baked Raspberry Pi Mod will install phpsysinfo for you, which is shows a heap of detail.

I just used it to install phpsysinfo as a demo for you here:

http://www.tall.co.nz/phpsysinfo/index.php?disp=dynamic

I did note that there is no option but to install to /var/www/ so if you need it in a different directory, you will need to move it, or install it manually (just drag and drop the whole phpsysinfo dir if needed).

This will be fixed in the next release.

Re: System stats on a website?

Posted: Wed Feb 20, 2013 4:41 am
by tonyhughes
And the most simple way I can think of to display the free ram is this:

Create a script:

Code: Select all

nano ~/freeram.sh
then paste in:

Code: Select all

#! /bin/bash
RAM=$(free -m)
echo $RAM > /var/www/freeram.txt
and save it (CTRL+X)

then type:

Code: Select all

chmod +x ~/freeram.sh
then run:

Code: Select all

~/./freeram.sh
Then you can just browse to http://www.domain.com/freeram.txt to see it.

There are a million ways to improve on this, and get the output looking good, or piped into another page somewhere.

Re: System stats on a website?

Posted: Sat Feb 23, 2013 2:31 am
by sim_tcr
65coupei6 wrote:adream: Care to share the source of your live stats?
Here is it http://raspisimon.no-ip.org/livestatushelp.php