elastic / elastic-agent-system-metrics

Apache License 2.0
0 stars 22 forks source link

[metric/system/diskio] On Windows network shares are not reported. #154

Open leehinman opened 5 months ago

leehinman commented 5 months ago

In Windows diskio to network mapped drives is not reported.

  1. use net use to map a network drive. net use Z: \\VBOXSVR\vagrant
  2. in cmd.exe switch to the drive. Z:
  3. start metricbeat with system module enabled and just diskio metricset
  4. in cmd.exe create some disk io. echo "some long string" > newfile.txt

We do see events for the C: drive, but nothing for the Z: drive.

We do see the following error:

{"log.level":"error","@timestamp":"2024-05-28T09:16:49.163-0700","log.origin":{"function":"github.com/elastic/elastic-agent-system-metrics/metric/system/diskio.ioCounters","file.name":"diskio/diskstat_windows_helper.go","file.line":75},"message":"Could not return any performance counter values for \\\\.\\Z: .Error: Incorrect function.","service.name":"metricbeat","ecs.version":"1.6.0"}

We need to either fix or update the documentation for windows diskio that network drives will not be reported.

nerophon commented 5 months ago

It looks like the problem may be here: https://github.com/shirou/gopsutil/blob/master/disk/disk_windows.go#L202