Sometimes my saltmaster hangs for a while on salt '*' test.ping
waiting for downed minions to reply. Is there a way so see a list of connected minions, regardless of whether they respond to test.ping
?
Sometimes my saltmaster hangs for a while on salt '*' test.ping
waiting for downed minions to reply. Is there a way so see a list of connected minions, regardless of whether they respond to test.ping
?
The official answer:
Also useful are:
From the master type:
or:
Entering a faulty salt query (ex. salt '*' -) will also return a list of all the minions each followed by a message stating that the command is not available. You can grep/cut away the extraneous characters. Neither of these options are particularly elegant and the later doesn't address the timeout but it works while I'm looking for an answer to a similar question; "How to list all associated minions via the saltstack python api?".
There are few new commands that makes it much more easier,
salt-run manage.alived
Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions)salt-run manage.allowed
Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions)salt-run manage.not_alived
Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent)salt-run manage.not_allowed
Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent)salt-run manage.not_joined
Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent)"salt-key -L" will list all minions that whose public keys you've accepted on your master.
I think one can use the grains module to achieve this:
To make ping to all minions, try on salt master node: