Ever dreamed about some mission control like dashboards to get a quick insight about the performance of your Windows systems? 😊
So here is how you get such a dashboard for your system in 6 simple steps in under an hour:
Install a VM with Ubuntu Linux 16.04.2 LTS
Even when it is Linux, no rocket science is needed here 😊. Just download the ISO image from the Ubuntu Website, attach it to your VM and boot form it. After that you get asked some simple questions about time zone, keyboard and partition settings. The most you can accept with the defaults or choose simple your preferred languages etc. Quite easy.
Set time zone to UTC
Login in to your Ubuntu system and change the time zone to UTC. As the InfluxDB (the backend) uses UTC time internally it is a clever idea to set the time zone for the system also to UTC.
To do so run the following command. Then choose “Non of the above” > “UTC”.
sudo dpkg-reconfigure tzdata
InfluxDB is the he backend of the solution where all data is stored. It is a database engine which is built form the ground up to store metric data and for doing real-time analytics.
To install InfluxDB run the following commands on the Linux VM:
#download debian package
#install influxdb package
sudo dpkg -i influxdb_1.2.2_amd64.deb
sudo systemctl start influxdb
#configure influxdb to automatically start at boot
sudo systemctl enable influxdb
Grafana is the frontend which will generate your nice-looking dashboard with the data stored in the InfluxDB. To install Grafana run the following commands on the Linux VM:
#downlaod debian package
#install prerequirements and grafana package
sudo apt-get install -y adduser libfontconfig
sudo dpkg -i grafana_4.2.0_amd64.deb
#start grafana server
systemctl start grafana-server
#configure grafana server to start automatically at boot
sudo systemctl enable grafana-server.service
Install Telegraf on your Windows system
Now we are ready to collect data from our systems with the Telegraf, a small agent which can collect data from many various sources. One of these source is Windows Perfmon Counters which we will use here.
1. Download the Windows version of the Telegraf agent
2. Copy the content of the zip file to C:\Program Files\telegraf on your systems
3. Replace the telegraf.conf with this one. -> telegraf.conf
So all needed perform counters get collected which are needed for the example dashboard in the last step.
4. Also in the telegraf.conf, update the urls paramter so it point to the IP address of your Linux VM
5. Install Telegraf as service and start it
cd "C:\Program Files\telegraf\"
telegraf.exe --service install
net start telegraf
Create Dahsboards and have fun! 🙂
The last step is to create your nice dashboards in the Grafana web UI. A good starting point is the “Telegraf & Influx Windows Host Overview” dashboard which can directly imported from the grafana.net repository
Login into the Grafana Web UI -> http://<your linux VM IP>:3000 (Username: admin, Password: admin)
First Grafana need to know it’s data source. Click on the Grafana logo in the top left corner and select “Data Source” in the menu. Then click on “+ Add data source“.
Define an Name for the Data Source (e.g. InfluxDB-telegraf) and choose “InfluxDB” as Type.
The URL is http://localhost:8086 has we have installed the InfluxDB locally. “Proxy” as the access type is correct.
The telegraf agent will automatically create the data base “telegraf”. So enter “telegraf” as Database name. As user you can enter anything. InfluxDB does not need any credentials by default but the Grafana interface wants you to enter something. (otherwise you can not save the data source)
And tada! 🙂
Now the Telegraf / InfluxDB setup is collecting performance data of your windows machines. With Grafana the collected data can visualized in a meaningful way so the determination the health of your system gets easy.
To further customize the data and visualization to your specific needs you can:
- Add further perfmon counters to collect to the telegraf agent configuration file
For more information, consult the official telegraf documentation: GitHub: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters
- Create custom graphs and Dashboards in Grafana
- Get more pre built dashboards from the community