Projet

Général

Profil

ClientSalt » Historique » Version 34

Daniel Dehennin, 03/05/2019 15:51

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 34 Daniel Dehennin
** Par le module *@SaltStack@*
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 34 Daniel Dehennin
** En exécutant une commande sur le poste
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 1 Joël Cuissinat
* 5 secondes
114 19 Joël Cuissinat
<pre>
115 34 Daniel Dehennin
salt 'FDGFDG.ac-test.fr' system.reboot 5 in_seconds=True
116 19 Joël Cuissinat
</pre>
117 19 Joël Cuissinat
118 34 Daniel Dehennin
_Par défaut, le timeout s'exprime en minutes. Il est possible de l'exprimer en seconde en passant le paramètre *@in_seconds@* à *@True@* :)_
119 19 Joël Cuissinat
120 19 Joël Cuissinat
h2. Gestion des clients Microsoft
121 19 Joël Cuissinat
122 19 Joël Cuissinat
h3. Documentation
123 19 Joël Cuissinat
124 19 Joël Cuissinat
* Module win_system : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_system.html
125 19 Joël Cuissinat
* Module win_dns_client : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_dns_client.html
126 23 Joël Cuissinat
* Module win_network : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_network.html
127 25 Joël Cuissinat
* Module win_lgpo : https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_lgpo.html
128 19 Joël Cuissinat
129 24 Joël Cuissinat
h3. Interrogations diverses
130 24 Joël Cuissinat
131 24 Joël Cuissinat
<pre>
132 24 Joël Cuissinat
root@scribe:~# salt 'PC-124784.ac-test.fr' system.get_computer_name
133 24 Joël Cuissinat
PC-124784.ac-test.fr:
134 24 Joël Cuissinat
    PC-CDI1
135 24 Joël Cuissinat
</pre>
136 24 Joël Cuissinat
137 24 Joël Cuissinat
<pre>
138 24 Joël Cuissinat
root@scribe:~# salt 'PC-124784.ac-test.fr' system.get_domain_workgroup
139 24 Joël Cuissinat
PC-124784.ac-test.fr:
140 24 Joël Cuissinat
    ----------
141 24 Joël Cuissinat
    Domain:
142 24 Joël Cuissinat
        etb1.lan
143 24 Joël Cuissinat
</pre>
144 24 Joël Cuissinat
145 24 Joël Cuissinat
<pre>
146 24 Joël Cuissinat
root@scribe:~# salt 'PC-124784.ac-test.fr' system.get_system_date 
147 24 Joël Cuissinat
PC-124784.ac-test.fr:
148 24 Joël Cuissinat
    05/04/2018
149 24 Joël Cuissinat
</pre>
150 24 Joël Cuissinat
151 24 Joël Cuissinat
152 24 Joël Cuissinat
153 15 Joël Cuissinat
h3. Renommage du PC
154 15 Joël Cuissinat
155 15 Joël Cuissinat
<pre>
156 15 Joël Cuissinat
root@scribe:~# salt PC-124784.ac-test.fr system.set_computer_name PC-CDI1
157 15 Joël Cuissinat
PC-124784.ac-test.fr:
158 15 Joël Cuissinat
    ----------
159 15 Joël Cuissinat
    Computer Name:
160 15 Joël Cuissinat
        ----------
161 15 Joël Cuissinat
        Current:
162 15 Joël Cuissinat
            PC-125292
163 15 Joël Cuissinat
        Pending:
164 15 Joël Cuissinat
            PC-CDI1
165 15 Joël Cuissinat
</pre>
166 15 Joël Cuissinat
167 15 Joël Cuissinat
Le renommage ne sera effectif qu'après redémarrage du poste client.
168 20 Joël Cuissinat
Évidemment le renommage du poste ne modifie pas le nom du Minion !
169 20 Joël Cuissinat
170 22 Joël Cuissinat
h3. Jonction au domaine
171 20 Joël Cuissinat
172 20 Joël Cuissinat
<pre>
173 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
174 20 Joël Cuissinat
</pre>
175 20 Joël Cuissinat
176 20 Joël Cuissinat
Si on relance la commande une seconde fois, on obtient le message suivant :
177 20 Joël Cuissinat
<pre>
178 20 Joël Cuissinat
PC-124784.ac-test.fr:
179 20 Joël Cuissinat
Already joined to etb1.lan
180 22 Joël Cuissinat
</pre>
181 15 Joël Cuissinat
182 1 Joël Cuissinat
h3. Changer le DNS
183 1 Joël Cuissinat
184 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
185 1 Joël Cuissinat
186 1 Joël Cuissinat
<pre>
187 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' network.get_route 192.168.0.5
188 13 Klaas TJEBBES
</pre>
189 13 Klaas TJEBBES
190 13 Klaas TJEBBES
<pre>
191 1 Joël Cuissinat
root@dc1:~# salt 'PC-124784.ac-test.fr' network.get_route 192.168.0.5
192 1 Joël Cuissinat
PC-124784.ac-test.fr:
193 1 Joël Cuissinat
    ----------
