Project Owner: Jannos-443
PRTG Script to monitor Windows DHCP
Free and open source: MIT License
Features
- PercentageInUse
- CheckFailOver
- AddressesFree
- AddressesInUse
- ReservedAddress
- IPv4 and IPv6 Scopes
- Excludes/Includes
-
Place
PRTG-DHCP-Stats.ps1
underC:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML
-
Place the lookup File
dhcp.failover.mode.ovl
dhcp.failover.state.ovl
underC:\Program Files (x86)\PRTG Network Monitor\lookups\custom
-
Run PRTG Lookup File Reload
-
Install
DHCP-Servertools
on the PRTG Probe (DHCP Powershell Module) -
create a "EXE/Script Advanced" sensor. Choose this script from the dropdown and set at least:
-
Set the $ExcludeScope or $IncludeScope parameter to Exclude/Include DHCP Scopes if needed
-DHCPServer "YourDHCPServer" -CheckFailOver -PercentageInUse
Display Failover and PercentageInUse channels
-DHCPServer "YourDHCPServer" -AddressesFree -AddressesInUse
Display AddressesFree and AddressesInUse channels
You can either use the parameter $ExcludeScope to exclude a DHCP Scope on sensor basis, or set the variable $ExcludeScript within the script. Both variables take a regular expression as input to provide maximum flexibility. These regexes are then evaluated againt the DHCP Scope ID
By default, the $ExcludeScript varialbe looks like this:
$ExcludeScript = '^(TestIgnore)$'
For more information about regular expressions in PowerShell, visit Microsoft Docs.
".+" is one or more charakters ".*" is zero or more charakters