Access OS metrics from Golang
- golang
I’ve recently published StatGo, it gives you access to your operating system metrics like free memory, used disk spaces …
It’s a binding to the C library libstatgrab, a proven stable piece of code that works on many different systems, FreeBSD, Linux, OSX …
It’s very simple to use:
s := NewStat()
c := s.CPUStats()
fmt.Prinln(c.Idle)
98.2
Feel free to contribute, it may need some improvement but it’s working I’m using it in a small metrics web server to monitor small network of servers.