194 1 Joël Cuissinat
    destination:
195 13 Klaas TJEBBES
        192.168.0.5
196 18 Klaas TJEBBES
    gateway:
197 18 Klaas TJEBBES
        0.0.0.0
198 18 Klaas TJEBBES
    interface:
199 18 Klaas TJEBBES
        MonInterface
200 18 Klaas TJEBBES
    source:
201 18 Klaas TJEBBES
        192.168.0.184
202 18 Klaas TJEBBES
</pre>
203 18 Klaas TJEBBES
204 18 Klaas TJEBBES
<pre>
205 18 Klaas TJEBBES
salt 'PC-124784.ac-test.fr' ip.set_static_dns MonInterface 192.168.0.5
206 18 Klaas TJEBBES
</pre>
207 18 Klaas TJEBBES
208 26 Joël Cuissinat
h3. Gestion des GPO
209 26 Joël Cuissinat
210 26 Joël Cuissinat
Lister toutes les GPO du poste :
211 26 Joël Cuissinat
<pre>
212 26 Joël Cuissinat
salt 'PC-124784.ac-test.fr' lgpo.get machine return_full_policy_names=True
213 26 Joël Cuissinat
</pre>
214 26 Joël Cuissinat
215 28 Joël Cuissinat
<pre>
216 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.get_policy_info 'Maximum password age' machine
217 28 Joël Cuissinat
PC-125292.etb1.lan:
218 28 Joël Cuissinat
    ----------
219 28 Joël Cuissinat
    message:
220 28 Joël Cuissinat
    policy_aliases:
221 28 Joël Cuissinat
        - MaxPasswordAge
222 28 Joël Cuissinat
    policy_class:
223 28 Joël Cuissinat
        machine
224 28 Joël Cuissinat
    policy_elements:
225 28 Joël Cuissinat
    policy_found:
226 28 Joël Cuissinat
        True
227 28 Joël Cuissinat
    policy_name:
228 28 Joël Cuissinat
        Maximum password age
229 28 Joël Cuissinat
    rights_assignment:
230 28 Joël Cuissinat
        False
231 28 Joël Cuissinat
</pre>
232 28 Joël Cuissinat
233 28 Joël Cuissinat
<pre>
234 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.get_policy_info 'Account lockout duration' machine
235 28 Joël Cuissinat
PC-125292.etb1.lan:
236 28 Joël Cuissinat
    ----------
237 28 Joël Cuissinat
    message:
238 28 Joël Cuissinat
    policy_aliases:
239 28 Joël Cuissinat
        - LockoutDuration
240 28 Joël Cuissinat
    policy_class:
241 28 Joël Cuissinat
        machine
242 28 Joël Cuissinat
    policy_elements:
243 28 Joël Cuissinat
    policy_found:
244 28 Joël Cuissinat
        True
245 28 Joël Cuissinat
    policy_name:
246 28 Joël Cuissinat
        Account lockout duration
247 28 Joël Cuissinat
    rights_assignment:
248 28 Joël Cuissinat
        False
249 28 Joël Cuissinat
root@scribe:~#
250 28 Joël Cuissinat
</pre>
251 28 Joël Cuissinat
252 28 Joël Cuissinat
<pre>
253 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.set computer_policy="{'LockoutDuration': 90}"
254 28 Joël Cuissinat
PC-125292.etb1.lan:
255 28 Joël Cuissinat
    True
256 28 Joël Cuissinat
root@scribe:~#
257 28 Joël Cuissinat
</pre>
258 28 Joël Cuissinat
259 28 Joël Cuissinat
ou
260 28 Joël Cuissinat
261 28 Joël Cuissinat
<pre>
262 28 Joël Cuissinat
root@scribe:~# salt 'PC-125292.etb1.lan' lgpo.set_computer_policy LockoutDuration 1440
263 28 Joël Cuissinat
PC-125292.etb1.lan:
264 28 Joël Cuissinat
    True
