SheevaPlug Real time Statistics

From ComputingPlugs

Jump to: navigation, search

Here are some real time statistics of my SheevaPlug. I decided to make this information public so that others could see a real world example of the SheevaPlug and what it can really handle. I use rrdtool to gather and plot the data. I have the following tasks that are always running on the Sheeva Plug:

  • This website, computingplugs.com, runs entirely on the Sheeva Plug. I used Apache + MySQL + MediaWiki to host computingplugs.com. I have a WordPress plugin to MediaWiki that handles comments. I also use awstats to visualize the hosting stats.
  • I run a master MythTV backend as described on this page. Mythfilldatabase and MythWeb also runs on the Sheeva Plug.
  • MySQL that handles all database access for MediaWiki, Wordpress and MythTV.
  • VNC server with 1 session always opened using IceWM as the window manager.
  • Postfix mail server that handles local mail only.
  • SSH tunnel that is always connected to my work.
  • A gkrell session running on the SSH tunnel that I use to monitor the Sheeva Plug at work.
  • NFS services for my local network. My MythTV slave backend uses this heavily to store recordings.
  • A screen session with Myth alarm running.

Here are tasks that I sometimes run on the SheevaPlug:

  • FreeNX Server is always running, but it doesn't use any resource unless a NX session is started. I do not have a constantly running session, but when I do, it runs with Gnome as the window manager.
  • Compiling kernels or applications like MythTV.
  • rTorrent.
  • Pan for Usenet upload/download.

As you can see, I really do use the Sheeva Plug because I see the Sheeva Plug as a server replacement. The Sheeva Plug has been running non-stop for more than a month(6/2/09) now and it handles everything I do comfortably. However, you don't need to take my word for it, you are using the Sheeva Plug right now because computingplugs.com is hosted on it. So what do you think?

Contents

Real time statistics

I provide 6 different statistics that shows the general health of the SheevaPlug. All statistics are gather once a minute and the charts are redrawn every 10 minutes.

System uptime

uptime.gif

CPU usage in percent

cpu.png

CPU loading

load.png

Memory usage

The Sheeva Plug comes with 512MBytes of RAM, and I created a 1Gbytes swap space on the USB harddrive. memory.png

Network usage

net.png

External USB harddisk usage

hdd.png

Scripts

Here are the rrdtool scripts I used to create the real time stats.



Comments:
  • Kenny Says:

    Please keep comments clean and constructive. Inappropriate comments will be removed. Thank you.

  • wintermite Says:

    Nice Scripts for the Real Time Statistics. May you publish these Scripts ?1

  • Kenny Says:

    Sure, why not.

  • Vince Says:

    I'm getting a failure message on my sheeva trying to run memory.sh create - any ideas ?

    Here's a transcript...

    /usr/bin/rrdtool create /tmp/rrd/memory.rrd -s 60 DS:totalmem:GAUGE:180:U:U DS:usedmem:GAUGE:180:U:U DS:freemem:GAUGE:180:U:U DS:totalswap:GAUGE:180:U:U DS:usedswap:GAUGE:180:U:U DS:freeswap:GAUGE:180:U:U RRA:AVERAGE:0.5:1:1440 RRA:MAX:0.5:1440:1 RRA:min:0.5:1440:1

    ERROR: Unrecognized consolidation function

  • Kenny Says:

    I didn't run into that problem so I don't know for sure. Quick googling shows something with the rrd data file. Maybe it was created with a different version of rrdtool? For the record, I'm using rrdtool version 1.3.1

  • Vince Says:

    The problem is your memory.sh create section specifies a "min" when it should be "MIN" in uppercase. Change that and it all works fine. Thanks much for the scripts !!

  • Kenny Says:

    yeah, I see it. Odd that it doesn't give me an error on my setup. I've fixed the file. Thanks Vince.

  • MarkG Says:

    Didn't get ANY of those scripts working, looks like there are additional dependancies.

    root@ubuntu:~# chmod +x *.sh

    root@ubuntu:~# ls

    backup.sh ethernet.sh load.sh mbox memory.sh sda2.sh uptime.sh

    root@ubuntu:~# ./ethernet.sh

    Invalid option.

    root@ubuntu:~# ./memory.sh

    Invalid option.

    root@ubuntu:~# ./sda2.sh

    Invalid option.

    root@ubuntu:~# ./uptime.sh

    ./uptime.sh: line 3: /usr/bin/pnmpad: No such file or directory

    ./uptime.sh: line 3: /usr/bin/pnmcrop: No such file or directory

    ./uptime.sh: line 3: /usr/bin/pbmtext: No such file or directory

    ./uptime.sh: line 4: /usr/bin/convert: No such file or directory

  • Kenny Says:

    First of all you need to give the scripts (except uptime.sh) an argument like create, update or graph. That explains the problem of "Invalid option". For uptime.sh, you need to install netpbm and imagemagick. Both are available in the repository.

  • Brad Says:

    Really nice work you've done here. Great example. Makes my head spin, all the things we can do with this plug.

  • Simon Says:

    I've been thinking about getting one of these for ages, I'm sold now. Keep up the good work.

  • chemary Says:

    Very nice scripts, thanks.

    I will try to modify them to draw also weekly and monthly graphs.

    You run all the scripts with cron to get 1min update and 10min graph?

  • Kenny Says:

    yeah, I have a cron job that runs every minute to collect data, and another that runs every 10 minutes to redraw the graph for the website.

  • R Says:

    Looks you have put to great use the shivaplug... And /. routed me to your page.

  • markusk Says:

    on memory.png - isn't the index of the vertical scale wrong? shouldn't it say MB? but silly me can't find a way to change this :(

  • brentaar Says:

    The memory script should be modified. The line reads as:

    N:`/usr/bin/free -o | grep "Mem" | /usr/bin/gawk '{ print $2":"$3":"$4 ; }'`:`/usr/bin/free -o | grep "Swap" | /usr/bin/gawk '{ print $2":"$3":"$4 ; }'`;;

    This returns kiloBytes, which is default, instead of Bytes. That throws off the graph, since it assumes the data will be in Bytes.

    Adding a b flag should fix the issue, the flag returns Bytes giving the correct scale.

    After a quick test, the mem usage corresponds with the data that top gives.

    Example of new line:

    N:`/usr/bin/free -ob | grep "Mem" | /usr/bin/gawk '{ print $2":"$3":"$4 ; }'`:`/usr/bin/free -ob | grep "Swap" | /usr/bin/gawk '{ print $2":"$3":"$4 ; }'`;;

  • Kenny Says:

    Thanks for the fix brentaar. But really, who needs more than 512K of ram?  :D

  • A Says:

    do you have a guide with any info or steps to duplicate this or something similar?

    thanks

Click here to leave a comment




... ...

Did you find this page useful?
Help others find this site
by linking here.

... ...
Personal tools