Info
Content

System Metrics Panels (CPU, Ram, Free Space)

system_metrics_header.jpg

This tutorial is cross platform compatible.

Telegraf is a command-line application that scrapes system metrics from your computer like CPU usage, hard drive space available, network in/out, etc. This tutorial assumes you already have Telegraf installed and set up to report to InfluxDB, and that Influx has already been set up as a data source in Grafana.

Dependencies:

  • Grafana
  • Telegraf
  • InfluxDB

Click here for a tutorial on how to install Telegraf on various platforms.

1. CPU usage panel

Panel type: singlestat

cpu_panel.JPG

The data source:

data_source_influx.JPG

The Grafana query setup:

cpu_query.JPG

The actual query:

SELECT mean("Percent_Idle_Time") *-1+100 FROM "win_cpu" WHERE ("host" = 'COMPUTER_NAME') AND $timeFilter GROUP BY time($__interval) fill(null)

2. RAM usage panel

Panel type: singlestat

RAM_Panel.JPG

The data source:

data_source_influx.JPG

The Grafana query setup:

ram_query.JPG

The actual query:

SELECT mean("Available_Bytes") / 1024/1024/1024 FROM "win_mem" WHERE ("host" = 'COMPUTER_NAME') AND $timeFilter GROUP BY time($__interval) fill(null)

3. Free hard drive space panel

Panel type: Pie Chart

In the case of Free Space, I have multiple hard drives, so I had to input multiple queries into a Pie Chart panel.

free_space_panel.JPG

The data source:

data_source_influx.JPG

The Grafana query setup:

free_space_queries.JPG

The actual query:

SELECT mean("Free_Megabytes") FROM "win_disk" WHERE ("host" = 'COMPUTER_NAME' AND "instance" = 'F:') AND $timeFilter GROUP BY time($__interval) fill(null)

 

Back to top