-
-
Save lwalthert/405b9db828662f02929989b00d5b50eb to your computer and use it in GitHub Desktop.
PRTG-Sensor-Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum PRTGUnit { | |
BytesBandwidth | |
BytesMemory | |
BytesDisk | |
Temperature | |
Percent | |
TimeResponse | |
TimeSeconds | |
Custom | |
Count | |
CPU | |
BytesFile | |
SpeedDisk | |
SpeedNet | |
TimeHours | |
} | |
enum PRTGSize { | |
One | |
Kilo | |
Mega | |
Giga | |
Tera | |
Byte | |
KiloByte | |
MegaByte | |
GigaByte | |
TeraByte | |
Bit | |
KiloBit | |
MegaBit | |
GigaBit | |
TeraBit | |
} | |
enum PRTGSpeed { | |
Second | |
Minute | |
Hour | |
Day | |
} | |
enum PRTGMode { | |
Absolute | |
Difference | |
} | |
class PRTGChannel { | |
#Properties | |
[String] $Name | |
[String] $Value | |
[PRTGUnit] $Unit | |
} | |
class PRTGFloatChannel : PRTGChannel { | |
} | |
class PRTGIntegerChannel : PRTGChannel { | |
} | |
function New-PRTGChannel { | |
[CmdletBinding()] | |
param ( | |
# Channel Name | |
[Parameter(Mandatory=$true)] | |
[string] | |
$Name, | |
# Value | |
[Parameter(Mandatory=$true)] | |
[string] | |
$Value, | |
# Unit | |
[Parameter()] | |
[ValidateSet("BytesBandwidth","BytesMemory","BytesDisk","Temperature","Percent","TimeResponse","TimeSeconds","Custom","Count","BytesFile","SpeedDisk","SpeedNet","TimeHours")] | |
[string] | |
$Unit | |
) | |
DynamicParam { | |
$ParameterName = Unit | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment