Skip to content

Instantly share code, notes, and snippets.

@lwalthert
Created May 3, 2017 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lwalthert/405b9db828662f02929989b00d5b50eb to your computer and use it in GitHub Desktop.
Save lwalthert/405b9db828662f02929989b00d5b50eb to your computer and use it in GitHub Desktop.
PRTG-Sensor-Powershell
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