Monitoring vDisk Replication

In a recent use-case that I stumbled across, I wanted to monitor a few different things in a Citrix-environment with Provisioning Services technology.

In this specific blog-post I’ll show you how I configured monitoring of vDisk Replication with Provisioning Services (PVS) Powershell SnapIn.

Provisioning Services Powershell SnapIn

In case you don’t have Provisioning Services Powershell SnapIn configured already, you can read more about this here. This particular script is written with the Management Command Line Interface (MCLI).

When working with MCLI-SnapIn your regexp (Regular expression) knowledge will come in handy. I’ve only commented what my specific regexp replaces does in each section, I recommend taking help from the following sites in case you’re in need of assistance:


For this case, we have different Device Collections in which I wanted to separately monitor using NRPE (Nagios Remote Plugin Execution). First off start with establishing a connection to your PVS server and predefining prerequisite parameters.

The only information you actually need is the $vDisk variable, for reuse of the script on several sites you can use the $StorePath variable. In this scenario we have more than one store, which makes us unable to retrieve the store path without the predefined $StoreName parameter. In deployments with one store you could use this row instead of the one in below section:
$StorePath = (Mcli-get Store -f Path 2>$null | Select-String ”path:”) -replace ”path:\s”

Normally you’d exit the else statement with a UNKNOWN exit code (3), but I prefer exiting this scripts else statement with critical due to the importance of the monitoring. Below is the execution of what’s checked:

-replace ”path:\s” cleans my output
FROM Path: D:\vDiskPath\vDisks
TO D:\vDiskPath\vDisks

-replace ”.*$StoreName\W” cleans my outout
FROM diskLocatorName: Store Name\vDiskName
TO vDiskName

If you have any questions, feel free to email me at or leave a comment below.

Disclaimer: All information on this blog is offered "as is" with no warranty. It is strongly recommended that you verify all information and validate all scripts in isolated test environments before using them in production environments.