문제

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

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top