Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

salt-stack

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.

like image 765
sorin Avatar asked Nov 01 '13 09:11

sorin


People also ask

How do I check my Salt-minion status?

If you have netcat installed, you can check port connectivity from the minion with the nc command: $ nc -v -z salt.

Where do you find Salt-minion ID?

By default, the salt-minion configuration will be in /etc/salt/minion . A notable exception is FreeBSD, where the configuration will be in /usr/local/etc/salt/minion .

How do you list Salt in minions?

"salt-key -L" will list all minions that whose public keys you've accepted on your master.


2 Answers

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

salt '*' grains.item mem_total
like image 93
Jeff Bauer Avatar answered Sep 26 '22 15:09

Jeff Bauer


salt targetminion status.meminfo

If you are parsing this, change the output formatting:

salt targetminion status.meminfo --out=json

like image 34
Dan Garthwaite Avatar answered Sep 25 '22 15:09

Dan Garthwaite