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.
How can I get the free memory available on minions using on salt?
-
02-07-2022 - |
質問
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.
解決 5
他のヒント
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.