Create a graph of your system’s performance
Once the installation is complete, run a quick test to check if Dstat was installed correctly. Run the following command in a terminal window:
# dstat
Now hit the key combination Ctrl+C in order to exit Dstat.
Introducing Gnuplot
Gnuplot is a fantastic scientific package for visualising data and plotting functions. It’s a cross-platform open source project and is available for free download. This tool is very handy whenever you need to create production-quality graphs from a set of data. It is no wonder that in the 20-plus years of its existence, it has been employed in various industries. Flexible, powerful and easy to use, Gnuplot is not only useful as a standalone program but can also be used with a variety of programming languages, including Ruby, Python and Perl. It has also been adopted as a plotting engine by open source programs such as GNU Octave. The minimal effort required to learn Gnuplot is therefore quite worthwhile. Being able to visualise things as you analyse data and explore mathematics can prove to be invaluable.
In this article we will use Gnuplot to generate graphs from the data we gather using Dstat. We will share a set of scripts with which we will take the Dstat data file as input and return an image file containing the graph.
Gnuplot setup
Gnuplot ships by default with most modern distributions of Linux. It is quite likely that you have Gnuplot already installed on your Linux machine. To locate it you can run the command ‘# whereis gnuplot’. The command should return something like ‘/usr/bin/gnuplot’, which means that you already have Gnuplot installed. If this command doesn’t return you a positive result, it means that you don’t have Gnuplot installed and will need to do so. The installation of Gnuplot is a bit more complex than that of Dstat. Ubuntu and Fedora users should be able to use their package management systems to get it installed, as follows.
On Ubuntu, run the following command:
# sudo apt-get install gnuplot
For Fedora Linux users:
# yum install gnuplot
If you don’t have Gnuplot installed and can’t find a working binary for your distribution, we suggest you look at the Gnuplot documentation to see how to get it installed on your machine. Mind you, the source installation is for the brave.
After the installation, run a check to see if Gnuplot was installed correctly. Run the command ‘gnuplot’ in the terminal. You should be greeted by a message and then presented with the interactive Gnuplot interface. Type ‘exit’ to quit the application.











Inspired by this article i tried to make a finer script on similar lines
Have a look : http://h3manth.com/content/plotting-performance-graph-gnulinux-box
Inspired by this article i have tried to make a single script, have a look here:
http://h3manth.com/content/plotting-performance-graph-gnulinux-box
Useful. Pity the editor changed all the ” into “ and ” so that the scripts don’t actually work. People who publish Linux articles should know about this.
R.
Works great! … Did need to replace the double quotes in the three scripts on page 4 with single quotes, though.
Works great! … Did need to replace the double quotes in the three scripts on page 4 with single quotes, though, and vice versa on the grep line.
Good stuff. Thanks.
While understanding how this task can be performed is useful, perhaps installing a FOSS tool like SysUsage http://freshmeat.net/projects/sysusage/ to create performance graphs would result in greater usability?
Is another and interesting way to measure things about your server, like rrdtool do. Congratulations for the clear and easy to follow article!
[...] Create a graph of your system’s performance [...]
[...] Create a graph of your system’s performance [...]
Nice and practical article. Adding “set grid” to the scripts would make the graphs look nicer.
What's your opinion?