Hello,
I have a w10 pro with telegraf-influx-grafana
I need to send to influxdb the disk name example
C: “Local”
D: “Data”
Now with the telegranf.conf only i get the instance (letter C,D, etc)
I put this part of code:
[[inputs.win_perf_counters.object]]
# Disk times and queues
ObjectName = "LogicalDisk"
Instances = ["*"]
Counters = [
"% Idle Time",
"% Disk Time",
"% Disk Read Time",
"% Disk Write Time",
"% User Time",
"% Free Space",
"Current Disk Queue Length",
"Free Megabytes",
"Disk Read Bytes/sec",
"Disk Write Bytes/sec",
"Avg. Disk Queue Length",
"Split IO/Sec"
]
Measurement = "win_disk"
# Set to true to include _Total instance when querying for all (*).
#IncludeTotal=false
I make a shell script and try to get the names, seems work if i send to a csv but i dont sure how send to influx
$disks = Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID, VolumeName
foreach ($disk in $disks) {
$volumeName = $disk.Label
Write-Output $volumeName
}
I dont sure if it is correct, i dont use shellscript usually…
I would like the “volumeName” go to win_disk measurement as a tag but i dont sure if is even possible…is ok to another measurement
The conf to telegraf to execute the script is
[[inputs.exec]]
interval = "3h"
commands = [
'powershell "C:\telegraf\telegraf.d\get_info.ps1"'
]
timeout = "2m"
data_format = "influx"