Grafana: Top N values: Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „ == Top N values single == === Telegraf configuration === ''Because there is no Perfmon-Counter for the total size of Cluster Shared Volumes (CSV), I wrote a P…“) |
Admin (Diskussion | Beiträge) |
||
Zeile 3: | Zeile 3: | ||
=== Telegraf configuration === | === Telegraf configuration === | ||
''Because there is no Perfmon-Counter for the total size of Cluster Shared Volumes (CSV), I wrote a PowerShell CMDLET.'' | ''Because there is no Perfmon-Counter for the total size of Cluster Shared Volumes (CSV), I wrote a PowerShell CMDLET.'' | ||
+ | <code> | ||
[[inputs.exec]] | [[inputs.exec]] | ||
commands = ['''powershell.exe -NoProfile -Command "Get-Volume | Where-Object {$_.FileSystem -eq 'CSVFS'} | select FileSystemLabel, AllocationUnitSize, Size, SizeRemaining, @{N='SizeUsed';E={$_.Size - $_.SizeRemaining}} | ConvertTo-Json"'''] | commands = ['''powershell.exe -NoProfile -Command "Get-Volume | Where-Object {$_.FileSystem -eq 'CSVFS'} | select FileSystemLabel, AllocationUnitSize, Size, SizeRemaining, @{N='SizeUsed';E={$_.Size - $_.SizeRemaining}} | ConvertTo-Json"'''] | ||
Zeile 9: | Zeile 10: | ||
data_type = "float" | data_type = "float" | ||
tag_keys = ["FileSystemLabel"] | tag_keys = ["FileSystemLabel"] | ||
+ | </code> | ||
+ | |||
Version vom 6. Oktober 2020, 15:30 Uhr
Top N values single
Telegraf configuration
Because there is no Perfmon-Counter for the total size of Cluster Shared Volumes (CSV), I wrote a PowerShell CMDLET.
inputs.exec
commands = [powershell.exe -NoProfile -Command "Get-Volume | Where-Object {$_.FileSystem -eq 'CSVFS'} | select FileSystemLabel, AllocationUnitSize, Size, SizeRemaining, @{N='SizeUsed';E={$_.Size - $_.SizeRemaining}} | ConvertTo-Json"]
name_override = "cluster_csv"
data_format = "json"
data_type = "float"
tag_keys = ["FileSystemLabel"]
InfluxQL in Grafana
SELECT top("UsedSpace (%)","FileSystemLabel",$top) AS "UsedSpace (%)" FROM (
SELECT mean("SizeUsed") * (100 / mean("Size")) AS "UsedSpace (%)" FROM "$rp"."cluster_csv" WHERE $timeFilter GROUP BY "FileSystemLabel"
)
SELECT top("Average","host",$top) AS "Average" FROM (
SELECT sum("Average") AS "Average" FROM ( SELECT ((100 / (mean("Current_Bandwidth") / 8)) * (mean("Bytes_Sent_persec") + mean("Bytes_Received_persec"))) AS "Average" FROM "$rp"."win_net" WHERE $timeFilter AND "host" =~ $hostfilter AND "instance" !~ /^Hyper-V.+/ GROUP BY "host", "instance" ) GROUP BY "host"
)