How to collect Linux metrics: CPU, Memory, Load Avg etc?

Hi All,
I’m looking for a basic/simple (i.e no prometeus and complicated dependencies) Erlang library to collect Linux’s metrics such as: CPU, Memory, Load Avg, Network R/T (not mandatory) where my node is currently running.
Many thanks.
/Z

2 Likes

There are built-in tools to get CPU and Memory information:

To get some more Linux specific stuff like Load Avg you might want to consider adding a gen_server that periodically sends a message to itsself and call out to system tools using os:cmd/1.

3 Likes

Have a look at https://www.erlang.org/doc/man/snmp.html

You OS is almost certainly capable of exposing every metric you’d ever want via SNMP

3 Likes