Projet

Général

Profil

ClientSalt » Historique » Version 33

Gérald Schwartzmann, 29/06/2018 09:55

1 1 Joël Cuissinat
h1. Utilisation de Salt pour remplacer le client Scribe
2 1 Joël Cuissinat
3 6 Joël Cuissinat
{{>toc}}
4 6 Joël Cuissinat
5 1 Joël Cuissinat
h2. Mise en place sur le module
6 1 Joël Cuissinat
7 1 Joël Cuissinat
Les paquets nécessaires sont déjà en place sur un module Seth ou un module Scribe car ils sont nécessaires à l'EAD3.
8 1 Joël Cuissinat
Dans le cadre de ScribeAD, on pourrait envisager d'installer le paquet *salt-master* dans le conteneur _addc_.
9 1 Joël Cuissinat
10 4 Joël Cuissinat
Le service salt-master doit être activé (même si l'EAD3 est désactivé !) et les minions (clients) doivent pouvoir accéder aux ports 4405 et 4406 du master.
11 4 Joël Cuissinat
L'extrait de dictionnaire Creole suivant force l'activation du service (utilisation d'une balise conteneur pour contourner #10956) et ouvre l'accès _eole-firewall_ :
12 1 Joël Cuissinat
<pre>
13 4 Joël Cuissinat
    <containers>
14 4 Joël Cuissinat
        <container name='fichier'>
15 30 Joël Cuissinat
            <service>salt-master</service>
16 4 Joël Cuissinat
            <service_access service='salt-master'>
17 4 Joël Cuissinat
                <port>4505</port>
18 4 Joël Cuissinat
                <port>4506</port>
19 4 Joël Cuissinat
            </service_access>
20 4 Joël Cuissinat
        </container>
21 4 Joël Cuissinat
    </containers>
22 1 Joël Cuissinat
</pre>
23 1 Joël Cuissinat
24 1 Joël Cuissinat
h2. Mise en place sur les clients
25 1 Joël Cuissinat
26 31 Gérald Schwartzmann
h2. Installation par setup
27 31 Gérald Schwartzmann
28 1 Joël Cuissinat
Pour les premières maquettes, nous installons manuellement la dernière version de Salt-Minion à partir de l'exécutable officiel (Python3 AMD64) : https://docs.saltstack.com/en/latest/topics/installation/windows.html
29 2 Joël Cuissinat
30 2 Joël Cuissinat
À l'étape *Minion Settings* :
31 2 Joël Cuissinat
* sélectionner *Default Config*
32 2 Joël Cuissinat
* renseigner Master IP or Hostname avec l'IP du master (exemple : 10.1.3.5 pour etb1.scribe)
33 11 Klaas TJEBBES
* laisser *_hostname_* dans *_Minion Name:_* (c'est un mot clé, "hostname" ne sera pas renseigné dans la configuration et Minion utilisera "socket.getfqdn()" pour savoir quel nom renvoyer au Master)
34 3 Joël Cuissinat
35 3 Joël Cuissinat
NB : Le fichier de configuration du Minion est disponible dans @C:\salt\conf\minion@
36 31 Gérald Schwartzmann
37 31 Gérald Schwartzmann
h3. Installation silencieuse
38 31 Gérald Schwartzmann
39 31 Gérald Schwartzmann
<pre>
40 31 Gérald Schwartzmann
Salt-Minion-2017.7.1-Py2-AMD64-Setup.exe /S /master=yoursaltmaster /minion-name=yourminionname
41 31 Gérald Schwartzmann
</pre>
42 5 Joël Cuissinat
43 32 Gérald Schwartzmann
Sans démarrer le service
44 32 Gérald Schwartzmann
45 32 Gérald Schwartzmann
<pre>
46 32 Gérald Schwartzmann
Salt-Minion-2017.7.1-Py3-AMD64-Setup.exe /S /master=yoursaltmaster /minion-name=yourminionname /start-minion=0
47 32 Gérald Schwartzmann
</pre>
48 32 Gérald Schwartzmann
49 32 Gérald Schwartzmann
Spécifier le fichier de configuration et enregistrement multimaster
50 32 Gérald Schwartzmann
51 32 Gérald Schwartzmann
<pre>
52 32 Gérald Schwartzmann
Salt-Minion-2017.7.1-Py3-AMD64-Setup.exe /S /custom-config=windows_minion /master=prod_master1,prod_master2
53 32 Gérald Schwartzmann
</pre>
54 32 Gérald Schwartzmann
55 5 Joël Cuissinat
h2. Enregistrement du minion
56 5 Joël Cuissinat
57 12 Klaas TJEBBES
* Le Minion apparaît dans la liste des clés à accepter :
58 12 Klaas TJEBBES
59 5 Joël Cuissinat
<pre>
60 5 Joël Cuissinat
root@scribe:~# salt-key -L
61 5 Joël Cuissinat
Accepted Keys:
62 5 Joël Cuissinat
Denied Keys:
63 5 Joël Cuissinat
Unaccepted Keys:
64 5 Joël Cuissinat
PC-124784.ac-test.fr
65 5 Joël Cuissinat
Rejected Keys:
66 1 Joël Cuissinat
</pre>
67 1 Joël Cuissinat
68 12 Klaas TJEBBES
* Accepter la clé :
69 12 Klaas TJEBBES
70 5 Joël Cuissinat
<pre>
71 5 Joël Cuissinat
root@scribe:~# salt-key -y -a PC-124784.ac-test.fr
72 5 Joël Cuissinat
The following keys are going to be accepted:
73 5 Joël Cuissinat
Unaccepted Keys:
74 5 Joël Cuissinat
PC-124784.ac-test.fr
75 1 Joël Cuissinat
Key for minion PC-124784.ac-test.fr accepted.
76 1 Joël Cuissinat
</pre>
77 5 Joël Cuissinat
78 12 Klaas TJEBBES
* Supprimer la clé :
79 12 Klaas TJEBBES
80 1 Joël Cuissinat
<pre>
81 1 Joël Cuissinat
root@scribe:~# salt-key -d PC-124784.ac-test.fr
82 7 Joël Cuissinat
</pre>
83 7 Joël Cuissinat
84 12 Klaas TJEBBES
* Accepter toutes les clés :
85 12 Klaas TJEBBES
86 7 Joël Cuissinat
<pre>
87 7 Joël Cuissinat
root@scribe:~# salt-key -A
88 7 Joël Cuissinat
</pre>
89 7 Joël Cuissinat
90 1 Joël Cuissinat
h2. Commandes basiques
91 8 Joël Cuissinat
92 8 Joël Cuissinat
h3. Test du Minion
93 9 Joël Cuissinat
94 8 Joël Cuissinat
<pre>
95 8 Joël Cuissinat
root@scribe:~# salt PC-124784.ac-test.fr  test.ping 
96 1 Joël Cuissinat
PC-124784.ac-test.fr:
97 1 Joël Cuissinat
    True
98 1 Joël Cuissinat
</pre>
99 1 Joël Cuissinat
100 33 Gérald Schwartzmann
Gestion du timeout : https://dev-eole.ac-dijon.fr/projects/scribe/wiki/MigrationAD#Gestion-du-Timeout
101 19 Joël Cuissinat
102 19 Joël Cuissinat
h3. Redémarrage du PC
103 19 Joël Cuissinat
104 19 Joël Cuissinat
* Immédiat
105 19 Joël Cuissinat
106 19 Joël Cuissinat
<pre>
107 19 Joël Cuissinat
salt PC-124784.ac-test.fr system.reboot 0
108 19 Joël Cuissinat
</pre>
109 19 Joël Cuissinat
110 19 Joël Cuissinat
<pre>
111 19 Joël Cuissinat
salt 'PC-12511.ac-test.fr' cmd.run 'shutdown /r /t 0 /f'
112 19 Joël Cuissinat
</pre>
113 19 Joël Cuissinat
114 19 Joël Cuissinat
* 5 secondes
115 19 Joël Cuissinat
116 19 Joël Cuissinat
<pre>
117 19 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' system.reboot 5 True
118 19 Joël Cuissinat
</pre>
119 19 Joël Cuissinat
120 19 Joël Cuissinat
_Par défaut, le timeout s'exprime en minutes. Il est possible de l'exprimer en seconde en passant le second paramètre à True :)_
121 19 Joël Cuissinat
122 19 Joël Cuissinat
h2. Gestion des clients Microsoft
123 19 Joël Cuissinat
124 19 Joël Cuissinat
h3. Documentation
125 19 Joël Cuissinat
126 19 Joël Cuissinat
* Module win_system : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_system.html
127 19 Joël Cuissinat
* Module win_dns_client : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_dns_client.html
128 23 Joël Cuissinat
* Module win_network : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_network.html
129 25 Joël Cuissinat
* Module win_lgpo : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_lgpo.html
130 19 Joël Cuissinat
131 24 Joël Cuissinat
h3. Interrogations diverses
132 24 Joël Cuissinat
133 24 Joël Cuissinat
<pre>
134 24 Joël Cuissinat
root@scribe:~# salt 'PC-124784.ac-test.fr' system.get_computer_name
135 24 Joël Cuissinat
PC-124784.ac-test.fr:
136 24 Joël Cuissinat
    PC-CDI1
137 24 Joël Cuissinat
</pre>
138 24 Joël Cuissinat
139 24 Joël Cuissinat
<pre>
140 24 Joël Cuissinat
root@scribe:~# salt 'PC-124784.ac-test.fr' system.get_domain_workgroup
141 24 Joël Cuissinat
PC-124784.ac-test.fr:
142 24 Joël Cuissinat
    ----------
143 24 Joël Cuissinat
    Domain:
144 24 Joël Cuissinat
        etb1.lan
145 24 Joël Cuissinat
</pre>
146 24 Joël Cuissinat
147 24 Joël Cuissinat
<pre>
148 24 Joël Cuissinat
root@scribe:~# salt 'PC-124784.ac-test.fr' system.get_system_date 
149 24 Joël Cuissinat
PC-124784.ac-test.fr:
150 24 Joël Cuissinat
    05/04/2018
151 24 Joël Cuissinat
</pre>
152 24 Joël Cuissinat
153 24 Joël Cuissinat
154 24 Joël Cuissinat
155 15 Joël Cuissinat
h3. Renommage du PC
156 15 Joël Cuissinat
157 15 Joël Cuissinat
<pre>
158 15 Joël Cuissinat
root@scribe:~# salt PC-124784.ac-test.fr system.set_computer_name PC-CDI1
159 15 Joël Cuissinat
PC-124784.ac-test.fr:
160 15 Joël Cuissinat
    ----------
161 15 Joël Cuissinat
    Computer Name:
162 15 Joël Cuissinat
        ----------
163 15 Joël Cuissinat
        Current:
164 15 Joël Cuissinat
            PC-125292
165 15 Joël Cuissinat
        Pending:
166 15 Joël Cuissinat
            PC-CDI1
167 15 Joël Cuissinat
</pre>
168 15 Joël Cuissinat
169 15 Joël Cuissinat
Le renommage ne sera effectif qu'après redémarrage du poste client.
170 20 Joël Cuissinat
Évidemment le renommage du poste ne modifie pas le nom du Minion !
171 20 Joël Cuissinat
172 22 Joël Cuissinat
h3. Jonction au domaine
173 20 Joël Cuissinat
174 20 Joël Cuissinat
<pre>
175 20 Joël Cuissinat
salt PC-124784.ac-test.fr system.join_domain domain='etb1.lan' username='admin' password='eole' account_exists=False restart=True
176 20 Joël Cuissinat
</pre>
177 20 Joël Cuissinat
178 20 Joël Cuissinat
Si on relance la commande une seconde fois, on obtient le message suivant :
179 20 Joël Cuissinat
<pre>
180 20 Joël Cuissinat
PC-124784.ac-test.fr:
181 20 Joël Cuissinat
Already joined to etb1.lan
182 22 Joël Cuissinat
</pre>
183 15 Joël Cuissinat
184 1 Joël Cuissinat
h3. Changer le DNS
185 1 Joël Cuissinat
186 1 Joël Cuissinat
* Récupérer le nom de l'interface réseau du client, 192.168.0.5=<ip salt master> => on récupère le nom de la bonne interface s'il y en a plusieurs
187 1 Joël Cuissinat
188 1 Joël Cuissinat
<pre>
189 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' network.get_route 192.168.0.5
190 13 Klaas TJEBBES
</pre>
191 13 Klaas TJEBBES
192 13 Klaas TJEBBES
<pre>
193 1 Joël Cuissinat
root@dc1:~# salt 'PC-124784.ac-test.fr' network.get_route 192.168.0.5
194 1 Joël Cuissinat
PC-124784.ac-test.fr:
195 1 Joël Cuissinat
    ----------
196 1 Joël Cuissinat
    destination:
197 13 Klaas TJEBBES
        192.168.0.5
198 18 Klaas TJEBBES
    gateway:
199 18 Klaas TJEBBES
        0.0.0.0
200 18 Klaas TJEBBES
    interface:
201 18 Klaas TJEBBES
        MonInterface
202 18 Klaas TJEBBES
    source:
203 18 Klaas TJEBBES
        192.168.0.184
204 18 Klaas TJEBBES
</pre>
205 18 Klaas TJEBBES
206 18 Klaas TJEBBES
<pre>
207 18 Klaas TJEBBES
salt 'PC-124784.ac-test.fr' ip.set_static_dns MonInterface 192.168.0.5
208 18 Klaas TJEBBES
</pre>
209 18 Klaas TJEBBES
210 26 Joël Cuissinat
h3. Gestion des GPO
211 26 Joël Cuissinat
212 26 Joël Cuissinat
Lister toutes les GPO du poste :
213 26 Joël Cuissinat
<pre>
214 26 Joël Cuissinat
salt 'PC-124784.ac-test.fr' lgpo.get machine return_full_policy_names=True
215 26 Joël Cuissinat
</pre>
216 26 Joël Cuissinat
217 28 Joël Cuissinat
<pre>
218 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.get_policy_info 'Maximum password age' machine
219 28 Joël Cuissinat
PC-125292.etb1.lan:
220 28 Joël Cuissinat
    ----------
221 28 Joël Cuissinat
    message:
222 28 Joël Cuissinat
    policy_aliases:
223 28 Joël Cuissinat
        - MaxPasswordAge
224 28 Joël Cuissinat
    policy_class:
225 28 Joël Cuissinat
        machine
226 28 Joël Cuissinat
    policy_elements:
227 28 Joël Cuissinat
    policy_found:
228 28 Joël Cuissinat
        True
229 28 Joël Cuissinat
    policy_name:
230 28 Joël Cuissinat
        Maximum password age
231 28 Joël Cuissinat
    rights_assignment:
232 28 Joël Cuissinat
        False
233 28 Joël Cuissinat
</pre>
234 28 Joël Cuissinat
235 28 Joël Cuissinat
<pre>
236 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.get_policy_info 'Account lockout duration' machine
237 28 Joël Cuissinat
PC-125292.etb1.lan:
238 28 Joël Cuissinat
    ----------
239 28 Joël Cuissinat
    message:
240 28 Joël Cuissinat
    policy_aliases:
241 28 Joël Cuissinat
        - LockoutDuration
242 28 Joël Cuissinat
    policy_class:
243 28 Joël Cuissinat
        machine
244 28 Joël Cuissinat
    policy_elements:
245 28 Joël Cuissinat
    policy_found:
246 28 Joël Cuissinat
        True
247 28 Joël Cuissinat
    policy_name:
248 28 Joël Cuissinat
        Account lockout duration
249 28 Joël Cuissinat
    rights_assignment:
250 28 Joël Cuissinat
        False
251 28 Joël Cuissinat
root@scribe:~#
252 28 Joël Cuissinat
</pre>
253 28 Joël Cuissinat
254 28 Joël Cuissinat
<pre>
255 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.set computer_policy="{'LockoutDuration': 90}"
256 28 Joël Cuissinat
PC-125292.etb1.lan:
257 28 Joël Cuissinat
    True
258 28 Joël Cuissinat
root@scribe:~#
259 28 Joël Cuissinat
</pre>
260 28 Joël Cuissinat
261 28 Joël Cuissinat
ou
262 28 Joël Cuissinat
263 28 Joël Cuissinat
<pre>
264 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.set_computer_policy LockoutDuration 1440
265 28 Joël Cuissinat
PC-125292.etb1.lan:
266 28 Joël Cuissinat
    True
267 28 Joël Cuissinat
root@scribe:~#
268 28 Joël Cuissinat
</pre>
269 29 Joël Cuissinat
270 27 Joël Cuissinat
Application mise à disposition par Microsoft qui recense les GPO : http://gpsearch.azurewebsites.net/default.aspx?ref=1#10677
271 29 Joël Cuissinat
272 27 Joël Cuissinat
273 1 Joël Cuissinat
h3. Autre
274 1 Joël Cuissinat
275 1 Joël Cuissinat
<pre>
276 1 Joël Cuissinat
salt 'PC-12511.ac-test.fr' cmd.run notepad.exe
277 1 Joël Cuissinat
</pre>
278 1 Joël Cuissinat
279 1 Joël Cuissinat
<pre>
280 1 Joël Cuissinat
salt '*ac-test.fr' sys.list_functions
281 1 Joël Cuissinat
salt '*ac-test.fr' sys.list_state_functions
282 1 Joël Cuissinat
</pre>
283 1 Joël Cuissinat
284 1 Joël Cuissinat
<pre>
285 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' win_dns_client.get_dns_config
286 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' win_dns_client.add_dns 8.8.8.8 "Ethernet" 1
287 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' cmd.run "netsh interface ip show config"
288 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' cmd.run "CHCP 1252 & netsh interface ip show config"
289 1 Joël Cuissinat
</pre>
290 1 Joël Cuissinat
291 1 Joël Cuissinat
<pre>
292 1 Joël Cuissinat
salt -G 'os_family:Windows' network.interfaces
293 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' network.interfaces
294 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' network.interfaces_names
295 1 Joël Cuissinat
</pre>
296 1 Joël Cuissinat
297 1 Joël Cuissinat
h3. Commandes non fonctionnelles 
298 1 Joël Cuissinat
299 1 Joël Cuissinat
Les commandes suivantes ne fonctionne pas :
300 1 Joël Cuissinat
301 1 Joël Cuissinat
<pre>
302 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' ip.get_all_interfaces
303 1 Joël Cuissinat
</pre> 
304 1 Joël Cuissinat
<pre>
305 18 Klaas TJEBBES
salt -G 'os_family:Windows' ip.get_all_interfaces
306 18 Klaas TJEBBES
</pre>
307 18 Klaas TJEBBES
308 18 Klaas TJEBBES
h2. Voir les logs du client depuis le serveur (avec _tail_ par ex.)
309 18 Klaas TJEBBES
310 18 Klaas TJEBBES
* Monter C$ pour accéder au système de fichiers du client
311 18 Klaas TJEBBES
312 18 Klaas TJEBBES
<pre>
313 18 Klaas TJEBBES
root@dc1:~# mount -t cifs //PC-12511.ac-test.fr/C$ /mnt/ -o username=admin,password='Eole;2121',vers=3.0,ip=192.168.0.181
314 18 Klaas TJEBBES
# notez le "vers=3.0" pour éviter l'erreur "host is down"
315 18 Klaas TJEBBES
</pre>
316 18 Klaas TJEBBES
317 18 Klaas TJEBBES
* changer le log level (vim ou nano sur le fichier devrait fonctionner, sinon notepad depuis windows)
318 18 Klaas TJEBBES
319 18 Klaas TJEBBES
<pre>
320 18 Klaas TJEBBES
root@dc1:~# grep log_level /mnt/salt/conf/minion
321 18 Klaas TJEBBES
#log_level: warning
322 18 Klaas TJEBBES
log_level: info
323 18 Klaas TJEBBES
</pre>
324 18 Klaas TJEBBES
325 18 Klaas TJEBBES
<pre>
326 18 Klaas TJEBBES
root@dc1:~# tail -f /mnt/salt/var/log/salt/minion
327 18 Klaas TJEBBES
</pre>
328 18 Klaas TJEBBES
329 18 Klaas TJEBBES
330 18 Klaas TJEBBES
* MS-DOS :
331 18 Klaas TJEBBES
332 18 Klaas TJEBBES
<pre>
333 18 Klaas TJEBBES
sc stop salt-minion
334 18 Klaas TJEBBES
rem attendre qques secondes que ça s'arrête effectivement
335 18 Klaas TJEBBES
sc start salt-minion
336 18 Klaas TJEBBES
</pre>
337 18 Klaas TJEBBES
338 18 Klaas TJEBBES
339 18 Klaas TJEBBES
h2. Erreur "Minion did not return. [No response]"
340 18 Klaas TJEBBES
341 18 Klaas TJEBBES
<pre>
342 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functions
343 18 Klaas TJEBBES
PC-12511.ac-test.fr:
344 18 Klaas TJEBBES
    Minion did not return. [No response]
345 18 Klaas TJEBBES
</pre>
346 18 Klaas TJEBBES
347 18 Klaas TJEBBES
<pre>
348 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functionsA
349 18 Klaas TJEBBES
PC-12511.ac-test.fr:
350 18 Klaas TJEBBES
    Minion did not return. [No response]
351 18 Klaas TJEBBES
</pre>
352 18 Klaas TJEBBES
353 18 Klaas TJEBBES
<pre>
354 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functionsA -t 15
355 18 Klaas TJEBBES
PC-12511.ac-test.fr:
356 18 Klaas TJEBBES
    'sys.list_functionsA' is not available.
357 18 Klaas TJEBBES
ERROR: Minions returned with non-zero exit code
358 18 Klaas TJEBBES
</pre>
359 18 Klaas TJEBBES
360 18 Klaas TJEBBES
<pre>
361 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functions -t 15
362 18 Klaas TJEBBES
PC-12511.ac-test.fr:
363 18 Klaas TJEBBES
    - aliases.get_target
364 18 Klaas TJEBBES
    - aliases.has_target
365 18 Klaas TJEBBES
    - aliases.list_aliases
366 18 Klaas TJEBBES
    - aliases.rm_alias
367 18 Klaas TJEBBES
    - aliases.set_target
368 18 Klaas TJEBBES
    - archive.cmd_unzip
369 18 Klaas TJEBBES
    [...]
370 18 Klaas TJEBBES
    - zenoss.set_prod_state
371 18 Klaas TJEBBES
372 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_state_functions -t 15
373 18 Klaas TJEBBES
PC-12511.ac-test.fr:
374 18 Klaas TJEBBES
    - alias.absent
375 18 Klaas TJEBBES
    - alias.present
376 18 Klaas TJEBBES
    - archive.extracted
377 18 Klaas TJEBBES
    - artifactory.downloaded
378 18 Klaas TJEBBES
    - beacon.absent
379 18 Klaas TJEBBES
    - beacon.disabled
380 18 Klaas TJEBBES
    - beacon.enabled
381 18 Klaas TJEBBES
    - beacon.present
382 18 Klaas TJEBBES
</pre>
383 18 Klaas TJEBBES
384 18 Klaas TJEBBES
385 18 Klaas TJEBBES
386 18 Klaas TJEBBES
387 18 Klaas TJEBBES
h2. _tcpdump_ pour voir comment est exécutée une commande  :
388 18 Klaas TJEBBES
389 18 Klaas TJEBBES
* pendant
390 18 Klaas TJEBBES
391 18 Klaas TJEBBES
<pre>
392 18 Klaas TJEBBES
root@dc1:~# date; salt 'PC-12511.ac-test.fr' test.ping; date
393 18 Klaas TJEBBES
vendredi 4 mai 2018, 11:05:22 (UTC+0200)
394 18 Klaas TJEBBES
PC-12511.ac-test.fr:
395 18 Klaas TJEBBES
    True
396 18 Klaas TJEBBES
vendredi 4 mai 2018, 11:05:34 (UTC+0200)
397 18 Klaas TJEBBES
</pre>
398 18 Klaas TJEBBES
399 18 Klaas TJEBBES
* il se passe
400 18 Klaas TJEBBES
401 18 Klaas TJEBBES
<pre>
402 18 Klaas TJEBBES
root@dc1:~# tcpdump -nni any host 192.168.0.181
403 18 Klaas TJEBBES
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
404 18 Klaas TJEBBES
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
405 18 Klaas TJEBBES
11:05:23.512624 IP 192.168.0.5.4505 > 192.168.0.181.62346: Flags [P.], seq 2666401297:2666401476, ack 3424014703, win 229, length 179
406 18 Klaas TJEBBES
11:05:23.560410 IP 192.168.0.181.62346 > 192.168.0.5.4505: Flags [.], ack 179, win 2052, length 0
407 18 Klaas TJEBBES
11:05:28.520941 ARP, Request who-has 192.168.0.181 tell 192.168.0.5, length 28
408 18 Klaas TJEBBES
11:05:28.522143 ARP, Reply 192.168.0.181 is-at 02:00:c0:a8:00:66, length 46
409 18 Klaas TJEBBES
11:05:28.639886 IP 192.168.0.5.4505 > 192.168.0.181.62346: Flags [P.], seq 179:390, ack 1, win 229, length 211
410 18 Klaas TJEBBES
11:05:28.685272 IP 192.168.0.181.62346 > 192.168.0.5.4505: Flags [.], ack 390, win 2051, length 0
411 18 Klaas TJEBBES
11:05:34.192625 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [S], seq 3979318635, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
412 18 Klaas TJEBBES
11:05:34.192773 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [S.], seq 1292250989, ack 3979318636, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
413 18 Klaas TJEBBES
11:05:34.193296 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [.], ack 1, win 256, length 0
414 18 Klaas TJEBBES
11:05:34.193613 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [P.], seq 1:11, ack 1, win 229, length 10
415 18 Klaas TJEBBES
11:05:34.193669 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [P.], seq 1:11, ack 1, win 256, length 10
416 18 Klaas TJEBBES
11:05:34.193690 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [.], ack 11, win 229, length 0
417 18 Klaas TJEBBES
11:05:34.193809 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [P.], seq 11:12, ack 11, win 229, length 1
418 18 Klaas TJEBBES
11:05:34.194073 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [.], ack 12, win 256, length 0
419 18 Klaas TJEBBES
11:05:34.194393 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [P.], seq 11:65, ack 12, win 256, length 54
420 18 Klaas TJEBBES
11:05:34.194525 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [P.], seq 12:65, ack 65, win 229, length 53
421 18 Klaas TJEBBES
11:05:34.194573 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [P.], seq 65:108, ack 65, win 229, length 43
422 18 Klaas TJEBBES
11:05:34.194879 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [.], ack 108, win 256, length 0
423 18 Klaas TJEBBES
11:05:34.194977 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [P.], seq 65:105, ack 108, win 256, length 40
424 18 Klaas TJEBBES
11:05:34.196240 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [S], seq 2078233463, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
425 18 Klaas TJEBBES
11:05:34.196318 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [S.], seq 3541933958, ack 2078233464, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
426 18 Klaas TJEBBES
11:05:34.196599 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [.], ack 1, win 256, length 0
427 18 Klaas TJEBBES
11:05:34.197026 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [P.], seq 1:11, ack 1, win 256, length 10
428 18 Klaas TJEBBES
11:05:34.197059 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [.], ack 11, win 229, length 0
429 18 Klaas TJEBBES
11:05:34.197276 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [P.], seq 1:12, ack 11, win 229, length 11
430 18 Klaas TJEBBES
11:05:34.197631 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [P.], seq 11:65, ack 12, win 256, length 54
431 18 Klaas TJEBBES
11:05:34.197803 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [P.], seq 12:65, ack 65, win 229, length 53
432 18 Klaas TJEBBES
11:05:34.197836 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [P.], seq 65:108, ack 65, win 229, length 43
433 18 Klaas TJEBBES
11:05:34.198124 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [.], ack 108, win 256, length 0
434 18 Klaas TJEBBES
11:05:34.198166 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [P.], seq 65:105, ack 108, win 256, length 40
435 18 Klaas TJEBBES
11:05:34.198358 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [P.], seq 105:888, ack 108, win 256, length 783
436 18 Klaas TJEBBES
11:05:34.198380 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [.], ack 888, win 241, length 0
437 18 Klaas TJEBBES
11:05:34.218144 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [P.], seq 108:1396, ack 888, win 241, length 1288
438 18 Klaas TJEBBES
11:05:34.232902 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [.], ack 105, win 229, length 0
439 18 Klaas TJEBBES
11:05:34.261652 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [F.], seq 888, ack 1396, win 251, length 0
440 18 Klaas TJEBBES
11:05:34.262028 IP 192.168.0.5.4506 > 192.168.0.181.64084: Flags [F.], seq 1396, ack 889, win 241, length 0
441 18 Klaas TJEBBES
11:05:34.262386 IP 192.168.0.181.64084 > 192.168.0.5.4506: Flags [.], ack 1397, win 251, length 0
442 18 Klaas TJEBBES
11:05:34.265439 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [P.], seq 105:302, ack 108, win 256, length 197
443 18 Klaas TJEBBES
11:05:34.265500 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [.], ack 302, win 237, length 0
444 18 Klaas TJEBBES
11:05:34.278014 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [P.], seq 108:179, ack 302, win 237, length 71
445 18 Klaas TJEBBES
11:05:34.281873 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [F.], seq 302, ack 179, win 255, length 0
446 18 Klaas TJEBBES
11:05:34.282010 IP 192.168.0.5.4506 > 192.168.0.181.64083: Flags [F.], seq 179, ack 303, win 237, length 0
447 18 Klaas TJEBBES
11:05:34.282351 IP 192.168.0.181.64083 > 192.168.0.5.4506: Flags [.], ack 180, win 255, length 0
448 18 Klaas TJEBBES
^C
449 18 Klaas TJEBBES
43 packets captured
450 18 Klaas TJEBBES
43 packets received by filter
451 18 Klaas TJEBBES
0 packets dropped by kernel
452 18 Klaas TJEBBES
453 18 Klaas TJEBBES
454 18 Klaas TJEBBES
455 1 Joël Cuissinat
</pre>