265 28 Joël Cuissinat
root@scribe:~#
266 28 Joël Cuissinat
</pre>
267 29 Joël Cuissinat
268 27 Joël Cuissinat
Application mise à disposition par Microsoft qui recense les GPO : http://gpsearch.azurewebsites.net/default.aspx?ref=1#10677
269 29 Joël Cuissinat
270 27 Joël Cuissinat
271 1 Joël Cuissinat
h3. Autre
272 1 Joël Cuissinat
273 1 Joël Cuissinat
<pre>
274 1 Joël Cuissinat
salt 'PC-12511.ac-test.fr' cmd.run notepad.exe
275 1 Joël Cuissinat
</pre>
276 1 Joël Cuissinat
277 1 Joël Cuissinat
<pre>
278 1 Joël Cuissinat
salt '*ac-test.fr' sys.list_functions
279 1 Joël Cuissinat
salt '*ac-test.fr' sys.list_state_functions
280 1 Joël Cuissinat
</pre>
281 1 Joël Cuissinat
282 1 Joël Cuissinat
<pre>
283 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' win_dns_client.get_dns_config
284 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' win_dns_client.add_dns 8.8.8.8 "Ethernet" 1
285 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' cmd.run "netsh interface ip show config"
286 1 Joël Cuissinat
salt 'FDGFDG.ac-test.fr' cmd.run "CHCP 1252 & netsh interface ip show config"
287 1 Joël Cuissinat
</pre>
288 1 Joël Cuissinat
289 1 Joël Cuissinat
<pre>
290 1 Joël Cuissinat
salt -G 'os_family:Windows' network.interfaces
291 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' network.interfaces
292 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' network.interfaces_names
293 1 Joël Cuissinat
</pre>
294 1 Joël Cuissinat
295 1 Joël Cuissinat
h3. Commandes non fonctionnelles 
296 1 Joël Cuissinat
297 1 Joël Cuissinat
Les commandes suivantes ne fonctionne pas :
298 1 Joël Cuissinat
299 1 Joël Cuissinat
<pre>
300 1 Joël Cuissinat
salt 'PC-124784.ac-test.fr' ip.get_all_interfaces
301 1 Joël Cuissinat
</pre> 
302 1 Joël Cuissinat
<pre>
303 18 Klaas TJEBBES
salt -G 'os_family:Windows' ip.get_all_interfaces
304 18 Klaas TJEBBES
</pre>
305 18 Klaas TJEBBES
306 18 Klaas TJEBBES
h2. Voir les logs du client depuis le serveur (avec _tail_ par ex.)
307 18 Klaas TJEBBES
308 18 Klaas TJEBBES
* Monter C$ pour accéder au système de fichiers du client
309 18 Klaas TJEBBES
310 18 Klaas TJEBBES
<pre>
311 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
312 18 Klaas TJEBBES
# notez le "vers=3.0" pour éviter l'erreur "host is down"
313 18 Klaas TJEBBES
</pre>
314 18 Klaas TJEBBES
315 18 Klaas TJEBBES
* changer le log level (vim ou nano sur le fichier devrait fonctionner, sinon notepad depuis windows)
316 18 Klaas TJEBBES
317 18 Klaas TJEBBES
<pre>
318 18 Klaas TJEBBES
root@dc1:~# grep log_level /mnt/salt/conf/minion
319 18 Klaas TJEBBES
#log_level: warning
320 18 Klaas TJEBBES
log_level: info
321 18 Klaas TJEBBES
</pre>
322 18 Klaas TJEBBES
323 18 Klaas TJEBBES
<pre>
324 18 Klaas TJEBBES
root@dc1:~# tail -f /mnt/salt/var/log/salt/minion
325 18 Klaas TJEBBES
</pre>
326 18 Klaas TJEBBES
327 18 Klaas TJEBBES
328 18 Klaas TJEBBES
* MS-DOS :
329 18 Klaas TJEBBES
330 18 Klaas TJEBBES
<pre>
331 18 Klaas TJEBBES
sc stop salt-minion
332 18 Klaas TJEBBES
rem attendre qques secondes que ça s'arrête effectivement
333 18 Klaas TJEBBES
sc start salt-minion
334 18 Klaas TJEBBES
</pre>
335 18 Klaas TJEBBES
336 18 Klaas TJEBBES
337 18 Klaas TJEBBES
h2. Erreur "Minion did not return. [No response]"
338 18 Klaas TJEBBES
339 18 Klaas TJEBBES
<pre>
340 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functions
341 18 Klaas TJEBBES
PC-12511.ac-test.fr:
342 18 Klaas TJEBBES
    Minion did not return. [No response]
