Project Owner: Jannos-443
PRTG Powershell Script to monitor vmware vm status
Using VMWare PowerCLI this Script checks VMware VM Status for example VMware Tools, Heartbeat, CDDrive Connected and Overall State
Free and open source: MIT License
Features
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-Status.ps1
under C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML
check if file needs to be unblocked
Unblock-File C:\Scripts\Script.ps1
GUI: right click -> properties -> unblock
Create new Sensor
Settings | Value |
---|---|
EXE/Script Advanced | PRTG-VMware-Status.ps1 |
Parameters | -ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' |
Scanning Interval | 10 minutes |
Change parameter if needed
Monitor all VMs with all categories
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword'
Monitor all VMs with all categories but excludes all VMs starting with "TEST"
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -ExcludeVMName '^(TEST.*)$'
Monitor all VMs with all categories but excludes "APPLIANCE1" from VMware Tools monitoring
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -ExcludeVM_VMTools '^(APPLIANCE1)$'
Monitor all VMs with but without the "VMwareTool" monitoring
-ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword' -HideVMTools
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