Telegraf: Input Plugins: Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „= exec = timeout = "1m" <br> data_format = "influx" <br> PowerShell Parameter = -NoProfile <br> == PowerShell Module "PSInfluxLineConverter" == ''PowerShell…“) |
Admin (Diskussion | Beiträge) |
||
Zeile 26: | Zeile 26: | ||
$VHDs = (Get-VM).Id | ForEach {Get-VHD -Id $_} | select Path, DiskIdentifier, VhdFormat, VhdType, Size, MinimumSize, FileSize, LogicalSectorSize, PhysicalSectorSize, BlockSize, FragmentationPercentage | $VHDs = (Get-VM).Id | ForEach {Get-VHD -Id $_} | select Path, DiskIdentifier, VhdFormat, VhdType, Size, MinimumSize, FileSize, LogicalSectorSize, PhysicalSectorSize, BlockSize, FragmentationPercentage | ||
$VHDs | ConvertTo-Metric -Measure hyperv_vhd -MetricProperty Size, MinimumSize, FileSize, LogicalSectorSize, PhysicalSectorSize, BlockSize, FragmentationPercentage -TagProperty Path, DiskIdentifier, VhdFormat, VhdType | ConvertTo-InfluxLineString | $VHDs | ConvertTo-Metric -Measure hyperv_vhd -MetricProperty Size, MinimumSize, FileSize, LogicalSectorSize, PhysicalSectorSize, BlockSize, FragmentationPercentage -TagProperty Path, DiskIdentifier, VhdFormat, VhdType | ConvertTo-InfluxLineString | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Version vom 6. Mai 2020, 09:45 Uhr
Inhaltsverzeichnis
exec
timeout = "1m"
data_format = "influx"
PowerShell Parameter = -NoProfile
PowerShell Module "PSInfluxLineConverter"
PowerShell module to convert PowerShell outputs for Telegraf agent to the InfluxLine-Protocol. The Telegraf agents reads the converted outputs and send this to an InfluxDB.
More informations on my [Github Project-Page]https://github.com/R-Studio/PSInfluxLineConverter.
Examples
PowerShell-Skript Get-VHD (with PowerShell Module)
Telegraf Configuration
[[inputs.exec]] commands = ['powershell -NoProfile -File "C:\Program Files\Telegraf\scripts\input.vhd.ps1"'] data_format = "influx" timeout = "1m"
PowerShell-Skript "input.vhd.ps1"
- Install the PowerShell-Module "PSInfluxLineConverter" first, or copy the module to a destination (in this example: "C:\Program Files\Telegraf\scripts\psmodules\PSInfluxLineConverter")
Import-Module 'C:\Program Files\Telegraf\scripts\psmodules\PSInfluxLineConverter' -Force $VHDs = (Get-VM).Id | ForEach {Get-VHD -Id $_} | select Path, DiskIdentifier, VhdFormat, VhdType, Size, MinimumSize, FileSize, LogicalSectorSize, PhysicalSectorSize, BlockSize, FragmentationPercentage $VHDs | ConvertTo-Metric -Measure hyperv_vhd -MetricProperty Size, MinimumSize, FileSize, LogicalSectorSize, PhysicalSectorSize, BlockSize, FragmentationPercentage -TagProperty Path, DiskIdentifier, VhdFormat, VhdType | ConvertTo-InfluxLineString