The Grafana Monitoring Tool is an open source enterprise-grade monitoring system that can help you keep tabs on your Linux servers. This how-to will walk you through the easy installation process.
Your data center Linux servers need to be monitored. But what tool to use? There are plenty, many of which are quite powerful. If you're looking for one that allows you to monitor numerous services (such as Graphite, MySQL, InfluxDB, Prometheus, Elasticsearch, and Cloudwatch) and lets you customize dashboards to monitor in-house apps or your data center infrastructure, you might consider turning to Grafana Monitoring Tool. You'll be surprised at how easy this powerhouse tool is to install.
What you need
- A machine (or virtual machine) running Ubuntu Server 18.04
- An account on the machine with sudo privileges
With everything in check, let's install.
Adding the repository
Open a terminal window and issue the command:
sudo nano /etc/apt/sources.list.d/grafana.list
In this new file, add the following:
deb https://packagecloud.io/grafana/stable/debian/ stretch main
Save and close that file.
Download and install the necessary GPG key with the command:
sudo curl https://packagecloud.io/gpg.key | sudo apt-key add -
SEE: Linux distribution comparison chart (Tech Pro Research)
Update and install
Next, we're going to update apt and install Grafana. This is accomplished with the following two commands:
sudo apt-get update -y sudo apt-get install grafana -y
Start and enable Grafana
With Grafana installed, the service needs to be enabled and started. We'll do this with the following three commands:
sudo systemctl daemon-reload sudo systemctl enable grafana-server sudo systemctl start grafana-server
The Grafana daemon is now running and listening for connections.
Open up a browser (one that's on the same network as your new Grafana monitor) and point it to http://SERVER_IP:3000 (Where SERVER_IP is the actual IP address of the server hosting Grafana). You will be presented with a login window (Figure A).
The default credentials are admin/admin. Once you successfully authenticate with that username/password combination, you will be prompted to change the admin user password (Figure B).
After you've changed the password, you will be presented with a blank dashboard (Figure C).
Click Add data source and you will be prompted to configure the new source (Figure D). How you configure the source will depend upon the type added.
If the data source you want to monitor isn't available, head over to the Plugins tab or directly to the Grafana plugins page, where you can find a number of new additions for the Grafana monitor. Some of the plugins are data sources and some are panels. Most of these plugins are installed from the command line like so:
sudo grafana-cli plugins install grafana-clock-panel
Once you've installed a plugin, you must then restart Grafana with the command:
sudo systemctl restart grafana-server
Once you've added your data source and any extra plugins, you can go back to the main window, click on the + button, and add a new dashboard to house the various elements (graphs, single stats, tables, rows, heatmaps, etc.). It might take you awhile to get your Grafana dashboard exactly how you want it, but it will be worth the time and effort.
SEE: 20 quick tips to make Linux networking easier (free TechRepublic PDF)
Grafana is up and running and ready to keep you apprised on what's going on with the servers and systems in your data center. Thanks to this open source enterprise-grade monitoring system, you can take the guesswork out of what's happening with your Linux machines and the services they provide.
What tools have you used to monitor your Linux servers? Have you tried Grafana? Share your recommendations with fellow TechRepublic members.