Question

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.

Was it helpful?

Solution 5

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.

OTHER TIPS

To get the total memory, use grains.item, rather than grains.items:

salt '*' grains.item mem_total

salt targetminion status.meminfo

If you are parsing this, change the output formatting:

salt targetminion status.meminfo --out=json

Better you use Grains for the same:
salt '*' grains.item mem_total
Please refer:
Grains

salt '*' disk.usage should give you details about every partition in the minion. Details as in the available space, capacity usage and so on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top