Screen-Graph
This is a simple script, to visualize data, which is output to a screen-window. To do this mainly gnu screen and gnuplot are used.
Prerequisites
screen-graph is a bash-script, which utilizes the following additional tools:
All of this tools should be available with every linux-distribution. I have not tested the script on other operation systems!
Usage
To create a graph the following simple steps are necessary:
First of all start screen in a terminal:
$ screen
Get the ID of this screen, which is saved in the environment-variable $STY
$ echo $STY 2294.pts-0.fun
Now create a window in this screen to output the data to. If you didn’t change the keybindings press CTRL-a c (create new window) and CTRL-a :title aname[RETURN] (set the window-title to “aname”)
You now can output the data to this window. They have to follow this format:
UNIXTIMESTAMP datavalue
As an example lets check the load of your server. Enter the following line in the data-window:
$ while true; do echo -n $(date +%s)' '; cat /proc/loadavg | cut -f 1 -d ' '; sleep 10; done
The output should look something like this:
1144870745 0.22 1144870755 0.18 1144870765 0.39 1144870775 0.64 1144870785 0.85
Don’t stop this line. Just let it output the data. Now go to another window in the same screen, or even to another terminal (on the same computer, with the same user!). Now comes the magic:
$ screen-graph.sh 2294.pts-0.fun aname
Change the parameters according to the above done commands. You should see an graph in your terminal filling it up.
Download
The current version of screen-graph can be download here:
- screen-graph-0.1.tar.gz first published version 0.1
To get my current development version of this script, you can use the following line to get it from my darcs-repository:
darcs get http://www.jerri.de/darcs/screengraph
Screenshot
Here is a screenshot of screengraph in action showing the example from above. The windowmanager used is ratpoison.



