thejrcrafter
Posts: 29
Joined: Sun Dec 09, 2012 9:15 pm

System stats on a website?

Sat Feb 16, 2013 2:59 pm

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


User avatar
Keschy
Posts: 21
Joined: Sat Aug 18, 2012 9:30 pm
Location: Mainz / Germany
Contact: Website

Re: System stats on a website?

Sat Feb 16, 2013 3:44 pm

you could try this:
http://derkev.in/rpisysinfoscript/

simply extract the zip file in your lighttpd-www-directory
My Webpage: http://derkev.in

adream
Posts: 23
Joined: Fri Jul 06, 2012 4:15 pm
Contact: Website

Re: System stats on a website?

Tue Feb 19, 2013 5:23 pm

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
http://212.159.76.122:81/serendipity/

65coupei6
Posts: 27
Joined: Wed Jul 18, 2012 1:29 am

Re: System stats on a website?

Wed Feb 20, 2013 2:36 am

adream: Care to share the source of your live stats?

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: System stats on a website?

Wed Feb 20, 2013 3:44 am

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.
Last edited by tonyhughes on Wed Feb 20, 2013 3:55 am, edited 1 time in total.

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: System stats on a website?

Wed Feb 20, 2013 4:41 am

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.

sim_tcr
Posts: 326
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
Contact: Website

Re: System stats on a website?

Sat Feb 23, 2013 2:31 am

65coupei6 wrote:adream: Care to share the source of your live stats?
Here is it http://raspisimon.no-ip.org/livestatushelp.php
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Raspberry Pi 2 x 2, Transcend 32GB Class 10, Transcend 16GB Class 10, Transcend 8GB Class 4, Custom 12V 1.5A (stepped down to 5.5V)

Return to “Networking and servers”