"Available" and "used" memory metrics aren't collected by DataSet's Linux system module, so how can you retrieve stats that aren't available out of the box?
You could use a shell monitor to get the "available" memory of the server. Adding the following config to agent.json should do it.
{
"monitors": [
{
"module": "scalyr_agent.builtin_monitors.shell_monitor",
"id": "report available memory",
"command": "free -m | grep Mem | awk '{print $7}'"
}
]
}
Basically, it executes the bash command on the server and the output result is forwarded to the DataSet server. You can then parse the output value to set up the alert.
Here is a sample log event of the shell monitor using the above monitor configuration.
The field "value" is taken from the "available" output of "free-m".
[centos@ip-172-31-29-136 ~]$ free -m
total used free shared buff/cache available
Mem: 990 383 65 56 540 361
Comments
0 comments
Please sign in to leave a comment.