Table of Contents
- Why is it necessary to monitor Windows performance metrics?
- What are Windows performance metrics?
- Monitor Windows performance on Graphite
- Build a Grafana dashboard
- Advantages of using Hosted Graphite by MetricFire
- Wrapping up
Windows is the most popular operating system in the world. It powers not only personal computers and laptops at home but also enterprise servers and systems. Due to the vast use of the software, many solutions to monitor Windows have been developed. In this article, we will discuss an efficient way to monitor Windows and the reason why we want to track the metrics of the operating system. But before we start, check MetricFire.
MetricFire provides comprehensive monitoring solutions with Hosted Graphite. You can set up various metrics to monitor Windows with minimal configuration. If you would like to learn more about it, please book a demo with us, or sign on for the free trial today.
Why is it necessary to monitor Windows performance metrics?
Let’s first learn why it is important to monitor Windows performance. In the enterprise space, Windows is often used to run servers that contain applications, databases, and back-end systems. When the performance of a Windows server gets degraded, this can lead to a broad failure of the software running on that server. This serial effect can affect business continuity and reliability of digital infrastructure. Monitoring Windows (i.e. servers) is an essential practice to ensure smooth business operations.
Monitoring Windows performance can also help you to detect potential hacking threats. If you observe a spike in traffic or witness abnormal memory use, this could signal a cyber attack against your digital assets. In a worst-case scenario, you may end up giving an ill-minded person control over your system and exposing sensitive data.
What are Windows performance metrics?
No business wants to experience these events. You can avoid these incidents by implementing proper monitoring metrics. In this section, we will share what performance metrics we can utilize.
Metrics that show CPU utilization are important data to analyze the CPU load during a specific time period and to improve performance degradation. You will need to monitor abnormal CPU usage - both high and low. But, some spikes and idle CPU usage might be expected as part of testing or modifying systems, so it is important to communicate across teams to prevent misunderstanding.
You can track memory usage to detect underused or overused Windows servers and adjust memory accordingly. These metrics will help you to detect server overloads before they cause downtime or data loss. When you find the servers that suffer memory shortage, you may want to optimize the memory usage of the servers or perform a physical memory upgrade.
Monitoring disk space is also one of the most critical ways to ensure reliability. When your disk space is almost full, the performance of a server will become slow and processes running on that server can halt. You can use past disk usage metrics to predict a future increase and make preemptive actions. When disk space appears to be approaching full, you can either optimize disk space usage or make physical disk upgrades.
The network metrics are especially important when your Windows servers accept inbound traffic. The amount of inbound traffic can be translated into the volume of workload that a server has to digest. When a particular server takes in too much traffic while others don’t, you will want to modify the routing policy so that you can distribute it evenly. Also, checking outbound error packets can be used to estimate normal inbound requests and monitor the normal operations of your applications. Tracking bandwidth utilization can help you to understand the level of traffic and amount of data transferred between your site, users, and the Internet.
By monitoring event logs, you can access comprehensive data that tell you various aspects of server performances including downtime, low performance, and security infringements. Detailed metrics on logging messages and processes can give you an in-depth understanding of your Windows servers. You can build logic to search specific keywords and occurrences in event logs.
Monitor Windows performance on Graphite
Let’s now learn how we can start monitoring Windows performance on Graphite. There are two ways to send performance metrics from Windows to Graphite.
Use Telegraf to send metrics to Graphite
Telegraf is a monitoring client that you can install on various operating systems including Windows, MacOS, Linux, Red Hat, and CentOS. The client has a Graphite output plugin, so it is not complicated to set up. So, you can use Telegraf to send metrics to Graphite.
First, we need to install Telegraf in Windows. Open your Powershell and execute the following commands:
wget https://dl.influxdata.com/telegraf/releases/telegraf-1.21.4_windows_amd64.zip -UseBasicParsing -OutFile telegraf-1.21.4_windows_amd64.zip Expand-Archive .\telegraf-1.21.4_windows_amd64.zip -DestinationPath 'C:\Program Files\InfluxData\telegraf'
This will download the stable version as of Feb 2022.
Create a configuration file
In your PowerShell, run:
./telegraf.exe --output-filter graphite config > telegraf.conf
Update the config to send metrics to Graphite
We can send metrics to Graphite via TCP protocol. To do so, you need to change the variables in the config file. Below is a sample configuration.
## This is the configuration for Graphite server to send metrics to [[outputs.graphite]] ## TCP endpoint for your graphite instance. ## If multiple endpoints are configured, the output will be load balanced. ## Only one of the endpoints will be written to with each iteration. ## You can put your hosted graphite endpoint URL servers = ["carbon.yourgraphite.com:2003"] ## Metrics prefix name prefix = "YOUR_API_KEY.telegraf" ## Graphite output template ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md template = "host.tags.measurement.field" ## Graphite templates patterns ## 1. Template for cpu ## 2. Template for disk* ## 3. Default template # templates = [ # "cpu tags.measurement.host.field", # "disk* measurement.field", # "host.measurement.tags.field" #] ## Enable Graphite tags support # graphite_tag_support = false ## Metric name and field separating character for Graphite tag # graphite_separator = "." ## timeout in seconds for the write connection to Graphite timeout = 2 ## Optional TLS Config # tls_ca = "/etc/telegraf/ca.pem" # tls_cert = "/etc/telegraf/cert.pem" # tls_key = "/etc/telegraf/key.pem" ## Use TLS but skip chain & host verification # insecure_skip_verify = false
Within the configuration, there are three main areas you want to focus on.
- The “servers” field that accepts a list. Put your Graphite server URL there.
- Put your prefix following the pattern of "YOUR_API_KEY.telegraf".
After modifying the variables, save and exit. Restart the Telegraf service to apply the changes.
Now you can launch Telegraf by running the command below.
./telegraf.exe -service install -config 'C:\Program Files\telegraf\telegraf.conf' net start telegraf
Use Graphite PowerShell Functions
Another way of sending metrics to Graphite is by using Graphite Powershell Functions.
- Download the latest Graphite PowerShell Functions from GitHub. Click Download ZIP.
- Unzip the compression file to extract Graphite-PowerShell.ps1 and StatsToGraphiteConfig.xml to C:GraphitePowerShell on your machine.
- Open C:GraphitePowerShellStatsToGraphiteConfig.xml in a text editor. This is the config file that contains settings. Let’s only focus on the <Graphite> section for now.
<Graphite> <CarbonServer>carbon.hostedgraphite.com</CarbonServer> <CarbonServerPort>2003</CarbonServerPort> <MetricPath>YOUR-API-KEY.foo.bar</MetricPath> <MetricSendIntervalSeconds>30</MetricSendIntervalSeconds> <TimeZoneOfGraphiteServer>UTC</TimeZoneOfGraphiteServer> </Graphite>
- Save the C:\GraphitePowerShellStatsToGraphiteConfig.xml file
- Open a PowerShell console in Administrator mode.
- Set your Execution Policy to allow scripts to be executed by entering Set-ExecutionPolicy RemoteSigned
- Run the following PowerShell commands to start sending metrics into Graphite
cd C:\GraphitePowerShell . .\Graphite-PowerShell.ps1 Start-StatsToGraphite -Verbose
Your output will look like the following:
VERBOSE: Metric Received: YOUR-API-KEY.foo.bar.servername.physicaldisk.total.diskreadqueuelength 0.000393834171592958 1408416870 VERBOSE: Metric Received: YOUR-API-KEY.foo.bar.servername.memory.pagesinput-sec 0.996814761294544 1408416870 PerfMon Job Execution Time: 5.4987477 seconds
Build a Grafana dashboard
When you receive metrics in Graphite, they will remain as numbers and letters that can be hard to comprehend. To understand metrics clearly, you need to visualize them. Grafana can be a great option since it offers powerful visualization as well as good compatibility with Graphite. Grafana is also an open-source analytics and interactive visualization web application. You can customize charts, graphs, and alerts. On top of its visualization features, you can design its back end. With its extensive features, you can create customized dashboards and run queries to generate the metrics you want.
Advantages of using Hosted Graphite by MetricFire
Graphite is an open-source software. It requires users to maintain everything from installation and monitoring Graphite clusters. This can create a management overhead and prevent you from focusing on what really matters. The hosted Graphite by MetricFire does heavy-lifting for users. In addition to the benefits that the open-source Graphite offers, it provides the following benefits.
- Redundancy storage: Graphite’s default storage is file-based and antiquated. MetricFire offers 3 times the redundant storage for seamless scaling and better data protection.
- Control by APIs: The APIs that MetricFire provides let you control and automate the resources of Hosted Graphite.
- Tagged metrics: Hosted Graphite stores data using tags that enable viewing and organizing metrics with data views.
In this article, we learned how to monitor your Windows performance metrics by using Hosted Graphite. Going through these setting-up processes could be a daunting task. Choose hosted solutions from MetricFire and create dynamic information graphics easily and quickly. Sign up for a MetricFire free trial or book a demo with our experts to learn more about how MetricFire can help you.