There is a salt-master and a number of salt-minion machines .

How to view (in a readable form) information collected about minion- s (especially important for cases when minion is not available)?

because it is clearly present (in binary form) in the files /var/cache/salt/master/minions/*/data.p :

 $ sudo cat /var/cache/salt/master/minions/minion001/data.p | hexdump -C | head 00000000 82 a6 70 69 6c 6c 61 72 80 a6 67 72 61 69 6e 73 |..pillar..grains| 00000010 de 00 3b ab 62 69 6f 73 76 65 72 73 69 6f 6e af |..;.biosversion.| 00000020 43 43 43 4e 31 38 57 57 28 56 32 2e 30 34 29 a6 |CCCN18WW(V2.04).| 00000030 6b 65 72 6e 65 6c a5 4c 69 6e 75 78 a6 64 6f 6d |kernel.Linux.dom| 00000040 61 69 6e a0 aa 7a 6d 71 76 65 72 73 69 6f 6e a5 |ain..zmqversion.| 00000050 34 2e 31 2e 34 ad 6b 65 72 6e 65 6c 72 65 6c 65 |4.1.4.kernelrele| 00000060 61 73 65 b0 34 2e 34 2e 30 2d 32 31 2d 67 65 6e |ase.4.4.0-21-gen| 00000070 65 72 69 63 aa 70 79 74 68 6f 6e 70 61 74 68 9b |eric.pythonpath.| 00000080 a8 2f 75 73 72 2f 62 69 6e b2 2f 75 73 72 2f 6c |./usr/bin./usr/l| 00000090 69 62 2f 70 79 74 68 6f 6e 32 2e 37 da 00 26 2f |ib/python2.7..&/| 
  • This is not a question-answer. I really did not find the answer either from the search engines or diagonally in the viewed documentation. - aleksandr barakin 4:34
  • Here is something similar. stackoverflow.com/q/19724347/2790048 - Nick Volynkin
  • @NickVolynkin, thanks, I've already read about this in search engines and in documentation. Alas, these are requests to working minions , and not sampling from the cache. alas, it does not work with minions currently inaccessible . - aleksandr barakin

1 answer 1

You can view information collected about the minion with the help of the following command :

 $ sudo salt-run cache.grains имя-minion-а 

example output (first ten lines):

 имя-minion-а ---------- SSDs: biosreleasedate: 11/11/2015 biosversion: CCCN18WW(V2.04) cpu_flags: - fpu - vme 

about all minions :

 $ sudo salt-run cache.grains '*' 

or even without arguments:

 $ sudo salt-run cache.grains 

There is a lot of information:

 $ sudo salt-run cache.grains имя-minion-а | wc -l 304 

and most importantly, what was required - it is taken from the cache, without reference to the minion- s, which at this moment can be turned off.