Jannos-443 / PRTG-VMware-Snapshot

PRTG VMware Snapshot Monitoring
MIT License
13 stars 2 forks source link

PRTG-VMware-Snapshot.PS1

About The Project

Project Owner: Jannos-443

PRTG Powershell Script to monitor VMware Snapshots

Free and open source: MIT License

Features

Parameter Default Value
WarningHours 24 (hours)
ErrorHours 48 (hours)
WarningSize 10 (GB)
ErrorSize 20 (GB)

Getting Started

  1. Make sure the VMware PowerCLI Module exists on the Probe under the Powershell Module Path

    • C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation.Core
  2. Place PRTG-VMware-Snapshot.ps1 under C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML

  3. Create new sensor

    Settings Value
    EXE/Script Advanced PRTG-VMware-Snapshot.ps1
    Parameters -ViServer 'yourVCenterFQDN' -User 'yourUser' -Password 'yourPassword'
    Scanning Interval 10 minutes
  4. Change parameter if needed

    • Include/Exclude
    • Change Limits

Usage

-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"

Examples

PRTG-VMware-Snapshot

PRTG-VMware-Snapshot

Includes/Excludes

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