Thursday, June 3, 2021

How to Automatically Monitor Storage Health in Windows Server

How to Automatically Monitor Storage Health in Windows Serve

Here’s how to automatically monitor storage health using a PowerShell cmdlet.

Windows Server includes a PowerShell cmdlet called Get-ClusterPerformanceHistory that gives organizations a way to monitor storage health. The cmdlet returns a wealth of information about a cluster’s storage health, but you can take advantage of this information only if you remember to use cmdlet. However, there is a way to set up PowerShell to automatically run the cmdlet on a scheduled basis. Here’s how to set up automatic storage health monitoring in Windows Server using the Get-ClusterPerformanceHistory cmdlet.

There are three basic tasks you will need to perform to monitor storage health using the Get-ClusterPerformanceHistory cmdlet:

  • Make the script run according to a schedule.
  • Configure the script to check to make sure that reported values fall within the expected range.
  • Send an alert to an administrator if values exceed a predetermined threshold.

So let’s take a look at how you might accomplish these three tasks.

1. Run the script on a schedule.

It’s relatively easy to make a PowerShell script run automatically according to a schedule by using the Windows Task Scheduler.

To do so, open the Task Scheduler, then choose the Create Task option. The Create Task window is divided into several tabs. The General tab lets you assign a name to the task, and you can use the Triggers tab to set up the task schedule. The Actions tab is where you will need to go to tell Windows to run your PowerShell script. Make sure that the Action option is set to Start a Program, and then set powershell.exe as the program name.  You can then use the Add Arguments section to specify the name of the script you want to run. You will need to specify the -File switch followed by the path and filename of the script. You can see an example of this in Figure 1.






No comments:

Post a Comment

How to Name a Window in Google Chrome

  How to Name a Window in Google Chrome A new option has landed in the Google Chrome browser. It will allow you to name individual  windows,...