In this tutorial, we will use the Win32_PingStatus WMI query to monitor and report on connectivity between two remote systems.
Monitoring connectivity between the monitoring server and a remote system is fine but there is an even greater value in knowing when there is a problem between two systems that need to communicate with each other.
Using the Win32_PingStatus WMI class, we can execute a ping from one system and target another system This may be useful when testing communication between two Exchange server roles or between a server and an internet resource.
In this tutorial we will use a WMI query based on the Win32_PingStatus class and execute it on a remote system. The remote system will then ping another system and report back all the statistics and data to the Goverlan Scope Action.
With the information retrieved, we can then use a condition to evaluate the data and determine if we need to be alerted. For example, we may need to be notified if round trip time goes above 10 ms.
If you have never created a Scope Action before, please refer to the below video and the Scope Action Creation Basics article for more information.
Scope Module Construction
The scope module should consist of the source Windows computer. If we need to ping Computer B from Computer A, this will be Computer A.
Add as many computers as necessary to test connectivity to the secondary resources.
Action Module Construction
First we will need to add the query to our Scope Action so we can use its properties.
Go to Add \ Remove –> Report Computer Property –> WMI Objects –> Manage WMI Objects.
Here we will select “Use a separate list” and click the Manage Custom List link.
Next, click the <> and select Add a new query object.
Name the query. TIP: Include the IP Address to be ping’d in the name because it will be hard coded into the query. Create different queries for different targets.
For simplicity, we have created the following query for you.
Select ProtocolAddressResolved,ResponseTime,StatusCode From Win32_PingStatus Where Address = ‘22.214.171.124’ AND ResolveAddressNames = 1
This query will show the resolved name of the target, response time and status code (0=success, 1= failure).
Once the item is added, navigate back to Add \ Remove –> Report Computer Property –> WMI Objects –> (Name of your query)
Here you can choose all of the report items.
Use the Conditions Section “Only if the following is true” to create conditions to monitor.
For example, Add \ Remove –> Set Computer Condition –> WMI Objects –> (Name of your query) –> ResponseTime < 10.
This will only pass the condition if the response time is greater than 10 ms.