Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:lpic:21:450:l101 [2022/10/05 04:51] adminelearning:workbooks:lpic:21:450:l101 [2022/11/01 07:25] (Version actuelle) admin
Ligne 5: Ligne 5:
 Updated: ~~LASTMOD~~ Updated: ~~LASTMOD~~
  
-======Topic 1 - Capacity Planning======+======Topic 200: Capacity Planning======
  
-FIXMEAdd collectd+  * **Topic 200Capacity Planning** 
 +    * Présentation des Fichiers Spéciaux  
 +    * LAB #1 - Commandes 
 +      * 1.1 - La Commande lspci 
 +      * 1.2 - La Commande lsusb 
 +      * 1.3 - La Commande lsblk 
 +      * 1.4 - La Commande dmidecode 
 +    * LAB #2 - La Commande sysctl 
 +      * 2.1 - Répertoire /proc 
 +        * Fichiers 
 +          * Processeur 
 +          * Interruptions système 
 +          * Canaux DMA 
 +          * Plages d'entrée/sortie 
 +          * Périphériques 
 +          * Modules 
 +          * Statistiques de l'utilisation des disques 
 +          * Partitions 
 +          * Espaces de pagination 
 +          * Statistiques d'utilisation du processeur 
 +          * Statistiques d'utilisation de la mémoire 
 +          * Version du noyau 
 +        * Répertoires 
 +          * ide/scsi 
 +          * acpi 
 +          * bus 
 +          * net 
 +          * sys 
 +      * 2.2 - Utilisation de la Commande sysctl        
 +    * LAB #3 - Interprétation des informations dans /proc 
 +      * 3.1 - free 
 +      * 3.2 - uptime ou w  
 +      * 3.3 - iostat 
 +      * 3.4 - hdparm 
 +      * 3.5 - vmstat 
 +      * 3.6 - mpstat 
 +      * 3.7 - sar 
 +      * 3.8 - collectd 
 +    * Modules usb 
 +    * udev 
 +      * La Commande udevadm 
 +    * Système de fichiers /sys 
 +    * LAB #4 - Processus et fichiers ouverts 
 +      * Les Types de Processus 
 +      * 4.1 - La Commande ps 
 +      * 4.2 - La Commande pstree 
 +      * 4.3 - La Commande top 
 +      * 4.4 - La Commande lsof 
 +    * LAB # 5 - Mesurer l'utilisation du réseau 
 +      * 5.1 - La Commande netstat
  
-=====Contents=====+=====Présentation des Fichiers Spéciaux=====
  
-  * **Topic 1 - Capacity Planning** +Dans l'ordinateur les périphériques sont reliés à un **contrôleur** qui communique avec le processeur à l'aide d'un **bus**. Le contrôleur ainsi que les périphériques nécessitent des pilotesSous Linux, les pilotes sont généralement fournis sous la forme d'un **module**. Chaque périphérique est représenté par un **fichier spécial** dans le répertoire **/dev** et c'est dans ce fichier que le système trouve les informations nécessaires pour s'adresser au pilote.
-    Contents +
-    LAB #1 - Interprétation des informations dans /proc +
-      1.1 - free +
-      * 1.2 - collectd  +
-      1.3 - iostat +
-      1.4 - hdparm +
-      1.5 - vmstat +
-      1.6 - mpstat +
-      1.7 - sar +
-    LAB #2 - Processus et fichiers ouverts +
-      2.1 - Les Types de Processus +
-      2.1 - La Commande ps +
-      2.3 - La Commande pstree +
-      2.4 - La Commande top +
-      2.5 - La Commande lsof +
-    LAB # 3 - Mesurer l'utilisation du réseau et la disponibilité du système +
-      * 3.1 - La Commande netstat +
-      * 3.2 - Les Commandes uptime et w+
  
