If you’re running a Linux server, you can use Grafana to manage your data. Grafana is a popular open-source data management platform that’s free and easy to use. You can create custom dashboards for your server, or use the default ones that come with the system. To set up a Grafana dashboard on your server, first make sure you have the necessary software installed. You’ll need Grafana 2.0 or higher, MySQL 5.5 or higher, and PHP 7.0 or higher. If you’re using Ubuntu 14.04 LTS, these are all required by default. Once you have the software installed, open it and click on the “Grafana” icon in the top left corner of the screen. This will take you to the mainGrafana window. In this window, you’ll see a list of all of your servers and their associated data stores: MySQL, PostgreSQL, GPT disk image (if using an SSD), and so on. You can drag and drop any of these stores into a new column in the “Data Stores” column; or if you want to create custom columns for each store (for example, user data), then click on “Create Column” in the top right corner of the window and enter your desired information into the “Column Name” field. Now click on “Create Dashboard” in the top left corner of the window to start creating your own Grafana dashboard!
Grafana is an open-source observability platform for creating dashboards that visualize datasets. You can use it to conveniently monitor server statistics such as CPU consumption, network throughput, and uptime.
Grafana can be self-hosted or accessed as a SaaS solution via the official Grafana Cloud instance. In this article, you’ll learn how to set up Grafana Cloud and configure it to show basic metrics from a Linux server. You’ll use the official Grafana Agent to collect the data and send it to Grafana.
Getting Started With Grafana Cloud
Begin by signing up for a free Grafana Cloud account. You can add up to 10,000 data metrics using the free plan, as well as up to 50 GB each of stored logs and traces. Your data will be retained for 14 days.
Follow the sign up procedure until you reach the welcome screen. You can access it by clicking the Grafana icon in the top-left of the side menu if you end up in a different place.
Adding Your Server as a Data Source
Once you’re on the welcome screen, click the blue “Connect data” button to begin setting up your dashboard. You’ll arrive on the Integrations and Connections page. These provide pre-built dashboard layouts with officially supported connectors for common data sources. They’re the quickest way to get Grafana up and running.
Either scroll down or use the searchbar to find the “Linux Server” integration. Click its tile to view the information page. This provides a description of the integration and its usage instructions.
Change the operating system and system architecture parameters in the “Choose your OS” section to match the machine you’ll be monitoring.
Next scroll down the page and press the blue “Install integration” button to add the dashboards to your account.
Installing Grafana Agent on Your Server
The page will update to display a Grafana Agent installation script. The script downloads the correct Agent binary for the platform you selected and automatically configures authentication with your Grafana Cloud API key.
Open a terminal to your server and run the displayed script.
Grafana Agent is a minimal version of the Prometheus data collector. It runs as a service that periodically scrapes metrics and logs from your machine. Installation is successful if you see the Grafana Agent is now running message at the end of the script’s output.
You can confirm that data is flowing into your Grafana account by pressing the blue “Test integration” button back in the web UI. After the test completes, press the replacement “View dashboards” button to start browsing your server’s metrics.
Using the Dashboards
The Linux Server integration is also referred to as Node Exporter as it’s based on the Prometheus collector of the same name. It exports metrics from your compute nodes. Your dashboards will be grouped into a folder called “Integration – Linux Node” by default. You can change this name by heading to the folder’s Settings tab.
Two dashboards are included with the integration. The “Node Exporter / Nodes” dashboard provides an overview of system resource utilization. CPU usage, load average, and memory consumption graphs are shown prominently at the top of the view. You’ll find graphs of disk usage and network traffic further down, followed by the contents of your server’s system logs.
The USE Method dashboard variant presents the data from the perspective of the USE observability strategy. USE stands for Utilization, Saturation, and Errors:
Utilization is the percentage of time that a particular resource is consumed for, such as current CPU usage. Saturation is the amount of work that resource performs, such as the recent load average. Errors is the number of error events that occur over a particular period.
The USE method dashboard provides side-by-side graphs of utilization and saturation for each hardware resource. System logs are provided as panels at the bottom, allowing detection of reported errors.
Dashboards automatically refresh while you’re viewing them. You can change the update interval using the dropdown menu in the top-right. It defaults to 30 seconds. This area of the screen also contains controls for adjusting the visible timeframe and switching between display modes. Clicking the screen icon in the top-right activates kiosk mode, ideal when you’re using Grafana on a large display in a shared space.
Summary
Grafana Cloud makes it simple to set up advanced server monitoring dashboards using Grafana Agent with the Linux Server integration. It provides pre-built dashboards so you don’t need to manually manipulate metrics or set up graphical panels.
The integration is a starting point that’s ready to be customized to match your observability needs. You can modify the dashboards by adding new metrics and changing how existing ones are displayed. Click the settings cog icon in the top-right of the dashboard, then press the “Make editable” button to enable the editing controls. This will let you add new panels to your dashboards and change their variables and display options in the settings.