vSAN Health PRTG Sensor

I just wanted to create a quick post on a PRTG Network Monitoring Sensor that I created to provide some monitoring for vSAN deployed in my Lab. The script is not extensively tested as I am just using it in the Lab however hopefully you will get some value from it. The sensor performs an Invoke of a vSAN Health check against a VSAN cluster and reports any failures  or warnings for components.

The sensor is available from my Github and uses a module from Roman Gelman (@rgelman75) VSAN.psm1 which is available from here.

Sensor Setup

  1. Download PRTG-vSphere-vSANealth.ps1 from here and place it in C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\ on your Probe
  2. Download the prtg.customlookups.vsan.status.ovl from here (Custom Lookup for PRTG) and place this file in C:\Program Files (x86)\PRTG Network Monitor\lookups\custom\ on your Central Probe
  3. Download VSAN.psm1 from here and place this in C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\ on your Probe
  4. Logon to PRTG and select Setup > Administrative Tools > Load Lookup and File Lists

5. Next against your vCenter device create a new Sensor of type EXE/Script Advanced

6. Enter the following parameters and then click Continue to finish the setup:

    • Sensor Name: The name of the sensor (e.g. VSAN Cluster Status – Development)
    • EXE/Script: PRTG-vSphere-vSANHealth.ps1
    • Parameters: -vCenterServer “<FQDN of your vCenter>” -vSANCluster “<Name of the VSAN Cluster>”
    • Security Context: Use Windows Credentials of parent device
    • Timeout (Sec): 300
After configuration it should start reporting the status and you can setup notifications, monitoring frequency and channel limits as desired.

  • The User executing the scripts (the Windows account specified in PRTG) must have sufficient rights to the vCenter Server
  • PRTG runs all PowerShell scripts under the 32-bit image; this will cause PowerCLI not to run unless the modules are installed under the x86 Modules folder. The easiest way to fix this is to run: Save-Module -Name VMware.PowerCLI -Path SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\Modules\
  • If you encounter a number of virtual machines in your enviornment “vsan-healthcheck-disposable….” in your environment this is due to the Timeout value (which is statically set to 2 seconds) not being high enough in the VSAN.psm1 module; find any references to VsanQueryVcClusterHealthSummary and replace the Integer 2 with something higher (eg. 30 seconds)
The Code