Search code examples
salt-project

How can I get the free memory available on minions using on salt?


I am looking for a simple way to get information about memory usage, like free memory form the salt minions.

So far I know that the total memory can be listed using salt '*' grains.items but I don't even know how to list only just the total memory instead of the all grains data.

Second problem is that I don't know how to get the free memory returned.


Solution

  • So far, I was able to obtain this information using: salt '*' cmd.run 'free -m -o | grep "Mem"' -- maybe somebody else knows a better/easier way.