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.
If you have netcat installed, you can check port connectivity from the minion with the nc command: $ nc -v -z salt.
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 .
"salt-key -L" will list all minions that whose public keys you've accepted on your master.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With