343 18 Klaas TJEBBES
</pre>
344 18 Klaas TJEBBES
345 18 Klaas TJEBBES
<pre>
346 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functionsA
347 18 Klaas TJEBBES
PC-12511.ac-test.fr:
348 18 Klaas TJEBBES
    Minion did not return. [No response]
349 18 Klaas TJEBBES
</pre>
350 18 Klaas TJEBBES
351 18 Klaas TJEBBES
<pre>
352 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functionsA -t 15
353 18 Klaas TJEBBES
PC-12511.ac-test.fr:
354 18 Klaas TJEBBES
    'sys.list_functionsA' is not available.
355 18 Klaas TJEBBES
ERROR: Minions returned with non-zero exit code
356 18 Klaas TJEBBES
</pre>
357 18 Klaas TJEBBES
358 18 Klaas TJEBBES
<pre>
359 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_functions -t 15
360 18 Klaas TJEBBES
PC-12511.ac-test.fr:
361 18 Klaas TJEBBES
    - aliases.get_target
362 18 Klaas TJEBBES
    - aliases.has_target
363 18 Klaas TJEBBES
    - aliases.list_aliases
364 18 Klaas TJEBBES
    - aliases.rm_alias
365 18 Klaas TJEBBES
    - aliases.set_target
366 18 Klaas TJEBBES
    - archive.cmd_unzip
367 18 Klaas TJEBBES
    [...]
368 18 Klaas TJEBBES
    - zenoss.set_prod_state
369 18 Klaas TJEBBES
370 18 Klaas TJEBBES
root@dc1:~# salt 'PC-12511.ac-test.fr' sys.list_state_functions -t 15
371 18 Klaas TJEBBES
PC-12511.ac-test.fr:
372 18 Klaas TJEBBES
    - alias.absent
373 18 Klaas TJEBBES
    - alias.present
374 18 Klaas TJEBBES
    - archive.extracted
375 18 Klaas TJEBBES
    - artifactory.downloaded
376 18 Klaas TJEBBES
    - beacon.absent
377 18 Klaas TJEBBES
    - beacon.disabled
378 18 Klaas TJEBBES
    - beacon.enabled
379 18 Klaas TJEBBES
    - beacon.present
380 18 Klaas TJEBBES
</pre>
381 18 Klaas TJEBBES
382 18 Klaas TJEBBES
383 18 Klaas TJEBBES
384 18 Klaas TJEBBES
385 18 Klaas TJEBBES
h2. _tcpdump_ pour voir comment est exécutée une commande  :
386 18 Klaas TJEBBES
387 18 Klaas TJEBBES
* pendant
388 18 Klaas TJEBBES
389 18 Klaas TJEBBES
<pre>
390 18 Klaas TJEBBES
root@dc1:~# date; salt 'PC-12511.ac-test.fr' test.ping; date
391 18 Klaas TJEBBES
vendredi 4 mai 2018, 11:05:22 (UTC+0200)
392 18 Klaas TJEBBES
PC-12511.ac-test.fr:
393 18 Klaas TJEBBES
    True
394 18 Klaas TJEBBES
vendredi 4 mai 2018, 11:05:34 (UTC+0200)
395 18 Klaas TJEBBES
</pre>
396 18 Klaas TJEBBES
397 18 Klaas TJEBBES
* il se passe
398 18 Klaas TJEBBES
399 18 Klaas TJEBBES
<pre>
400 18 Klaas TJEBBES
root@dc1:~# tcpdump -nni any host 192.168.0.181
401 18 Klaas TJEBBES
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
402 18 Klaas TJEBBES
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
403 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
404 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
405 18 Klaas TJEBBES
11:05:28.520941 ARP, Request who-has 192.168.0.181 tell 192.168.0.5, length 28
406 18 Klaas TJEBBES
11:05:28.522143 ARP, Reply 192.168.0.181 is-at 02:00:c0:a8:00:66, length 46
407 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
408 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
409 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
410 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
411 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
412 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
413 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
414 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
415 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
416 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
417 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
418 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
419 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
420 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
421 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
422 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
423 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
424 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
425 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
426 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
427 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
428 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
429 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
430 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
431 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
432 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
433 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
434 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
435 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
436 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
437 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
438 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
439 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
440 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
441 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
442 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
443 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
444 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
445 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
446 18 Klaas TJEBBES
^C
447 18 Klaas TJEBBES
43 packets captured
448 18 Klaas TJEBBES
43 packets received by filter
449 18 Klaas TJEBBES
0 packets dropped by kernel
450 18 Klaas TJEBBES
451 18 Klaas TJEBBES
452 18 Klaas TJEBBES
453 1 Joël Cuissinat
</pre>