it-novum / openitcockpit-agent-go

Cross-Platform Monitoring Agent for openITCOCKPIT written in Go
https://openitcockpit.io/download_agent/
Apache License 2.0
5 stars 2 forks source link

Darwin: DiskIO uses CGO #23

Closed jabdr closed 3 years ago

nook24 commented 3 years ago

After searching the web for many hours there is no alternative than using CGO. It looks like the only tool build into macOS is fs_usage -f diskio -t 1 But this displays I/O per process. (I also guess this is used by Activity Monitor in the background).

Tools like iosnoop or iotop depanding on dtrace which is disabled on modern macOS systems.

We will continue using gopsutil which is based on https://github.com/lufia/iostat. This is also used by the Prometheus node_exporter: https://github.com/prometheus/node_exporter/blob/v1.1.2/collector/diskstats_darwin.go#L22