Project Owner: Jannos-443
PRTG Powershell Script to monitor VMware Snapshots
Free and open source: MIT License
Features
- Monitor Snapshot Size
- Monitor Snapshot Age
- Excludes/Includes
- ExcludeVMName
- ExcludeFolder
- ExcludeRessource
- ExcludeVMHost
- ExcludeSnapDescription
- ExcludeSnapName
- IncludeVMName
- IncludeFolder
- IncludeRessource
- IncludeVMHost
- IncludeSnapDescription
- IncludeSnapName
Parameter | Default Value |
---|---|
WarningHours | 24 (hours) |
ErrorHours | 48 (hours) |
WarningSize | 10 (GB) |
ErrorSize | 20 (GB) |
-
Make sure the VMware PowerCLI Module exists on the Probe under the Powershell Module Path
C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation.Core
-
Place
PRTG-VMware-Snapshot.ps1
underC:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML
-
Create new sensor
Settings Value EXE/Script Advanced PRTG-VMware-Snapshot.ps1 Parameters -ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' Scanning Interval 10 minutes -
Change parameter if needed
- Include/Exclude
- Change Limits
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -WarningHours 72 -ErrorHours 96
Change default WarningHours limit to 72 hours and ErrorHour limit to 96 hours
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -WarningSize 5 -ErrorSize 10
Change default WarningSize limit to 5 GB and ErrorSize limit to 10 GB
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -ExcludeVMName '^(TestVM.*)$'
Exclude all VMs with Names that start with "TestVM"
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -ExcludeVMHost '^(ESXI-Test.contoso.com)$'
Exclude all VMs on the VMHost "ESXI-Test"
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -ExcludeFolder '^(Test)$'
Excude all VMs in the folder "Test"
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -ExcludeFolder '^(Test|unimportant)$'
Excude all VMs in the folders "Test" AND "unimportant"
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -IncludeFolder '^(Test2)$'
ONLY monitor VMs in the folder "Test2"
You can use the variables to exclude/include VM(s)/Snapshots(s) The variables take a regular expression as input to provide maximum flexibility.
For more information about regular expressions in PowerShell, visit Microsoft Docs.
".+" is one or more charakters ".*" is zero or more charakters