Telegraf: Input Plugins: Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 7: | Zeile 7: | ||
== PowerShell Module "PSInfluxLineConverter" == | == 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.'' <br> | ''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.'' <br> | ||
− | More informations on my [https://github.com/R-Studio/ | + | More informations on my [https://github.com/R-Studio/PSInfluxLineConvert Github Project-Page]. |
Aktuelle Version vom 26. November 2021, 09:15 Uhr
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.
Example: PowerShell-Skript that gets informations about the VHD (and converted with the PowerShell Module "PSInfluxLineConverter")
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