How to Set Up Windows Server 2016 with Grafana
Grafana is an open-source observability and visualization platform that creates rich, interactive dashboards from diverse data sources including Prometheus, InfluxDB, Elasticsearch, and many others. While Grafana itself is not a monitoring agent, it serves as the visualization and alerting layer when combined with a metrics collection backend. Setting up Grafana for Windows Server 2016 monitoring typically involves deploying a metrics collection agent such as Telegraf or the Prometheus Windows Exporter, storing metrics in a time-series database, and then visualizing that data in Grafana. This guide covers the complete setup of this monitoring stack for Windows Server 2016.
Choosing a Metrics Backend
Two common approaches exist for collecting Windows Server 2016 metrics and feeding them into Grafana. The first approach uses Telegraf with InfluxDB. Telegraf is a plugin-based metrics agent with excellent Windows support, and InfluxDB is a purpose-built time-series database that stores the collected metrics. The second approach uses the Prometheus Windows Exporter (windows_exporter) with Prometheus as the metrics storage backend. Both approaches are valid; this guide covers both the Telegraf/InfluxDB and windows_exporter/Prometheus approaches.
Installing windows_exporter on Windows Server 2016
The Prometheus windows_exporter is a lightweight agent that exposes Windows Server metrics in Prometheus format via an HTTP endpoint. Prometheus scrapes this endpoint at regular intervals and stores the data. Download the windows_exporter MSI installer from the GitHub releases page and install it on Windows Server 2016:
msiexec /i windows_exporter-0.25.1-amd64.msi ENABLED_COLLECTORS="cpu,cs,logical_disk,net,os,process,service,system,memory,tcp" LISTEN_PORT=9182 /qn
Verify the exporter is running and exposing metrics:
Get-Service -Name "windows_exporter" | Select-Object Name, Status
Invoke-WebRequest -Uri "http://localhost:9182/metrics" -UseBasicParsing | Select-Object -ExpandProperty Content | Select-String "windows_cpu_time_total" | Select-Object -First 5
Configuring Windows Firewall for Prometheus Scraping
Allow the Prometheus server to scrape metrics from the windows_exporter by creating a firewall rule on the Windows Server 2016 system:
New-NetFirewallRule -DisplayName "Prometheus windows_exporter" -Direction Inbound -Protocol TCP -LocalPort 9182 -RemoteAddress 192.168.1.210 -Action Allow
Replace 192.168.1.210 with the IP address of your Prometheus server. Restricting to a specific IP rather than allowing from any source is an important security practice.
Configuring Prometheus to Scrape Windows Server 2016
On the Prometheus server, edit the prometheus.yml configuration file to add a scrape job for the Windows Server 2016 system. Add a new job under the scrape_configs section:
scrape_configs:
- job_name: 'windows_servers'
static_configs:
- targets:
- '192.168.1.100:9182'
- '192.168.1.101:9182'
labels:
environment: 'production'
os: 'windows-2016'
scrape_interval: 15s
scrape_timeout: 10s
Reload the Prometheus configuration and verify the targets are being scraped by navigating to http://prometheus-server:9090/targets in a browser. The Windows Server 2016 targets should appear with a green “UP” status.
Installing Telegraf on Windows Server 2016 (InfluxDB Alternative)
If using the Telegraf and InfluxDB approach, download Telegraf from the InfluxData downloads page. Extract the ZIP archive and install Telegraf as a Windows service. Create the Telegraf configuration directory and main configuration file:
# Install Telegraf as a Windows service
cd "C:Program FilesTelegraf"
.telegraf.exe --service install --config "C:Program FilesTelegraftelegraf.conf"
Start-Service telegraf
Configure the telegraf.conf file to collect Windows performance counters and send them to InfluxDB:
[[outputs.influxdb_v2]]
urls = ["http://192.168.1.210:8086"]
token = "YourInfluxDBToken"
organization = "YourOrg"
bucket = "windows_servers"
[[inputs.win_perf_counters]]
[[inputs.win_perf_counters.object]]
ObjectName = "Processor"
Instances = ["_Total"]
Counters = ["% Idle Time", "% Interrupt Time", "% Privileged Time", "% User Time", "% Processor Time"]
Measurement = "win_cpu"
[[inputs.win_perf_counters.object]]
ObjectName = "Memory"
Instances = ["------"]
Counters = ["Available Bytes", "Cache Bytes", "Committed Bytes", "Page Faults/sec"]
Measurement = "win_mem"
[[inputs.win_perf_counters.object]]
ObjectName = "Network Interface"
Instances = ["*"]
Counters = ["Bytes Received/sec", "Bytes Sent/sec", "Packets Received/sec"]
Measurement = "win_net"
Connecting Grafana to Prometheus or InfluxDB
In the Grafana web interface, navigate to Connections > Data Sources and add a new data source. Select Prometheus or InfluxDB depending on which backend you configured. For Prometheus, enter the Prometheus server URL (for example http://192.168.1.210:9090) and click Save and Test. For InfluxDB v2, enter the InfluxDB URL, organization, token, and bucket name.
Importing a Windows Server Dashboard
Rather than building a dashboard from scratch, import a community-built Windows Server dashboard from the Grafana dashboard gallery. Navigate to Dashboards > Import and enter a dashboard ID. For windows_exporter with Prometheus, the Windows Node dashboard (ID 14694) provides comprehensive Windows Server monitoring out of the box. For Telegraf with InfluxDB, dashboard ID 10820 provides a good starting point.
After importing, the dashboard will immediately begin displaying metrics from your Windows Server 2016 systems. Customize panels, add new visualizations, and configure Grafana alerting rules to notify your team when metrics exceed defined thresholds. Grafana’s alerting can send notifications via email, Slack, PagerDuty, Microsoft Teams, and many other channels, providing a complete observability solution for Windows Server 2016 environments.