Snapshot monitoring (primarily VMware, HyperV)
We often encounter customer environments where snapshots remain after updates or are not cleaned up by the backup software in use. This leads to cluster volumes filling up and impacts machine performance.

There are other ways to solve this as there is not a lot of demand.
PRTG is an excellent tool for implementing your snapshot monitoring idea, as it's highly flexible and supports custom sensors.1 While PRTG has built-in sensors for VMware and Hyper-V, they don't natively provide detailed snapshot age and size information out-of-the-box for every VM. This is where Custom Sensors (specifically EXE/Script Advanced sensors) come into play.
Here's how you can achieve snapshot monitoring in PRTG for both VMware and Hyper-V:
General Approach for PRTG Custom Sensors
The core idea is to use PowerShell scripts (for both VMware and Hyper-V) that connect to your virtualization environment, query snapshot information, and then output that data in a format that PRTG can understand (PRTG XML or simple numeric output).
PRTG XML Format:
PRTG expects XML output for advanced custom sensors, allowing you to create multiple channels (e.g., snapshot count, oldest snapshot age, total snapshot size) from a single script execution.
A basic PRTG XML output looks like this:
XML
1. VMware Snapshot Monitoring with PRTG
For VMware, you'll leverage VMware PowerCLI and a PowerShell script.
Prerequisites:
- PRTG Probe: Ensure your PRTG probe (local or remote) has network access to your vCenter Server (or individual ESXi hosts if not using vCenter).
- VMware PowerCLI: Install VMware PowerCLI on the PRTG probe server where the sensor will run. You can install it via PowerShell Gallery: Install-Module -Name VMware.PowerCLI -Scope AllUsers
- Credentials: Have a VMware user account with read-only permissions to view VM and snapshot information.
Steps:
- Create the PowerShell Script:
- You'll need a PowerShell script that:
- Connects to your vCenter Server.
- Iterates through all VMs or specific VMs.
- For each VM, checks for snapshots.
- If snapshots exist, retrieves their creation time and size.
- Calculates the age of the oldest snapshot and the total size of all snapshots for that VM.
- Outputs this data in PRTG XML format.
- Example (Conceptual) PowerShell Snippet:
- PowerShell
- Important: You can find existing community scripts on GitHub (like Jannos-443/PRTG-VMware-Snapshot) that do exactly this.2 Search for "PRTG VMware snapshot powershell script" to find reliable examples and adapt them to your needs.
- Place the Script:
- Save the .ps1 script in the C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML folder on your PRTG probe.
- Create the Sensor in PRTG:
- In PRTG, navigate to the device (your vCenter server or an ESXi host).
- Click "Add Sensor".
- Search for "EXE/Script Advanced".
- Sensor Name: Give it a descriptive name (e.g., "VMware Snapshot Overview").
- EXE/Script: Select your PRTG-VMware-Snapshot-Monitor.ps1 from the dropdown.
- Parameters: Provide the required parameters, for example: -vCenterServer "your_vcenter_fqdn" -VMUser "your_vmware_username" -VMPassword "your_vmware_password" (Note: It's better practice to use PRTG's built-in credential system. You can configure the parent device's credentials and then use placeholders like %host, %username, %password in the script parameters if the script supports it or adapts it.)
- Scanning Interval: Set an appropriate interval (e.g., 30 minutes or 1 hour).
- Timeout: Increase the timeout significantly (e.g., 300 seconds) if you have a large environment, as PowerCLI cmdlets can be slow.
- Click "Create Sensor".
- Configure Thresholds:
- Once the sensor starts collecting data, go into its settings. For each channel (e.g., "VM Name - Snapshot Count", "VM Name - Oldest Snapshot Age (Days)", "VM Name - Total Snapshot Size (GB)"), you can set:
- Warning Limits: (e.g., "Snapshot Count > 1", "Oldest Snapshot Age (Days) > 3")
- Error Limits: (e.g., "Snapshot Count > 2", "Oldest Snapshot Age (Days) > 7", "Total Snapshot Size (GB) > 100") This will trigger PRTG notifications when thresholds are breached.
2. Hyper-V Snapshot (Checkpoint) Monitoring with PRTG
For Hyper-V, you'll use PowerShell and WMI.
Prerequisites:
- PRTG Probe: Ensure your PRTG probe has network access and appropriate permissions (WMI access) to your Hyper-V hosts.
- Credentials: A Windows user account with administrator privileges on the Hyper-V hosts (or sufficient permissions to query Hyper-V WMI namespaces).
Steps:
- Create the PowerShell Script:
- This script will connect to each Hyper-V host, query for VMs, and then for checkpoints (snapshots) associated with those VMs.
- PowerShell
- Note on Hyper-V Checkpoint Size: Hyper-V doesn't expose checkpoint size as readily as VMware via standard cmdlets. To get accurate sizes, you'd typically need to find the .avhdx files associated with the VM and its checkpoints and sum their sizes. This often involves parsing the VM's configuration XML or traversing the file system where the VM's VHDX and AVHDX files are stored. This can make the script more complex.
- Place the Script:
- Save the .ps1 script in the C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML folder on your PRTG probe.
- Create the Sensor in PRTG:
- In PRTG, navigate to the Hyper-V host device.
- Click "Add Sensor".
- Search for "EXE/Script Advanced".
- Sensor Name: "Hyper-V Checkpoint Overview".
- EXE/Script: Select your PRTG-HyperV-Checkpoint-Monitor.ps1.
- Parameters: -HyperVHost "%host" (assuming the parent device is the Hyper-V host and its IP/FQDN is used). Ensure the device credentials have WMI access.
- Scanning Interval: Set an appropriate interval.
- Timeout: Adjust as needed.
- Click "Create Sensor".
- Configure Thresholds:
- Similar to VMware, configure warning and error limits for "Checkpoint Count" and "Oldest Checkpoint Age (Days)" channels.
Best Practices and Considerations
- Dedicated Probe: For large virtual environments, consider running these custom sensors on a dedicated PRTG remote probe that has PowerCLI/PowerShell access and resources to execute the scripts without impacting your core PRTG server.
- Permissions: Ensure the user account PRTG uses for the probe (or the credentials configured on the device) has the necessary permissions to query VMware vCenter/ESXi (read-only for PowerCLI) and Hyper-V hosts (WMI access, usually local administrator or a dedicated monitoring user).
- Error Handling: Include robust error handling in your PowerShell scripts to provide meaningful error messages to PRTG, rather than just script failures.
- Logging: Add logging within your PowerShell scripts to help troubleshoot if a sensor isn't working as expected.
- Performance Impact: Be mindful of the performance impact of frequent script execution on your vCenter/ESXi hosts and Hyper-V hosts, especially in large environments. Adjust scanning intervals accordingly.
- Exclusions/Inclusions: If you have certain VMs that are intentionally snapshotted for longer periods (e.g., test environments, VDI master images), consider adding logic to your scripts to exclude them from alerts or to have separate thresholds for them.
- Datastore/Volume Monitoring: Complement snapshot monitoring with direct monitoring of your datastores (VMware) and cluster shared volumes (Hyper-V) for free space. PRTG has built-in sensors for this (e.g., VMware Datastore (SOAP), Windows Disk Free for CSVs). This helps identify if snapshot bloat is actually causing storage issues.
- Backup Software Integration: While a PRTG custom sensor won't directly "integrate" with backup software, you can set up alerts in PRTG that coincide with your backup windows. If a snapshot persists after a backup window, it's a strong indicator of a backup issue.
By combining PRTG's custom sensor capabilities with robust PowerShell scripting, you can build a powerful and proactive snapshot monitoring solution that addresses the common issues you've identified.