Once the installation is complete, run a quick test to check if Dstat was installed correctly. Run the following command in a terminal window:
Now hit the key combination Ctrl+C in order to exit Dstat.
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 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.