Get linux process metrics for Mackerel and Sensu.
For example ...
- Page swapped (swap)
- Connections each network service primitives (netstat)
- Disk read time (diskstats)
- Interrupts (proc_stat)
- Context switches
- Forks
- Login users (users)
- Linux Kernel 2.6.32 or above.
First, build this program.
go get github.com/mackerelio/mackerel-agent-plugins
cd $(go env GOPATH)/src/github.com/mackerelio/mackerel-agent-plugins/mackerel-plugin-linux
go test
go build
Next, you can execute this program :-)
./mackerel-plugin-linux
Finally, if you want to get linux metrics via Mackerel, please edit mackerel-agent.conf. For example is below.
[plugin.metrics.linux]
command = "/path/to/mackerel-plugin-linux"
Please execute 'mackerel-plugin-linux -h' and you can get command line options.
This program to use as reference from Percona Monitoring Plugins for Cacti.