-=====LAB#1 - Interprétation des informations dans /proc=====+<WRAP center round important 60%> 
 +**Important** : Les périphériques qui nécessitent à ce que l'ordinateur soit éteint afin des les brancher/débrancher sont appelés communément **Cold Plug Devices**. Les périphériques qui peuvent être brancher/débrancher à chaud sont appelés des **Hot Plug Devices**. 
 +</WRAP> 
 + 
 +Consultez le contenu du répertoire /dev : 
 + 
 +<code> 
 +root@debian11:~# ls -l /dev | more 
 +total 0 
 +crw-r--r--  1 root root     10, 235 Apr 26 13:08 autofs 
 +drwxr-xr-x  2 root root         480 Apr 28 06:26 block 
 +drwxr-xr-x  2 root root         120 Apr 26 13:08 bsg 
 +crw-rw----  1 root disk     10, 234 Apr 28 05:31 btrfs-control 
 +drwxr-xr-x  3 root root          60 Apr 26 13:08 bus 
 +lrwxrwxrwx  1 root root           3 Apr 26 13:08 cdrom -> sr0 
 +drwxr-xr-x  2 root root        2800 Apr 28 06:02 char 
 +crw--w----  1 root tty       5,   1 Apr 30 12:19 console 
 +lrwxrwxrwx  1 root root          11 Apr 26 13:08 core -> /proc/kcore 
 +crw-------  1 root root     10,  62 Apr 26 13:08 cpu_dma_latency 
 +crw-------  1 root root     10, 203 Apr 26 13:08 cuse 
 +drwxr-xr-x  7 root root         140 Apr 26 13:08 disk 
 +brw-rw----  1 root disk    254,   0 Apr 27 15:21 dm-0 
 +brw-rw----  1 root disk    254,   1 Apr 26 16:33 dm-1 
 +brw-rw----  1 root disk    254,   2 Apr 28 06:27 dm-2 
 +drwxr-xr-x  3 root root          80 Apr 26 13:08 dri 
 +lrwxrwxrx  1 root root           3 Apr 26 13:08 dvd -> sr0 
 +crw-------  1 root root     10,  61 Apr 28 06:02 ecryptfs 
 +crw-rw----  1 root video    29,   0 Apr 26 13:08 fb0 
 +lrwxrwxrwx  1 root root          13 Apr 26 13:08 fd -> /proc/self/fd 
 +crw-rw-rw-  1 root root      1,   7 Apr 26 13:08 full 
 +crw-rw-rw-  1 root root     10, 229 Apr 26 13:08 fuse 
 +crw-------  1 root root    248,   0 Apr 26 13:08 hidraw0 
 +crw-------  1 root root     10, 228 Apr 26 13:08 hpet 
 +drwxr-xr-x  2 root root           0 Apr 26 13:08 hugepages 
 +lrwxrwxrwx  1 root root          12 Apr 26 13:08 initctl -> /run/initctl 
 +drwxr-xr-x  4 root root         280 Apr 26 13:08 input 
 +crw-r--r--  1 root root      1,  11 Apr 26 13:08 kmsg 
 +lrwxrwxrwx  1 root root          28 Apr 26 13:08 log -> /run/systemd/journal/dev-log 
 +crw-rw----  1 root disk     10, 237 Apr 26 13:08 loop-control 
 +drwxr-xr-x  2 root root         120 Apr 28 06:26 mapper 
 +crw-r-----  1 root kmem      1,   1 Apr 26 13:08 mem 
 +drwxrwxrwt  2 root root          40 Apr 26 13:08 mqueue 
 +drwxr-xr-x  2 root root          60 Apr 26 13:08 net 
 +crw-rw-rw-  1 root root      1,   3 Apr 26 13:08 null 
 +crw-------  1 root root     10, 144 Apr 26 13:08 nvram 
 +crw-r-----  1 root kmem      1,   4 Apr 26 13:08 port 
 +crw-------  1 root root    108,   0 Apr 26 13:08 ppp 
 +crw-------  1 root root     10,   1 Apr 26 13:08 psaux 
 +crw-rw-rw-  1 root tty       5,   2 Apr 30 15:29 ptmx 
 +drwxr-xr-x  2 root root           0 Apr 26 13:08 pts 
 +crw-rw-rw-  1 root root      1,   8 Apr 26 13:08 random 
 +crw-rw-r--  1 root netdev   10, 242 Apr 26 13:08 rfkill 
 +lrwxrwxrwx  1 root root           4 Apr 26 13:08 rtc -> rtc0 
 +crw-------  1 root root    252,   0 Apr 26 13:08 rtc0 
 +--More-- 
 +[q] 
 +</code> 
 + 
 +On peut noter dans la sortie de la commande que certains fichiers sont de type **bloc** (**b**), tandis que d'autre sont de type **caractère** (**c**).  
 + 
 +<code> 
 +... 
 +brw-rw----  1 root disk      8,  33 Apr 26 13:46 sdc1 
 +... 
 +crw--w----  1 root tty       5,   1 Apr 30 12:19 console 
 +... 
 +</code> 
 + 
 +La différence entre les deux repose sur le type de communication entre le système et le module. Dans le premier cas le système accède au périphérique par des coordonnées du bloc de données sur le support tandis que dans le deuxième cas la communication d'échange de données se fait octet par octet sans utiliser des tampons. 
 + 
 +Les deux informations clefs du fichier spécial sont situées à la place de la taille d'un fichier normal et se nomment le **majeur** et le **mineur** : 
 + 
 +  * le **majeur** identifie le pilote du périphérique et donc son contrôleur, 
 +  * le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque. 
 + 
 +=====LAB #1 - Commandes===== 
 + 
 +====1.1 - La Commande lspci==== 
 + 
 +Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express : 
 + 
 +<code> 
 +root@debian11:~# lspci 
 +00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 
 +00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 
 +00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] 
 +00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01) 
 +00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03) 
 +00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) 
 +00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon 
 +00:05.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI 
 +00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device 
 +00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge 
 +00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge 
 +</code> 
 + 
 +Pour obtenir de l'information sur un adaptateur spécifique, il convient d'utiliser la même commande avec l'option **-v** en spécifiant l'identifiant concerné : 
 + 
 +<code> 
 +root@debian11:~# lspci -v -s 00:03.0 
 +00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon 
 +        Subsystem: Red Hat, Inc. Virtio memory balloon 
 +        Physical Slot: 3 
 +        Flags: bus master, fast devsel, latency 0, IRQ 10 
 +        I/O ports at e000 [size=64] 
 +        Memory at fe400000 (64-bit, prefetchable) [size=16K] 
 +        Capabilities: [84] Vendor Specific Information: VirtIO: <unknown> 
 +        Capabilities: [70] Vendor Specific Information: VirtIO: Notify 
 +        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg 
 +        Capabilities: [50] Vendor Specific Information: VirtIO: ISR 
 +        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg 
 +        Kernel driver in use: virtio-pci 
 +        Kernel modules: virtio_pci 
 +</code> 
 + 
 +ou : 
 + 
 +<code> 
 +root@debian11:~# lspci -vv -s 00:03.0 
 +00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon 
 +        Subsystem: Red Hat, Inc. Virtio memory balloon 
 +        Physical Slot: 3 
 +        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- 
 +        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- 
 +        Latency: 0 
 +        Interrupt: pin A routed to IRQ 10 
 +        Region 0: I/O ports at e000 [size=64] 
 +        Region 4: Memory at fe400000 (64-bit, prefetchable) [size=16K] 
 +        Capabilities: [84] Vendor Specific Information: VirtIO: <unknown> 
 +                BAR=0 offset=00000000 size=00000000 
 +        Capabilities: [70] Vendor Specific Information: VirtIO: Notify 
 +                BAR=4 offset=00003000 size=00001000 multiplier=00000004 
 +        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg 
 +                BAR=4 offset=00002000 size=00001000 
 +        Capabilities: [50] Vendor Specific Information: VirtIO: ISR 
 +                BAR=4 offset=00001000 size=00001000 
 +        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg 
 +                BAR=4 offset=00000000 size=00001000 
 +        Kernel driver in use: virtio-pci 
 +        Kernel modules: virtio_pci 
 +</code> 
 + 
 +Les options de cette commande sont : 
 + 
 +<code> 
 +root@debian11:~# lspci --help 
 +lspci: invalid option -- '-' 
 +Usage: lspci [<switches>
 + 
 +Basic display modes: 
 +-mm             Produce machine-readable output (single -m for an obsolete format) 
 +-t              Show bus tree 
 + 
 +Display options: 
 +-v              Be verbose (-vv or -vvv for higher verbosity) 
 +-k              Show kernel drivers handling each device 
 +-x              Show hex-dump of the standard part of the config space 
 +-xxx            Show hex-dump of the whole config space (dangerous; root only) 
 +-xxxx           Show hex-dump of the 4096-byte extended config space (root only) 
 +-b              Bus-centric view (addresses and IRQ's as seen by the bus) 
 +-D              Always show domain numbers 
 +-P              Display bridge path in addition to bus and device number 
 +-PP             Display bus path in addition to bus and device number 
 + 
 +Resolving of device ID's to names: 
 +-n              Show numeric ID's 
 +-nn             Show both textual and numeric ID's (names & numbers) 
 +-q              Query the PCI ID database for unknown ID's via DNS 
 +-qq             As above, but re-query locally cached entries 
 +-Q              Query the PCI ID database for all ID's via DNS 
 + 
 +Selection of devices: 
 +-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]   Show only devices in selected slots 
 +-d [<vendor>]:[<device>][:<class>             Show only devices with specified ID's 
 + 
 +Other options: 
 +-i <file>       Use specified ID database instead of /usr/share/misc/pci.ids.gz 
 +-p <file>       Look up kernel modules in a given file instead of default modules.pcimap 
 +-M              Enable `bus mapping' mode (dangerous; root only) 
 + 
 +PCI access options: 
 +-A <method>     Use the specified PCI access method (see `-A help' for a list) 
 +-O <par>=<val>  Set PCI access parameter (see `-O help' for a list) 
 +-G              Enable PCI access debugging 
 +-H <mode>       Use direct hardware access (<mode> = 1 or 2) 
 +-F <file>       Read PCI configuration dump from a given file 
 +</code> 
 + 
 +====1.2 - La Commande lsusb==== 
 + 
 +Cette commande vous renseigne sur les adaptateurs reliés au bus usb : 
 + 
 +<code> 
 +root@debian11:~# lsusb 
 +Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet 
 +Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
 + 
 +root@debian11:~# lsusb -vt 
 +/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M 
 +    ID 1d6b:0001 Linux Foundation 1.1 root hub 
 +    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M 
 +        ID 0627:0001 Adomax Technology Co., Ltd  
 +</code> 
 + 
 +Les options de cette commande sont : 
 + 
 +<code> 
 +root@debian11:~# lsusb --help 
 +Usage: lsusb [options]... 
 +List USB devices 
 +  -v, --verbose 
 +      Increase verbosity (show descriptors) 
 +  -s [[bus]:][devnum] 
 +      Show only devices with specified device and/or 
 +      bus numbers (in decimal) 
 +  -d vendor:[product] 
 +      Show only devices with the specified vendor and 
 +      product ID numbers (in hexadecimal) 
 +  -D device 
 +      Selects which device lsusb will examine 
 +  -t, --tree 
 +      Dump the physical USB device hierarchy as a tree 
 +  -V, --version 
 +      Show version of program 
 +  -h, --help 
 +      Show usage and help 
 +</code> 
 + 
 +====1.3 - La Commande lsblk==== 
 + 
 +Cette commande vous renseigne sur les périphériques de type bloc : 
 + 
 +<code> 
 +root@debian11:~# lsblk 
 +NAME        MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT 
 +sda           8:   0   32G  0 disk   
 +├─sda1        8:1    0   31G  0 part  / 
 +├─sda2        8:2    0    1K  0 part   
 +└─sda5        8:5    0  975M  0 part  [SWAP] 
 +sdb           8:16     64G  0 disk   
 +sdc           8:32      4G  0 disk   
 +├─sdc1        8:33    100M  0 part   
 +├─sdc2        8:34    100M  0 part   
 +├─sdc3        8:35    100M  0 part   
 +├─sdc4        8:36      1K  0 part   
 +├─sdc5        8:37    500M  0 part   
 +├─sdc6        8:38    200M  0 part   
 +│ └─vg0-lv1 254:0    0  104M  0 lvm    
 +├─sdc7        8:39    300M  0 part   
 +│ └─vg0-lv2 254:1    0  112M  0 lvm    
 +├─sdc8        8:40    500M  0 part   
 +│ └─md1       9:   0  996M  0 raid5  
 +├─sdc9        8:41    400M  0 part   
 +│ └─vg0-lv2 254:1    0  112M  0 lvm    
 +├─sdc10       8:42    500M  0 part   
 +│ └─md1       9:   0  996M  0 raid5  
 +├─sdc11       8:43    500M  0 part   
 +│ └─md1       9:   0  996M  0 raid5  
 +└─sdc12       8:44    200M  0 part   
 +sr0          11:0    1  378M  0 rom     
 +</code> 
 + 
 +Les options de cette commande sont : 
 + 
 +<code> 
 +root@debian11:~# lsblk --help 
 + 
 +Usage: 
 + lsblk [options] [<device> ...] 
 + 
 +List information about block devices. 
 + 
 +Options: 
 + -D, --discard        print discard capabilities 
 + -E, --dedup <column> de-duplicate output by <column> 
 + -I, --include <list> show only devices with specified major numbers 
 + -J, --json           use JSON output format 
 + -O, --output-all     output all columns 
 + -P, --pairs          use key="value" output format 
 + -S, --scsi           output info about SCSI devices 
 + -T, --tree[=<column>] use tree format output 
 + -a, --all            print all devices 
 + -b, --bytes          print SIZE in bytes rather than in human readable format 
 + -d, --nodeps         don't print slaves or holders 
 + -e, --exclude <list> exclude devices by major number (default: RAM disks) 
 + -f, --fs             output info about filesystems 
 + -i, --ascii          use ascii characters only 
 + -l, --list           use list format output 
 + -M, --merge          group parents of sub-trees (usable for RAIDs, Multi-path) 
 + -m, --perms          output info about permissions 
 + -n, --noheadings     don't print headings 
 + -o, --output <list>  output columns 
 + -p, --paths          print complete device path 
 + -r, --raw            use raw output format 
 + -s, --inverse        inverse dependencies 
 + -t, --topology       output info about topology 
 + -z, --zoned          print zone model 
 + -x, --sort <column>  sort output by <column> 
 +     --sysroot <dir>  use specified directory as system root 
 + 
 + -h, --help           display this help 
 + -V, --version        display version 
 + 
 +Available output columns: 
 +        NAME  device name 
 +       KNAME  internal kernel device name 
 +        PATH  path to the device node 
 +     MAJ:MIN  major:minor device number 
 +     FSAVAIL  filesystem size available 
 +      FSSIZE  filesystem size 
 +      FSTYPE  filesystem type 
 +      FSUSED  filesystem size used 
 +      FSUSE%  filesystem use percentage 
 +       FSVER  filesystem version 
 +  MOUNTPOINT  where the device is mounted 
 +       LABEL  filesystem LABEL 
 +        UUID  filesystem UUID 
 +      PTUUID  partition table identifier (usually UUID) 
 +      PTTYPE  partition table type 
 +    PARTTYPE  partition type code or UUID 
 + PARTTYPENAME  partition type name 
 +   PARTLABEL  partition LABEL 
 +    PARTUUID  partition UUID 
 +   PARTFLAGS  partition flags 
 +          RA  read-ahead of the device 
 +          RO  read-only device 
 +          RM  removable device 
 +     HOTPLUG  removable or hotplug device (usb, pcmcia, ...) 
 +       MODEL  device identifier 
 +      SERIAL  disk serial number 
 +        SIZE  size of the device 
 +       STATE  state of the device 
 +       OWNER  user name 
 +       GROUP  group name 
 +        MODE  device node permissions 
 +   ALIGNMENT  alignment offset 
 +      MIN-IO  minimum I/O size 
 +      OPT-IO  optimal I/O size 
 +     PHY-SEC  physical sector size 
 +     LOG-SEC  logical sector size 
 +        ROTA  rotational device 
 +       SCHED  I/O scheduler name 
 +     RQ-SIZE  request queue size 
 +        TYPE  device type 
 +    DISC-ALN  discard alignment offset 
 +   DISC-GRAN  discard granularity 
 +    DISC-MAX  discard max bytes 
 +   DISC-ZERO  discard zeroes data 
 +       WSAME  write same max bytes 
 +         WWN  unique storage identifier 
 +        RAND  adds randomness 
 +      PKNAME  internal parent kernel device name 
 +        HCTL  Host:Channel:Target:Lun for SCSI 
 +        TRAN  device transport type 
 +  SUBSYSTEMS  de-duplicated chain of subsystems 
 +         REV  device revision 
 +      VENDOR  device vendor 
 +       ZONED  zone model 
 +         DAX  dax-capable device 
 + 
 +For more details see lsblk(8). 
 +</code> 
 + 
 +====1.4 - La Commande dmidecode==== 
 + 
 +La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface//) aussi appelée **SMBIOS** (//System Management BIOS//) et fourni les informations sur : 
 + 
 +  * l'état du matériel actuel, 
 +  * les extensions possibles. 
 + 
 +<code> 
 +root@debian11:~# dmidecode 
 +# dmidecode 3.3 
 +Getting SMBIOS data from sysfs. 
 +SMBIOS 2.8 present. 
 +10 structures occupying 443 bytes. 
 +Table at 0x000F58C0. 
 + 
 +Handle 0x0000, DMI type 0, 24 bytes 
 +BIOS Information 
 +        Vendor: SeaBIOS 
 +        Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 
 +        Release Date: 04/01/2014 
 +        Address: 0xE8000 
 +        Runtime Size: 96 kB 
 +        ROM Size: 64 kB 
 +        Characteristics: 
 +                BIOS characteristics not supported 
 +                Targeted content distribution is supported 
 +        BIOS Revision: 0.0 
 + 
 +Handle 0x0100, DMI type 1, 27 bytes 
 +System Information 
 +        Manufacturer: QEMU 
 +        Product Name: Standard PC (i440FX + PIIX, 1996) 
 +        Version: pc-i440fx-5.2 
 +        Serial Number: Not Specified 
 +        UUID: ce816e48-faa4-4cb9-a03e-f0f58040c52b 
 +        Wake-up Type: Power Switch 
 +        SKU Number: Not Specified 
 +        Family: Not Specified 
 + 
 +Handle 0x0300, DMI type 3, 22 bytes 
 +Chassis Information 
 +        Manufacturer: QEMU 
 +        Type: Other 
 +        Lock: Not Present 
 +        Version: pc-i440fx-5.2 
 +        Serial Number: Not Specified 
 +        Asset Tag: Not Specified 
 +        Boot-up State: Safe 
 +        Power Supply State: Safe 
 +        Thermal State: Safe 
 +        Security Status: Unknown 
 +        OEM Information: 0x00000000 
 +        Height: Unspecified 
 +        Number Of Power Cords: Unspecified 
 +        Contained Elements: 0 
 +        SKU Number: Not Specified 
 + 
 +Handle 0x0400, DMI type 4, 42 bytes 
 +Processor Information 
 +        Socket Designation: CPU 0 
 +        Type: Central Processor 
 +        Family: Other 
 +        Manufacturer: QEMU 
 +        ID: 61 0F 00 00 FF FB 8B 07 
 +        Version: pc-i440fx-5.2 
 +        Voltage: Unknown 
 +        External Clock: Unknown 
 +        Max Speed: 2000 MHz 
 +        Current Speed: 2000 MHz 
 +        Status: Populated, Enabled 
 +        Upgrade: Other 
 +        L1 Cache Handle: Not Provided 
 +        L2 Cache Handle: Not Provided 
 +        L3 Cache Handle: Not Provided 
 +        Serial Number: Not Specified 
 +        Asset Tag: Not Specified 
 +        Part Number: Not Specified 
 +        Core Count: 2 
 +        Core Enabled: 2 
 +        Thread Count: 1 
 +        Characteristics: None 
 + 
 +Handle 0x1000, DMI type 16, 23 bytes 
 +Physical Memory Array 
 +        Location: Other 
 +        Use: System Memory 
 +        Error Correction Type: Multi-bit ECC 
 +        Maximum Capacity: 4 GB 
 +        Error Information Handle: Not Provided 
 +        Number Of Devices: 1 
 + 
 +Handle 0x1100, DMI type 17, 40 bytes 
 +Memory Device 
 +        Array Handle: 0x1000 
 +        Error Information Handle: Not Provided 
 +        Total Width: Unknown 
 +        Data Width: Unknown 
 +        Size: 4 GB 
 +        Form Factor: DIMM 
 +        Set: None 
 +        Locator: DIMM 0 
 +        Bank Locator: Not Specified 
 +        Type: RAM 
 +        Type Detail: Other 
 +        Speed: Unknown 
 +        Manufacturer: QEMU 
 +        Serial Number: Not Specified 
 +        Asset Tag: Not Specified 
 +        Part Number: Not Specified 
 +        Rank: Unknown 
 +        Configured Memory Speed: Unknown 
 +        Minimum Voltage: Unknown 
 +        Maximum Voltage: Unknown 
 +        Configured Voltage: Unknown 
 + 
 +Handle 0x1300, DMI type 19, 31 bytes 
 +Memory Array Mapped Address 
 +        Starting Address: 0x00000000000 
 +        Ending Address: 0x000BFFFFFFF 
 +        Range Size: 3 GB 
 +        Physical Array Handle: 0x1000 
 +        Partition Width: 1 
 + 
 +Handle 0x1301, DMI type 19, 31 bytes 
 +Memory Array Mapped Address 
 +        Starting Address: 0x00100000000 
 +        Ending Address: 0x0013FFFFFFF 
 +        Range Size: 1 GB 
 +        Physical Array Handle: 0x1000 
 +        Partition Width: 1 
 + 
 +Handle 0x2000, DMI type 32, 11 bytes 
 +System Boot Information 
 +        Status: No errors detected 
 + 
 +Handle 0x7F00, DMI type 127, 4 bytes 
 +End Of Table 
 +</code> 
 + 
 +Les options de cette commande sont : 
 + 
 +<code> 
 +root@debian11:~# dmidecode --help 
 +Usage: dmidecode [OPTIONS] 
 +Options are: 
 + -d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem) 
 + -h, --help             Display this help text and exit 
 + -q, --quiet            Less verbose output 
 + -s, --string KEYWORD   Only display the value of the given DMI string 
 + -t, --type TYPE        Only display the entries of given type 
 + -H, --handle HANDLE    Only display the entry of given handle 
 + -u, --dump             Do not decode the entries 
 +     --dump-bin FILE    Dump the DMI data to a binary file 
 +     --from-dump FILE   Read the DMI data from a binary file 
 +     --no-sysfs         Do not attempt to read DMI data from sysfs files 
 +     --oem-string N     Only display the value of the given OEM string 
 + -V, --version          Display the version and exit 
 +</code> 
 + 
 +=====LAB #2 - La commande sysctl===== 
 + 
 +====2.1 - Répertoire /proc==== 
 + 
 +Le répertoire /proc contient des fichiers et des répertoires virtuels. Le contenu de ces fichiers est créé dynamiquement lors de la consultation. Seul root peut consulter la totalité des informations dans le répertoire /proc. 
 + 
 +<code> 
 +root@debian11:~# ls /proc 
 +1    128  24     34952  46798  54400  55364  56363  57690  68    acpi       dynamic_debug  key-users    mtrr          sys 
 +10   13   244    4      46804  54401  55367  56440  57691  71    buddyinfo  execdomains    kmsg         net           sysrq-trigger 
 +11   15   25     42378  46805  54405  55368  56894  57772  72    bus        fb             kpagecgroup  pagetypeinfo  sysvipc 
 +116  16   27     42390  46806  54406  55385  56910  57773  7576  cgroups    filesystems    kpagecount   partitions    thread-self 
 +119  17   28     42391  46808  54407  55392  56911  57781  7708  cmdline    fs             kpageflags   pressure      timer_list 
 +12   176  287    42392  46812  54408  55549  56912  57785  7709  consoles   interrupts     loadavg      sched_debug   tty 
 +120  177  29     42401  46813  55     55563  57     57792  7883  cpuinfo    iomem          locks        schedstat     uptime 
 +121  18        42402  50     55345  55565  57148  57798  7894  crypto     ioports        mdstat       self          version 
 +122  2    30     46777  51     55347  55569  57149  57800  8     devices    irq            meminfo      slabinfo      vmallocinfo 
 +123  20   31     46780  52     55348  55571  57150  58     8904  diskstats  kallsyms       misc         softirqs      vmstat 
 +126  214  32     46782  53     55350  56     57308  59     8905  dma        kcore          modules      stat          zoneinfo 
 +127  23   34924  46797  54     55353  56135  57689  6      9     driver     keys           mounts       swaps 
 +</code> 
 + 
 +===Fichiers=== 
 + 
 +==Processeur== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/cpuinfo 
 +processor       : 0 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 2399.982 
 +cache size      : 16384 KB 
 +physical id     : 0 
 +siblings        : 2 
 +core id         : 0 
 +cpu cores       : 2 
 +apicid          : 0 
 +initial apicid  : 0 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 4799.96 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 1 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 2399.982 
 +cache size      : 16384 KB 
 +physical id     : 0 
 +siblings        : 2 
 +core id         : 1 
 +cpu cores       : 2 
 +apicid          : 1 
 +initial apicid  : 1 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 4799.96 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 +</code> 
 + 
 +==Interruptions système== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/interrupts 
 +           CPU0       CPU1        
 +  0:         29          0   IO-APIC   2-edge      timer 
 +  1:          0          9   IO-APIC   1-edge      i8042 
 +  6:          0          3   IO-APIC   6-edge      floppy 
 +  8:          1          0   IO-APIC   8-edge      rtc0 
 +  9:          0          0   IO-APIC   9-fasteoi   acpi 
 + 10:          0     177277   IO-APIC  10-fasteoi   virtio0 
 + 11:         40          0   IO-APIC  11-fasteoi   uhci_hcd:usb1 
 + 12:         15          0   IO-APIC  12-edge      i8042 
 + 14:          0          0   IO-APIC  14-edge      ata_piix 
 + 15:          0     352265   IO-APIC  15-edge      ata_piix 
 + 24:          0          0   PCI-MSI 294912-edge      virtio2-config 
 + 25:      24163          0   PCI-MSI 294913-edge      virtio2-input.0 
 + 26:          0      18954   PCI-MSI 294914-edge      virtio2-output.0 
 + 27:          0          0   PCI-MSI 81920-edge      virtio1-config 
 + 28:          0          0   PCI-MSI 81921-edge      virtio1-control 
 + 29:          0          0   PCI-MSI 81922-edge      virtio1-event 
 + 30:      74023          0   PCI-MSI 81923-edge      virtio1-request 
 + 31:          0      71408   PCI-MSI 81924-edge      virtio1-request 
 +NMI:          0          0   Non-maskable interrupts 
 +LOC:    1701175    2400564   Local timer interrupts 
 +SPU:          0          0   Spurious interrupts 
 +PMI:          0          0   Performance monitoring interrupts 
 +IWI:          1          0   IRQ work interrupts 
 +RTR:          0          0   APIC ICR read retries 
 +RES:     284026     248715   Rescheduling interrupts 
 +CAL:      47419      21994   Function call interrupts 
 +TLB:      23047      13223   TLB shootdowns 
 +TRM:          0          0   Thermal event interrupts 
 +THR:          0          0   Threshold APIC interrupts 
 +DFR:          0          0   Deferred Error APIC interrupts 
 +MCE:          0          0   Machine check exceptions 
 +MCP:       1140       1140   Machine check polls 
 +ERR:          0 
 +MIS:          0 
 +PIN:          0          0   Posted-interrupt notification event 
 +NPI:          0          0   Nested posted-interrupt event 
 +PIW:          0          0   Posted-interrupt wakeup event 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +**Important** : Un pilote de périphérique demande au processeur de fournir un service en utilisant un IRQ. Quand la demande est faite, le processeur interrompe ses activités et passe le contrôle au pilote identifié par l'IRQ. Techniquement l'attribution d'un IRQ à un périphérique doit être exclusive. Dans le cas où deux périphériques demandent un service en même temps, c'est le périphérique ayant l'IRQ le plus bas qui est prioritaire. 
 +</WRAP>  
 + 
 +==Canaux DMA== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/dma 
 + 2: floppy 
 + 4: cascade 
 +</code> 
 + 
 +==Plages d'entrée/sortie== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/ioports 
 +0000-0cf7 : PCI Bus 0000:00 
 +  0000-001f : dma1 
 +  0020-0021 : pic1 
 +  0040-0043 : timer0 
 +  0050-0053 : timer1 
 +  0060-0060 : keyboard 
 +  0064-0064 : keyboard 
 +  0070-0077 : rtc0 
 +  0080-008f : dma page reg 
 +  00a0-00a1 : pic2 
 +  00c0-00df : dma2 
 +  00f0-00ff : fpu 
 +  0170-0177 : 0000:00:01.1 
 +    0170-0177 : ata_piix 
 +  01f0-01f7 : 0000:00:01.1 
 +    01f0-01f7 : ata_piix 
 +  0376-0376 : 0000:00:01.1 
 +    0376-0376 : ata_piix 
 +  03c0-03df : vga+ 
 +  03f2-03f2 : floppy 
 +  03f4-03f5 : floppy 
 +  03f6-03f6 : 0000:00:01.1 
 +    03f6-03f6 : ata_piix 
 +  03f7-03f7 : floppy 
 +  0510-051b : QEMU0002:00 
 +    0510-051b : fw_cfg_io 
 +  0600-063f : 0000:00:01.3 
 +    0600-0603 : ACPI PM1a_EVT_BLK 
 +    0604-0605 : ACPI PM1a_CNT_BLK 
 +    0608-060b : ACPI PM_TMR 
 +  0700-070f : 0000:00:01.3 
 +    0700-0708 : piix4_smbus 
 +0cf8-0cff : PCI conf1 
 +0d00-ffff : PCI Bus 0000:00 
 +  afe0-afe3 : ACPI GPE0_BLK 
 +  c000-cfff : PCI Bus 0000:02 
 +  d000-dfff : PCI Bus 0000:01 
 +  e000-e03f : 0000:00:03.0 
 +  e040-e07f : 0000:00:05.0 
 +  e080-e09f : 0000:00:01.2 
 +    e080-e09f : uhci_hcd 
 +  e0a0-e0bf : 0000:00:12.0 
 +  e0c0-e0cf : 0000:00:01.1 
 +    e0c0-e0cf : ata_piix 
 +</code> 
 + 
 +<WRAP center round alert 60% > 
 +**Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. 
 +</WRAP> 
 + 
 +==Périphériques== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/devices 
 +Character devices: 
 +  1 mem 
 +  4 /dev/vc/0 
 +  4 tty 
 +  4 ttyS 
 +  5 /dev/tty 
 +  5 /dev/console 
 +  5 /dev/ptmx 
 +  6 lp 
 +  7 vcs 
 + 10 misc 
 + 13 input 
 + 21 sg 
 + 29 fb 
 + 99 ppdev 
 +128 ptm 
 +136 pts 
 +153 spi 
 +180 usb 
 +189 usb_device 
 +226 drm 
 +248 hidraw 
 +249 aux 
 +250 cec 
 +251 bsg 
 +252 rtc 
 +253 dax 
 +254 gpiochip 
 + 
 +Block devices: 
 +  2 fd 
 +  8 sd 
 +  9 md 
 + 11 sr 
 + 65 sd 
 + 66 sd 
 + 67 sd 
 + 68 sd 
 + 69 sd 
 + 70 sd 
 + 71 sd 
 +128 sd 
 +129 sd 
 +130 sd 
 +131 sd 
 +132 sd 
 +133 sd 
 +134 sd 
 +135 sd 
 +253 mdp 
 +254 device-mapper 
 +259 blkext 
 +</code> 
 + 
 +==Modules== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/modules | more 
 +ufs 94208 0 - Live 0xffffffffc0cde000 
 +qnx4 16384 0 - Live 0xffffffffc07a3000 
 +hfsplus 126976 0 - Live 0xffffffffc0d2b000 
 +hfs 73728 0 - Live 0xffffffffc0cc4000 
 +minix 45056 0 - Live 0xffffffffc0cb8000 
 +vfat 20480 0 - Live 0xffffffffc0cb2000 
 +msdos 20480 0 - Live 0xffffffffc0cac000 
 +fat 86016 2 vfat,msdos, Live 0xffffffffc0c8f000 
 +jfs 212992 0 - Live 0xffffffffc0cf6000 
 +xfs 1773568 0 - Live 0xffffffffc0add000 
 +xts 16384 1 - Live 0xffffffffc0ad2000 
 +dm_crypt 53248 1 - Live 0xffffffffc0ac4000 
 +cbc 16384 0 - Live 0xffffffffc0abf000 
 +aes_generic 36864 3 - Live 0xffffffffc0ab5000 
 +libaes 16384 1 aes_generic, Live 0xffffffffc0ab0000 
 +crypto_simd 16384 0 - Live 0xffffffffc0aab000 
 +cryptd 24576 1 crypto_simd, Live 0xffffffffc0a9f000 
 +glue_helper 16384 0 - Live 0xffffffffc08dd000 
 +ecb 16384 2 - Live 0xffffffffc0883000 
 +ecryptfs 122880 0 - Live 0xffffffffc0a80000 
 +btrfs 1568768 0 - Live 0xffffffffc0900000 
 +blake2b_generic 20480 0 - Live 0xffffffffc087d000 
 +raid1 53248 0 - Live 0xffffffffc08f2000 
 +dm_raid 45056 0 - Live 0xffffffffc08e6000 
 +raid456 180224 1 dm_raid, Live 0xffffffffc08b0000 
 +async_raid6_recov 24576 1 raid456, Live 0xffffffffc08a7000 
 +async_memcpy 20480 2 raid456,async_raid6_recov, Live 0xffffffffc089f000 
 +async_pq 20480 2 raid456,async_raid6_recov, Live 0xffffffffc0899000 
 +async_xor 20480 3 raid456,async_raid6_recov,async_pq, Live 0xffffffffc0893000 
 +async_tx 20480 5 raid456,async_raid6_recov,async_memcpy,async_pq,async_xor, Live 0xffffffffc088a000 
 +md_mod 180224 3 raid1,dm_raid,raid456, Live 0xffffffffc0850000 
 +xor 24576 2 btrfs,async_xor, Live 0xffffffffc0845000 
 +raid6_pq 122880 4 btrfs,raid456,async_raid6_recov,async_pq, Live 0xffffffffc0822000 
 +libcrc32c 16384 3 xfs,btrfs,raid456, Live 0xffffffffc07b3000 
 +dm_snapshot 53248 0 - Live 0xffffffffc07b9000 
 +dm_bufio 36864 1 dm_snapshot, Live 0xffffffffc07a9000 
 +dm_mod 163840 10 dm_crypt,dm_raid,dm_snapshot,dm_bufio, Live 0xffffffffc07f6000 
 +rfkill 28672 0 - Live 0xffffffffc07cb000 
 +joydev 28672 0 - Live 0xffffffffc0725000 
 +evdev 28672 2 - Live 0xffffffffc071d000 
 +virtio_balloon 24576 0 - Live 0xffffffffc06f7000 
 +sg 36864 0 - Live 0xffffffffc06cc000 
 +serio_raw 20480 0 - Live 0xffffffffc06ba000 
 +pcspkr 16384 0 - Live 0xffffffffc06b0000 
 +qemu_fw_cfg 20480 0 - Live 0xffffffffc06aa000 
 +parport_pc 40960 0 - Live 0xffffffffc0679000 
 +ppdev 24576 0 - Live 0xffffffffc0664000 
 +lp 20480 0 - Live 0xffffffffc066b000 
 +parport 69632 3 parport_pc,ppdev,lp, Live 0xffffffffc0652000 
 +fuse 167936 1 - Live 0xffffffffc0628000 
 +--More-- 
 +[q] 
 +</code> 
 + 
 +==Statistiques de l'utilisation  des disques== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/diskstats 
 +  11       0 sr0 77 0 4235 23 0 0 0 0 0 68 23 0 0 0 0 0 0 
 +         0 sda 12242 8305 1103196 42502 11683 13369 1910368 718254 0 105044 783887 0 0 0 0 2936 23131 
 +         1 sda1 11481 8305 1067918 41666 10597 13369 1910368 717761 0 103920 759427 0 0 0 0 0 0 
 +         2 sda2 11 0 14 38 0 0 0 0 0 64 38 0 0 0 0 0 0 
 +         5 sda5 201 0 14692 296 0 0 0 0 0 460 296 0 0 0 0 0 0 
 +        16 sdb 227 0 8976 27 0 0 0 0 0 72 27 0 0 0 0 0 0 
 +        32 sdc 5023 507625 4247435 13154 1528 253646 2060274 14491 0 12120 31223 0 0 0 0 141 3577 
 +        33 sdc1 144 0 9972 5 0 0 0 0 0 68 5 0 0 0 0 0 0 
 +        34 sdc2 138 0 9924 6 0 0 0 0 0 64 6 0 0 0 0 0 0 
 +        35 sdc3 138 0 9924 6 0 0 0 0 0 64 6 0 0 0 0 0 0 
 +        36 sdc4 24 0 566 43 0 0 0 0 0 124 43 0 0 0 0 0 0 
 +        37 sdc5 941 127001 1035648 1742 19 0 26 1281 0 3504 3024 0 0 0 0 0 0 
 +        38 sdc6 278 0 24508 243 0 0 0 0 0 352 243 0 0 0 0 0 0 
 +        39 sdc7 220 8 19832 268 0 0 0 0 0 376 268 0 0 0 0 0 0 
 +        40 sdc8 1539 253750 2054126 3152 41 0 48 3380 0 6968 6533 0 0 0 0 0 0 
 +        41 sdc9 142 4 19720 211 0 0 0 0 0 332 211 0 0 0 0 0 0 
 +        42 sdc10 807 126861 1033214 5955 734 126795 1019952 4901 0 8468 10857 0 0 0 0 0 0 
 +        43 sdc11 281 1 9545 835 715 126851 1040248 4581 0 5564 5417 0 0 0 0 0 0 
 +        44 sdc12 148 0 13300 287 0 0 0 0 0 368 287 0 0 0 0 0 0 
 + 254       0 dm-0 210 0 8440 72 0 0 0 0 0 108 72 0 0 0 0 0 0 
 + 254       1 dm-1 242 0 8440 164 0 0 0 0 0 168 164 0 0 0 0 0 0 
 +         1 md1 57 0 2304 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
 +</code> 
 + 
 +==Partitions== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/partitions 
 +major minor  #blocks  name 
 + 
 +  11        0     387072 sr0 
 +          0   33554432 sda 
 +          1   32552960 sda1 
 +          2          1 sda2 
 +          5     998400 sda5 
 +         16   67108864 sdb 
 +         32    4194304 sdc 
 +         33     102400 sdc1 
 +         34     102400 sdc2 
 +         35     102400 sdc3 
 +         36          1 sdc4 
 +         37     512000 sdc5 
 +         38     204800 sdc6 
 +         39     307200 sdc7 
 +         40     512000 sdc8 
 +         41     409600 sdc9 
 +         42     512000 sdc10 
 +         43     512000 sdc11 
 +         44     204800 sdc12 
 + 254        0     106496 dm-0 
 + 254        1     114688 dm-1 
 +          1    1019904 md1 
 +</code> 
 + 
 +==Espaces de pagination== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/swaps 
 +Filename                                Type            Size            Used         Priority 
 +/dev/sda5                               partition       998396          0            -2 
 +</code> 
 + 
 +==Statistiques d'utilisation du processeur== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/loadavg 
 +0.00 0.00 0.00 1/292 57813 
 +</code> 
 + 
 +==Statistiques d'utilisation de la mémoire== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/meminfo 
 +MemTotal:        4025596 kB 
 +MemFree:         2604608 kB 
 +MemAvailable:    3626000 kB 
 +Buffers:           28244 kB 
 +Cached:          1159028 kB 
 +SwapCached:            0 kB 
 +Active:           447852 kB 
 +Inactive:         807036 kB 
 +Active(anon):        748 kB 
 +Inactive(anon):    68892 kB 
 +Active(file):     447104 kB 
 +Inactive(file):   738144 kB 
 +Unevictable:           0 kB 
 +Mlocked:               0 kB 
 +SwapTotal:        998396 kB 
 +SwapFree:         998396 kB 
 +Dirty:                 0 kB 
 +Writeback:             0 kB 
 +AnonPages:         67648 kB 
 +Mapped:            65484 kB 
 +Shmem:              2024 kB 
 +KReclaimable:      82492 kB 
 +Slab:             120008 kB 
 +SReclaimable:      82492 kB 
 +SUnreclaim:        37516 kB 
 +KernelStack:        4688 kB 
 +PageTables:         3504 kB 
 +NFS_Unstable:          0 kB 
 +Bounce:                0 kB 
 +WritebackTmp:          0 kB 
 +CommitLimit:     3011192 kB 
 +Committed_AS:    1645372 kB 
 +VmallocTotal:   34359738367 kB 
 +VmallocUsed:       27688 kB 
 +VmallocChunk:          0 kB 
 +Percpu:             2080 kB 
 +HardwareCorrupted:     0 kB 
 +AnonHugePages:     26624 kB 
 +ShmemHugePages:        0 kB 
 +ShmemPmdMapped:        0 kB 
 +FileHugePages:         0 kB 
 +FilePmdMapped:         0 kB 
 +HugePages_Total:       0 
 +HugePages_Free:        0 
 +HugePages_Rsvd:        0 
 +HugePages_Surp:        0 
 +Hugepagesize:       2048 kB 
 +Hugetlb:               0 kB 
 +DirectMap4k:      114536 kB 
 +DirectMap2M:     4079616 kB 
 +</code> 
 + 
 +==Version du noyau== 
 + 
 +<code> 
 +root@debian11:~# cat /proc/version 
 +Linux version 5.10.0-13-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.106-1 (2022-03-17) 
 +</code> 
 + 
 +===Répertoires=== 
 + 
 +==ide/scsi== 
 + 
 +Ce répertoire contient des répertoires dans lesquels se trouvent des informations sur la capacité, le type et la géométrie des disques. 
 + 
 +==acpi== 
 + 
 +Ce répertoire contient des informations sur la gestion de l'énérgie, les températures, les vitesses de ventilateurs, la charge des batteries. 
 + 
 +==bus== 
 + 
 +Ce répertoire contient un sous-répertoire par bus. 
 + 
 +==net== 
 + 
 +Ce répertoire contient des informations sur le réseau. 
 + 
 +==sys== 
 + 
 +Ce répertoire contient des paramètres du noyau. Certains des fichiers dans ce répertoire sont accessibles en écriture par root en temps réel. Par exemple pour éviter des attaques réseau **%%DoS%%** utilisant la commande **ping**, saisissez la commande suivante : 
 + 
 +  # echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all [Entrée] 
 + 
 +Cette commande a pour résultat d'ignorer les reqûetes ping. 
 + 
 +====2.2 - Utilisation de la Commande sysctl==== 
 + 
 +Les fichiers dans le répertoire **/proc/sys** peuvent être administrés par la commande **sysctl** en temps réel.  
 + 
 +La commande **sysctl** applique les règles consignés dans le fichier **/etc/sysctl.conf** au démarrage de la machine. 
 + 
 +Saisissez la commande : 
 + 
 +<code> 
 +root@debian11:~# cat /etc/sysctl.conf 
 +
 +# /etc/sysctl.conf - Configuration file for setting system variables 
 +# See /etc/sysctl.d/ for additional system variables. 
 +# See sysctl.conf (5) for information. 
 +
 + 
 +#kernel.domainname = example.com 
 + 
 +# Uncomment the following to stop low-level messages on console 
 +#kernel.printk = 3 4 1 3 
 + 
 +################################################################### 
 +# Functions previously found in netbase 
 +
 + 
 +# Uncomment the next two lines to enable Spoof protection (reverse-path filter) 
 +# Turn on Source Address Verification in all interfaces to 
 +# prevent some spoofing attacks 
 +#net.ipv4.conf.default.rp_filter=1 
 +#net.ipv4.conf.all.rp_filter=1 
 + 
 +# Uncomment the next line to enable TCP/IP SYN cookies 
 +# See http://lwn.net/Articles/277146/ 
 +# Note: This may impact IPv6 TCP sessions too 
 +#net.ipv4.tcp_syncookies=1 
 + 
 +# Uncomment the next line to enable packet forwarding for IPv4 
 +#net.ipv4.ip_forward=1 
 + 
 +# Uncomment the next line to enable packet forwarding for IPv6 
 +#  Enabling this option disables Stateless Address Autoconfiguration 
 +#  based on Router Advertisements for this host 
 +#net.ipv6.conf.all.forwarding=1 
 + 
 + 
 +################################################################### 
 +# Additional settings - these settings can improve the network 
 +# security of the host and prevent against some network attacks 
 +# including spoofing attacks and man in the middle attacks through 
 +# redirection. Some network environments, however, require that these 
 +# settings are disabled so review and enable them as needed. 
 +
 +# Do not accept ICMP redirects (prevent MITM attacks) 
 +#net.ipv4.conf.all.accept_redirects = 0 
 +#net.ipv6.conf.all.accept_redirects = 0 
 +# _or_ 
 +# Accept ICMP redirects only for gateways listed in our default 
 +# gateway list (enabled by default) 
 +# net.ipv4.conf.all.secure_redirects = 1 
 +
 +# Do not send ICMP redirects (we are not a router) 
 +#net.ipv4.conf.all.send_redirects = 0 
 +
 +# Do not accept IP source route packets (we are not a router) 
 +#net.ipv4.conf.all.accept_source_route = 0 
 +#net.ipv6.conf.all.accept_source_route = 0 
 +
 +# Log Martian Packets 
 +#net.ipv4.conf.all.log_martians = 1 
 +
 + 
 +################################################################### 
 +# Magic system request Key 
 +# 0=disable, 1=enable all, >1 bitmask of sysrq functions 
 +# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html 
 +# for what other values do 
 +#kernel.sysrq=438 
 + 
 +root@debian11:~# ls -l /etc/sysctl.d/ 
 +total 4 
 +lrwxrwxrwx 1 root root  14 Mar 20 20:55 99-sysctl.conf -> ../sysctl.conf 
 +-rw-r--r-- 1 root root 639 Apr  6  2021 README.sysctl 
 +</code> 
 + 
 +Les options de la commande **sysctl** sont : 
 + 
 +<code> 
 +root@debian11:~# sysctl --help 
 + 
 +Usage: 
 + sysctl [options] [variable[=value] ...] 
 + 
 +Options: 
 +  -a, --all            display all variables 
 +  -A                   alias of -a 
 +  -X                   alias of -a 
 +      --deprecated     include deprecated parameters to listing 
 +  -b, --binary         print value without new line 
 +  -e, --ignore         ignore unknown variables errors 
 +  -N, --names          print variable names without values 
 +  -n, --values         print only values of the given variable(s) 
 +  -p, --load[=<file> read values from file 
 +  -f                   alias of -p 
 +      --system         read values from all system directories 
 +  -r, --pattern <expression> 
 +                       select setting that match expression 
 +  -q, --quiet          do not echo variable set 
 +  -w, --write          enable writing a value to variable 
 +  -o                   does nothing 
 +  -x                   does nothing 
 +  -d                   alias of -h 
 + 
 + -h, --help     display this help and exit 
 + -V, --version  output version information and exit 
 + 
 +For more details see sysctl(8). 
 +</code> 
 + 
 +=====LAB#- Interprétation des informations dans /proc=====
  
 Les informations brutes stockées dans /proc peuvent être interprétées grâce à l'utilisation des commandes dites de //gestion des performances// : Les informations brutes stockées dans /proc peuvent être interprétées grâce à l'utilisation des commandes dites de //gestion des performances// :
  
   * free,   * free,
 +  * uptime et w,
   * iostat,   * iostat,
   * hdparm,   * hdparm,
Ligne 43: Ligne 1186:
   * collectd.   * collectd.
  
-====1.1 - La Commande free====+====3.1 - La Commande free====
  
 La commande **free** permet de donner l’état de la mémoire totale, libre, partagée, swap et bufferisée. Saisissez donc la commande suivante : La commande **free** permet de donner l’état de la mémoire totale, libre, partagée, swap et bufferisée. Saisissez donc la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# free -m +root@debian11:~# free -m 
-              total        used        free      shared  buff/cache   available +               total        used        free      shared  buff/cache   available 
-Mem:           3735        1135        1818          14         782        2363 +Mem:            3931         147        2543                  1240        3541 
-Swap:          3279           0        3279+Swap:            974           0         974
 </code> </code>
  
 Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : Dans le cas de cet exemple, nous pouvons constater que l’affichage montre :
  
-  * 3735 Mo de mémoire physique totale, +  * 3931 Mo de mémoire physique totale, 
-  * 1135 Mo de mémoire physique utilisée et 1818 Mo de mémoire physique libre, +  * 147 Mo de mémoire physique utilisée et 2543 Mo de mémoire physique libre, 
-  * 3279 Mo de mémoire swap totale et 0 Mo de swap utilisé+  * 974 Mo de mémoire swap totale et 0 Mo de swap utilisé
  
 Les options de cette commande sont : Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# free --help+root@debian11:~# free --help
  
 Usage: Usage:
Ligne 94: Ligne 1237:
 </code> </code>
  
-====1.2 - La Commande iostat====+====3.2 - Les Commandes uptime et w====
  
-La commande **iostat** affiche des statistiques sur l'utilisation des disquesdes terminaux et des lecteurs de cartouche :+Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute5 minutes et 15 minutes :
  
 <code> <code>
-[root@centos8 ~]iostat +root@debian11:~# uptime 
-bashiostatcommand not found... + 15:51:36 up 4 days,  2:43,  1 user,  load average: 0.10, 0.03, 0.01
-Install package 'sysstat' to provide command 'iostat'? [N/y] y+
  
 +root@debian11:~# w
 + 15:51:38 up 4 days,  2:43,  1 user,  load average: 0.10, 0.03, 0.01
 +USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
 +trainee  pts/0    10.0.2.1         10:54    2.00s  0.43s  0.06s sshd: trainee [priv]
 +</code>
  
- Waiting in queue...  +Les valeurs **load average** ou //charge moyenne// indiquent le nombre moyen de processus en cours de traitement ou en attente pour la période concernée.
-The following packages have to be installed: +
- lm_sensors-libs-3.4.0-22.20180522git70f7e08.el8.x86_64 Lm_sensors core libraries +
- sysstat-11.7.3-5.el8.x86_64    Collection of performance monitoring tools for Linux +
-Proceed with changes? [N/y] y+
  
 +Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3,48  4,00  3,85** ceci indiquerait que le processeur a du mal à traiter les processus mettant en moyenne :
  
- Waiting in queue...  +  * 2,48 processus en attente dans la dernière minute, 
- Waiting for authentication...  +  3,00 processus en attente dans les dernières 5 minutes, 
- * Waiting in queue...  +  2,85 processus en attente dans les dernières 15 minutes
- * Downloading packages...  + 
- * Requesting data...  +Les options de ces commandes sont : 
- * Testing changes...  + 
- Installing packages...  +<code> 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(CPU)+root@debian11:~# uptime --help 
 + 
 +Usage: 
 + uptime [options] 
 + 
 +Options: 
 + -p, --pretty   show uptime in pretty format 
 + -h, --help     display this help and exit 
 + -s, --since    system up since 
 + -V, --version  output version information and exit 
 + 
 +For more details see uptime(1)
 + 
 +root@debian11:~# w --help 
 + 
 +Usage: 
 + w [options] 
 + 
 +Options: 
 + -h, --no-header     do not print header 
 + -u, --no-current    ignore current process username 
 + -s, --short         short format 
 + -f, --from          show remote hostname field 
 + -o, --old-style     old style output 
 + -i, --ip-addr       display IP address instead of hostname (if possible) 
 + 
 +     --help     display this help and exit 
 + -V, --version  output version information and exit 
 + 
 +For more details see w(1)
 +</code> 
 + 
 +====3.3 - La Commande iostat==== 
 + 
 +La commande **iostat** affiche des statistiques sur l'utilisation des disques, des terminaux et des lecteurs de cartouche : 
 + 
 +<code> 
 +root@debian11:~# iostat 
 +-bash: iostat: command not found 
 +root@debian11:~# apt -y install sysstat 
 +</code> 
 + 
 +<code> 
 +root@debian11:~# iostat 
 +Linux 5.10.0-13-amd64 (debian11)        05/01/2022      _x86_64_        (CPU)
  
 avg-cpu:  %user   %nice %system %iowait  %steal   %idle avg-cpu:  %user   %nice %system %iowait  %steal   %idle
-           0.03    0.00    0.03    0.01    0.00   99.93+           0.21    0.00    0.11    0.31    0.00   99.38
  
-Device             tps    kB_read/   kB_wrtn/   kB_read    kB_wrtn +Device             tps    kB_read/   kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd 
-sda               0.28         7.67         1.49     735338     142510 +dm-0              0.01         0.29         0.00         0.00       4220          0          0 
-sdb               0.00         0.03         0.00       2995          0 +dm-1              0.02         0.29         0.00         0.00       4220          0          0 
-scd0              0.00         0.00         0.00                   0 +md1               0.00         0.08         0.00         0.00       1152                   0 
-dm-             0.26         7.25         1.55     694786     148837 +sda               1.64        37.79        65.45         0.00     551666     955604          0 
-dm-1              0.00         0.02         0.00       2220          0+sdb               0.02         0.31         0.00         0.00       4488          0          0 
 +sdc               0.45       145.46        70.56         0.00    2123717    1030137          0 
 +sr0               0.01         0.15         0.00         0.00       2117          0          0
 </code> </code>
  
Ligne 148: Ligne 1338:
   * Le nombre de blocs de KB lus par seconde.   * Le nombre de blocs de KB lus par seconde.
   * Le nombre de blocs de KB écrits par seconde.   * Le nombre de blocs de KB écrits par seconde.
 +  * Le nombre de blocs de KB jetés par seconde.
   * Le nombre total de KB lus.   * Le nombre total de KB lus.
   * Le nombre total de KB écrits.   * Le nombre total de KB écrits.
 +  * Le nombre total de KB jetés.
      
 Dernièrement, pour voir les statistiques étendues des disques, utilisez la commande suivante : Dernièrement, pour voir les statistiques étendues des disques, utilisez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# iostat -d -x +root@debian11:~# iostat -d -x 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (CPU)+Linux 5.10.0-13-amd64 (debian11)        05/01/2022      _x86_64_        (CPU)
  
-Device            r/s     w/s     rkB/s     wkB/s   rrqm/s   wrqm/ %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util +Device            r/s     rkB/s   rrqm/ %rrqm r_await rareq-sz     w/s     wkB/  wrqm/ %wrqm w_await wareq-sz     d/s     dkB/  drqm/ %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util 
-sda              0.20    0.16     11.67      1.81     0.00     0.03   0.48  17.45    6.79   69.99   0.01    58.28    11.33   9.13   0.33 +dm-0             0.01      0.29     0.00   0.00    0.34    20.10    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00 
-sdb              0.00    0.00      0.02      0.00     0.00     0.00   0.00   0.00    0.13    0.00   0.00     8.81     0.00   0.51   0.00 +dm-1             0.02      0.29     0.00   0.00    0.68    17.44    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00 
-scd0             0.00    0.00      0.00      0.00     0.00     0.00   0.00   0.00    0.20    0.00   0.00     0.20     0.00   0.90   0.00 +md1              0.00      0.08     0.00   0.00    0.00    20.21    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00 
-dm-            0.12    0.19      3.98      1.90     0.00     0.00   0.00   0.00    4.18   79.07   0.02    32.88    10.07  10.34   0.32 +sda              0.84     37.71     0.57  40.42    3.47    45.06    0.80     65.31     0.91  53.23   61.25    81.27    0.00      0.00     0.00   0.00    0.00     0.00    0.20    7.89    0.05   0.72 
-dm-1             0.00    0.00      0.01      0.00     0.00     0.00   0.00   0.00    0.76    0.00   0.00    21.35     0.00   0.68   0.00+sdb              0.02      0.31     0.00   0.00    0.12    19.77    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00 
 +sdc              0.34    145.15    34.70  99.02    2.62   422.80    0.10     70.41    17.34  99.40    9.48   674.17    0.00      0.00     0.00   0.00    0.00     0.00    0.01   25.37    0.00   0.08 
 +sr0              0.01      0.14     0.00   0.00    0.30    27.50    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00
 </code> </code>
  
Ligne 168: Ligne 1362:
  
 <code> <code>
-[root@centos8 ~]# iostat --help+root@debian11:~# iostat --help
 Usage: iostat [ options ] [ <interval> [ <count> ] ] Usage: iostat [ options ] [ <interval> [ <count> ] ]
 Options are: Options are:
 [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ]
-[ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ]+[ { -f | +f } <directory>[ -j { ID | LABEL | PATH | UUID | ... } ] 
 +[ --dec={ 0 | 1 | 2 } ] [ --human ] [ --pretty ] [ -o JSON ]
 [ [ -H ] -g <group_name> ] [ -p [ <device> [,...] | ALL ] ] [ [ -H ] -g <group_name> ] [ -p [ <device> [,...] | ALL ] ]
 [ <device> [...] | ALL ] [ <device> [...] | ALL ]
 </code> </code>
  
-====1.3 - La Commande hdparm====+====3.4 - La Commande hdparm====
  
 Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** :
  
 <code> <code>
-[root@centos8 ~]# hdparm -t /dev/sda+root@debian11:~# hdparm -t /dev/sdc
  
-/dev/sda+root@debian11:~# apt -y install hdparm 
- Timing buffered disk reads: 1410 MB in  3.00 seconds = 469.98 MB/sec+ 
 +root@debian11:~# hdparm -t /dev/sdc 
 + 
 +/dev/sdc
 + Timing buffered disk reads: 2788 MB in  3.00 seconds = 928.32 MB/sec
 </code> </code>
  
-====1.- La Commande vmstat====+====3.- La Commande vmstat====
  
 La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur : La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur :
  
 <code> <code>
-[root@centos8 ~]# vmstat 1 10+root@debian11:~# vmstat 1 10
 procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
   b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st   b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
-  0      0 1765216   2256 866336       0         0      12  100  +  0      0 3229368  26228 621512       0    22    33   14   27  99  
-  0      0 1765136   2256 866336       0           57   80   0 100  0  0 +  0      0 3229360  26228 621552       0           34   42   0 100  0  0 
-  0      0 1765136   2256 866376       0           54   77   0 100  0  0 +  0      0 3229360  26228 621552       0           22   31   0 100  0  0 
-  0      0 1765136   2256 866376       0           66  100   0 100  0  0 +  0      0 3229360  26228 621552       0           29   43   0 100  0  0 
-  0      0 1765136   2256 866376       0          103  125   0 100  0  0 +  0      0 3229360  26228 621552       0           28   40   0 100  0  0 
-  0      0 1765108   2256 866376       0           64   86   0 100  0  0 +  0      0 3229360  26228 621552       0           29   41   0 100  0  0 
-  0      0 1765108   2256 866376       0         0   62   88  100   0 +  0      0 3229392  26236 621544       0        12   33   52  95   0 
-  0      0 1765108   2256 866376       0           68   97   0 100  0  0 +  0      0 3229392  26236 621552       0           40   50   0 100  0  0 
-  0      0 1765108   2256 866376       0           60   88   0 100  0  0 +  0      0 3229392  26236 621552       0           29   40   0 100  0  0 
-  0      0 1765108   2256 866376       0          177  251   0 100  0  0+  0      0 3229392  26236 621552       0           36   60   0 100  0  0
 </code> </code>
  
Ligne 247: Ligne 1446:
  
 <code> <code>
-[root@centos8 ~]# vmstat --help+root@debian11:~# vmstat --help
  
 Usage: Usage:
Ligne 275: Ligne 1474:
 </WRAP> </WRAP>
  
-====1.- La Commande mpstat====+====3.- La Commande mpstat====
  
 La commande **mpstat** affiche des statistiques détaillées sur le CPU : La commande **mpstat** affiche des statistiques détaillées sur le CPU :
  
 <code> <code>
-[root@centos8 ~]# mpstat +root@debian11:~# mpstat 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-04:53:22     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +04:10:45 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-04:53:22     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92+04:10:45 PM  all    0.04    0.00    0.02    0.12    0.00    0.00    0.00    0.00    0.00   99.83
 </code> </code>
  
Ligne 290: Ligne 1489:
  
 <code> <code>
-[root@centos8 ~]# mpstat -P ALL +root@debian11:~# mpstat -P ALL 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-04:54:28     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +04:11:05 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-04:54:28     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92 +04:11:05 PM  all    0.04    0.00    0.02    0.12    0.00    0.00    0.00    0.00    0.00   99.83 
-04:54:28          0.03    0.00    0.01    0.00    0.01    0.00    0.00    0.00    0.00   99.94 +04:11:05 PM       0.04    0.00    0.02    0.13    0.00    0.00    0.00    0.00    0.00   99.81 
-04:54:28          0.02    0.00    0.02    0.03    0.02    0.00    0.00    0.00    0.00   99.91 +04:11:05 PM       0.04    0.00    0.02    0.10    0.00    0.00    0.00    0.00    0.00   99.84
-04:54:28          0.02    0.00    0.01    0.01    0.01    0.04    0.00    0.00    0.00   99.90 +
-04:54:28          0.01    0.00    0.01    0.02    0.00    0.00    0.00    0.00    0.00   99.95 +
-04:54:28          0.05    0.00    0.02    0.03    0.01    0.00    0.00    0.00    0.00   99.88 +
-04:54:28          0.03    0.01    0.01    0.02    0.01    0.00    0.00    0.00    0.00   99.92 +
-04:54:28          0.02    0.00    0.02    0.01    0.01    0.00    0.00    0.00    0.00   99.95 +
-04:54:28          0.02    0.00    0.01    0.01    0.01    0.00    0.00    0.00    0.00   99.94+
 </code> </code>
  
Ligne 308: Ligne 1501:
  
 <code> <code>
-[root@centos8 ~]# mpstat -P ALL 2 5 +root@debian11:~# mpstat -P ALL 2 5 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-04:55:11     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +04:11:24 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-04:55:13     all    0.00    0.00    0.00    0.00    0.00    0.00    0.06    0.00    0.00   99.94 +04:11:26 PM  all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:26 PM       0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:26 PM       0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.50    0.00    0.00   99.50 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00+
  
-04:55:13     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +04:11:26 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-04:55:15     all    0.00    0.00    0.00    0.00    0.06    0.00    0.00    0.00    0.00   99.94 +04:11:28 PM  all    0.00    0.00    0.25    0.00    0.00    0.00    0.00    0.00    0.00   99.75 
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:28 PM       0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:28 PM       0.00    0.00    0.50    0.00    0.00    0.00    0.00    0.00    0.00   99.50
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50+
  
-04:55:15     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +04:11:28 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-04:55:17     all    0.00    0.00    0.00    0.00    0.06    0.00    0.00    0.00    0.00   99.94 +04:11:30 PM  all    0.00    0.00    0.25    0.00    0.00    0.00    0.00    0.00    0.00   99.75 
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:30 PM       0.00    0.00    0.50    0.00    0.00    0.00    0.00    0.00    0.00   99.50 
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:30 PM       0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
-04:55:17          0.00    0.00    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00+
  
-04:55:17     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +04:11:30 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-04:55:19     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:32 PM  all    0.25    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.75 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:32 PM       0.50    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.50 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:32 PM       0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00+
  
-04:55:19     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +04:11:32 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-04:55:21     all    0.06    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.94 +04:11:34 PM  all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:34 PM       0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +04:11:34 PM       0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.50    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.50+
  
 Average:     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle Average:     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
-Average:     all    0.01    0.00    0.00    0.00    0.02    0.00    0.01    0.00    0.00   99.95 +Average:     all    0.05    0.00    0.10    0.00    0.00    0.00    0.00    0.00    0.00   99.85 
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Average:          0.10    0.00    0.10    0.00    0.00    0.00    0.00    0.00    0.00   99.80 
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Average:          0.00    0.00    0.10    0.00    0.00    0.00    0.00    0.00    0.00   99.90
-Average:          0.00    0.00    0.00    0.00    0.10    0.00    0.00    0.00    0.00   99.90 +
-Average:       3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.10    0.00    0.00   99.90 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.10    0.00    0.00    0.00    0.10    0.00    0.00    0.00    0.00   99.80+
 </code> </code>
  
Ligne 381: Ligne 1538:
  
 <code> <code>
-[root@centos8 ~]# mpstat --help+root@debian11:~# mpstat --help
 Usage: mpstat [ options ] [ <interval> [ <count> ] ] Usage: mpstat [ options ] [ <interval> [ <count> ] ]
 Options are: Options are:
-[ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] +[ -A ] [ -n ] [ -T ] [ -u ] [ -V ] 
-[ -N { <node_list> | ALL } ] [ -o JSON ] [ -P { <cpu_list> | ALL } ]+[ -I { SUM | CPU | SCPU | ALL } ] [ -N { <node_list> | ALL } ] 
 +[ --dec={ 0 | 1 | 2 } ] [ -o JSON ] [ -P { <cpu_list> | ALL } ]
 </code> </code>
  
-====1.- La Commande sar====+====3.- La Commande sar====
  
-La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l'option qui est passée en argument à la commande. +La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l'option qui est passée en argument à la commande. Quelques options importantes sont :
  
-Sous RHEL/CentOS 8 la commande **/usr/lib64/sa/sadc** permet de collecter les informations :+^ Option ^ Description ^ 
 +| -u | Pourcentage d'utilisation du CPU | 
 +| -q | Nombre de processus en attente | 
 +| -r | Utilisation de la mémoire centrale | 
 +| -w | Surveillance du swapping | 
 +| -p | Surveillance de la pagination | 
 +| -b | Utilisation des tampons | 
 +| -d | Utilisation des disques | 
 + 
 +Sous Debian 11 la commande **/usr/lib/sysstat/sadc** permet de collecter les informations :
  
 <code> <code>
-[root@centos8 ~]# ls /usr/lib64/sa +root@debian8:~# ls /usr/lib/sysstat
-sa1  sa2  sadc+debian-sa1  sa1  sa2  sadc
 </code> </code>
  
-Le script **/usr/lib64/sa/sa1** exécute la commande **sadc**. Ce script prend deux options :+Le script **/usr/lib/sysstat/sa1** exécutent la commande **sadc**. Sous Debian 11, c'est le script **debian-sa1** qui est appelé à la place de **sa1** afin de rectifier une bogue dans ce dernier ( Bug#499461 ). Ce script, tout comme le script **sa1**, prend deux options :
  
 ^ Option ^ Description ^ ^ Option ^ Description ^
-| -t | L'intervalle entre les collectes |+| -t | L'interval entre les collectes |
 | -n | Nombre de collectes | | -n | Nombre de collectes |
  
-Le script **/usr/lib64/sa/sa2** exécute la commande **sar** et consigne les informations dans un fichier au format **/var/log/sa/sar<jj>** +Le script **/usr/lib/sysstat/sa2** exécutent la commande **sar** et consignent les informations dans un fichier au format **/var/log/sysstat/sar<jj>**.
- +
-<code> +
-[root@centos8 ~]# ls /var/log/sa/ +
-sa29  s+
  
- +Sous Debian 11, l'intervalle entre les collectes des informations est configuré par les **timers** de systemd au lieu des cron jobs :
-ar29 +
-</code> +
- +
-Sous CentOS / RHEL 8, l'intervalle entre les collectes des informations est configuré par les **timers** de systemd au lieu des cron jobs :+
  
 <code> <code>
-[root@centos8 ~]# cat /usr/lib/systemd/system/sysstat-collect.timer +root@debian11:~# cat /usr/lib/systemd/system/sysstat-collect.timer 
-/usr/lib/systemd/system/sysstat-collect.timer+# /lib/systemd/system/sysstat-collect.timer
 # (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl> # (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl>
 # #
-# sysstat-11.7.systemd unit file:+# sysstat-12.5.systemd unit file:
 #        Activates activity collector every 10 minutes #        Activates activity collector every 10 minutes
  
Ligne 437: Ligne 1596:
 La valeur de **OnCalendar** indique un collecte toutes les dix minutes. La valeur de **OnCalendar** indique un collecte toutes les dix minutes.
  
-Pour modifier l'intervalle entre les collectes, il faut créer un fichier **override** dans le répertoire **/etc/systemd/system/** en utilisant la commande **systemctl edit**. En effet, il ne faut jamais éditer les fichiers dans le répertoire **/usr/lib/systemd/system** :+Pour modifier l'intervalle entre les collectes, il faut créer un fichier **override** dans le répertoire **/etc/systemd/system/** en utilisant la commande **systemctl edit** :
  
 <code> <code>
-[root@centos8 ~]# systemctl edit sysstat-collect.timer +root@debian11:~# EDITOR=/usr/bin/vi 
-[root@centos8 ~]cat /etc/systemd/system/sysstat-collect.timer.d/override.conf +root@debian11:~# export EDITOR 
 +root@debian11:~# systemctl edit sysstat-collect.timer 
 +### Editing /etc/systemd/system/sysstat-collect.timer.d/override.conf 
 +### Anything between here and the comment below will become the new contents of the file 
 [Unit] [Unit]
 Description=Run system activity accounting tool every 2 minutes Description=Run system activity accounting tool every 2 minutes
Ligne 448: Ligne 1611:
 OnCalendar= OnCalendar=
 OnCalendar=*:00/2 OnCalendar=*:00/2
-AccuracySec=0+ 
 +[Install] 
 +WantedBy=sysstat.service 
 + 
 +### Lines below this comment will be discarded 
 + 
 +### /lib/systemd/system/sysstat-collect.timer 
 +# # /lib/systemd/system/sysstat-collect.timer 
 +# # (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl> 
 +# # 
 +# # sysstat-12.5.2 systemd unit file: 
 +# #        Activates activity collector every 10 minutes 
 +
 +# [Unit] 
 +# Description=Run system activity accounting tool every 10 minutes 
 +
 +# [Timer] 
 +# OnCalendar=*:00/10 
 +
 +# [Install] 
 +# WantedBy=sysstat.service 
 +[Escape] [:] [x]  <<<<<<<<<<<<<<<<<<<<<<<<APPUYEZ sur le touches 
 + 
 + 
 +root@debian11:~# cat /etc/systemd/system/sysstat-collect.timer.d/override.conf 
 +[Unit] 
 +Description=Run system activity accounting tool every 2 minutes 
 + 
 +[Timer] 
 +OnCalendar= 
 +OnCalendar=*:00/2  
 + 
 +[Install] 
 +WantedBy=sysstat.serviceroot@debian11:~# 
 </code> </code>
  
Ligne 458: Ligne 1654:
  
 <code> <code>
-[root@centos8 ~]# systemctl status sysstat-collect.timer+root@debian11:~# systemctl status sysstat-collect.timer
 ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes
-   Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: disabled+     Loaded: loaded (/lib/systemd/system/sysstat-collect.timer; disabled; vendor preset: enabled
-  Drop-In: /etc/systemd/system/sysstat-collect.timer.d +    Drop-In: /etc/systemd/system/sysstat-collect.timer.d 
-           └─override.conf +             └─override.conf 
-   Active: active (waiting) since Tue 2021-06-29 06:16:04 EDT3h 2min ago +     Active: inactive (dead) 
-  Trigger: Tue 2021-06-29 09:20:00 EDT; 1min 19s left+    Trigger: n/a 
 +   Triggers: ● sysstat-collect.service 
 +root@debian11:~# systemctl start sysstat-collect.timer 
 +root@debian11:~# systemctl status sysstat-collect.timer 
 +● sysstat-collect.timer - Run system activity accounting tool every 2 minutes 
 +     Loaded: loaded (/lib/systemd/system/sysstat-collect.timer; disabled; vendor preset: enabled) 
 +    Drop-In: /etc/systemd/system/sysstat-collect.timer.d 
 +             └─override.conf 
 +     Active: active (waiting) since Sat 2022-04-30 16:30:54 CEST2s ago 
 +    Trigger: Sat 2022-04-30 16:32:00 CEST; 1min 2s left 
 +   Triggers: ● sysstat-collect.service
  
-Jun 29 06:16:04 centos8.ittraining.loc systemd[1]: Started Run system activity accounting tool every 10 minutes.+Apr 30 16:30:54 debian11 systemd[1]: Started Run system activity accounting tool every minutes. <<<<<<<<<<<<< NOTEZ "2 minutes"
 </code> </code>
  
 <code> <code>
-[root@centos8 ~]# journalctl -g sysstat-collect.service 
--- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- 
-Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 06:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:00:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:10:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:53:56 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:54:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:56:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 07:58:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-Jun 29 08:00:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-... 
-</code> 
  
 Saisissez la commande suivante : Saisissez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# sar +root@debian11:~# sar 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (CPU) +Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
- +
-06:16:04     LINUX RESTART      (8 CPU) +
- +
-06:20:33        CPU     %user     %nice   %system   %iowait    %steal     %idle +
-06:26:29        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-06:30:33        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-06:40:33        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-06:50:33        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-07:00:33        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-07:10:33        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-07:20:33        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-07:30:33        all      0.02      0.01      0.03      0.00      0.00     99.94 +
-07:40:33        all      0.03      0.00      0.04      0.00      0.00     99.93 +
-07:50:33        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-07:53:56        all      0.08      0.00      0.06      0.00      0.00     99.86 +
-07:54:00        all      0.09      0.00      0.06      0.00      0.00     99.85 +
-Average:        all      0.03      0.00      0.03      0.00      0.00     99.94 +
- +
-07:55:44     LINUX RESTART      (8 CPU) +
- +
-07:56:00        CPU     %user     %nice   %system   %iowait    %steal     %idle +
-07:58:00        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-08:00:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:02:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-08:04:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:06:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:08:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:10:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:12:00        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-08:14:00        all      0.02      0.00      0.03      0.01      0.00     99.94 +
-08:16:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:18:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:20:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:22:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:24:00        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-08:26:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:28:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:30:00        all      0.02      0.05      0.05      0.00      0.00     99.87 +
-08:32:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:34:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:36:00        all      0.03      0.00      0.04      0.00      0.00     99.94 +
-08:38:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:40:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:42:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-08:44:00        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-08:46:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-08:48:00        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-08:50:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:52:00        all      0.02      0.00      0.06      0.00      0.00     99.92 +
-08:54:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:56:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:58:00        all      0.02      0.00      0.02      0.00      0.00     99.96 +
-09:00:00        all      0.07      0.00      0.05      0.00      0.00     99.88 +
-09:02:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-09:04:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-09:06:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-09:08:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-09:10:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-09:12:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
- +
-09:12:00        CPU     %user     %nice   %system   %iowait    %steal     %idle +
-09:14:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-09:16:00        all      0.02      0.00      0.06      0.00      0.00     99.92 +
-09:18:00        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-09:20:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-Average:        all      0.02      0.00      0.03      0.00      0.00     99.94+
 </code> </code>
  
Ligne 569: Ligne 1689:
  
 <code> <code>
-[root@centos8 ~]# sar -u 5 3 +root@debian11:~# sar -u 5 3 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-09:22:52        CPU     %user     %nice   %system   %iowait    %steal     %idle +04:33:15 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle 
-09:22:57        all      0.03      0.00      0.03      0.00      0.00     99.95 +04:33:20 PM     all      0.00      0.00      0.00      0.00      0.00    100.00 
-09:23:02        all      0.03      0.00      0.03      0.00      0.00     99.95 +04:33:25 PM     all      0.00      0.00      0.00      0.00      0.00    100.00 
-09:23:07        all      0.00      0.00      0.03      0.00      0.00     99.97 +04:33:30 PM     all      0.00      0.00      0.00      0.00      0.00    100.00 
-Average:        all      0.02      0.00      0.03      0.00      0.00     99.96+Average:        all      0.00      0.00      0.00      0.00      0.00    100.00
 </code> </code>
  
Ligne 582: Ligne 1702:
  
 <code> <code>
-[root@centos8 ~]# sar -u ALL 5 3 +root@debian11:~# sar -u ALL 5 3 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-01:49:14        CPU      %usr     %nice      %sys   %iowait    %steal      %irq     %soft    %guest    %gnice     %idle +04:33:53 PM     CPU      %usr     %nice      %sys   %iowait    %steal      %irq     %soft    %guest    %gnice     %idle 
-01:49:19        all      0.03      0.00      0.00      0.00      0.00      0.03      0.00      0.00      0.00     99.95 +04:33:58 PM     all      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00    100.00 
-01:49:24        all      0.03      0.00      0.03      0.00      0.00      0.10      0.05      0.00      0.00     99.80 +04:34:03 PM     all      0.10      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00     99.90 
-01:49:29        all      0.00      0.00      0.00      0.25      0.00      0.10      0.05      0.00      0.00     99.60 +04:34:08 PM     all      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00    100.00 
-Average:        all      0.02      0.00      0.01      0.08      0.00      0.08      0.03      0.00      0.00     99.78+Average:        all      0.03      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00     99.97
 </code> </code>
  
Ligne 595: Ligne 1715:
  
 <code> <code>
-[root@centos8 ~]# sar -u -P 5 3 +root@debian11:~# sar -u -P 5 3 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-01:51:52        CPU     %user     %nice   %system   %iowait    %steal     %idle +04:35:14 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle 
-01:51:57          1      0.00      0.00      0.00      0.00      0.00    100.00 +04:35:19 PM            0.00      0.00      0.00      0.00      0.00    100.00 
-01:52:02          1      0.20      0.00      0.00      0.00      0.00     99.80 +04:35:24 PM            0.00      0.00      0.00      0.00      0.00    100.00 
-01:52:07          1      0.00      0.00      0.00      0.00      0.00    100.00 +04:35:29 PM            0.00      0.00      0.00      0.00      0.00    100.00 
-Average:               0.07      0.00      0.00      0.00      0.00     99.93 +Average:               0.00      0.00      0.00      0.00      0.00    100.00
-[root@centos8 ~]# sar -u -P 5 5 3 +
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)+
  
-01:52:16        CPU     %user     %nice   %system   %iowait    %steal     %idle +root@debian11:~# sar -u -P 1 5 3 
-01:52:21          5      0.00      0.00      0.00      0.00      0.00    100.00 +Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (2 CPU) 
-01:52:26          5      0.00      0.00      0.00      0.00      0.00    100.00 + 
-01:52:31          5      0.00      0.00      0.00      0.00      0.00    100.00 +04:34:39 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle 
-Average:               0.00      0.00      0.00      0.00      0.00    100.00+04:34:44 PM            0.00      0.00      0.00      0.00      0.00    100.00 
 +04:34:49 PM            0.00      0.00      0.00      0.00      0.00    100.00 
 +04:34:54 PM            0.00      0.00      0.00      0.00      0.00    100.00 
 +Average:               0.00      0.00      0.00      0.00      0.00    100.00
 </code> </code>
  
Ligne 618: Ligne 1739:
  
 <code> <code>
-[root@centos8 ~]# sar -r 5 3 +root@debian11:~# sar -r 5 3 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_(CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-07:33:32    kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty +04:35:58 PM kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty 
-07:33:37      1647240   2297232   2177792     56.94      3356    827396   5096432     70.94    359072   1486368         0 +04:36:03 PM   2977608   3629252    115520      2.87     33556    789044   1645752     32.76    463612    428012       308 
-07:33:42      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486300         0 +04:36:08 PM   2977664   3629308    115448      2.87     33556    789068   1645752     32.76    463612    428016       356 
-07:33:47      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486376         0 +04:36:13 PM   2977664   3629332    115440      2.87     33564    789068   1645752     32.76    463636    428016       308 
-Average:      1647235   2297227   2177797     56.94      3356    827396   5096003     70.94    359072   1486348         0+Average:      2977645   3629297    115469      2.87     33559    789060   1645752     32.76    463620    428015       324
 </code> </code>
 +
 +HERE
  
 Utilisez l'option **-S** pour visualiser les statistiques concernant le Swap : Utilisez l'option **-S** pour visualiser les statistiques concernant le Swap :
  
 <code> <code>
-[root@centos8 ~]# sar -S 5 3 +root@debian11:~# sar -S 5 3 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_(CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-07:31:58    kbswpfree kbswpused  %swpused  kbswpcad   %swpcad +04:39:41 PM kbswpfree kbswpused  %swpused  kbswpcad   %swpcad 
-07:32:03      3358716         0      0.00              0.00 +04:39:46 PM    998396         0      0.00              0.00 
-07:32:08      3358716         0      0.00              0.00 +04:39:51 PM    998396         0      0.00              0.00 
-07:32:13      3358716         0      0.00              0.00 +04:39:56 PM    998396         0      0.00              0.00 
-Average:      3358716         0      0.00              0.00+Average:       998396         0      0.00              0.00
 </code> </code>
  
Ligne 646: Ligne 1769:
  
 <code> <code>
-[root@centos8 ~]# sar -b 5 3 +root@debian11:~# sar -b 5 3 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (CPU)+Linux 5.10.0-13-amd64 (debian11)        04/30/2022      _x86_64_        (CPU)
  
-09:24:49          tps      rtps      wtps   bread/  bwrtn/+04:40:19 PM       tps      rtps      wtps      dtps   bread/  bwrtn/s   bdscd/s 
-09:24:54         0.00      0.00      0.00      0.00      0.00 +04:40:24 PM      0.40      0.00      0.40      0.00      0.00     11.20      0.00 
-09:24:59         1.20      0.00      1.20      0.00     20.20 +04:40:29 PM      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:04         0.00      0.00      0.00      0.00      0.00 +04:40:34 PM      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-Average:         0.40      0.00      0.40      0.00      6.73+Average:         0.13      0.00      0.13      0.00      0.00      3.73      0.00
 </code> </code>
  
Ligne 661: Ligne 1784:
  
 <code> <code>
-[root@centos8 ~]# sar -d 5 3 +root@debian11:~# sar -d 5 3 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (CPU)+Linux 5.10.0-13-amd64 (debian11)        05/01/2022      _x86_64_        (CPU)
  
-09:25:45          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +02:48:27 PM       DEV       tps     rkB/    wkB/s     dkB/s   areq-sz    aqu-sz     await     %util 
-09:25:50       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:32 PM       sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:50      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:32 PM       sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:50      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:32 PM       sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:50     dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:32 PM       sdc      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:50     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+02:48:32 PM      dm-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +02:48:32 PM      dm-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +02:48:32 PM       md1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
  
-09:25:50          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +02:48:32 PM       DEV       tps     rkB/    wkB/s     dkB/s   areq-sz    aqu-sz     await     %util 
-09:25:55       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:37 PM       sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:55      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:37 PM       sda      1.80      0.00      7.20      0.00      4.00      0.05     26.44      0.56 
-09:25:55      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:37 PM       sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:55     dev253-     0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:37 PM       sdc      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:25:55     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+02:48:37 PM      dm-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +02:48:37 PM      dm-     0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +02:48:37 PM       md1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
  
-09:25:55          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +02:48:37 PM       DEV       tps     rkB/    wkB/s     dkB/s   areq-sz    aqu-sz     await     %util 
-09:26:00       dev8-0      0.60      0.00      0.30      0.50      0.01     13.00     13.00      0.78 +02:48:42 PM       sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:26:00      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:42 PM       sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:26:00      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +02:48:42 PM       sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:26:00     dev253-0      0.60      0.00      0.50      0.83      0.01     12.67     13.00      0.78 +02:48:42 PM       sdc      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-09:26:00     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+02:48:42 PM      dm-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +02:48:42 PM      dm-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +02:48:42 PM       md1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
  
-Average:          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +Average:          DEV       tps     rkB/    wkB/s     dkB/s   areq-sz    aqu-sz     await     %util 
-Average:       dev8-0      0.20      0.00      0.10      0.50      0.00     13.00     13.00      0.26 +Average:          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-Average:      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +Average:          sda      0.60      0.00      2.40      0.00      4.00      0.02     26.44      0.19 
-Average:      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +Average:          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-Average:     dev253-0      0.20      0.00      0.17      0.83      0.00     12.67     13.00      0.26 +Average:          sdc      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-Average:     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+Average:         dm-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +Average:         dm-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +Average:          md1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.000
 </code> </code>
  
-La colonne **DEV** indentifie les disques par leurs majeurs et mineurs. Pour voir les informations avec les noms des disques, ajoutez l'option **-p** :+Dernièrement, vérifiez que le répertoire **/var/log/sysstat/** contient un fichier **saXX** :
  
 <code> <code>
-[root@centos8 ~]sar -p -d 5 3 +root@debian11:~# ls -/var/log/sysstat
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (8 CPU) +total 16 
- +-rw-r--r-- 1 root root 14284 Apr 30 16:44 sa30
-07:48:32          DEV       tps     rkB/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +
-07:48:37          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:37          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:37          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:37    cl_centos8-root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:37    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
- +
-07:48:37          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +
-07:48:42          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:42          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:42          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:42    cl_centos8-root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:42    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
- +
-07:48:42          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +
-07:48:47          sda      0.40      0.00      0.40      1.00      0.02     56.00     56.50      2.26 +
-07:48:47          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:47          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:47    cl_centos8-root      0.40      0.00      0.80      2.00      0.02     56.00     56.50      2.26 +
-07:48:47    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
- +
-Average:          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +
-Average:          sda      0.13      0.00      0.13      1.00      0.01     56.00     56.50      0.75 +
-Average:          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-Average:          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-Average:    cl_centos8-root      0.13      0.00      0.27      2.00      0.01     56.00     56.50      0.75 +
-Average   cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+
 </code> </code>
  
Ligne 731: Ligne 1835:
  
 <code> <code>
-[root@centos8 ~]# sar --help+root@debian11:~# sar --help
 Usage: sar [ options ] [ <interval> [ <count> ] ] Usage: sar [ options ] [ <interval> [ <count> ] ]
 Main options and reports (report name between square brackets): Main options and reports (report name between square brackets):
Ligne 774: Ligne 1878:
                 FC      Fibre channel HBAs                 FC      Fibre channel HBAs
                 SOFT    Software-based network processing                 SOFT    Software-based network processing
-        -q      Queue length and load average statistics [A_QUEUE]+        -q [ <keyword> [,...] | PSI | ALL ] 
 +                System load and pressure-stall statistics 
 +                Keywords are: 
 +                LOAD    Queue length and load average statistics [A_QUEUE
 +                CPU     Pressure-stall CPU statistics [A_PSI_CPU] 
 +                IO      Pressure-stall I/O statistics [A_PSI_IO] 
 +                MEM     Pressure-stall memory statistics [A_PSI_MEM]
         -r [ ALL ]         -r [ ALL ]
                 Memory utilization statistics [A_MEMORY]                 Memory utilization statistics [A_MEMORY]
Ligne 786: Ligne 1896:
 </code> </code>
  
-=====LAB #2 - Processus et Fichiers Ouverts=====+====3.8 - La Commande collectd==== 
 + 
 +collectd est une solution open sourceavec des plugins qui peuvent collecter des statistiques système pour une grande variété d'applications. 
 + 
 +Le paquet collectd n'est pas installé par défaut sous Debian 11 : 
 + 
 +<code> 
 +root@debian11:~apt install collectd 
 +</code> 
 + 
 +Vérifiez que le service collectd est en cours d'exécution : 
 + 
 +<code> 
 +root@debian11:~# systemctl status collectd 
 +● collectd.service - Statistics collection and monitoring daemon 
 +     Loaded: loaded (/lib/systemd/system/collectd.service; enabled; vendor preset: en> 
 +     Active: active (running) since Sun 2022-10-09 19:31:24 CEST; 1min 31s ago 
 +       Docs: man:collectd(1) 
 +             man:collectd.conf(5) 
 +             https://collectd.org 
 +   Main PID: 2088 (collectd) 
 +      Tasks: 12 (limit: 19155) 
 +     Memory: 40.5M 
 +        CPU: 269ms 
 +     CGroup: /system.slice/collectd.service 
 +             └─2088 /usr/sbin/collectd 
 + 
 +Oct 09 19:31:24 debian11 collectd[2088]: plugin_load: plugin "irq" successfully loade> 
 +Oct 09 19:31:24 debian11 collectd[2088]: plugin_load: plugin "load" successfully load> 
 +Oct 09 19:31:24 debian11 collectd[2088]: plugin_load: plugin "memory" successfully lo> 
 +Oct 09 19:31:24 debian11 collectd[2088]: plugin_load: plugin "processes" successfully> 
 +Oct 09 19:31:24 debian11 collectd[2088]: plugin_load: plugin "rrdtool" successfully l> 
 +Oct 09 19:31:24 debian11 collectd[2088]: plugin_load: plugin "swap" successfully load> 
 +Oct 09 19:31:24 debian11 collectd[2088]: plugin_load: plugin "users" successfully loa> 
 +Oct 09 19:31:24 debian11 collectd[2088]: Systemd detected, trying to signal readiness. 
 +Oct 09 19:31:24 debian11 systemd[1]: Started Statistics collection and monitoring dae> 
 +Oct 09 19:31:24 debian11 collectd[2088]: Initialization complete, entering read-loop. 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +**Important** - notez que collectd récolte des données toutes les 10 secondes. 
 +</WRAP> 
 + 
 +Le fichier principal de configuration de collectd est **/etc/collectd/collectd.conf** : 
 + 
 +<code> 
 +root@debian11:~# more /etc/collectd/collectd.conf 
 +# Config file for collectd(1). 
 +
 +# Some plugins need additional configuration and are disabled by default. 
 +# Please read collectd.conf(5) for details. 
 +
 +# You should also read /usr/share/doc/collectd-core/README.Debian.plugins 
 +# before enabling any more plugins. 
 + 
 +############################################################################## 
 +# Global                                                                     # 
 +#----------------------------------------------------------------------------# 
 +# Global settings for the daemon.                                            # 
 +############################################################################## 
 + 
 +#Hostname "localhost" 
 +FQDNLookup true 
 +#BaseDir "/var/lib/collectd" 
 +#PluginDir "/usr/lib/collectd" 
 +#TypesDB "/usr/share/collectd/types.db" "/etc/collectd/my_types.db" 
 + 
 +#----------------------------------------------------------------------------# 
 +# When enabled, plugins are loaded automatically with the default options    # 
 +# when an appropriate <Plugin ...> block is encountered.                     # 
 +# Disabled by default.                                                       # 
 +#----------------------------------------------------------------------------# 
 +#AutoLoadPlugin false 
 + 
 +#----------------------------------------------------------------------------# 
 +# When enabled, internal statistics are collected, using "collectd" as the   # 
 +# plugin name.                                                               # 
 +# Disabled by default.                                                       # 
 +#----------------------------------------------------------------------------# 
 +#CollectInternalStats false 
 + 
 +#----------------------------------------------------------------------------# 
 +# Interval at which to query values. This may be overwritten on a per-plugin # 
 +# base by using the 'Interval' option of the LoadPlugin block:               # 
 +#   <LoadPlugin foo>                                                         # 
 +#       Interval 60                                                          # 
 +#   </LoadPlugin>                                                            # 
 +#----------------------------------------------------------------------------# 
 +#Interval 10 
 + 
 +#MaxReadInterval 86400 
 +#Timeout         2 
 +#ReadThreads     5 
 +#WriteThreads    5 
 + 
 +# Limit the size of the write queue. Default is no limit. Setting up a limit 
 +# is recommended for servers handling a high volume of traffic. 
 +#WriteQueueLimitHigh 1000000 
 +#WriteQueueLimitLow   800000 
 + 
 +############################################################################## 
 +# Logging                                                                    # 
 +#----------------------------------------------------------------------------# 
 +# Plugins which provide logging functions should be loaded first, so log     # 
 +# messages generated when loading or configuring other plugins can be        # 
 +--More--(8%) 
 +</code> 
 + 
 +D'autres fichiers de configuration sont présents dans le répertoire **/etc/collectd/collectd.conf.d** : 
 + 
 +<code> 
 +root@debian11:~# tail /etc/collectd/collectd.conf 
 + 
 +#<Plugin zookeeper> 
 +#       Host "localhost" 
 +#       Port "2181" 
 +#</Plugin> 
 + 
 +<Include "/etc/collectd/collectd.conf.d"> 
 +        Filter "*.conf" 
 +</Include> 
 +</code> 
 + 
 +<code> 
 +root@debian11:~# ls -l /etc/collectd/collectd.conf.d/ 
 +total 8 
 +-rw-r--r-- 1 root root 656 Jun  1  2021 filters.conf 
 +-rw-r--r-- 1 root root 836 Jun  1  2021 thresholds.conf 
 +</code> 
 + 
 +<code> 
 +root@debian11:~# more /etc/collectd/collectd.conf.d/filters.conf  
 +# Filter configuration for collectd(1). 
 +
 +# See the section "FILTER CONFIGURATION" in collectd.conf(5) for details. 
 + 
 +#PreCacheChain "PreCache" 
 +#PostCacheChain "PostCache" 
 + 
 +#LoadPlugin match_empty_counter 
 +#LoadPlugin match_hashed 
 +#LoadPlugin match_regex 
 +#LoadPlugin match_timediff 
 +#LoadPlugin match_value 
 + 
 +#LoadPlugin target_notification 
 +#LoadPlugin target_replace 
 +#LoadPlugin target_scale 
 +#LoadPlugin target_set 
 +#LoadPlugin target_v5upgrade 
 + 
 +#<Chain "PreCache"> 
 +#       <Rule "no_fqdn"> 
 +#               <Match "regex"> 
 +#                       Host "^[^\.]*$" 
 +#                       Invert false 
 +#               </Match> 
 +#               Target "stop" 
 +#       </Rule> 
 +#</Chain> 
 + 
 +# Default behavior: 
 +#<Chain "PostCache"> 
 +#       Target "write" 
 +#</Chain> 
 +</code> 
 + 
 +L'organisation de collectd se repose sur l'utilisation de **plugins**. Pour activer un plugin, il suffit de décommenter les lignes appropriées dans le fichier **/etc/collectd/collectd.conf**. 
 + 
 +Décommentez donc les deux lignes suivantes : 
 + 
 +  * LoadPlugin cpufreq 
 +  * LoadPlugin thermal 
 + 
 +Ensuite re-démarrez le service collectd : 
 + 
 +<code> 
 +root@debian11:~# vi /etc/collectd/collectd.conf 
 +root@debian11:~# systemctl restart collectd 
 +root@debian11:~# systemctl status collectd 
 +● collectd.service - Statistics collection and monitoring daemon 
 +     Loaded: loaded (/lib/systemd/system/collectd.service; enabled; vendor preset: en> 
 +     Active: active (running) since Sun 2022-10-09 19:40:35 CEST; 12s ago 
 +       Docs: man:collectd(1) 
 +             man:collectd.conf(5) 
 +             https://collectd.org 
 +    Process: 10521 ExecStartPre=/usr/sbin/collectd -t (code=exited, status=0/SUCCESS) 
 +   Main PID: 10522 (collectd) 
 +      Tasks: 12 (limit: 19155) 
 +     Memory: 6.5M 
 +        CPU: 52ms 
 +     CGroup: /system.slice/collectd.service 
 +             └─10522 /usr/sbin/collectd 
 + 
 +Oct 09 19:40:35 debian11 collectd[10522]: plugin_load: plugin "memory" successfully l> 
 +Oct 09 19:40:35 debian11 collectd[10522]: plugin_load: plugin "processes" successfull> 
 +Oct 09 19:40:35 debian11 collectd[10522]: plugin_load: plugin "rrdtool" successfully > 
 +Oct 09 19:40:35 debian11 collectd[10522]: plugin_load: plugin "swap" successfully loa> 
 +Oct 09 19:40:35 debian11 collectd[10522]: plugin_load: plugin "thermal" successfully > 
 +Oct 09 19:40:35 debian11 collectd[10522]: plugin_load: plugin "users" successfully lo> 
 +Oct 09 19:40:35 debian11 collectd[10522]: Systemd detected, trying to signal readines> 
 +Oct 09 19:40:35 debian11 collectd[10522]: cpufreq plugin: Found 0 CPUs 
 +Oct 09 19:40:35 debian11 systemd[1]: Started Statistics collection and monitoring dae> 
 +root@debian11:~#  
 +</code> 
 + 
 +La consultation des données collectées par collectd peut se faire à l'aide du logiciel **kcollectd** : 
 + 
 +{{ :elearning:workbooks:lpic:21:450:capture_d_ecran_du_2022-10-09_18-59-03.png?nolink&600 |}} 
 + 
 +Dernièrement, les options de cette commande sont : 
 + 
 +<code> 
 +root@debian11:~# collectd --help 
 +collectd: invalid option -- '-' 
 +Usage: collectd [OPTIONS] 
 + 
 +Available options: 
 +  General: 
 +    -C <file>       Configuration file. 
 +                    Default: /etc/collectd/collectd.conf 
 +    -t              Test config and exit. 
 +    -T              Test plugin read and exit. 
 +    -P <file>       PID-file. 
 +                    Default: /var/run/collectd.pid 
 +    -f              Don't fork to the background. 
 +    -B              Don't create the BaseDir 
 +    -h              Display help (this message) 
 + 
 +Builtin defaults: 
 +  Config file       /etc/collectd/collectd.conf 
 +  PID file          /var/run/collectd.pid 
 +  Plugin directory  /usr/lib/collectd 
 +  Data directory    /var/lib/collectd 
 + 
 +collectd 5.12.0.git, http://collectd.org/ 
 +by Florian octo Forster <octo@collectd.org> 
 +for contributions see `AUTHORS' 
 +</code> 
 + 
 +=====Modules usb===== 
 + 
 +L'**USB** (//Universal Serial Bus//) est un bus de données qui peut offrir des taux de transfert jusqu'à 480Mb/s sous la version 2.0 et jusqu'à 4.8 Gb/s sous la version 3.0. Les modules nécessaires pour les contrôleurs USB sont : 
 + 
 +^ Version USB ^ Module ^ Nom Complet ^ 
 +|  1.0\1.1  | **UHCI** | //Universal Controller Host Interface// | 
 +|  :::  | **OHCI** | //Open Controller Host Interface// | 
 +|  2.0  | **EHCI** | //Enhanced Host Controller Interface// | 
 +|  3.0  | **XHCI** | //Extensible Host Controller Interface// | 
 + 
 +Le tableau suivant liste les modules courrament chargés en fonction du périphérique utilisé : 
 + 
 +^ Module ^ Type de Périphérique ^  
 +|  **usb_storage**  | Supports de masse | 
 +|  **usbhid**  | Periphériques HID (//Human Interface Device//) | 
 +|  **snd-usb-audio**  | Cartes son usb | 
 +|  **usbvidéo**  | Cartes vidéo et d'acquisition | 
 +|  **irda-usb**  | Périphériques infrarouges | 
 +|  **usbnet**  | Cartes réseaux usb | 
 + 
 +Les modules peuvent être chargés par un des moyens suivants : 
 + 
 +  * INITrd, 
 +  * Le processus init (systemd), 
 +  * kmod, d'une manière dynamique et transparente lors du branchement du périphérique, 
 +  * udev, 
 +  * manuellement. 
 + 
 +=====udev===== 
 + 
 +Depuis le noyau Linux 2.6 Linux est capable de détecter des périphériques branchés à chaud. Cette technologie s'appelle le **//hotplugging//**. Le //hotplugging// est obtenu grâce à l'utilisation de trois composants : 
 + 
 +  * Udev, 
 +  * HAL, 
 +  * Dbus. 
 + 
 +Les rôles de chaque composant sont les suivants : 
 + 
 +  * Udev se charge de créer et supprimer d'une manière dynamique les nœuds dans le répertoire **/dev**, 
 +  * HAL obtient des informations à partir d'Udev et créé un fichier au format XML représentant le périphérique branché. Il informe ensuite Nautilus en utilisant le Dbus, 
 +  * Dbus joue le rôle d'un bus système qui est utilisé pour la communication inter-processus. 
 + 
 +Lors de démarrage de Linux, Udev joue un rôle important : 
 + 
 +  * Au démarrage **tmpfs** est monté sur /dev, 
 +  * Udev copie les éventuels nœuds statiques de **/lib/udev/devices** vers /dev, 
 +  * le démon **udevd** collecte des données appelées **uevents** du noyau et cherche une règle correspondante dans le répertoire **/lib/udev/rules.d/**, 
 +  * Udev crée les nœuds et liens symboliques spécifiés dans la règle identifiée, 
 +  * Udev stocke les règles contenues dans **/lib/udev/rules.d/*.rules** en mémoire, 
 +  * En cas de modification des ces règles, Udev met à jour la mémoire. 
 + 
 +Udev repose sur le filesystem **sysfs** monté sur /sys qui permet de rendre les périphériques visibles à Udev dans l'//User Space//. Par exemple, lors du branchement d'une clé USB, Udev crée **/dev/sdx1** automatiquement et utilise les informations contenues dans le fichier **/lib/modules/`uname -r`/modules.alias** pour trouver le pilote nécessaire : 
 + 
 +Le fichier de configuration principal d'Udev est **/etc/udev/udev.conf** : 
 + 
 +<code> 
 +root@debian11:~# cat /etc/udev/udev.conf 
 +# see udev.conf(5) for details 
 +
 +# udevd is also started in the initrd.  When this file is modified you might 
 +# also want to rebuild the initrd, so that it will include the modified configuration. 
 + 
 +#udev_log=info 
 +#children_max= 
 +#exec_delay= 
 +#event_timeout=180 
 +#timeout_signal=SIGKILL 
 +#resolve_names=early 
 +</code> 
 + 
 +Les fichiers de règles se trouvent dans **/lib/udev/rules.d/** : 
 + 
 +<code> 
 +root@debian11:~# ls /lib/udev/rules.d/ 
 +39-usbmuxd.rules                  70-joystick.rules                    77-mm-usb-device-blacklist.rules 
 +40-usb_modeswitch.rules           70-mouse.rules                       77-mm-usb-serial-adapters-greylist.rules 
 +50-firmware.rules                 70-power-switch.rules                77-mm-x22x-port-types.rules 
 +50-udev-default.rules             70-printers.rules                    77-mm-zte-port-types.rules 
 +55-dm.rules                       70-touchpad.rules                    78-sound-card.rules 
 +56-lvm.rules                      70-uaccess.rules                     80-debian-compat.rules 
 +60-autosuspend.rules              71-ipp-usb.rules                     80-drivers.rules 
 +60-block.rules                    71-seat.rules                        80-ifupdown.rules 
 +60-cdrom_id.rules                 73-seat-late.rules                   80-libinput-device-groups.rules 
 +60-drm.rules                      73-special-net-names.rules           80-mm-candidate.rules 
 +60-evdev.rules                    75-net-description.rules             80-net-setup-link.rules 
 +60-fido-id.rules                  75-probe_mtd.rules                   80-udisks2.rules 
 +60-input-id.rules                 77-mm-broadmobi-port-types.rules     84-nm-drivers.rules 
 +60-libgphoto2-6.rules             77-mm-cinterion-port-types.rules     85-hdparm.rules 
 +60-libopenni2-0.rules             77-mm-dell-port-types.rules          85-hwclock.rules 
 +60-libsane1.rules                 77-mm-dlink-port-types.rules         85-nm-unmanaged.rules 
 +60-persistent-alsa.rules          77-mm-ericsson-mbm.rules             90-alsa-restore.rules 
 +60-persistent-input.rules         77-mm-fibocom-port-types.rules       90-console-setup.rules 
 +60-persistent-storage-dm.rules    77-mm-foxconn-port-types.rules       90-libinput-fuzz-override.rules 
 +60-persistent-storage.rules       77-mm-haier-port-types.rules         90-nm-thunderbolt.rules 
 +60-persistent-storage-tape.rules  77-mm-huawei-net-port-types.rules    90-pipewire-alsa.rules 
 +60-persistent-v4l.rules           77-mm-longcheer-port-types.rules     90-pulseaudio.rules 
 +60-qemu-guest-agent.rules         77-mm-mtk-port-types.rules           95-cd-devices.rules 
 +60-sensor.rules                   77-mm-nokia-port-types.rules         95-dm-notify.rules 
 +60-serial.rules                   77-mm-pcmcia-device-blacklist.rules  95-upower-csr.rules 
 +64-btrfs-dm.rules                 77-mm-qdl-device-blacklist.rules     95-upower-hidpp.rules 
 +64-btrfs.rules                    77-mm-quectel-port-types.rules       95-upower-hid.rules 
 +64-xorg-xkb.rules                 77-mm-sierra.rules                   95-upower-wup.rules 
 +65-libwacom.rules                 77-mm-simtech-port-types.rules       96-e2scrub.rules 
 +69-cd-sensors.rules               77-mm-telit-port-types.rules         99-libsane1.rules 
 +69-lvm-metad.rules                77-mm-tplink-port-types.rules        99-systemd.rules 
 +69-wacom.rules                    77-mm-ublox-port-types.rules 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +**Important** : Il vous est possible d'ajouter des règles si besoin est. Dans ce cas, créez un fichier **99-local.rules** est éditez-le au lieu d'éditer les fichiers existants. 
 +</WRAP> 
 + 
 +Comme indique le nom de chaque fichier, le contenu est composé de règles à l'attention d'udev. Le fichier des règles par défaut est le **50-udev-default.rules** : 
 + 
 +<code> 
 +root@debian11:~# cat /lib/udev/rules.d/50-udev-default.rules | more 
 +# do not edit this file, it will be overwritten on update 
 + 
 +# run a command on remove events 
 +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" 
 +ACTION=="remove", GOTO="default_end" 
 + 
 +SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" 
 + 
 +# select "system RTC" or just use the first one 
 +SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc" 
 +SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100" 
 + 
 +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb", GOTO="default_hwdb_i 
 +mported" 
 +ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}" 
 +LABEL="default_hwdb_imported" 
 + 
 +ACTION!="add", GOTO="default_end" 
 + 
 +SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" 
 +SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666" 
 +SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" 
 +KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout" 
 + 
 +SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" 
 + 
 +SUBSYSTEM=="input", GROUP="input" 
 +SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664" 
 + 
 +SUBSYSTEM=="video4linux", GROUP="video" 
 +SUBSYSTEM=="graphics", GROUP="video" 
 +SUBSYSTEM=="drm", KERNEL!="renderD*", GROUP="video" 
 +SUBSYSTEM=="dvb", GROUP="video" 
 +SUBSYSTEM=="media", GROUP="video" 
 +SUBSYSTEM=="cec", GROUP="video" 
 + 
 +SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="render", MODE="0660" 
 +SUBSYSTEM=="kfd", GROUP="render", MODE="0660" 
 + 
 +# When using static_node= with non-default permissions, also update 
 +# tmpfiles.d/static-nodes-permissions.conf.in to keep permissions synchronized. 
 + 
 +SUBSYSTEM=="sound", GROUP="audio",
 +  OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer" 
 + 
 +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664" 
 +--More-- 
 +[q] 
 +</code> 
 + 
 +Chaque règle prend la forme suivante : 
 + 
 +KEY, [KEY, ...] NAME [, SYMLINK] 
 + 
 +Chaque KEY est un champ au format **type=valeur** qui doit correspondre à un périphérique unique. La valeur de type peut prendre plusieurs formes : 
 + 
 +^ Type ^ Description ^ Exemples ^ 
 +| BUS | Type de bus | usb, scsi, ide | 
 +| KERNEL | Le nom par défault du périphérique donné par le noyau | hda, ttyUSB0, lp0 | 
 +| SUBSYSTEM | Le nom noyau du sous-système, généralement identique à la valeur du BUS | usb, scsi | 
 +| DRIVER | Le nom du pilote qui contrôle le périphérique | usb-storage | 
 +| ID | Le numéro du périphérique sur son bus | PCI bus id, USB id | 
 +| PLACE | Ne concerne que les périphériques USB et donne la position topologique du périphérique sur son bus | S/O | 
 +| SYSFS{filename} | Le nom du fichier dans /sys pour le périphérique. Ce fichier contient le fabricant, le label, le numéro de série et UUID du périphérique. La vérification de jusqu'à 5 fichiers est possible par règle | S/O | 
 +| PROGRAM | Ceci permet à Udev d'appeler un programme externe pour nommer un périphérique | S/O | 
 +| RESULT | Valeur à comparer au résultat de PROGRAM | S/O | 
 + 
 +NAME et SYMLINK sont utilisées pour stipuler ce que Udev doit faire avec le périphérique : 
 + 
 +^ Type ^ Description ^ Exemples ^ 
 +| NAME | Le nome du nœud dans /dev | S/O | 
 +| SYMLINK | Le ou les lien(s) symbolique(s) qui pointe(nt) vers le NAME | S/O | 
 + 
 +====La commande udevadm==== 
 + 
 +Pour obtenir de l'information sur un périphérique il convient d'utiliser la commande **udevadm** : 
 + 
 +<code> 
 +root@debian11:~# udevadm info --query=all -n /dev/sdc 
 +P: /devices/pci0000:00/0000:00:05.0/virtio1/host2/target2:0:0/2:0:0:1/block/sdc 
 +N: sdc 
 +L: 0 
 +S: disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 
 +S: disk/by-path/pci-0000:00:05.0-scsi-0:0:0:
 +E: DEVPATH=/devices/pci0000:00/0000:00:05.0/virtio1/host2/target2:0:0/2:0:0:1/block/sdc 
 +E: DEVNAME=/dev/sdc 
 +E: DEVTYPE=disk 
 +E: MAJOR=8 
 +E: MINOR=32 
 +E: SUBSYSTEM=block 
 +E: USEC_INITIALIZED=1712598 
 +E: ID_SCSI=1 
 +E: ID_VENDOR=QEMU 
 +E: ID_VENDOR_ENC=QEMU\x20\x20\x20\x20 
 +E: ID_MODEL=QEMU_HARDDISK 
 +E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 
 +E: ID_REVISION=2.5+ 
 +E: ID_TYPE=disk 
 +E: ID_SERIAL=0QEMU_QEMU_HARDDISK_drive-scsi1 
 +E: ID_SERIAL_SHORT=drive-scsi1 
 +E: ID_BUS=scsi 
 +E: ID_PATH=pci-0000:00:05.0-scsi-0:0:0:
 +E: ID_PATH_TAG=pci-0000_00_05_0-scsi-0_0_0_1 
 +E: ID_PART_TABLE_UUID=304308a3 
 +E: ID_PART_TABLE_TYPE=dos 
 +E: DEVLINKS=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 /dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:
 +E: TAGS=:systemd: 
 +E: CURRENT_TAGS=:systemd: 
 +</code> 
 + 
 +Les options de la commande udevadm sont : 
 + 
 +<code> 
 +root@debian11:~# udevadm --help 
 +udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS] 
 + 
 +Send control commands or test the device manager. 
 + 
 +Commands: 
 +  info          Query sysfs or the udev database 
 +  trigger       Request events from the kernel 
 +  settle        Wait for pending udev events 
 +  control       Control the udev daemon 
 +  monitor       Listen to kernel and udev events 
 +  test          Test an event run 
 +  test-builtin  Test a built-in command 
 + 
 +See the udevadm(8) man page for details. 
 + 
 +root@debian11:~# udevadm info --help 
 +udevadm info [OPTIONS] [DEVPATH|FILE] 
 + 
 +Query sysfs or the udev database. 
 + 
 +  -h --help                   Print this message 
 +  -V --version                Print version of the program 
 +  -q --query=TYPE             Query device information: 
 +       name                     Name of device node 
 +       symlink                  Pointing to node 
 +       path                     sysfs device path 
 +       property                 The device properties 
 +       all                      All values 
 +  -p --path=SYSPATH           sysfs device path used for query or attribute walk 
 +  -n --name=NAME              Node or symlink name used for query or attribute walk 
 +  -r --root                   Prepend dev directory to path names 
 +  -a --attribute-walk         Print all key matches walking along the chain 
 +                              of parent devices 
 +  -d --device-id-of-file=FILE Print major:minor of device containing this file 
 +  -x --export                 Export key/value pairs 
 +  -P --export-prefix          Export the key name with a prefix 
 +  -e --export-db              Export the content of the udev database 
 +  -c --cleanup-db             Clean up the udev database 
 +  -w --wait-for-initialization[=SECONDS] 
 +                              Wait for device to be initialized 
 +</code> 
 + 
 +=====Système de fichiers /sys===== 
 + 
 +Le système de fichiers virtuel **/sys** a été introduit avec le noyau Linux **2.6**. Son rôle est de décrire le matériel pour udev. 
 + 
 +Saisissez la commande suivante : 
 + 
 +<code> 
 +root@debian11:~# ls -l /sys 
 +total 0 
 +drwxr-xr-x   2 root root 0 Apr 30 16:32 block 
 +drwxr-xr-x  33 root root 0 Apr 30 16:21 bus 
 +drwxr-xr-x  51 root root 0 Apr 30 16:21 class 
 +drwxr-xr-x   4 root root 0 Apr 30 16:21 dev 
 +drwxr-xr-x  14 root root 0 Apr 26 13:08 devices 
 +drwxr-xr-x   6 root root 0 Apr 30 16:21 firmware 
 +drwxr-xr-x  10 root root 0 Apr 26 13:08 fs 
 +drwxr-xr-x   2 root root 0 Apr 30 16:50 hypervisor 
 +drwxr-xr-x  15 root root 0 Apr 26 13:08 kernel 
 +drwxr-xr-x 151 root root 0 Apr 30 16:21 module 
 +drwxr-xr-x   3 root root 0 Apr 30 16:50 power 
 +</code> 
 + 
 +Chaque répertoire contient des informations : 
 + 
 +  * **block** 
 +    * contient des informations sur les périphériques bloc 
 +  * **bus** 
 +    * contient des informations sur les bus de données 
 +  * **class** 
 +    * contient des informations sur des classes de matériel 
 +  * **devices** 
 +    * contient des informations sur la position des périphériques sur les bus 
 +  * **firmware** 
 +    * contient, entre autre, des informations sur l'ACPI 
 +  * **module** 
 +    * contient des informations sur les modules du noyau 
 +  * **power** 
 +    * contient des informations sur la gestion de l'énergie 
 +  * **fs** 
 +    * contient des informations sur les systèmes de fichiers 
 + 
 +Pour illustrer ceci, saisissez la commande suivante : 
 + 
 +<code> 
 +root@debian11:~# cat /sys/block/sdc/sdc1/size 
 +204800 
 +</code> 
 + 
 +Ce chiffre correspond aux nombre de secteurs. 
 + 
 +=====LAB #4 - Processus et Fichiers Ouverts=====
  
-====2.1 - Présentation====+=====Présentation=====
  
 Un processus est un fichier binaire ( binary file ) qui est chargé en mémoire centrale. Une fois chargé la mémoire exécute le programme en langage machine. Quand le programme est chargé, il a besoin du système d’exploitation qui lui fournit des informations pour qu’il puisse s’exécuter correctement. Ces informations sont appelées des **données d’identification**.  Un processus est un fichier binaire ( binary file ) qui est chargé en mémoire centrale. Une fois chargé la mémoire exécute le programme en langage machine. Quand le programme est chargé, il a besoin du système d’exploitation qui lui fournit des informations pour qu’il puisse s’exécuter correctement. Ces informations sont appelées des **données d’identification**. 
Ligne 808: Ligne 2484:
  
 <code> <code>
-[root@centos8 ~]# cd /proc; ls -d [0-9]* +root@debian11:~# cd /proc; ls -d [0-9]* 
-    1113  1158  1464  1590  1601  163   166  171  20  24  28  303  31   34  38  41  45   461  465  469  473  478  481  487  497  507  52   528  531  599  649  69   765  793  800  827  840  853  875  902 +   128    213    21985  22049  22095  22976  23037  28304  30129  368  453  59 
-10    1125  12    1465  1594  162   1634  167  18   21  25  29  305  310  35  39  42  457  462  466  47   475  479  482  489  498  508  521  529  532  6    655     766  795  801  828  841  854  880  905 +10   12807  21895  21989  22051  22096  22991  24     28305  30151  374  458  
-11    1126  13    15    16    1627  164   168  19   22  26  3   306  311  36    43  459  463  467  470  476  48   484  49      51   526  53   533  60   662  741  779  799  823  834  847  866  884  910 +11   13     21900  21995  22052  22119  22992  244    28309  30185  375  50   60 
-1111  1135  14    1585  1600  1628  165   17      23  27  30  309  32   37  40  44  46   464  468  472  477  480  485  496  50   518  527  530  534  632  666  751  791  8    825  837  850  874  9+119  15     21901  22005  22060  22122  22994  25     28310  30202  377  51   69 
 +12   16     21916  22007  22063  22131  22995  258    29     30223  380  52   72 
 +120  17     21917  22010  22065  22136  22996  27     29208  30227  381  53   73 
 +121  175    21920  22024  22066  22146  23     27914  29263  31        536  8 
 +122  176    21921  22027  22076  22151  23008  27915  29345  32     400  54   
 +123  18     21928  22036  22084  22947  23013  28     29614  353    422  55   95 
 +125  2      21970  22040  22093  22970  23015  28194  3      364    433  57 
 +127  20     21980  22045  22094  22974  23033  28295  30     366    452  58
 </code> </code>
  
Ligne 818: Ligne 2501:
  
 <code> <code>
-[root@centos8 proc]# cd 1 ; ls -l+root@debian11:/proc# cd 1 ; ls -l
 total 0 total 0
-dr-xr-xr-x2 root root 0 Jun  3 09:01 attr +-r--r--r--  1 root root 0 Jun  2 11:06 arch_status 
--rw-r--r--1 root root 0 Jun  3 09:02 autogroup +dr-xr-xr-x  2 root root 0 May 10 14:37 attr 
--r--------1 root root 0 Jun  3 09:02 auxv +-rw-r--r--  1 root root 0 Jun  2 11:06 autogroup 
--r--r--r--1 root root 0 Jun  3 09:01 cgroup +-r--------  1 root root 0 Jun  2 11:06 auxv 
---w-------1 root root 0 Jun  3 09:02 clear_refs +-r--r--r--  1 root root 0 May 10 14:37 cgroup 
--r--r--r--1 root root 0 Jun  3 09:01 cmdline +--w-------  1 root root 0 Jun  2 11:06 clear_refs 
--rw-r--r--1 root root 0 Jun  3 09:01 comm +-r--r--r--  1 root root 0 May 10 14:37 cmdline 
--rw-r--r--1 root root 0 Jun  3 09:02 coredump_filter +-rw-r--r--  1 root root 0 May 10 14:37 comm 
--r--r--r--1 root root 0 Jun  3 09:02 cpu_resctrl_groups +-rw-r--r--  1 root root 0 May 10 14:37 coredump_filter 
--r--r--r--1 root root 0 Jun  3 09:02 cpuset +-r--r--r--  1 root root 0 Jun  2 11:06 cpu_resctrl_groups 
-lrwxrwxrwx1 root root 0 Jun  09:02 cwd -> / +-r--r--r--  1 root root 0 Jun  2 11:06 cpuset 
--r--------1 root root 0 Jun  3 09:01 environ +lrwxrwxrwx  1 root root 0 Jun  09:55 cwd -> / 
-lrwxrwxrwx1 root root 0 Jun  3 09:01 exe -> /usr/lib/systemd/systemd +-r--------  1 root root 0 May 10 14:37 environ 
-dr-x------2 root root 0 Jun  3 09:01 fd +lrwxrwxrwx  1 root root 0 May 10 14:37 exe -> /usr/lib/systemd/systemd 
-dr-x------2 root root 0 Jun  09:01 fdinfo +dr-x------  2 root root 0 May 10 14:37 fd 
--rw-r--r--1 root root 0 Jun  3 09:01 gid_map +dr-x------  2 root root 0 Jun  09:55 fdinfo 
--r--------1 root root 0 Jun  3 09:02 io +-rw-r--r--  1 root root 0 May 10 14:37 gid_map 
--r--r--r--1 root root 0 Jun  3 09:02 limits +-r--------  1 root root 0 Jun  2 11:06 io 
--rw-r--r--1 root root 0 Jun  3 09:01 loginuid +-r--r--r--  1 root root 0 May 10 14:37 limits 
-dr-x------2 root root 0 Jun  3 09:02 map_files +-rw-r--r--  1 root root 0 May 10 14:37 loginuid 
--r--r--r--1 root root 0 Jun  3 09:01 maps +dr-x------  2 root root 0 Jun  2 11:06 map_files 
--rw-------1 root root 0 Jun  3 09:02 mem +-r--r--r--  1 root root 0 May 10 14:37 maps 
--r--r--r--1 root root 0 Jun  3 09:01 mountinfo +-rw-------  1 root root 0 Jun  2 11:06 mem 
--r--r--r--1 root root 0 Jun  3 09:01 mounts +-r--r--r--  1 root root 0 May 10 14:37 mountinfo 
--r--------1 root root 0 Jun  3 09:02 mountstats +-r--r--r--  1 root root 0 Jun  2 11:06 mounts 
-dr-xr-xr-x. 6 root root 0 Jun  3 09:01 net +-r--------  1 root root 0 Jun  2 11:06 mountstats 
-dr-x--x--x2 root root 0 Jun  3 09:02 ns +dr-xr-xr-x 54 root root 0 May 10 14:37 net 
--r--r--r--1 root root 0 Jun  3 09:02 numa_maps +dr-x--x--x  2 root root 0 Jun  2 11:06 ns 
--rw-r--r--1 root root 0 Jun  3 09:02 oom_adj +-r--r--r--  1 root root 0 Jun  2 11:06 numa_maps 
--r--r--r--1 root root 0 Jun  3 09:02 oom_score +-rw-r--r--  1 root root 0 Jun  2 11:06 oom_adj 
--rw-r--r--1 root root 0 Jun  3 09:02 oom_score_adj +-r--r--r--  1 root root 0 Jun  2 11:06 oom_score 
--r--------1 root root 0 Jun  3 09:02 pagemap +-rw-r--r--  1 root root 0 May 10 14:37 oom_score_adj 
--r--------1 root root 0 Jun  3 09:02 patch_state +-r--------  1 root root 0 Jun  2 11:06 pagemap 
--r--------1 root root 0 Jun  3 09:02 personality +-r--------  1 root root 0 Jun  2 11:06 patch_state 
--rw-r--r--1 root root 0 Jun  3 09:02 projid_map +-r--------  1 root root 0 Jun  2 11:06 personality 
-lrwxrwxrwx1 root root 0 Jun  3 09:01 root -> / +-rw-r--r--  1 root root 0 Jun  2 11:06 projid_map 
--rw-r--r--1 root root 0 Jun  3 09:01 sched +lrwxrwxrwx  1 root root 0 May 10 14:37 root -> / 
--r--r--r--1 root root 0 Jun  3 09:02 schedstat +-rw-r--r--  1 root root 0 May 10 14:37 sched 
--r--r--r--1 root root 0 Jun  3 09:01 sessionid +-r--r--r--  1 root root 0 Jun  2 11:06 schedstat 
--rw-r--r--1 root root 0 Jun  3 09:01 setgroups +-r--r--r--  1 root root 0 May 10 14:37 sessionid 
--r--r--r--1 root root 0 Jun  3 09:02 smaps +-rw-r--r--  1 root root 0 May 10 14:37 setgroups 
--r--r--r--1 root root 0 Jun  3 09:02 smaps_rollup +-r--r--r--  1 root root 0 Jun  2 11:06 smaps 
--r--------1 root root 0 Jun  3 09:02 stack +-r--r--r--  1 root root 0 Jun  2 11:06 smaps_rollup 
--r--r--r--1 root root 0 Jun  09:01 stat +-r--------  1 root root 0 Jun  2 11:06 stack 
--r--r--r--1 root root 0 Jun  3 09:02 statm +-r--r--r--  1 root root 0 Jun  09:55 stat 
--r--r--r--1 root root 0 Jun  3 09:01 status +-r--r--r--  1 root root 0 Jun  2 11:06 statm 
--r--------1 root root 0 Jun  3 09:02 syscall +-r--r--r--  1 root root 0 May 10 14:37 status 
-dr-xr-xr-x3 root root 0 Jun  3 09:01 task +-r--------  1 root root 0 Jun  2 11:06 syscall 
--r--r--r--1 root root 0 Jun  3 09:02 timers +dr-xr-xr-x  root root 0 May 10 14:37 task 
--rw-rw-rw-1 root root 0 Jun  3 09:02 timerslack_ns +-rw-r--r-- root root 0 Jun  2 11:06 timens_offsets 
--rw-r--r--1 root root 0 Jun  3 09:01 uid_map +-r--r--r--  1 root root 0 Jun  2 11:06 timers 
--r--r--r--1 root root 0 Jun  3 09:02 wchan+-rw-rw-rw-  1 root root 0 Jun  2 11:06 timerslack_ns 
 +-rw-r--r--  1 root root 0 May 10 14:37 uid_map 
 +-r--r--r--  1 root root 0 Jun  2 11:06 wchan
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** - Vous n'avez pas besoin de consulter le contenu des fichiers et des répertoires. Il convient tout simplement de savoir que ces données existent. **Important** - Vous n'avez pas besoin de consulter le contenu des fichiers et des répertoires. Il convient tout simplement de savoir que ces données existent.
 </WRAP> </WRAP>
  
-====2.2 - Les Types de Processus====+=====Les Types de Processus=====
  
 Il existe trois types de processus : Il existe trois types de processus :
Ligne 898: Ligne 2583:
   * //zombie// – le processus a terminé son exécution et est prêt à mourir.   * //zombie// – le processus a terminé son exécution et est prêt à mourir.
  
-====2.- La Commande ps====+====4.- La Commande ps====
  
 Cette commande affiche les processus de l’utilisateur attaché au terminal : Cette commande affiche les processus de l’utilisateur attaché au terminal :
  
 <code> <code>
-[root@centos8 1]# cd ~ +root@debian11:/proc/1# cd ~ 
-[root@centos8 ~]# ps+ 
 +root@debian11:~# ps 
 +    PID TTY          TIME CMD 
 +  28309 pts/1    00:00:00 su 
 +  28310 pts/1    00:00:00 bash 
 +  30237 pts/1    00:00:00 ps 
 + 
 +root@debian11:~# ps --forest
     PID TTY          TIME CMD     PID TTY          TIME CMD
-   1627 pts/   00:00:00 su +  28309 pts/   00:00:00 su 
-   1634 pts/   00:00:00 bash +  28310 pts/   00:00:00  \_ bash 
-   1690 pts/   00:00:00 ps+  30272 pts/   00:00:00      \_ ps
 </code> </code>
  
Ligne 914: Ligne 2606:
  
 <code> <code>
-[root@centos8 ~]# ps -l+root@debian11:~# ps -l
 F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
-4 S        1627    1601   80   0 - 48967 -      pts/   00:00:00 su +4 S       28309   28305   80   0 -  2529 -      pts/   00:00:00 su 
-4 S        1634    1627   80   0 -  6911 -      pts/   00:00:00 bash +4 S       28310   28309   80   0 -  2137 -      pts/   00:00:00 bash 
-R        1698    1634   80   0 - 11360 -      pts/   00:00:00 ps+R       30238   28310   80   0 -  2405 -      pts/   00:00:00 ps
 </code> </code>
  
Ligne 941: Ligne 2633:
  
 <code> <code>
-[root@centos8 ~]# ps lx | more+root@debian11:~# ps lx | more
 F   UID     PID    PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND F   UID     PID    PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
-4                  20   245540 14252 do_epo Ss   ?          0:01 /usr/lib/systemd/systemd --switched-root --system --deserialize 17+4                  20   165192 10516 -      Ss   ?          0:14 /sbin/init
 1                  20        0     0 -      S    ?          0:00 [kthreadd] 1                  20        0     0 -      S    ?          0:00 [kthreadd]
 1                   0 -20      0     0 -      I<   ?          0:00 [rcu_gp] 1                   0 -20      0     0 -      I<   ?          0:00 [rcu_gp]
 1                   0 -20      0     0 -      I<   ?          0:00 [rcu_par_gp] 1                   0 -20      0     0 -      I<   ?          0:00 [rcu_par_gp]
-1                 2  20   0      0     0 -      I    ?          0:00 [kworker/0:0-events+1                 2   -20          0 -      I<   ?          0:00 [kworker/0:0H-eve 
-1                 2   0 -20      0     0 -      I<   ?          0:00 [kworker/0:0H-kblockd+nts_highpri
-1                 2  20        0     0 -         ?          0:00 [kworker/0:1-ata_sff+1                 2   0 -20      0     0 -      I<   ?          0:00 [mm_percpu_wq
-1           8       2  20        0     0 -         ?          0:00 [kworker/u8:0-events_unbound+1                 2  20        0     0 -         ?          0:00 [rcu_tasks_rude_
-1           9         0 -20      0     0 -      I<   ?          0:00 [mm_percpu_wq] +1          10       2  20        0     0 -         ?          0:00 [rcu_tasks_trace
-1          10       2  20        0     0 -      S    ?          0:00 [ksoftirqd/0] +1          11       2  20        0     0 -      S    ?          0:00 [ksoftirqd/0] 
-1          11       2  20        0     0 -      I    ?          0:00 [rcu_sched] +1          12       2  20        0     0 -      I    ?          0:08 [rcu_sched] 
-1          12       2 -100  -      0     0 -      S    ?          0:00 [migration/0] +1          13       2 -100  -      0     0 -      S    ?          0:12 [migration/0] 
-5          13       2 -100  -      0     0 -      S    ?          0:00 [watchdog/0] +1          15       2  20        0     0 -      S    ?          0:00 [cpuhp/0] 
-1          14       2  20        0     0 -      S    ?          0:00 [cpuhp/0] +1          16       2  20        0     0 -      S    ?          0:00 [cpuhp/1] 
-1          15       2  20        0     0 -      S    ?          0:00 [cpuhp/1] +1          17       2 -100  -      0     0 -      S    ?          0:12 [migration/1]
-5          16       2 -100  -      0     0 -      S    ?          0:00 [watchdog/1] +
-1          17       2 -100  -      0     0 -      S    ?          0:00 [migration/1]+
 1          18        20        0     0 -      S    ?          0:00 [ksoftirqd/1] 1          18        20        0     0 -      S    ?          0:00 [ksoftirqd/1]
-1          19       2  20   0      0     0 -      I    ?          0:00 [kworker/1:0-memcg_kmem_cache+1          20       2   -20          0 -      I<   ?          0:00 [kworker/1:0H-eve 
-1          20       2   0 -20      0     0 -      I<   ?          0:00 [kworker/1:0H+nts_highpri] 
-1          21       2  20        0     0 -      S    ?          0:00 [cpuhp/2+5          23        20        0     0 -         ?          0:00 [kdevtmpfs
-    0      22       2 -100           0 -      S    ?          0:00 [watchdog/2]+1          24       2   0 -20      0     0 -      I<   ?          0:00 [netns
 +1          25       2  20        0     0 -      S    ?          0:00 [kauditd
 +    0      27       2  20            0 -      S    ?          0:00 [khungtaskd]
 --More-- --More--
 </code> </code>
Ligne 973: Ligne 2665:
 ^ RSS | La mémoire utilisée en kilobytes par le processus | ^ RSS | La mémoire utilisée en kilobytes par le processus |
 ^ STAT | La même chose que S dans l'exemple ci-dessus | ^ STAT | La même chose que S dans l'exemple ci-dessus |
- 
  
 Avec des options a,u et x la commande affiche le résultat suivant : Avec des options a,u et x la commande affiche le résultat suivant :
  
 <code> <code>
-[root@centos8 ~]# ps aux | more+root@debian11:~# ps aux | more
 USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
-root            0. 0.3 245540 14252 ?        Ss   09:01   0:01 /usr/lib/systemd/systemd --switched-root --system --deserialize 17 +root            0. 0.2 165192 10516 ?        Ss   May10   0:14 /sbin/init 
-root            0.0  0.0      0     0 ?        S    09:01   0:00 [kthreadd] +root            0.0  0.0      0     0 ?        S    May10   0:00 [kthreadd] 
-root            0.0  0.0      0     0 ?        I<   09:01   0:00 [rcu_gp] +root            0.0  0.0      0     0 ?        I<   May10   0:00 [rcu_gp] 
-root            0.0  0.0      0     0 ?        I<   09:01   0:00 [rcu_par_gp+root            0.0  0.0      0     0 ?        I<   May10   0:00 [rcu_par_gp] 
-root            0.0  0.0      0     0 ?        I    09:01   0:00 [kworker/0:0-events+root            0.0  0.0      0     0 ?        I<   May10   0:00 [kworker/0:0H-events_hi 
-root            0.0  0.0      0     0 ?        I<   09:01   0:00 [kworker/0:0H-kblockd] +ghpri
-root            0.1  0.0      0     0 ?        I    09:01   0:00 [kworker/0:1-ata_sff+root            0.0  0.0      0     0 ?        I<   May10   0:00 [mm_percpu_wq
-root            0.0  0.0      0     0 ?        I    09:01   0:00 [kworker/u8:0-events_unbound+root            0.0  0.0      0     0 ?        S    May10   0:00 [rcu_tasks_rude_
-root            0.0  0.0      0     0 ?        I<   09:01   0:00 [mm_percpu_wq+root          10  0.0  0.0      0     0 ?        S    May10   0:00 [rcu_tasks_trace
-root          10  0.0  0.0      0     0 ?        S    09:01   0:00 [ksoftirqd/0+root          11  0.0  0.0      0     0 ?           May10   0:00 [ksoftirqd/0
-root          11  0.0  0.0      0     0 ?           09:01   0:00 [rcu_sched+root          12  0.0  0.0      0     0 ?           May10   0:08 [rcu_sched
-root          12  0.0  0.0      0     0 ?           09:01   0:00 [migration/0+root          13  0.0  0.0      0     0 ?        S    May10   0:12 [migration/0] 
-root          13  0.0  0.0      0     0 ?        S    09:01   0:00 [watchdog/0] +root          15  0.0  0.0      0     0 ?        S    May10   0:00 [cpuhp/0] 
-root          14  0.0  0.0      0     0 ?        S    09:01   0:00 [cpuhp/0] +root          16  0.0  0.0      0     0 ?        S    May10   0:00 [cpuhp/1] 
-root          15  0.0  0.0      0     0 ?        S    09:01   0:00 [cpuhp/1] +root          17  0.0  0.0      0     0 ?        S    May10   0:12 [migration/1] 
-root          16  0.0  0.0      0     0 ?        S    09:01   0:00 [watchdog/1] +root          18  0.0  0.0      0     0 ?        S    May10   0:00 [ksoftirqd/1] 
-root          17  0.0  0.0      0     0 ?        S    09:01   0:00 [migration/1] +root          20  0.0  0.0      0     0 ?        I<   May10   0:00 [kworker/1:0H-events_hi 
-root          18  0.0  0.0      0     0 ?        S    09:01   0:00 [ksoftirqd/1] +ghpri
-root          19  0.0  0.0      0     0 ?           09:01   0:00 [kworker/1:0-memcg_kmem_cache+root          23  0.0  0.0      0     0 ?           May10   0:00 [kdevtmpfs
-root          20  0.0  0.0      0     0 ?        I<   09:01   0:00 [kworker/1:0H+root          24  0.0  0.0      0     0 ?        I<   May10   0:00 [netns
-root          21  0.0  0.0      0     0 ?        S    09:01   0:00 [cpuhp/2+root          25  0.0  0.0      0     0 ?        S    May10   0:00 [kauditd
-root          22  0.0  0.0      0     0 ?        S    09:01   0:00 [watchdog/2]+root          27  0.0  0.0      0     0 ?        S    May10   0:00 [khungtaskd]
 --More-- --More--
 </code> </code>
Ligne 1014: Ligne 2705:
  
 <code> <code>
-[root@centos8 ~]# ps --help all+root@debian11:~# ps --help all
  
 Usage: Usage:
Ligne 1097: Ligne 2788:
 </code> </code>
  
-====2.4 - La Commande pstree====+====4.2 - La Commande pstree====
  
 Cette commande affiche les processus en forme d'arborescence, démontrant ainsi les processus parents en enfants : Cette commande affiche les processus en forme d'arborescence, démontrant ainsi les processus parents en enfants :
  
 <code> <code>
-[root@centos8 ~]# pstree +root@debian11:~# pstree 
-systemd─┬─NetworkManager───2*[{NetworkManager}]+systemd─┬─ModemManager───2*[{ModemManager}] 
 +        ├─NetworkManager───2*[{NetworkManager}]
         ├─agetty         ├─agetty
         ├─atd         ├─atd
-        ├─auditdsedispatch +        ├─avahi-daemon───avahi-daemon 
-        │        └─2*[{auditd}] +        ├─colord───2*[{colord}] 
-        ├─chronyd +        ├─cron 
-        ├─crond +        ├─cups-browsed───2*[{cups-browsed}] 
-        ├─dbus-daemon───{dbus-daemon+        ├─cupsd 
-        ├─dnsmasq───dnsmasq +        ├─dbus-daemon 
-        ├─firewalld───{firewalld+        ├exim4 
-        ├─gssproxy───5*[{gssproxy}] +        ├lightdm┬─2*[Xorg───9*[{Xorg}]] 
-        ├─irqbalance───{irqbalance+        │         ├─lightdm─┬─xfce4-session─┬─Thunar───2*[{Thunar}] 
-        ├─ksmtuned───sleep +        │         │         │               ├─applet.py 
-        ├─lsmd +        │         │         │               ├light-locker───3*[{light-locker}] 
-        ├─mcelog +        │         │         │               ├─nm-applet───3*[{nm-applet}] 
-        ├─polkitd───7*[{polkitd}] +        │         │         │               ├─polkit-gnome-au───2*[{polkit-gnome-au}] 
-        ├─rngd───4*[{rngd}] +        │         │         │               ├─ssh-agent 
-        ├─rpcbind +        │         │         │               ├xfce4-notifyd───2*[{xfce4-notifyd}] 
-        ├─rsyslogd───2*[{rsyslogd}] +        │         │         │               ├─xfce4-panelpanel-10-notifi──2*[{panel-1+ 
-        ├─smartd+        │         │         │               │             ├─panel-14-action───2*[{panel-1+ 
 +        │         │         │               │             ├─panel-6-systray───2*[{panel-6+ 
 +        │         │         │               │             ├─panel-8-pulseau───2*[{panel-8+ 
 +        │         │         │               │             ├─panel-9-power-m───2*[{panel-9+ 
 +        │         │         │               │             └─2*[{xfce4-panel}] 
 +        │         │         │               ├─xfce4-power-man───2*[{xfce4-power-man}] 
 +        │         │         │               ├─xfdesktop───2*[{xfdesktop}] 
 +        │         │         │               ├─xfsettingsd───2*[{xfsettingsd}] 
 +        │         │         │               ├─xfwm4───10*[{xfwm4}] 
 +        │         │         │               ├─xiccd───2*[{xiccd}] 
 +        │         │         │               └─2*[{xfce4-session}] 
 +        │         │         └─2*[{lightdm}] 
 +        │         ├─lightdm─┬─lightdm-gtk-gre───10*[{lightdm-gtk-gre}] 
 +        │         │         └─2*[{lightdm}] 
 +        │         ├─lightdm 
 +        │         └─2*[{lightdm}] 
 +        ├─packagekitd───2*[{packagekitd}] 
 +        ├─polkitd───2*[{polkitd}] 
 +        ├─rsyslogd───3*[{rsyslogd}] 
 +        ├─rtkit-daemon───2*[{rtkit-daemon}]
         ├─sshd───sshd───sshd───bash───su───bash───pstree         ├─sshd───sshd───sshd───bash───su───bash───pstree
-        ├─sssd─┬─sssd_be +        ├─systemd─┬─(sd-pam) 
-        │      └─sssd_nss +        │         ├─at-spi-bus-laun─┬─dbus-daemon 
-        ├─systemd───(sd-pam)+        │         │                 └─3*[{at-spi-bus-laun}] 
 +        │         ├─at-spi2-registr───2*[{at-spi2-registr}] 
 +        │         ├─dbus-daemon 
 +        │         ├─gvfsd───2*[{gvfsd}] 
 +        │         ├─pipewire─┬─pipewire-media-───{pipewire-media-} 
 +        │         │          └─{pipewire} 
 +        │         └─pulseaudio───{pulseaudio} 
 +        ├─systemd─┬─(sd-pam) 
 +        │         ├─at-spi-bus-laun─┬─dbus-daemon 
 +        │         │                 └─3*[{at-spi-bus-laun}] 
 +        │         ├─at-spi2-registr───2*[{at-spi2-registr}] 
 +        │         ├─dbus-daemon 
 +        │         ├─dconf-service───2*[{dconf-service}] 
 +        │         ├─gpg-agent 
 +        │         ├─gvfs-udisks2-vo───3*[{gvfs-udisks2-vo}] 
 +        │         ├─gvfsd─┬─gvfsd-trash───2*[{gvfsd-trash}] 
 +        │         │       └─2*[{gvfsd}] 
 +        │         ├─gvfsd-metadata───2*[{gvfsd-metadata}] 
 +        │         ├─pipewire─┬─pipewire-media-───{pipewire-media-} 
 +        │         │          └─{pipewire} 
 +        │         ├─pulseaudio───{pulseaudio} 
 +        │         └─xfconfd───2*[{xfconfd}]
         ├─systemd-journal         ├─systemd-journal
         ├─systemd-logind         ├─systemd-logind
-        ├─systemd-machine+        ├─systemd-timesyn───{systemd-timesyn}
         ├─systemd-udevd         ├─systemd-udevd
-        └─tuned───3*[{tuned}]+        ├─udisksd───4*[{udisksd}] 
 +        ├─upowerd───2*[{upowerd}] 
 +        ├─wpa_supplicant 
 +        └─xfce4-terminalbash 
 +                         └2*[{xfce4-terminal}]
 </code> </code>
  
Ligne 1137: Ligne 2873:
  
 <code> <code>
-[root@centos8 ~]# pstree --help+root@debian11:~# pstree --help
 pstree: unrecognized option '--help' pstree: unrecognized option '--help'
-Usage: pstree [-acglpsStuZ] [ -h | -H PID ] [ -n | -N type ]+Usage: pstree [-acglpsStTuZ] [ -h | -H PID ] [ -n | -N type ]
               [ -A | -G | -U ] [ PID | USER ]               [ -A | -G | -U ] [ PID | USER ]
-       pstree -V+   or: pstree -V 
 Display a tree of processes. Display a tree of processes.
  
   -a, --arguments     show command line arguments   -a, --arguments     show command line arguments
   -A, --ascii         use ASCII line drawing characters   -A, --ascii         use ASCII line drawing characters
-  -c, --compact       don't compact identical subtrees +  -c, --compact-not   don't compact identical subtrees 
-  -h, --highlight-all highlight current process and its ancestors +  -C, --color=TYPE    color process by attribute 
-  -H PID, +                      (age)
-  --highlight-pid=PID highlight this process and its ancestors+
   -g, --show-pgids    show process group ids; implies -c   -g, --show-pgids    show process group ids; implies -c
   -G, --vt100         use VT100 line drawing characters   -G, --vt100         use VT100 line drawing characters
 +  -h, --highlight-all highlight current process and its ancestors
 +  -H PID, --highlight-pid=PID
 +                      highlight this process and its ancestors
   -l, --long          don't truncate long lines   -l, --long          don't truncate long lines
   -n, --numeric-sort  sort output by PID   -n, --numeric-sort  sort output by PID
-  -N type, +  -N TYPE, --ns-sort=TYPE 
-  --ns-sort=type      sort by namespace type (cgroup, ipc, mnt, net, pid, +                      sort output by this namespace type 
-                                              user, uts)+                              (cgroup, ipc, mnt, net, pid, time, user, uts)
   -p, --show-pids     show PIDs; implies -c   -p, --show-pids     show PIDs; implies -c
   -s, --show-parents  show parents of the selected process   -s, --show-parents  show parents of the selected process
Ligne 1166: Ligne 2905:
   -V, --version       display version information   -V, --version       display version information
   -Z, --security-context   -Z, --security-context
-                      show SELinux security contexts+                      show security attributes 
   PID    start at this PID; default is 1 (init)   PID    start at this PID; default is 1 (init)
   USER   show only trees rooted at processes of this user   USER   show only trees rooted at processes of this user
 </code> </code>
  
-====2.- La Commande top====+====4.- La Commande top====
  
 Cette commande indique les processus en mémoire : Cette commande indique les processus en mémoire :
  
 <code> <code>
-[root@centos8 ~]# top+root@debian11:~# top
  
-top - 09:10:02 up 8 min,  1 user,  load average: 0.05, 0.09, 0.08 +top - 09:22:03 up 26 days, 18:44,  2 users,  load average: 0.00, 0.00, 0.00 
-Tasks: 144 total,   1 running, 143 sleeping,   0 stopped,   0 zombie +Tasks: 141 total,   1 running, 140 sleeping,   0 stopped,   0 zombie 
-%Cpu(s):  0.us,  0.2 sy,  0.0 ni, 99.id,  0.0 wa,  0.hi,  0.si,  0.0 st +%Cpu(s):  0.us,  0.2 sy,  0.0 ni, 99.id,  0.0 wa,  0.hi,  0.si,  0.0 st 
-MiB Mem :   3737.total,   3249.free,    231.used,    257.buff/cache +MiB Mem :   3931.total,   1711.free,    405.used,   1814.buff/cache 
-MiB Swap:   2000.0 total,   2000.0 free,      0.0 used.   3280.avail Mem +MiB Swap:    975.0 total,    975.0 free,      0.0 used.   3238.avail Mem 
  
-    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                                                 +    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                  
-      root      20   0  245540  14260   9308 S   0.  0.4   0:01.64 systemd                                                                                                                                                                 +  22947 root      20   0  867344  56320  41236 S   0.  1.4   0:11.05 Xorg                                                                     
-    827 polkitd   20   1764748  25376  17348 S   0.  0.  0:00.12 polkitd                                                                                                                                                                 +  22994 lightdm   20   1168584  95868  59348 S   0.  2.  1:13.05 lightdm-gtk-gre                                                          
-    834 dbus      20     64684   5476   4480 S   0.  0.1   0:00.20 dbus-daemon                                                                                                                                                             +  28304 trainee   20     14832   5888   4616 S   0.  0.1   0:00.10 sshd                                                                     
-   1789 root      20     65420   4464   3764 R   0.  0.  0:00.03 top                                                                                                                                                                     +      root      20    165192  10516   7596 S   0.  0.  0:14.72 systemd                                                                  
-      2 root      20              0      0 S   0.0   0.0   0:00.00 kthreadd                                                                                                                                                                +      2 root      20              0      0 S   0.0   0.0   0:00.71 kthreadd                                                                 
-      3 root       0 -20            0      0 I   0.0   0.0   0:00.00 rcu_gp                                                                                                                                                                  +      3 root       0 -20            0      0 I   0.0   0.0   0:00.00 rcu_gp                                                                   
-      4 root       0 -20            0      0 I   0.0   0.0   0:00.00 rcu_par_gp                                                                                                                                                              +      4 root       0 -20            0      0 I   0.0   0.0   0:00.00 rcu_par_gp                                                               
-      6 root       0 -20            0      0 I   0.0   0.0   0:00.00 kworker/0:0H-kblockd                                                                                                                                                    +      6 root       0 -20            0      0 I   0.0   0.0   0:00.00 kworker/0:0H-events_highpri                                              
-      root      20   0            0      0 I   0.0   0.0   0:00.47 kworker/0:1-mm_percpu_wq                                                                                                                                                +      root       -20       0      0      0 I   0.0   0.0   0:00.00 mm_percpu_wq                                                             
-      9 root       0 -20            0      0   0.0   0.0   0:00.00 mm_percpu_wq                                                                                                                                                            +      9 root      20   0       0      0      0   0.0   0.0   0:00.00 rcu_tasks_rude_                                                          
-     10 root      20              0      0 S   0.0   0.0   0:00.00 ksoftirqd/                                                                                                                                                            +     10 root      20              0      0 S   0.0   0.0   0:00.00 rcu_tasks_trace                                                          
-     11 root      20              0      0   0.0   0.0   0:00.09 rcu_sched                                                                                                                                                               +     11 root      20              0      0   0.0   0.0   0:00.09 ksoftirqd/                                                             
-     12 root      rt   0            0      0   0.0   0.0   0:00.00 migration/                                                                                                                                                            +     12 root      20   0            0      0   0.0   0.0   0:08.85 rcu_sched                                                                
-     13 root      rt              0      0 S   0.0   0.0   0:00.00 watchdog/0                                                                                                                                                              +     13 root      rt              0      0 S   0.0   0.0   0:12.98 migration/0                                                              
-     14 root      20              0      0 S   0.0   0.0   0:00.00 cpuhp/                                                                                                                                                                +     15 root      20              0      0 S   0.0   0.0   0:00.00 cpuhp/                                                                 
-     15 root      20              0      0 S   0.0   0.0   0:00.00 cpuhp/                                                                                                                                                                +     16 root      20              0      0 S   0.0   0.0   0:00.00 cpuhp/                                                                 
-     16 root      rt              0      0 S   0.0   0.0   0:00.00 watchdog/                                                                                                                                                             +     17 root      rt              0      0 S   0.0   0.0   0:12.26 migration/                                                             
-     17 root      rt              0      0 S   0.0   0.0   0:00.00 migration/                                                                                                                                                            +     18 root      20              0      0 S   0.0   0.0   0:00.13 ksoftirqd/                                                             
-     18 root      20              0      0 S   0.0   0.0   0:00.00 ksoftirqd/                                                                                                                                                            +     20 root       0 -20            0      0 I   0.0   0.0   0:00.00 kworker/1:0H-events_highpri                                              
-     20 root       0 -20            0      0 I   0.0   0.0   0:00.00 kworker/1:0H                                                                                                                                                            +     23 root      20              0      0 S   0.0   0.0   0:00.00 kdevtmpfs                                                                
-     21 root      20              0      0 S   0.0   0.0   0:00.00 cpuhp/                                                                                                                                                                +     24 root       0 -20            0      0 I   0.0   0.0   0:00.00 netns                                                                    
-     22 root      rt              0      0 S   0.0   0.0   0:00.00 watchdog/                                                                                                                                                             +     25 root      20              0      0 S   0.0   0.0   0:00.00 kauditd                                                                  
-     23 root      rt              0      0 S   0.0   0.0   0:00.00 migration/                                                                                                                                                            +     27 root      20              0      0 S   0.0   0.0   0:00.99 khungtaskd                                                               
-     24 root      20              0      0 S   0.0   0.0   0:00.00 ksoftirqd/                                                                                                                                                            +     28 root      20              0      0 S   0.0   0.0   0:00.00 oom_reaper                                                               
-     26 root       0 -20            0      0 I   0.0   0.0   0:00.00 kworker/2:0H-kblockd                                                                                                                                                    +     29 root       0 -20            0      0 I   0.0   0.0   0:00.00 writeback                                                                
-     27 root      20              0      0 S   0.0   0.0   0:00.00 cpuhp/                                                                                                                                                                +     30 root      20              0      0 S   0.0   0.0   1:15.18 kcompactd0                                    
-     28 root      rt              0      0 S   0.0   0.0   0:00.00 watchdog/                                                                                                                                                             +
-     29 root      rt              0      0 S   0.0   0.0   0:00.00 migration/                                                                                                                                                            +
-     30 root      20              0      0 S   0.0   0.0   0:00.00 ksoftirqd/                                                                                                                                                            +
-     32 root       0 -20            0      0 I   0.0   0.0   0:00.00 kworker/3:0H-kblockd                                                                                                                                                    +
-     35 root      20              0      0 S   0.0   0.0   0:00.00 kdevtmpfs                                                                                                                                                               +
-     36 root       0 -20            0      0 I   0.0   0.0   0:00.00 netns                                                                                                                                                                   +
-     37 root      20              0      0 S   0.0   0.0   0:00.00 kauditd                                                                                                                                                                 +
-     38 root      20              0      0 S   0.0   0.0   0:00.00 khungtaskd                                                                                                                                                              +
-     39 root      20              0      0 S   0.0   0.0   0:00.00 oom_reaper                                                                                                                                                              +
-     40 root       0 -20            0      0 I   0.0   0.0   0:00.00 writeback                                                                                                                                                               +
-     41 root      20              0      0 S   0.0   0.0   0:00.00 kcompactd0                                                                                                                                                              +
-     42 root      25              0      0 S   0.0   0.0   0:00.00 ksmd                                                                                                                                                                    +
-     43 root      39  19            0      0 S   0.0   0.0   0:00.00 khugepaged                                                                                                                                                              +
-     44 root       0 -20            0      0 I   0.0   0.0   0:00.00 crypto                                                                                                                                                                  +
-     45 root       0 -20            0      0 I   0.0   0.0   0:00.00 kintegrityd                                                                                                                                                             +
-     46 root       0 -20            0      0 I   0.0   0.0   0:00.00 kblockd                                                                                                                                                                 +
-     47 root       0 -20            0      0 I   0.0   0.0   0:00.00 blkcg_punt_bio                                                                                                                                                          +
-     48 root       0 -20            0      0 I   0.0   0.0   0:00.00 tpm_dev_wq                                                                                                                                                              +
-     49 root       0 -20            0      0 I   0.0   0.0   0:00.00 md                                                                                                                                                                      +
-     50 root       0 -20            0      0 I   0.0   0.0   0:00.00 edac-poller                                                                                                                                                             +
-     51 root      rt              0      0 S   0.0   0.0   0:00.00 watchdogd                                                                                                                                                               +
-     53 root       0 -20            0      0 I   0.0   0.0   0:00.00 pm_wq                                                                                                                                                                   +
-     69 root      20              0      0 S   0.0   0.0   0:00.00 kswapd0                                                                                                                                                                 +
-    162 root       0 -20            0      0 I   0.0   0.0   0:00.00 kthrotld                                                                                                                                                                +
-    163 root       0 -20            0      0 I   0.0   0.0   0:00.00 acpi_thermal_pm                                     +
 ...                                                                          ...                                                                         
 </code> </code>
Ligne 1242: Ligne 2957:
  
 <code> <code>
-Help for Interactive Commands - procps-ng 3.3.15+Help for Interactive Commands - procps-ng 3.3.17
 Window 1:Def: Cumulative mode Off.  System: Delay 3.0 secs; Secure mode Off. Window 1:Def: Cumulative mode Off.  System: Delay 3.0 secs; Secure mode Off.
  
   Z,B,E,  Global: 'Z' colors; 'B' bold; 'E'/'e' summary/task memory scale   Z,B,E,  Global: 'Z' colors; 'B' bold; 'E'/'e' summary/task memory scale
-  l,t,m     Toggle Summary: 'l' load avg; 't' task/cpu stats; 'm' memory info +  l,t,m,I   Toggle: 'l' load avg; 't' task/cpu; 'm' memory; 'I' Irix mode 
-  0,1,2,3,Toggle: '0' zeros; '1/2/3' cpus or numa node views; 'IIrix mode+  0,1,2,3,Toggle: '0' zeros; '1/2/3' cpu/numa views; '4cpus two abreast
   f,F,X     Fields: 'f'/'F' add/remove/order/sort; 'X' increase fixed-width   f,F,X     Fields: 'f'/'F' add/remove/order/sort; 'X' increase fixed-width
  
   L,&,<,> . Locate: 'L'/'&' find/again; Move sort column: '<'/'>' left/right   L,&,<,> . Locate: 'L'/'&' find/again; Move sort column: '<'/'>' left/right
-  R,H,V,J . Toggle: 'R' Sort; 'H' Threads; 'V' Forest view; 'J' Num justify+  R,H,J,C . Toggle: 'R' Sort; 'H' Threads; 'J' Num justify; 'C' Coordinates
   c,i,S,j . Toggle: 'c' Cmd name/line; 'i' Idle; 'S' Time; 'j' Str justify   c,i,S,j . Toggle: 'c' Cmd name/line; 'i' Idle; 'S' Time; 'j' Str justify
   x,y     . Toggle highlights: 'x' sort field; 'y' running tasks   x,y     . Toggle highlights: 'x' sort field; 'y' running tasks
Ligne 1257: Ligne 2972:
   u,U,o,O . Filter by: 'u'/'U' effective/any user; 'o'/'O' other criteria   u,U,o,O . Filter by: 'u'/'U' effective/any user; 'o'/'O' other criteria
   n,#,^O  . Set: 'n'/'#' max tasks displayed; Show: Ctrl+'O' other filter(s)   n,#,^O  . Set: 'n'/'#' max tasks displayed; Show: Ctrl+'O' other filter(s)
-  C,...   . Toggle scroll coordinates msg forup,down,left,right,home,end+  V,v     . Toggle: 'V' forest view; 'v' hide/show forest view children
  
   k,r       Manipulate tasks: 'k' kill; 'r' renice   k,r       Manipulate tasks: 'k' kill; 'r' renice
   d or s    Set update interval   d or s    Set update interval
-  W,Y       Write configuration file 'W'; Inspect other output 'Y'+  W,Y,!     Write config file 'W'; Inspect other output 'Y'; Combine Cpus '!'
   q         Quit   q         Quit
           ( commands shown with '.' require a visible task display window )            ( commands shown with '.' require a visible task display window ) 
 Press 'h' or '?' for help with Windows, Press 'h' or '?' for help with Windows,
-Type 'q' or <Esc> to continue +Type 'q' or <Esc> to continue  
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** - Pour revenir à l'affichage précédent, appuyez sur la touche **q** ou **echap**. **Important** - Pour revenir à l'affichage précédent, appuyez sur la touche **q** ou **echap**.
 </WRAP> </WRAP>
Ligne 1275: Ligne 2990:
  
 <code> <code>
-[root@centos8 ~]# top+root@debian11:~# top
 ... ...
-top - 09:11:24 up 10 min,  1 user,  load average: 0.01, 0.07, 0.07 +top - 09:24:04 up 26 days, 18:46,  2 users,  load average: 0.00, 0.00, 0.00 
-Tasks: 144 total,   1 running, 143 sleeping,   0 stopped,   0 zombie +Tasks: 141 total,   1 running, 140 sleeping,   0 stopped,   0 zombie 
-%Cpu(s):  0.0 us,  0.sy,  0.0 ni, 99.id,  0.wa,  0.hi,  0.0 si,  0.0 st +%Cpu(s):  0.0 us,  0.sy,  0.0 ni, 99.id,  0.wa,  0.hi,  0.0 si,  0.0 st 
-MiB Mem :   3737.total,   3248.free,    231.used,    257.buff/cache +MiB Mem :   3931.total,   1711.free,    405.used,   1814.buff/cache 
-MiB Swap:   2000.0 total,   2000.0 free,      0.0 used.   3279.avail Mem +MiB Swap:    975.0 total,    975.0 free,      0.0 used.   3238.avail Mem 
 Change delay from 3.0 to 1 Change delay from 3.0 to 1
 +    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                 
 ... ...
 </code> </code>
Ligne 1289: Ligne 3005:
  
 <code> <code>
-[root@centos8 ~]# top+root@debian11:~# top
 ... ...
-top - 09:12:07 up 10 min,  1 user,  load average: 0.00, 0.05, 0.06 +top - 09:25:13 up 26 days, 18:48,  2 users,  load average: 0.00, 0.00, 0.00 
-Tasks: 146 total,   1 running, 145 sleeping,   0 stopped,   0 zombie +Tasks: 141 total,   1 running, 140 sleeping,   0 stopped,   0 zombie 
-%Cpu(s):  0.us,  0.sy,  0.ni, 97.id,  0.wa,  0.hi,  0.si,  0.0 st +%Cpu(s):  0.us,  0.sy,  0.ni,100.id,  0.wa,  0.hi,  0.si,  0.0 st 
-MiB Mem :   3737.total,   3192.free,    233.used,    311.4 buff/cache +MiB Mem :   3931.total,   1711.free,    405.used,   1814.4 buff/cache 
-MiB Swap:   2000.0 total,   2000.0 free,      0.0 used.   3277.avail Mem +MiB Swap:    975.0 total,    975.0 free,      0.0 used.   3238.avail Mem 
  
-    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                                                 +    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                  
-    874 root      20   0  290088  40696  17960 S   0.0   1.1   0:00.54 firewalld                                                                                                                                                               +  22994 lightdm   20   1168584  95868  59348 S   0.0   2.4   1:13.09 lightdm-gtk-gre                                                          
-    875 root      20   0  224868  40472  38904 S   0.0   1.  0:00.08 sssd_nss                                                                                                                                                                +    452 root      20   0  861748  78164  38060 S   0.0   1.  1:07.28 Xorg                                                                     
-    902 root      20   0  426324  33684  16668 S   0.0   0.  0:00.25 tuned                                                                                                                                                                   +  22007 trainee   20   0  973148  73384  57724 S   0.0   1.  0:03.88 xfwm4                                                                    
-    827 polkitd   20   1764748  25376  17348 S   0.0   0.  0:00.12 polkitd                                                                                                                                                                 +  22947 root      20   0  867344  56320  41236 S   0.0   1.  0:11.05 Xorg                                                                     
-    884 root      20   0  391768  18828  16220 S   0.  0.  0:00.11 NetworkManager                                                                                                                                                          +  22045 trainee   20   0  329636  53740  32396 S   0.  1.  0:05.50 xfdesktop                                                                
-    866 root      20   0  221424  15016  12284 S   0.0   0.  0:00.09 sssd_be                                                                                                                                                                 +  22036 trainee   20   0  319156  40340  31788 S   0.0   1.  0:06.02 xfce4-panel                                                              
-    840 root      20   0  214800  14292  12260 S   0.0   0.  0:00.03 sssd                                                                                                                                                                    +  22146 trainee   20   0  386976  36676  28888 S   0.0   0.  0:00.20 xfce4-terminal                                                           
-      1 root      20   0  245540  14260   9308 S   0.  0.  0:01.66 systemd                                                                                                                                                                 +  22051 trainee   20     62288  36480  18088 S   0.  0.  0:00.49 applet.py                                                                
-   1627 root      20   0  195868  11896  10336 S   0.0   0.  0:00.02 su                                                                                                                                                                      +  22096 trainee   20   0  240616  35676  28976 S   0.0   0.  0:00.27 panel-10-notifi                                                          
-    666 root      20   0  110416  11336   8292 S   0.0   0.  0:00.30 systemd-udevd                                                                                                                                                           +  22052 trainee   20   0  355636  33224  26600 S   0.0   0.  0:00.17 nm-applet                                                                
-   1585 root      20   0  163700  10636   9340 S   0.0   0.  0:00.01 sshd                                                                                                                                                                    +  22094 trainee   20   0  464892  31108  24892 S   0.0   0.  2:42.24 panel-8-pulseau                                                          
-   1590 trainee   20     94128   9872   8240 S   0.0   0.  0:00.05 systemd                                                                                                                                                                 +  22095 trainee   20    197048  28304  22796 S   0.0   0.  0:00.29 panel-9-power-m                                                          
-    880 root      20     96712   9780   7568 S   0.0   0.  0:00.25 systemd-logind                                                                                                                                                          +    213 root      20     56684  28064  24908 S   0.0   0.  0:08.07 systemd-journal                                                          
-    632 root      20     94036   9064   8016 S   0.0   0.  0:00.28 systemd-journal                                                                                                                                                         +  22093 trainee   20    341076  24972  18016 S   0.0   0.  0:00.25 panel-6-systray                                                          
-    837 root      20     83656   7004   6108 S   0.0   0.  0:00.19 systemd-machine                                                                                                                                                         +  22040 trainee   20    341956  24776  17892 S   0.0   0.  0:00.06 Thunar                                                                   
-    905 root      20     92288   6996   6100 S   0.0   0.  0:00.01 sshd                                                                                                                                                                    +  22024 trainee   20    227856  24132  18852 S   0.0   0.  0:00.17 xfsettingsd                                                              
-    847 rngd      20   0  381308   6500   5656 S   0.0   0.  0:15.38 rngd                                                                                                                                                                    +  22119 trainee   20   0  195152  23308  18416 S   0.0   0.  0:00.23 panel-14-action                                                          
-    828 root      20     50640   5900   4600 S   0.0   0.  0:00.03 smartd                                                                                                                                                                  +  22063 trainee   20    268476  23096  18368 S   0.0   0.  0:01.99 light-locker                                                             
-   1600 trainee   20   0  163700   5584   4284 S   0.0   0.  0:00.04 sshd                                                                                                                                                                    +  21928 trainee   20   0  267564  22348  17344 S   0.0   0.  0:00.16 xfce4-session                                                            
-   1601 trainee   20     28312   5564   3664 S   0.0   0.  0:00.02 bash                                                                                                                                                                    +  22049 trainee   20    264284  19340  15216 S   0.0   0.  0:00.02 xfce4-notifyd                                                            
-    834 dbus      20     64684   5476   4480 S   0.  0.  0:00.22 dbus-daemon                                                                                                                                                             +  12807 root      20    289480  18932  16368 S   0.  0.  0:07.01 packagekitd                                                              
-   1634 root      20     27644   5428   3408 S   0.0   0.  0:00.06 bash                                                                                                                                                                    +  22060 trainee   20    190476  17604  15312 S   0.0   0.  0:00.10 xfce4-power-man                                                          
-    791 rpc       20     67140   5396   4672 S   0.0   0.  0:00.01 rpcbind                                                                                                                                                                 +    368 root      20    254628  16664  14172 S   0.0   0.  0:46.42 NetworkManager                                                           
-   1594 trainee   20   0  175840   5228     40 S   0.0   0.  0:00.00 (sd-pam)                                                                                                                                                                +  22065 trainee   20   0  189472  15168  13384 S   0.0   0.  0:00.04 polkit-gnome-au                                                          
-   1113 root      20   0  209436   5036   3516 S   0.0   0.  0:00.09 rsyslogd                                                                                                                                                                +  22122 trainee   20   0  348880  13816  10064 S   0.0   0.  0:00.03 gvfs-udisks2-vo                                                          
-    823 root      20   0  124908   4644   4080 S   0.0   0.  0:00.03 irqbalance                                                                                                                                                              +  22084 colord    20   0  242896  13092   9484 S   0.0   0.  0:00.12 colord        
-   1803 root      20     65420   4508   3808 R   0.0   0.1   0:00.03 top        +
 ...                                                         ...                                                        
 </code> </code>
Ligne 1331: Ligne 3046:
  
 <code> <code>
-[root@centos8 ~]# top+root@debian11:~# top
 ... ...
-top - 09:13:01 up 11 min,  1 user,  load average: 0.00, 0.04, 0.06 +top - 09:26:38 up 26 days, 18:49,  2 users,  load average: 0.00, 0.00, 0.00 
-Tasks: 145 total,   running, 143 sleeping,   0 stopped,   0 zombie +Tasks: 142 total,   running, 141 sleeping,   0 stopped,   0 zombie 
-%Cpu(s):  0.us,  0.sy,  0.0 ni, 99.id,  0.0 wa,  0.hi,  0.0 si,  0.0 st +%Cpu(s):  0.us,  0.sy,  0.0 ni,100.id,  0.0 wa,  0.hi,  0.0 si,  0.0 st 
-MiB Mem :   3737.total,   3192.free,    233.used,    311.4 buff/cache +MiB Mem :   3931.total,   1711.free,    405.used,   1814.4 buff/cache 
-MiB Swap:   2000.0 total,   2000.0 free,      0.0 used.   3276.avail Mem +MiB Swap:    975.0 total,    975.0 free,      0.0 used.   3238.avail Mem 
  
-    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                                                 +    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                  
-    827 polkitd   20   0 1764748  25376  17348 S   0.1   0.7   0:00.13 polkitd                                                                                                                                                                 +  30295 root      20     10100   3512   3016 R   1.0   0.1   0:00.51 top                                                                           
-      1 root      20    245540  14260   9308 S   0.1   0.4   0:01.67 systemd                                                                                                                                                                 +
-    823 root      20    124908   4644   4080 S   0.  0.1   0:00.04 irqbalance                                                                                                                                                              +
-   1803 root      20     65420   4508   3808 R   0.2   0.1   0:00.08 top        +
 </code> </code>
  
Ligne 1351: Ligne 3063:
  
 <code> <code>
-[root@centos8 ~]# top --help+root@debian11:~# top --help
 top: inappropriate '-help' top: inappropriate '-help'
 Usage: Usage:
-  top -hv | -bcEHiOSs1 -d secs -n max -u|U user -p pid(s) -o field -w [cols]+  top -hv | -bcEeHiOSs1 -d secs -n max -u|U user -p pid(s) -o field -w [cols]
 </code> </code>
  
-====2.- La commande lsof====+====4.- La commande lsof====
  
 La commande **lsof** affiche des informations sur les fichiers ouverts par des processus : La commande **lsof** affiche des informations sur les fichiers ouverts par des processus :
  
 <code> <code>
-[trainee@centos8 tmp]$ su -+trainee@debian11:/tmp$ su -
 Password: fenestros Password: fenestros
-[root@centos8 ~]# lsof | more +root@debian11:~# lsof | more 
-COMMAND     PID   TID TASKCMD             USER   FD      TYPE             DEVICE +COMMAND     PID   TID TASKCMD               USER   FD      TYPE             DEVICE SIZE/OFF       NODE NAME 
- SIZE/OFF       NODE NAME +systemd                                   root  cwd       DIR                8,1     4096          2 
-systemd                                 root  cwd       DIR                8,+systemd                                   root  rtd       DIR                8,1     4096          2 
-      224        128 +systemd                                   root  txt       REG                8,1  1739200     135225 /usr/lib/systemd/systemd 
-systemd                                 root  rtd       DIR                8,+systemd                                   root  mem       REG                8,1   149576     131801 /usr/lib/x86_64-linux-gnu/libgpg-error.so 
-      224        128 +.0.29.0 
-systemd                                 root  txt       REG                8,3 +systemd       1                             root  mem       REG                8,1  3076992     130845 /usr/lib/x86_64-linux-gnu/libcrypto.so.1. 
-  1609248    8811152 /usr/lib/systemd/systemd +
-systemd                                 root  mem       REG                8,3 +systemd       1                             root  mem       REG                8,1    26984     131688 /usr/lib/x86_64-linux-gnu/libcap-ng.so.0. 
-  2191808     126296 /usr/lib64/libm-2.28.so +0.0 
-systemd                                 root  mem       REG                8,3 +systemd                                   root  mem       REG                8,1   617128     133011 /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 
-   628744     126019 /usr/lib64/libudev.so.1.6.11 +.10.1 
-systemd                                 root  mem       REG                8,+systemd                                   root  mem       REG                8,1   149520     131529 /usr/lib/x86_64-linux-gnu/libpthread-2.31 
-   969832     151279 /usr/lib64/libsepol.so.1 +.so 
-systemd                                 root  mem       REG                8,3 +systemd                                   root  mem       REG                8,1    18688     131516 /usr/lib/x86_64-linux-gnu/libdl-2.31.so 
-  1805368     179753 /usr/lib64/libunistring.so.2.1.0 +systemd                                   root  mem       REG                8,1   158400     132895 /usr/lib/x86_64-linux-gnu/liblzma.so.5.2. 
-systemd                                 root  mem       REG                8,3 +5 
-   303944     131440 /usr/lib64/libpcap.so.1.9.1 +systemd                                   root  mem       REG                8,  890800     134187 /usr/lib/x86_64-linux-gnu/libzstd.so.1.4. 
-systemd                                 root  mem       REG                8,3 +8 
-   145984     163438 /usr/lib64/libgpg-error.so.0.24.2 +systemd                                   root  mem       REG                8,1   137568     131838 /usr/lib/x86_64-linux-gnu/liblz4.so.1.9.
-systemd                                 root  mem       REG                8,+systemd                                   root  mem       REG                8,1    35280     134981 /usr/lib/x86_64-linux-gnu/libip4tc.so.2.
-    71528     194381 /usr/lib64/libjson-c.so.4.0.0 +.0 
-systemd                                 root  mem       REG                8,3+systemd                                   root  mem       REG                8,1  1176248     131813 /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 
 +.2.8 
 +systemd                                   root  mem       REG                8,1   202680     130829 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1 
 +.0 
 +systemd                                   root  mem       REG                8,1    38864     134959 /usr/lib/x86_64-linux-gnu/libcap.so.2.44 
 +systemd                                   root  mem       REG                8,1   326624     132627 /usr/lib/x86_64-linux-gnu/libblkid.so.1.
 +.0 
 +systemd                                   root  mem       REG                8,   38936     131226 /usr/lib/x86_64-linux-gnu/libacl.so.1.1.
 +253 
 +systemd                                   root  mem       REG                8,1  1839792     130842 /usr/lib/x86_64-linux-gnu/libc-2.31.so
 --More-- --More--
 +[q]
 </code> </code>
  
Ligne 1394: Ligne 3116:
  
 <code> <code>
-[root@centos8 ~]# lsof --help+root@debian11:~# lsof --help
 lsof: illegal option character: - lsof: illegal option character: -
 lsof: -e not followed by a file system path: "lp" lsof: -e not followed by a file system path: "lp"
Ligne 1403: Ligne 3125:
  usage: [-?abhKlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-E] [+|-e s] [+|-f[gG]]  usage: [-?abhKlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-E] [+|-e s] [+|-f[gG]]
  [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s]  [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s]
- [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [-Z [Z]] [--] [names]+ [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]
 Defaults in parentheses; comma-separated set (s) items; dash-separated ranges. Defaults in parentheses; comma-separated set (s) items; dash-separated ranges.
   -?|-h list help          -a AND selections (OR)     -b avoid kernel blocks   -?|-h list help          -a AND selections (OR)     -b avoid kernel blocks
Ligne 1435: Ligne 3157:
 </code> </code>
  
-=====LAB # - Mesurer l'utilisation du réseau et la disponibilité du système=====+=====LAB # - Mesurer l'utilisation du réseau et la disponibilité du système=====
  
-====3.1 - La Commande netstat====+====5.1 - La Commande netstat====
  
 Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** : Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** :
  
 <code> <code>
-[root@centos8 ~]# netstat -i+root@debian11:~# apt install net-tools 
 + 
 +root@debian11:~# netstat -i
 Kernel Interface table Kernel Interface table
-Iface             MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg +Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg 
-ens18            1500   476056           0 0        363562           0      0 BMRU +ens18     1500    52060           0 0         41193           0      0 BMRU 
-lo              65536    10936           0 0         10936           0      0 LRU +lo       65536     1197           0 0          1197           0      0 LRU
-virbr0           1500        0      0      0 0                  0      0      0 BMU+
 </code> </code>
  
Ligne 1453: Ligne 3176:
  
 <code> <code>
-[root@centos8 ~]# netstat --help+root@debian11:~# netstat --help
 usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help} usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}
        netstat [-vWnNcaeol] [<Socket> ...]        netstat [-vWnNcaeol] [<Socket> ...]
-       netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]+       netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }
  
         -r, --route              display routing table         -r, --route              display routing table
-        -I, --interfaces=<Iface> display interface table for <Iface> 
         -i, --interfaces         display interface table         -i, --interfaces         display interface table
         -g, --groups             display multicast group memberships         -g, --groups             display multicast group memberships
Ligne 1489: Ligne 3211:
     inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)      inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) 
     netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)      netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) 
-    x25 (CCITT X.25) +    x25 (CCITT X.25) 
-</code> +
- +
-====3.2 - Les Commandes uptime et w==== +
- +
-Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes : +
- +
-<code> +
-[root@centos8 ~]# uptime +
- 04:39:03 up 1 day,  2:34,  1 user,  load average: 0.00, 0.00, 0.00 +
-  +
-[root@centos8 ~]# w +
- 04:39:04 up 1 day,  2:34,  1 user,  load average: 0.00, 0.00, 0.00 +
-USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT +
-trainee  pts/0    10.0.2.1         03:58    0.00s  0.11s  0.02s sshd: trainee [priv] +
-</code> +
- +
-Les valeurs **load average** ou //charge moyenne// indiquent le nombre moyen de processus en cours de traitement ou en attente pour la période concernée. +
- +
-Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3,48  4,00  3,85** ceci indiquerait que le processeur a du mal à traiter les processus mettant en moyenne : +
- +
-  * 2,48 processus en attente dans la dernière minute, +
-  * 3,00 processus en attente dans les dernières 5 minutes, +
-  * 2,85 processus en attente dans les dernières 15 minutes. +
- +
-Les options de ces commandes sont : +
- +
-<code> +
-[root@centos8 ~]# uptime --help +
- +
-Usage: +
- uptime [options] +
- +
-Options: +
- -p, --pretty   show uptime in pretty format +
- -h, --help     display this help and exit +
- -s, --since    system up since +
- -V, --version  output version information and exit +
- +
-For more details see uptime(1). +
- +
-[root@centos8 ~]# w --help +
- +
-Usage: +
- w [options] +
- +
-Options: +
- -h, --no-header     do not print header +
- -u, --no-current    ignore current process username +
- -s, --short         short format +
- -f, --from          show remote hostname field +
- -o, --old-style     old style output +
- -i, --ip-addr       display IP address instead of hostname (if possible) +
- +
-     --help     display this help and exit +
- -V, --version  output version information and exit +
- +
-For more details see w(1).+
 </code> </code>
  
Menu