[Autogenerated] In the world of server management.
Monitoring.
The right metrics can be the difference between smooth
sailing and a full blown crisis.
Today, we're diving into the vitals of server health.
Let's start with CPU load trends.
These give us insights into the demand and processing power over time.
Next,
we'll check the pulse of our system's memory to ensure our
applications have the resources they need.
Moving on dis io operations will tell us about the read,
write speeds and cues that affect data access and transfer rates.
And finally, we'll look at network throughput,
the artery of our servers communication.
So keep your eyes filled for these metrics throughout this module.
A company has noted slowness on a server and create a PowerShell script to
record various performance metrics to a CS V file over time.
In this demo,
I will explain the PowerShell commands using this script to monitor CP
IZATION available memory disc latency and network traffic for each
counter will cover how to retrieve the metric with git counter and
discuss what the values indicate.
Once all the counters have been covered,
I'll showcase the full monitoring scripts that brings them all
together the team previously set up a script to record metrics like
CPU memory disk and network to a CS B file.
Let's first take a look at the CS V file that it generates.
You can see that the CS B file has a time stamp a counter and value fields.
Looking at the data over time,
you can see some negative trends indicating a degradation in performance.
CPU usage has steadily been increasing week over week
available memory you can see has also been trending downward
indicating a potential ra M constraint.
An average dis latency and average disk right latency has
spiked pointing to a potential ale bottleneck.
This highlights the value of collecting historical performance
data to understand and analyze trends over time.
Now let's walk through what the script is capturing exactly.
First is CPU like we did in the previous demo.
So nothing special there.
We'll just use git counter and specify that same
counter set name at ECU right now.
It's OK.
Next up is available memory again using GIT counter.
I can specify the total memory.
In this case, I'm just gonna use available megabytes.
I can see we have 6600 and three.
So not too bad right now, for dis we're recording read and write latency.
So for re latency,
we can check for all volumes using the asterisk on the
logical disc counter set and we can use average disc set
read and we have zero right now.
So right now it's good.
And then we can also check the right latency by using the
right name here and those look good as well.
Now, for these, if those are higher,
higher latency values indicate slower disk io and for the traffic volume,
we can use the network interface counters set and
look for all network interfaces,
use the asterisk again and this time we'll use bytes total per second.
You see right now it's doing 2400 and 87.
So about 2.4 K a second, which right now is not too bad,
but it's all about the trend.
Now,
let's take a peek at what the script looks like to pull all these commands
together to build this nice looking CS V file you found.
Now,
I've tried to comment out this script the best that I can and it
will be available for download for use and to play with the script
essentially does three main things.
First,
it creates an array of each counter to query and assigns all those
counter names to the counter array variable.
Next, it runs git counter to query,
all those counters at once and captures the value from all
of them into the counter result variable.
It then loops through all of the sample values in that output,
creates a custom PS object of the time stamp the counter name and the
value and then exports that object to a CS V file.
This is a great script.
To add into any scheduled tasks, run at a certain interval.
It's built to be remotely too,
as you can see from the volt command reference there and using the
server name parameter that I've provided to it,
you can pass different server names to it.
So i'll run up manually now.
And let's see what happens.
I'll use PowerShell or mode to connect to the server and
then run import CS V to check on the CS B file to see
what the latest time stamp is.
And there we go, it looks like the latest time stamp is 420 pm, 11 7 23.
So it did work and you see that it did record all of the current values.
So this will be a great script to add to a scheduled
tasks that runs every so often.
So feel free to download and expand upon this script in your own environment.