Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:centos:8:avance:l101 [2021/06/26 07:26] – admin | elearning:workbooks:centos:8:avance:l101 [2022/05/02 08:14] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | |||
~~PDF: | ~~PDF: | ||
- | Version : **2021.01** | + | Version : **2022.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF301 | + | ======LCF601 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
Ligne 12: | Ligne 11: | ||
* **LCF601 - Gestion des Paramètres et les Ressources du Matériel** | * **LCF601 - Gestion des Paramètres et les Ressources du Matériel** | ||
* Contenu du Module | * Contenu du Module | ||
- | * Fichiers Spéciaux | + | * Présentation des Fichiers Spéciaux |
- | * Commandes | + | * LAB #1 - Commandes |
- | * La Commande lspci | + | * 1.1 - La Commande lspci |
- | * La Commande lsusb | + | * 1.2 - La Commande lsusb |
- | * La Commande dmidecode | + | * 1.3 - La Commande dmidecode |
- | * Répertoire /proc | + | * LAB #2 - La Commande sysctl |
- | * Répertoires | + | * 2.1 - Répertoire |
- | * ide/scsi | + | * Fichiers |
- | | + | * Processeur |
- | * bus | + | * Interruptions système |
- | * net | + | * Canaux DMA |
- | * sys | + | * Plages d' |
- | * La Commande sysctl | + | * Périphériques |
- | | + | * Modules |
- | * Processeur | + | * Statistiques de l' |
- | * Interruptions système | + | * Partitions |
- | * Canaux DMA | + | * Espaces de pagination |
- | * Plages d' | + | * Statistiques d' |
- | * Périphériques | + | * Statistiques d' |
- | * Modules | + | * Version du noyau |
- | * Statistiques de l' | + | * Répertoires |
- | * Partitions | + | * ide/scsi |
- | * Espaces de pagination | + | * acpi |
- | * Statistiques d' | + | * bus |
- | * Statistiques d' | + | * net |
- | * Version du noyau | + | * sys |
- | * Interprétation des informations dans /proc | + | * 2.2 - Utilisation de la Commande sysctl |
- | * Commandes | + | * LAB #3 - Interprétation des informations dans /proc |
- | | + | * 3.1 - free |
- | * uptime ou w | + | * 3.2 - uptime ou w |
- | * iostat | + | * 3.3 - iostat |
- | * vmstat | + | * 3.4 - hdparm |
- | * mpstat | + | * 3.5 - vmstat |
- | * sar | + | * 3.6 - mpstat |
- | * Utilisation des commandes en production | + | * 3.7 - sar |
- | * Identifier un système limité par le processeur | + | |
- | * Identifier un système ayant un problème de mémoire | + | |
- | * Identifier un système ayant un problème d'E/S | + | |
* Modules usb | * Modules usb | ||
* udev | * udev | ||
* La Commande udevadm | * La Commande udevadm | ||
* Système de fichiers /sys | * Système de fichiers /sys | ||
- | * Limiter les Ressources | + | * LAB #4 - Limiter les Ressources |
- | * ulimit | + | * 4.1 - ulimit |
- | * Groupes de Contrôle | + | * 4.2 - Groupes de Contrôle |
- | * LAB #1 - Travailler avec les cgroups sous RHEL/CentOS 7 | + | * La Limitation de la Mémoire |
+ | * La Commande cgcreate | ||
+ | * La Commande cgdelete | ||
+ | * Le Fichier | ||
+ | * La Commande cgconfigparser | ||
- | =====Fichiers Spéciaux===== | + | =====Présentation des Fichiers Spéciaux===== |
Dans l' | Dans l' | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Les périphériques qui nécessitent à ce que l' | **Important** : Les périphériques qui nécessitent à ce que l' | ||
</ | </ | ||
Ligne 70: | Ligne 70: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
total 0 | total 0 | ||
- | crw-------. 1 root root 10, 235 Oct 28 09:40 autofs | + | crw-r--r--. 1 root root 10, 235 Jun 28 02:04 autofs |
- | drwxr-xr-x. 2 root root 140 Oct 28 09:40 block | + | drwxr-xr-x. |
- | drwxr-xr-x. 2 root root 80 Oct 28 09:40 bsg | + | drwxr-xr-x. |
- | crw-------. 1 root root 10, 234 Oct 28 09:40 btrfs-control | + | drwxr-xr-x. |
- | drwxr-xr-x. 3 root root 60 Oct 28 09:40 bus | + | lrwxrwxrwx. |
- | lrwxrwxrwx. 1 root root | + | drwxr-xr-x. |
- | drwxr-xr-x. 2 root root | + | drwxr-xr-x. |
- | crw-------. 1 root root 5, | + | crw-------. |
- | lrwxrwxrwx. 1 root root 11 Oct 28 09:40 core -> / | + | lrwxrwxrwx. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | crw-------. 1 root root | + | crw-------. |
- | crw-------. 1 root | + | drwxr-xr-x. 6 root root 120 Jun 28 02:04 disk |
- | drwxr-xr-x. 5 root | + | brw-rw----. 1 root disk 253, 0 Jun 28 02:04 dm-0 |
- | drwxr-xr-x. | + | brw-rw----. |
- | lrwxrwxrwx. 1 root root 13 Oct 28 09:40 fd -> / | + | drwxr-xr-x. |
- | crw-rw-rw-. 1 root root 1, | + | crw-rw----. 1 root video 29, 0 Jun 28 02:04 fb0 |
- | crw-rw-rw-. 1 root root 10, 229 Oct 28 09:41 fuse | + | lrwxrwxrwx. |
- | crw-------. 1 root root 10, 228 Oct 28 09:40 hpet | + | crw-rw-rw-. |
- | drwxr-xr-x. 3 root root | + | crw-rw-rw-. |
- | prw-------. 1 root root 0 Oct 28 09:40 initctl | + | crw-------. |
- | drwxr-xr-x. | + | crw-------. |
- | crw-r--r--. 1 root root 1, 11 Oct 28 09:40 kmsg | + | drwxr-xr-x. |
+ | crw-------. | ||
+ | lrwxrwxrwx. | ||
+ | drwxr-xr-x. | ||
+ | crw-r--r--. | ||
+ | lrwxrwxrwx. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | drwxr-xr-x. | ||
+ | crw-------. | ||
+ | crw-r-----. | ||
+ | drwxrwxrwt. | ||
+ | drwxr-xr-x. | ||
+ | crw-rw-rw-. | ||
--More-- | --More-- | ||
</ | </ | ||
Ligne 101: | Ligne 117: | ||
< | < | ||
... | ... | ||
- | brw-rw---- | + | brw-rw----. 1 root disk 8, |
... | ... | ||
- | crw-rw-rw- | + | crw-rw-rw-. 1 root tty |
... | ... | ||
</ | </ | ||
Ligne 114: | Ligne 130: | ||
* le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque. | * le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque. | ||
- | =====Commandes===== | + | =====LAB #1 - Commandes===== |
- | ====La Commande lspci==== | + | ====1.1 - La Commande lspci==== |
Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express : | Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) | 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) | ||
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/ | 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/ | ||
- | 00:01.1 IDE interface: Intel Corporation 82371AB/ | + | 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/ |
- | 00:02.0 VGA compatible controller: | + | 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/ |
- | 00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller | + | 00:01.3 Bridge: Intel Corporation 82371AB/ |
- | 00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service | + | 00:02.0 VGA compatible controller: |
- | 00:05.0 Multimedia audio controller: Intel Corporation | + | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon |
- | 00:06.0 USB controller: | + | 00:07.0 SATA controller: Intel Corporation |
- | 00:07.0 Bridge: Intel Corporation 82371AB/ | + | 00:12.0 Ethernet |
- | 00:0b.0 USB controller: Intel Corporation 82801FB/ | + | 00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge |
- | 00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ | + | 00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge |
</ | </ | ||
Ligne 138: | Ligne 154: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 00: | + | 00: |
- | Subsystem: | + | Subsystem: |
- | Flags: bus master, | + | |
- | Memory at f0000000 | + | |
- | I/O ports at d010 [size=8] | + | I/O ports at e000 [size=64] |
- | Capabilities: | + | Memory at fe400000 |
- | Capabilities: | + | |
- | Kernel driver in use: e1000 | + | Capabilities: |
+ | Capabilities: | ||
+ | | ||
+ | Capabilities: | ||
+ | | ||
</ | </ | ||
Ligne 152: | Ligne 172: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 00: | + | 00: |
- | Subsystem: | + | Subsystem: |
- | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- | + | Physical Slot: 3 |
- | Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium | + | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- |
- | Latency: | + | Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- |
- | Interrupt: pin A routed to IRQ 19 | + | Latency: |
- | Region 0: Memory at f0000000 | + | Interrupt: pin A routed to IRQ 10 |
- | Region 2: I/O ports at d010 [size=8] | + | Region 0: I/O ports at e000 [size=64] |
- | Capabilities: | + | Region 4: Memory at fe400000 |
- | Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-, | + | |
- | Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- | + | BAR=0 offset=00000000 |
- | Capabilities: | + | Capabilities: |
- | Command: DPERE- ERO+ RBC=512 OST=1 | + | BAR=4 offset=00003000 size=00001000 multiplier=00000004 |
- | Status: Dev=ff:1f.0 64bit- 133MHz- SCD- USC- DC=simple DMMRBC=2048 DMOST=1 DMCRS=8 RSCEM- 266MHz- 533MHz- | + | |
- | Kernel driver in use: e1000 | + | BAR=4 offset=00002000 size=00001000 |
+ | Capabilities: | ||
+ | BAR=4 offset=00001000 size=00001000 | ||
+ | | ||
+ | BAR=4 offset=00000000 size=00001000 | ||
+ | Kernel driver in use: virtio-pci | ||
</ | </ | ||
Ligne 175: | Ligne 200: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
lspci: invalid option -- ' | lspci: invalid option -- ' | ||
Usage: lspci [< | Usage: lspci [< | ||
Basic display modes: | Basic display modes: | ||
- | -mm Produce machine-readable output (single -m for an obsolete format) | + | -mm |
- | -t Show bus tree | + | -t Show bus tree |
Display options: | Display options: | ||
- | -v Be verbose (-vv for very verbose) | + | -v Be verbose (-vv or -vvv for higher verbosity) |
- | -k Show kernel drivers handling each device | + | -k Show kernel drivers handling each device |
- | -x Show hex-dump of the standard part of the config space | + | -x Show hex-dump of the standard part of the config space |
- | -xxx Show hex-dump of the whole config space (dangerous; root only) | + | -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) | + | -xxxx |
- | -b Bus-centric view (addresses and IRQ's as seen by the bus) | + | -b Bus-centric view (addresses and IRQ's as seen by the bus) |
- | -D Always show domain numbers | + | -D Always show domain numbers |
+ | -P Display bridge path in addition to bus and device number | ||
+ | -PP | ||
Resolving of device ID's to names: | Resolving of device ID's to names: | ||
- | -n Show numeric ID's | + | -n Show numeric ID's |
- | -nn Show both textual and numeric ID's (names & numbers) | + | -nn |
- | -q Query the PCI ID database for unknown ID's via DNS | + | -q Query the PCI ID database for unknown ID's via DNS |
- | -qq As above, but re-query locally cached entries | + | -qq |
- | -Q Query the PCI ID database for all ID's via DNS | + | -Q Query the PCI ID database for all ID's via DNS |
Selection of devices: | Selection of devices: | ||
- | -s [[[[< | + | -s [[[[< |
- | -d [< | + | -d [< |
Other options: | Other options: | ||
- | -i < | + | -i < |
- | -p < | + | -p < |
- | -M Enable `bus mapping' | + | -M Enable `bus |
- | + | ||
- | PCI access options: | + | |
- | -A < | + | |
- | -O < | + | |
- | -G Enable PCI access debugging | + | |
- | -H < | + | |
- | -F < | + | |
</ | </ | ||
- | ====La Commande lsusb==== | + | ====1.2 - La Commande lsusb==== |
Cette commande vous renseigne sur les adaptateurs reliés au bus usb : | Cette commande vous renseigne sur les adaptateurs reliés au bus usb : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Bus 001 Device | + | Bus 001 Device |
- | Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | + | Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub |
- | [root@centos7 | + | [root@centos8 |
- | /: Bus 02.Port 1: Dev 1, Class=root_hub, | + | /: Bus 01.Port 1: Dev 1, Class=root_hub, |
- | /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/8p, 480M | + | |
</ | </ | ||
Ligne 235: | Ligne 255: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Usage: lsusb [options]... | Usage: lsusb [options]... | ||
List USB devices | List USB devices | ||
Ligne 246: | Ligne 266: | ||
Show only devices with the specified vendor and | Show only devices with the specified vendor and | ||
product ID numbers (in hexadecimal) | product ID numbers (in hexadecimal) | ||
+ | .LAB#1 | ||
-D device | -D device | ||
Selects which device lsusb will examine | Selects which device lsusb will examine | ||
Ligne 256: | Ligne 277: | ||
</ | </ | ||
- | ====La Commande dmidecode==== | + | ====1.3 - La Commande dmidecode==== |
La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface// | La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface// | ||
Ligne 264: | Ligne 285: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | # dmidecode 2.12 | + | # dmidecode |
- | SMBIOS 2.5 present. | + | Getting SMBIOS data from sysfs. |
- | 10 structures occupying | + | SMBIOS 2.8 present. |
- | Table at 0x000E1000. | + | 11 structures occupying |
+ | Table at 0x000F5870. | ||
- | Handle 0x0000, DMI type 0, 20 bytes | + | Handle 0x0000, DMI type 0, 24 bytes |
BIOS Information | BIOS Information | ||
- | Vendor: | + | |
- | Version: | + | Version: |
- | Release Date: 12/01/2006 | + | Release Date: 04/01/2014 |
- | Address: | + | Address: |
- | Runtime Size: 128 kB | + | Runtime Size: 96 kB |
- | ROM Size: 128 kB | + | ROM Size: 64 kB |
- | Characteristics: | + | Characteristics: |
- | ISA is supported | + | BIOS characteristics not supported |
- | PCI is supported | + | |
- | Boot from CD is supported | + | BIOS Revision: 0.0 |
- | Selectable boot is supported | + | |
- | 8042 keyboard services are supported (int 9h) | + | |
- | CGA/mono video services are supported (int 10h) | + | |
- | ACPI is supported | + | |
- | Handle | + | Handle |
System Information | System Information | ||
- | Manufacturer: | + | |
- | Product Name: VirtualBox | + | Product Name: Standard PC (i440FX + PIIX, 1996) |
- | Version: | + | Version: |
- | Serial Number: | + | Serial Number: |
- | UUID: | + | UUID: 95bd69e3-4a74-44a7-b58c-b74fbfb86df2 |
- | Wake-up Type: Power Switch | + | Wake-up Type: Power Switch |
- | SKU Number: Not Specified | + | SKU Number: Not Specified |
- | Family: | + | Family: |
- | Handle | + | Handle |
- | Base Board Information | + | |
- | Manufacturer: | + | |
- | Product Name: VirtualBox | + | |
- | Version: 1.2 | + | |
- | Serial Number: 0 | + | |
- | Asset Tag: Not Specified | + | |
- | Features: | + | |
- | Board is a hosting board | + | |
- | Location In Chassis: Not Specified | + | |
- | Chassis Handle: 0x0003 | + | |
- | Type: Motherboard | + | |
- | Contained Object Handles: 0 | + | |
- | + | ||
- | Handle 0x0003, DMI type 3, 13 bytes | + | |
Chassis Information | Chassis Information | ||
- | Manufacturer: | + | |
- | Type: Other | + | Type: Other |
- | Lock: Not Present | + | Lock: Not Present |
- | Version: | + | Version: |
- | Serial Number: Not Specified | + | Serial Number: Not Specified |
- | Asset Tag: Not Specified | + | Asset Tag: Not Specified |
- | Boot-up State: Safe | + | Boot-up State: Safe |
- | Power Supply State: Safe | + | Power Supply State: Safe |
- | Thermal State: Safe | + | Thermal State: Safe |
- | Security Status: | + | Security Status: |
+ | OEM Information: | ||
+ | Height: Unspecified | ||
+ | Number Of Power Cords: Unspecified | ||
+ | Contained Elements: 0 | ||
+ | SKU Number: Not Specified | ||
- | Handle | + | Handle |
- | Inactive | + | Processor Information |
+ | Socket Designation: | ||
+ | Type: Central Processor | ||
+ | Family: Other | ||
+ | Manufacturer: | ||
+ | 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: 4 | ||
+ | Core Enabled: 4 | ||
+ | Thread Count: 1 | ||
+ | Characteristics: | ||
- | Handle | + | Handle |
- | Inactive | + | Processor Information |
+ | Socket Designation: | ||
+ | Type: Central Processor | ||
+ | Family: Other | ||
+ | Manufacturer: | ||
+ | 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: 4 | ||
+ | Core Enabled: 4 | ||
+ | Thread Count: 1 | ||
+ | Characteristics: | ||
- | Handle | + | Handle |
- | Inactive | + | 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 | + | Handle |
- | OEM Strings | + | Memory Device |
- | String 1: vboxVer_4.3.28 | + | Array Handle: 0x1000 |
- | String 2: vboxRev_100309 | + | 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: | ||
+ | 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 | + | Handle |
- | OEM-specific Type | + | Memory Array Mapped Address |
- | Header and Data: | + | |
- | 80 08 08 00 01 15 21 00 | + | |
+ | Range Size: 3 GB | ||
+ | Physical Array Handle: 0x1000 | ||
+ | Partition Width: 1 | ||
- | Handle | + | Handle |
- | End Of Table | + | 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 | ||
</ | </ | ||
Ligne 368: | Ligne 460: | ||
</ | </ | ||
- | =====Répertoire /proc===== | + | =====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. | 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. | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 1 | + | 1 |
- | 10 22619 2605 2879 3091 478 | + | 10 16476 1931 2215 2428 2659 432 |
- | 11 22650 2606 2883 3104 482 | + | 1007 |
- | 12 | + | 11 16576 1960 2226 2432 2686 434 |
- | 1215 | + | 11805 16593 2 |
- | 1217 | + | 12 |
- | 1227 | + | 1219 |
- | 1228 | + | 1228 |
- | 1230 | + | 1232 |
- | 1264 | + | 1234 |
- | 13 235 27 2926 363 | + | 1235 |
- | 1372 | + | 1247 |
- | 14 | + | 13 16712 2062 2267 2472 35 4790 69 875 |
- | 15 | + | 1307 |
- | 16 | + | 1339 |
- | 17 | + | 1356 |
- | 1732 | + | 14 |
- | 1744 | + | 1441 |
- | 17788 2486 | + | 1443 |
- | 18 | + | 1444 |
- | 19 | + | 1446 |
- | 2 259 28 2998 434 | + | 14977 1828 |
- | 20 | + | 15 |
- | 20638 2597 | + | 15067 183 2167 2330 2571 422 |
- | 21 26 2818 3084 458 | + | 1536 |
+ | 1553 | ||
+ | 15594 186 2187 2358 259 | ||
+ | 15735 187 2190 2373 2593 427 | ||
+ | 16 | ||
+ | 16165 1883 | ||
+ | 16167 1888 | ||
</ | </ | ||
- | ====Répertoires==== | + | ===Fichiers=== |
- | ===ide/scsi=== | + | ==Processeur== |
- | + | ||
- | 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' | + | |
- | + | ||
- | ===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 > / | + | |
- | + | ||
- | Cette commande a pour résultat d' | + | |
- | + | ||
- | ===La commande sysctl=== | + | |
- | + | ||
- | Les fichiers dans le répertoire **/ | + | |
- | + | ||
- | La commande **sysctl** applique les règles consignés dans le fichier **/ | + | |
- | + | ||
- | Saisissez la commande : | + | |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | # System default settings live in / | + | processor |
- | # To override those settings, enter new settings here, or in an / | + | vendor_id |
- | # | + | cpu family |
- | # For more information, | + | model : 6 |
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 0 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | [root@centos7 ~]# cat / | + | processor |
- | # Kernel sysctl configuration file | + | vendor_id |
- | # | + | cpu family |
- | # For binary values, 0 is disabled, | + | model : 6 |
- | # sysctl.conf(5) for more details. | + | model name : Common KVM processor |
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 1 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | # Disable netfilter on bridges. | + | processor |
- | net.bridge.bridge-nf-call-ip6tables = 0 | + | vendor_id |
- | net.bridge.bridge-nf-call-iptables = 0 | + | cpu family |
- | net.bridge.bridge-nf-call-arptables = 0 | + | model : 6 |
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : | ||
+ | siblings | ||
+ | core id : 2 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | # Controls the maximum shared segment | + | processor |
- | kernel.shmmax = 4294967295 | + | vendor_id |
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 3 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | # Controls the maximum number of shared memory segments, in pages | + | processor |
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 1 | ||
+ | siblings | ||
+ | core id : 0 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | [root@centos7 ~]# ls -l / | + | processor |
- | total 0 | + | vendor_id |
- | lrwxrwxrwx. 1 root root 14 Jun | + | cpu family |
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : | ||
+ | siblings | ||
+ | core id : 1 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | [root@centos7 ~]# cat / | + | processor |
- | # System default settings live in / | + | vendor_id |
- | # To override those settings, enter new settings here, or in an / | + | cpu family |
- | # | + | model : 6 |
- | # For more information, | + | model name : Common KVM processor |
- | </ | + | stepping |
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 1 | ||
+ | siblings | ||
+ | core id : 2 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | ==Options de la commande== | + | processor |
- | + | vendor_id | |
- | Les options de la commande **sysctl** sont : | + | cpu family |
- | + | model | |
- | < | + | model name : Common KVM processor |
- | [root@centos7 ~]# sysctl --help | + | stepping |
- | + | microcode | |
- | Usage: | + | cpu MHz |
- | | + | cache size : 16384 KB |
- | + | physical id | |
- | Options: | + | siblings |
- | -a, --all display all variables | + | core id |
- | -A alias of -a | + | cpu cores |
- | -X alias of -a | + | apicid |
- | --deprecated | + | initial apicid |
- | -b, --binary | + | fpu |
- | -e, --ignore | + | fpu_exception |
- | -N, --names | + | cpuid level |
- | -n, --values | + | wp : yes |
- | -p, --load[=< | + | flags |
- | -f alias of -p | + | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit |
- | --system | + | bogomips |
- | -r, --pattern < | + | clflush size : 64 |
- | | + | cache_alignment : 128 |
- | -q, --quiet | + | address sizes |
- | -w, --write | + | |
- | -o does nothing | + | |
- | -x does nothing | + | |
- | -d alias of -h | + | |
- | + | ||
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see sysctl(8). | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important> | + | |
- | **Important** : Consultez la page de la traduction du manuel de **sysctl** **[[http:// | + | |
- | </ | + | |
- | + | ||
- | ====Fichiers==== | + | |
- | + | ||
- | ===Processeur=== | + | |
- | + | ||
- | < | + | |
- | [root@centos7 ~]# cat / | + | |
- | processor : | + | |
- | vendor_id : GenuineIntel | + | |
- | cpu family : | + | |
- | model : 55 | + | |
- | model name : | + | |
- | stepping : | + | |
- | microcode : | + | |
- | cpu MHz : 2167.721 | + | |
- | cache size : | + | |
- | physical id : 0 | + | |
- | siblings : | + | |
- | core id : 0 | + | |
- | cpu cores : | + | |
- | apicid : 0 | + | |
- | initial apicid : | + | |
- | fpu : yes | + | |
- | fpu_exception : | + | |
- | cpuid level : | + | |
- | 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 syscall nx rdtscp | + | |
- | bogomips : | + | |
- | clflush size : 64 | + | |
- | cache_alignment : | + | |
- | address sizes : | + | |
power management: | power management: | ||
</ | </ | ||
- | ===Interruptions système=== | + | ==Interruptions système== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | | + | |
- | 0: | + | 0: |
- | 1: 5890 IO-APIC-edge | + | 1: |
- | 8: 0 | + | 8: |
- | 9: | + | 9: |
- | 12: | + | 10: |
- | | + | |
- | | + | |
- | 19: | + | |
- | 20: 119352 | + | |
- | 21: | + | 24: |
- | 22: 0 IO-APIC-fasteoi | + | 25: |
- | NMI: 0 | + | 26: 36 0 0 |
- | LOC: | + | 27: |
- | SPU: 0 | + | NMI: |
- | PMI: 0 | + | LOC: 870537 |
- | IWI: | + | SPU: |
- | RTR: 0 APIC ICR read retries | + | PMI: |
- | RES: | + | IWI: |
- | CAL: | + | RTR: |
- | TLB: | + | RES: 178171 |
- | TRM: 0 | + | CAL: |
- | THR: 0 | + | TLB: 2295 |
- | MCE: 0 | + | TRM: |
- | MCP: 48 Machine check polls | + | THR: |
+ | DFR: 0 0 0 0 0 0 0 0 | ||
+ | MCE: | ||
+ | MCP: | ||
+ | HYP: 0 0 0 0 0 0 0 0 | ||
+ | HRE: 0 0 0 0 0 0 0 0 | ||
+ | HVS: 0 0 0 0 0 0 0 0 | ||
ERR: 0 | ERR: 0 | ||
MIS: 0 | MIS: 0 | ||
+ | PIN: 0 0 0 0 0 0 0 0 | ||
+ | NPI: 0 0 0 0 0 0 0 0 | ||
+ | PIW: 0 0 0 0 0 0 0 0 | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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' | **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' | ||
</ | </ | ||
- | ===Canaux DMA=== | + | ==Canaux DMA== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
4: cascade | 4: cascade | ||
</ | </ | ||
- | ===Plages d' | + | ==Plages d' |
< | < | ||
- | [root@centos7 | + | root@centos8 |
- | 0000-001f : dma1 | + | 0000-0cf7 : PCI Bus 0000:00 |
- | 0020-0021 : pic1 | + | |
- | 0040-0043 : timer0 | + | 0020-0021 : pic1 |
- | 0050-0053 : timer1 | + | 0040-0043 : timer0 |
- | 0060-0060 : keyboard | + | 0050-0053 : timer1 |
- | 0064-0064 : keyboard | + | 0060-0060 : keyboard |
- | 0070-0071 : rtc_cmos | + | 0064-0064 : keyboard |
- | 0070-0071 : rtc0 | + | 0070-0077 : rtc0 |
- | 0080-008f : dma page reg | + | 0080-008f : dma page reg |
- | 00a0-00a1 : pic2 | + | 00a0-00a1 : pic2 |
- | 00c0-00df : dma2 | + | 00c0-00df : dma2 |
- | 00f0-00ff : fpu | + | 00f0-00ff : fpu |
- | 0170-0177 : 0000: | + | 0170-0177 : 0000: |
- | 0170-0177 : ata_piix | + | 0170-0177 : ata_piix |
- | 01f0-01f7 : 0000: | + | 01f0-01f7 : 0000: |
- | 01f0-01f7 : ata_piix | + | 01f0-01f7 : ata_piix |
- | 0376-0376 : 0000: | + | 0376-0376 : 0000: |
- | 0376-0376 : ata_piix | + | 0376-0376 : ata_piix |
- | 03c0-03df : vga+ | + | 03c0-03df : vga+ |
- | 03f6-03f6 : 0000: | + | 03f6-03f6 : 0000: |
- | 03f6-03f6 : ata_piix | + | 03f6-03f6 : ata_piix |
- | 0cf8-0cff : PCI conf1 | + | |
- | 4000-4003 : ACPI PM1a_EVT_BLK | + | |
--More-- | --More-- | ||
</ | </ | ||
<WRAP center round alert 60%> | <WRAP center round alert 60%> | ||
- | Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. | + | **Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. |
</ | </ | ||
- | ===Périphériques=== | + | ==Périphériques== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Character devices: | Character devices: | ||
1 mem | 1 mem | ||
Ligne 632: | Ligne 821: | ||
5 / | 5 / | ||
5 /dev/ptmx | 5 /dev/ptmx | ||
- | 6 lp | ||
7 vcs | 7 vcs | ||
10 misc | 10 misc | ||
13 input | 13 input | ||
- | 14 sound | + | 21 sg |
29 fb | 29 fb | ||
- | 99 ppdev | ||
- | 116 alsa | ||
128 ptm | 128 ptm | ||
136 pts | 136 pts | ||
Ligne 649: | Ligne 835: | ||
203 cpu/cpuid | 203 cpu/cpuid | ||
226 drm | 226 drm | ||
- | 250 hidraw | + | 244 aux |
- | 251 usbmon | + | 245 hidraw |
- | 252 bsg | + | 246 usbmon |
- | 253 watchdog | + | 247 bsg |
- | 254 rtc | + | 248 watchdog |
+ | 249 ptp | ||
+ | 250 pps | ||
+ | 251 rtc | ||
+ | 252 dax | ||
+ | 253 tpm | ||
+ | 254 gpiochip | ||
Block devices: | Block devices: | ||
- | 259 blkext | ||
8 sd | 8 sd | ||
9 md | 9 md | ||
Ligne 677: | Ligne 868: | ||
253 device-mapper | 253 device-mapper | ||
254 mdp | 254 mdp | ||
+ | 259 blkext | ||
</ | </ | ||
- | ===Modules=== | + | ==Modules== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | tcp_lp 12663 0 - Live 0xffffffffa059d000 | + | xt_CHECKSUM 16384 1 - Live 0xffffffffc09a8000 |
- | lp 17759 0 - Live 0xffffffffa0593000 | + | ipt_MASQUERADE 16384 3 - Live 0xffffffffc09a3000 |
- | nls_utf8 12557 1 - Live 0xffffffffa0527000 | + | xt_conntrack 16384 1 - Live 0xffffffffc099e000 |
- | isofs 39844 1 - Live 0xffffffffa0588000 | + | ipt_REJECT 16384 2 - Live 0xffffffffc0999000 |
- | bnep 19704 2 - Live 0xffffffffa0516000 | + | nft_compat 20480 16 - Live 0xffffffffc0993000 |
- | bluetooth 372662 7 bnep, Live 0xffffffffa052c000 | + | nf_nat_tftp 16384 0 - Live 0xffffffffc098b000 |
- | rfkill 26536 3 bluetooth, Live 0xffffffffa051f000 | + | nft_objref 16384 1 - Live 0xffffffffc0986000 |
- | fuse 87741 3 - Live 0xffffffffa04ff000 | + | nf_conntrack_tftp 16384 3 nf_nat_tftp, |
- | ip6t_rpfilter 12546 1 - Live 0xffffffffa04fa000 | + | nft_counter 16384 33 - Live 0xffffffffc097c000 |
- | ip6t_REJECT 12939 2 - Live 0xffffffffa04f5000 | + | tun 53248 1 - Live 0xffffffffc096e000 |
- | ipt_REJECT 12541 2 - Live 0xffffffffa04f0000 | + | bridge 192512 |
- | xt_conntrack 12760 7 - Live 0xffffffffa04e6000 | + | stp 16384 1 bridge, Live 0xffffffffc0939000 |
- | ebtable_nat 12807 0 - Live 0xffffffffa04e1000 | + | llc 16384 2 bridge,stp, Live 0xffffffffc0930000 |
- | ebtable_broute 12731 0 - Live 0xffffffffa04eb000 | + | nft_fib_inet 16384 1 - Live 0xffffffffc08f5000 |
- | bridge 115385 1 ebtable_broute, | + | nft_fib_ipv4 16384 1 nft_fib_inet, |
- | stp 12976 1 bridge, Live 0xffffffffa04be000 | + | nft_fib_ipv6 16384 1 nft_fib_inet, |
- | llc 14552 2 bridge,stp, Live 0xffffffffa04b5000 | + | nft_fib 16384 3 nft_fib_inet,nft_fib_ipv4,nft_fib_ipv6, Live 0xffffffffc08e3000 |
- | ebtable_filter 12827 0 - Live 0xffffffffa04b0000 | + | nft_reject_inet 16384 5 - Live 0xffffffffc08de000 |
- | ebtables 30913 3 ebtable_nat,ebtable_broute,ebtable_filter, Live 0xffffffffa04a3 | + | nf_reject_ipv4 16384 2 ipt_REJECT, |
- | 000 | + | nf_reject_ipv6 16384 1 nft_reject_inet, |
- | ip6table_nat 12864 1 - Live 0xffffffffa049e000 | + | nft_reject 16384 1 nft_reject_inet, Live 0xffffffffc08cf000 |
- | nf_conntrack_ipv6 18738 5 - Live 0xffffffffa0498000 | + | |
- | nf_defrag_ipv6 34651 1 nf_conntrack_ipv6, Live 0xffffffffa048a000 | + | |
--More-- | --More-- | ||
</ | </ | ||
- | ===Statistiques de l' | + | ==Statistiques de l' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | | + | 8 0 sda 15481 112 1445637 154103 10272 2377 277530 890611 |
- | | + | |
- | | + | |
- | | + | |
- | 8 | + | 11 |
+ | 253 0 dm-0 11651 0 1364532 72138 12121 0 288727 1208138 0 227630 1280276 0 0 0 0 | ||
+ | | ||
</ | </ | ||
- | ===Partitions=== | + | ==Partitions== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
major minor # | major minor # | ||
- | 11 0 56876 sr0 | + | 8 0 33554432 |
- | 8 0 20971520 | + | |
- | | + | |
- | | + | |
- | | + | 11 0 1048575 sr0 |
+ | | ||
+ | | ||
</ | </ | ||
- | ===Espaces de pagination=== | + | ==Espaces de pagination== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Filename Type Size Used Priority | + | Filename |
- | /dev/sda3 partition 3071996 0 -1 | + | /dev/dm-1 partition |
</ | </ | ||
- | ===Statistiques d' | + | ==Statistiques d' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 1.82 1.07 0.81 3/379 25349 | + | 0.00 0.00 0.00 1/697 16936 |
</ | </ | ||
- | ===Statistiques d' | + | ==Statistiques d' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | MemTotal: | + | MemTotal: |
- | MemFree: | + | MemFree: |
- | MemAvailable: | + | MemAvailable: |
- | Buffers: | + | Buffers: |
- | Cached: | + | Cached: |
SwapCached: | SwapCached: | ||
- | Active: | + | Active: |
- | Inactive: | + | Inactive: |
- | Active(anon): | + | Active(anon): |
- | Inactive(anon): | + | Inactive(anon): |
- | Active(file): | + | Active(file): |
- | Inactive(file): | + | Inactive(file): |
Unevictable: | Unevictable: | ||
Mlocked: | Mlocked: | ||
- | SwapTotal: | + | SwapTotal: |
- | SwapFree: | + | SwapFree: |
- | Dirty: | + | Dirty: |
Writeback: | Writeback: | ||
- | AnonPages: | + | AnonPages: |
- | Mapped: | + | Mapped: |
- | Shmem: | + | Shmem: |
- | Slab: | + | KReclaimable: |
- | SReclaimable: | + | Slab: 118396 |
- | SUnreclaim: | + | SReclaimable: |
- | KernelStack: | + | SUnreclaim: |
- | PageTables: | + | KernelStack: |
+ | PageTables: | ||
NFS_Unstable: | NFS_Unstable: | ||
Bounce: | Bounce: | ||
WritebackTmp: | WritebackTmp: | ||
- | CommitLimit: | + | CommitLimit: |
- | Committed_AS: | + | Committed_AS: |
VmallocTotal: | VmallocTotal: | ||
- | VmallocUsed: | + | VmallocUsed: |
- | VmallocChunk: | + | VmallocChunk: |
+ | Percpu: | ||
HardwareCorrupted: | HardwareCorrupted: | ||
- | AnonHugePages: | + | AnonHugePages: |
+ | ShmemHugePages: | ||
+ | ShmemPmdMapped: | ||
+ | FileHugePages: | ||
+ | FilePmdMapped: | ||
HugePages_Total: | HugePages_Total: | ||
HugePages_Free: | HugePages_Free: | ||
Ligne 793: | Ligne 993: | ||
HugePages_Surp: | HugePages_Surp: | ||
Hugepagesize: | Hugepagesize: | ||
- | DirectMap4k: | + | Hugetlb: |
- | DirectMap2M: | + | DirectMap4k: |
+ | DirectMap2M: | ||
</ | </ | ||
- | ===Version du noyau=== | + | ==Version du noyau== |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux version | + | Linux version |
</ | </ | ||
- | ==== Interprétation des informations dans /proc==== | + | ===Répertoires=== |
+ | |||
+ | ==ide/ | ||
+ | |||
+ | 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' | ||
+ | |||
+ | ==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 > / | ||
+ | |||
+ | Cette commande a pour résultat d' | ||
+ | |||
+ | ====2.2 - Utilisation de la Commande sysctl==== | ||
+ | |||
+ | Les fichiers dans le répertoire **/ | ||
+ | |||
+ | La commande **sysctl** applique les règles consignés dans le fichier **/ | ||
+ | |||
+ | Saisissez la commande : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cat / | ||
+ | # sysctl settings are defined through files in | ||
+ | # / | ||
+ | # | ||
+ | # Vendors settings live in / | ||
+ | # To override a whole file, create a new file with the same in | ||
+ | # / | ||
+ | # only specific settings, add a file with a lexically later | ||
+ | # name in / | ||
+ | # | ||
+ | # For more information, | ||
+ | |||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | lrwxrwxrwx. 1 root root 14 Mar 16 15:42 99-sysctl.conf -> ../ | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 24 | ||
+ | -rw-r--r--. 1 root root 1810 Dec 22 2020 10-default-yama-scope.conf | ||
+ | -rw-r--r--. 1 root root 524 Mar 16 15:42 50-coredump.conf | ||
+ | -rw-r--r--. 1 root root 1270 Mar 16 15:42 50-default.conf | ||
+ | -rw-r--r--. 1 root root 246 Jun 15 2020 50-libkcapi-optmem_max.conf | ||
+ | -rw-r--r--. 1 root root 636 Mar 16 15:42 50-pid-max.conf | ||
+ | -rw-r--r--. 1 root root 499 Nov 26 2019 60-libvirtd.conf | ||
+ | |||
+ | [root@centos8 ~]# cat / | ||
+ | # This file is part of systemd. | ||
+ | # | ||
+ | # systemd is free software; you can redistribute it and/or modify it | ||
+ | # under the terms of the GNU Lesser General Public License as published by | ||
+ | # the Free Software Foundation; either version 2.1 of the License, or | ||
+ | # (at your option) any later version. | ||
+ | |||
+ | # See sysctl.d(5) and core(5) for documentation. | ||
+ | |||
+ | # To override settings in this file, create a local file in /etc | ||
+ | # (e.g. / | ||
+ | # there. | ||
+ | |||
+ | # System Request functionality of the kernel (SYNC) | ||
+ | # | ||
+ | # Use kernel.sysrq = 1 to allow all keys. | ||
+ | # See https:// | ||
+ | # of values and keys. | ||
+ | kernel.sysrq = 16 | ||
+ | |||
+ | # Append the PID to the core filename | ||
+ | kernel.core_uses_pid = 1 | ||
+ | |||
+ | # https:// | ||
+ | kernel.kptr_restrict = 1 | ||
+ | |||
+ | # Source route verification | ||
+ | net.ipv4.conf.all.rp_filter = 1 | ||
+ | |||
+ | # Do not accept source routing | ||
+ | net.ipv4.conf.all.accept_source_route = 0 | ||
+ | |||
+ | # Promote secondary addresses when the primary address is removed | ||
+ | net.ipv4.conf.all.promote_secondaries = 1 | ||
+ | |||
+ | # Fair Queue CoDel packet scheduler to fight bufferbloat | ||
+ | net.core.default_qdisc = fq_codel | ||
+ | |||
+ | # Enable hard and soft link protection | ||
+ | fs.protected_hardlinks = 1 | ||
+ | fs.protected_symlinks = 1 | ||
+ | </ | ||
+ | |||
+ | Les options de la commande **sysctl** sont : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# sysctl --help | ||
+ | |||
+ | Usage: | ||
+ | | ||
+ | |||
+ | Options: | ||
+ | -a, --all display all variables | ||
+ | -A alias of -a | ||
+ | -X alias of -a | ||
+ | --deprecated | ||
+ | -b, --binary | ||
+ | -e, --ignore | ||
+ | -N, --names | ||
+ | -n, --values | ||
+ | -p, --load[=< | ||
+ | -f alias of -p | ||
+ | --system | ||
+ | -r, --pattern < | ||
+ | | ||
+ | -q, --quiet | ||
+ | -w, --write | ||
+ | -o does nothing | ||
+ | -x does nothing | ||
+ | -d alias of -h | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | For more details see sysctl(8). | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : Consultez la page de la traduction du manuel de **sysctl** **[[http:// | ||
+ | </ | ||
+ | |||
+ | =====LAB#3 - Interprétation des informations dans /proc===== | ||
Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | ||
Ligne 811: | Ligne 1153: | ||
* uptime et w, | * uptime et w, | ||
* iostat, | * iostat, | ||
+ | * hdparm, | ||
* vmstat, | * vmstat, | ||
* mpstat, | * mpstat, | ||
- | * sar. | + | * sar. |
- | ===Commandes=== | + | ====3.1 - La Commande free==== |
- | + | ||
- | ==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 : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
total used free shared | total used free shared | ||
- | Mem: 1749 | + | Mem: 3735 1135 1818 14 |
- | Swap: | + | Swap: |
</ | </ | ||
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 : | ||
- | * 1749 Mo de mémoire physique totale, | + | * 3735 Mo de mémoire physique totale, |
- | * 859 Mo de mémoire physique utilisée et 76 Mo de mémoire physique libre, | + | * 1135 Mo de mémoire physique utilisée et 1818 Mo de mémoire physique libre, |
- | * 2999 Mo de mémoire swap totale et 3 Mo de swap utilisé | + | * 3279 Mo de mémoire swap totale et 0 Mo de swap utilisé |
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Usage: | Usage: | ||
Ligne 844: | Ligne 1185: | ||
Options: | Options: | ||
-b, --bytes | -b, --bytes | ||
- | | + | --kilo |
- | -m, --mega | + | |
- | -g, --giga | + | |
| | ||
+ | | ||
+ | -k, --kibi | ||
+ | -m, --mebi | ||
+ | -g, --gibi | ||
+ | | ||
+ | | ||
-h, --human | -h, --human | ||
| | ||
Ligne 862: | Ligne 1209: | ||
</ | </ | ||
- | ==uptime | + | ====3.2 - Les Commandes |
Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes : | Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 14:43:46 up | + | 04:39:03 up 1 day, 2:34, |
- | + | ||
- | [root@centos7 | + | [root@centos8 |
- | 14:43:49 up | + | 04:39:04 up 1 day, 2:34, |
USER | USER | ||
- | trainee | + | trainee |
- | trainee | + | |
</ | </ | ||
Ligne 888: | Ligne 1234: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Usage: | Usage: | ||
Ligne 901: | Ligne 1247: | ||
For more details see uptime(1). | For more details see uptime(1). | ||
- | [root@centos7 | + | [root@centos8 |
Usage: | Usage: | ||
Ligne 920: | Ligne 1266: | ||
</ | </ | ||
- | ==iostat== | + | ====3.3 - La Commande |
La commande **iostat** affiche des statistiques sur l' | La commande **iostat** affiche des statistiques sur l' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | bash: iostat: command not found... |
+ | Install package ' | ||
+ | |||
+ | |||
+ | * Waiting in queue... | ||
+ | The following packages have to be installed: | ||
+ | | ||
+ | | ||
+ | Proceed with changes? [N/y] y | ||
+ | |||
+ | |||
+ | * Waiting in queue... | ||
+ | * Waiting for authentication... | ||
+ | * Waiting in queue... | ||
+ | * Downloading packages... | ||
+ | * Requesting data... | ||
+ | * Testing changes... | ||
+ | * Installing packages... | ||
+ | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 | ||
avg-cpu: | avg-cpu: | ||
- | 9.00 0.14 2.67 0.29 | + | 0.03 0.00 0.03 0.01 |
- | Device: | + | Device |
- | scd0 0.00 | + | sda |
- | sda 2.56 95.04 37.09 1409026 | + | sdb |
+ | scd0 0.00 | ||
+ | dm-0 0.26 7.25 1.55 | ||
+ | dm-1 0.00 | ||
</ | </ | ||
Au-dessous de la première ligne indiquant la version du noyau du système et son nom d' | Au-dessous de la première ligne indiquant la version du noyau du système et son nom d' | ||
- | * Pourcentage de temps passé en mode utilisateur (exécutant des applications, | + | * **%user** - Pourcentage de temps passé en mode utilisateur (exécutant des applications, |
- | * Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) | + | * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) |
- | * Pourcentage de temps passé en mode noyau | + | * **%system** - Pourcentage de temps passé en mode noyau |
- | * Pourcentage de temps passé en inactivité | + | * **%steal** - Pourcentage du temps passé par des CPU virtuels en attendant que l' |
+ | * **%iowait** - Pourcentage du temps passé à attendre les entrées et les sorties des disques. | ||
+ | * **%idle** - Pourcentage de temps passé en inactivité | ||
Notez la valeur de **%iowait**. Dans le cas où ce pourcentage est trop élévé, ceci indique que le processeur passe son temps à attendre les entrées et les sorties de disque. | Notez la valeur de **%iowait**. Dans le cas où ce pourcentage est trop élévé, ceci indique que le processeur passe son temps à attendre les entrées et les sorties de disque. | ||
- | Pour surveiller la vitesse des entrées et des sorties | + | Au-dessous |
- | Sous RHEL/CentOS 7, la commande | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Dernièrement, | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | </code> | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) |
- | < | + | Device |
- | [root@centos7 ~]# hdparm -t /dev/sda | + | sda 0.20 0.16 |
- | + | sdb 0.00 0.00 0.02 0.00 | |
- | /dev/sda: | + | scd0 |
- | Timing buffered disk reads: 254 MB in | + | dm-0 |
+ | dm-1 | ||
</ | </ | ||
- | |||
- | Au-dessous du rapport d' | ||
- | |||
- | * La spécification du périphérique, | ||
- | * Le nombre de transferts (ou opérations d'E/S) par seconde. | ||
- | * Le nombre de blocs de 512 octets lus par seconde. | ||
- | * Le nombre de blocs de 512 octets écrits par seconde. | ||
- | * Le nombre total de blocs de 512 octets lus par seconde. | ||
- | * Le nombre total de blocs de 512 octets écrits par seconde. | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Usage: iostat [ options ] [ < | Usage: iostat [ options ] [ < | ||
Options are: | Options are: | ||
- | [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] | + | [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] |
- | [ -j { ID | LABEL | PATH | UUID | ... } ] | + | [ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ] |
- | [ [ -T ] -g < | + | [ [ -H ] -g < |
[ < | [ < | ||
</ | </ | ||
- | ==vmstat== | + | ====3.4 - La Commande hdparm==== |
+ | |||
+ | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# hdparm -t /dev/sda | ||
+ | |||
+ | /dev/sda: | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ====3.5 - La Commande | ||
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 : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | ||
| | ||
- | 5 | + | 0 |
- | 1 | + | 0 |
- | | + | |
- | 1 | + | 0 |
- | | + | |
- | | + | |
- | 1 | + | 0 |
- | | + | |
- | | + | |
- | 1 | + | 0 |
</ | </ | ||
Ligne 1040: | Ligne 1419: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Usage: | Usage: | ||
Ligne 1064: | Ligne 1443: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Par défaut la commande vmstat affiche des informations depuis le démarrage du système. | **Important** : Par défaut la commande vmstat affiche des informations depuis le démarrage du système. | ||
</ | </ | ||
- | ==mpstat== | + | ====3.6 - La Commande |
La commande **mpstat** affiche des statistiques détaillées sur le CPU : | La commande **mpstat** affiche des statistiques détaillées sur le CPU : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 |
- | 03:19:32 PM | + | 04:53:22 CPU %usr |
- | 03:19:32 PM | + | 04:53:22 all |
</ | </ | ||
Ligne 1083: | Ligne 1462: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 |
- | 03:20:06 PM | + | 04:54:28 CPU %usr |
- | 03:20:06 PM | + | 04:54:28 all |
- | 03:20:06 PM | + | 04: |
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04:54:28 | ||
+ | 04: | ||
+ | 04: | ||
</ | </ | ||
Ligne 1094: | Ligne 1480: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 |
- | 03:20:43 PM | + | 04:55:11 CPU %usr |
- | 03:20:45 PM | + | 04:55:13 all |
- | 03:20:45 PM | + | 04: |
+ | 04: | ||
+ | 04:55:13 | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
- | 03:20:45 PM | + | 04:55:13 CPU %usr |
- | 03:20:47 PM | + | 04:55:15 all |
- | 03:20:47 PM | + | 04: |
+ | 04:55:15 | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
- | 03:20:47 PM | + | 04:55:15 CPU %usr |
- | 03:20:49 PM | + | 04:55:17 all |
- | 03:20:49 PM | + | 04:55:17 0 0.00 |
+ | 04:55:17 | ||
+ | 04: | ||
+ | 04:55:17 3 0.00 | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
- | 03:20:49 PM | + | 04:55:17 CPU %usr |
- | 03:20:51 PM | + | 04:55:19 all 0.00 |
- | 03:20:51 PM | + | 04:55:19 |
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
- | 03:20:51 PM | + | 04:55:19 CPU %usr |
- | 03:20:53 PM | + | 04:55:21 all |
- | 03:20:53 PM | + | 04: |
+ | 04:55:21 1 | ||
+ | 04:55:21 | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04:55:21 7 0.50 0.00 0.00 | ||
Average: | Average: | ||
- | Average: | + | Average: |
- | Average: | + | Average: |
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
</ | </ | ||
Ligne 1125: | Ligne 1553: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
Usage: mpstat [ options ] [ < | Usage: mpstat [ options ] [ < | ||
Options are: | Options are: | ||
- | [ -A ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] | + | [ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] |
- | [ -P { <cpu> [,...] | ON | ALL } ] | + | [ -N { <node_list> | ALL } ] [ -o JSON ] [ -P { < |
</ | </ | ||
- | ==sar== | + | ====3.7 - La Commande |
- | La commande **sar** permet de surveiller toutes les ressources du système selon l' | + | La commande **sar** |
- | ^ Option ^ Description ^ | + | Sous RHEL/ |
- | | -u | Pourcentage d' | + | |
- | | -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 RHEL/ | + | |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
sa1 sa2 sadc | sa1 sa2 sadc | ||
</ | </ | ||
Ligne 1155: | Ligne 1574: | ||
^ Option ^ Description ^ | ^ Option ^ Description ^ | ||
- | | -t | L'interval | + | | -t | L'intervalle |
| -n | Nombre de collectes | | | -n | Nombre de collectes | | ||
- | Le script **/ | + | Le script **/ |
- | Pour pouvoir fonctionner correctement, | + | < |
+ | [root@centos8 ~]# ls / | ||
+ | sa29 s | ||
- | Modifiez le fichier **/ | ||
- | < | + | ar29 |
- | [root@centos7 ~]# cat / | + | |
- | # Run system activity accounting tool every 10 minutes | + | |
- | # */10 * * * * root / | + | |
- | */2 * * * * root / | + | |
- | # 0 * * * * root / | + | |
- | # Generate a daily summary of process accounting at 23:53 | + | |
- | 53 23 * * * root / | + | |
</ | </ | ||
- | Attendez deux minutes puis saisissez | + | Sous CentOS / RHEL 8, l' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | # /usr/lib/ |
+ | # (C) 2014 Tomasz Torcz < | ||
+ | # | ||
+ | # sysstat-11.7.3 systemd unit file: | ||
+ | # Activates activity collector every 10 minutes | ||
- | 02:20:02 PM | + | [Unit] |
- | 02:30:01 PM | + | Description=Run |
- | 02:40:01 PM | + | |
- | 02:50:01 PM | + | [Timer] |
- | 03:00:01 PM | + | OnCalendar=*:00/10 |
- | 03:10:01 PM | + | |
- | 03:20:01 PM | + | [Install] |
- | 03:28:02 PM | + | WantedBy=sysstat.service |
- | 03:30:01 PM | + | |
- | 03:32:01 PM | + | |
- | Average: | + | |
</ | </ | ||
+ | |||
+ | La valeur de **OnCalendar** indique un collecte toutes les dix minutes. | ||
+ | |||
+ | Pour modifier l' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | [root@centos8 ~]# cat / |
+ | [Unit] | ||
+ | Description=Run system activity accounting tool every 2 minutes | ||
- | 03:34:01 PM | + | [Timer] |
- | 03:34:06 PM | + | OnCalendar= |
- | 03:34:11 PM | + | OnCalendar=*:00/2 |
- | 03:34:16 PM | + | AccuracySec=0 |
- | Average: | + | |
</ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : Notez la ligne **OnCalendar=** qui est necessaire afin de surcharger la valeur par défaut. | ||
+ | </ | ||
+ | |||
+ | Vérifiez ensuite la prise en compte de la configuration : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 | + | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes |
+ | | ||
+ | Drop-In: | ||
+ | | ||
+ | | ||
+ | Trigger: Tue 2021-06-29 09:20:00 EDT; 1min 19s left | ||
- | 03:34:48 PM kbmemfree kbmemused | + | Jun 29 06:16:04 centos8.ittraining.loc systemd[1]: Started Run system activity accounting tool every 10 minutes. |
- | 03:34:53 PM 137708 | + | |
- | 03:34:58 PM 130988 | + | |
- | 03:35:03 PM 131360 | + | |
- | Average: | + | |
</ | </ | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | -- 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: | ||
+ | Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 06:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 07:00:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | 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: | ||
+ | Jun 29 07:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 07:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 07:53:56 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 07:54:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 07:56:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 07:58:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Jun 29 08:00:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | ... | ||
+ | </ | ||
- | 03:35:51 PM proc/s cswch/s | + | Saisissez la commande suivante |
- | 03:35:56 PM | + | |
- | 03:36:01 PM 1.06 531.75 | + | < |
- | 03: | + | [root@centos8 ~]# sar |
- | Average: | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) |
+ | |||
+ | 06: | ||
+ | |||
+ | 06: | ||
+ | 06: | ||
+ | 06: | ||
+ | 06: | ||
+ | 06: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07:53:56 | ||
+ | 07: | ||
+ | Average: | ||
+ | |||
+ | 07: | ||
+ | |||
+ | 07: | ||
+ | 07: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08:04:00 all 0.02 0.00 0.03 0.00 0.00 | ||
+ | 08:06:00 all 0.02 0.00 0.03 0.00 0.00 99.95 | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08:36:00 all 0.03 0.00 0.04 0.00 0.00 | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | |||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | Average: | ||
</ | </ | ||
+ | |||
+ | ===Statistiques d' | ||
+ | |||
+ | Visualisez maintenant les statistiques d' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 |
- | 03:36:09 PM | + | 09:22:52 CPU |
- | 03:36:14 PM 0.00 | + | 09:22:57 all 0.03 |
- | 03:36:19 PM 0.00 | + | 09:23:02 all 0.03 |
- | 03:36:24 PM 2.32 | + | 09:23:07 all 0.00 |
- | Average: | + | Average: |
</ | </ | ||
+ | |||
+ | D' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 |
- | 03:36:46 PM | + | 01:49:14 CPU %usr |
- | 03:36:51 PM | + | 01:49:19 all |
- | 03:36:51 PM dev8-0 0.31 | + | 01: |
+ | 01:49:29 all 0.00 0.00 | ||
+ | Average: | ||
+ | </ | ||
- | 03:36:51 PM | + | Pour consulter les statistiques d'un coeur spécifique, |
- | 03:36:56 PM | + | |
- | 03:36:56 PM dev8-0 | + | |
- | 03:36:56 PM | + | < |
- | 03:37:01 PM | + | [root@centos8 ~]# sar -u -P 1 5 3 |
- | 03:37:01 PM dev8-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/ |
- | Average: | + | 01:51:52 CPU |
- | Average: | + | 01:51:57 1 0.00 0.00 0.00 0.00 0.00 |
- | Average: dev8-0 1.49 | + | 01: |
+ | 01:52:07 1 0.00 | ||
+ | Average: | ||
+ | [root@centos8 ~]# sar -u -P 5 5 3 | ||
+ | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | ||
+ | |||
+ | 01: | ||
+ | 01: | ||
+ | 01: | ||
+ | 01: | ||
+ | Average: | ||
</ | </ | ||
+ | |||
+ | ===Statistiques d' | ||
+ | |||
+ | Utilisez l' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 30/06/21 |
- | 03:37:16 PM | + | 07:33:32 kbmemfree |
- | 03:37:21 PM | + | 07:33:37 1647240 |
- | 03:37:26 PM | + | 07:33:42 1647232 |
- | 03:37:31 PM | + | 07:33:47 1647232 |
- | Average: | + | Average: |
</ | </ | ||
+ | |||
+ | Utilisez l' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Linux 3.10.0-229.4.2.el7.x86_64 (centos7.fenestros.loc) 11/02/2015 _x86_64_ (1 CPU) | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 30/06/21 |
- | 03:38:44 PM dentunusd | + | 07:31:58 kbswpfree kbswpused |
- | 03:38:49 PM 136266 | + | 07:32:03 3358716 |
- | 03:38:54 PM 136266 | + | 07:32:08 3358716 |
- | 03:38:59 PM 136266 | + | 07:32:13 3358716 |
- | Average: | + | Average: |
</ | </ | ||
- | Les options de cette commande sont : | + | ===Statistiques des E/S=== |
+ | |||
+ | Utilisez l' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Usage: sar [ options ] [ < | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/ |
- | Options are: | + | |
- | [ -A ] [ -B ] [ -b ] [ -C ] [ -d ] [ -H ] [ -h ] [ -p ] [ -q ] [ -R ] | + | 09: |
- | [ -r ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -V ] [ -v ] [ -W ] [ -w ] [ -y ] | + | 09: |
- | [ -I { <int> [,...] | SUM | ALL | XALL } ] [ -P { <cpu> [,...] | ALL } ] | + | 09: |
- | [ -m { < | + | 09:25:04 |
- | [ -j { ID | LABEL | PATH | UUID | ... } ] | + | Average: 0.40 0.00 0.40 0.00 6.73 |
- | [ -f [ < | + | |
- | [ -i < | + | |
</ | </ | ||
- | ===Utilisation | + | ===Statistiques |
- | ==Identifier un système limité | + | Utilisez l' |
- | Dans ce cas utilisez les commandes suivantes : | + | < |
+ | [root@centos8 ~]# sar -d 5 3 | ||
+ | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | ||
- | | + | 09: |
- | * vmstat | + | 09: |
- | * mpstat | + | 09: |
- | * sar -u | + | 09: |
- | * iostat | + | 09: |
+ | 09: | ||
- | ==Identifier un système ayant un problème de mémoire== | + | 09: |
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
- | Dans ce cas utilisez les commandes suivantes | + | 09:25:55 DEV |
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
- | | + | Average: |
- | * sar -B | + | Average: |
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | </ | ||
+ | La colonne **DEV** indentifie les disques par leurs majeurs et mineurs. Pour voir les informations avec les noms des disques, ajoutez l' | ||
- | ==Identifier un système ayant un problème | + | < |
+ | [root@centos8 ~]# sar -p -d 5 3 | ||
+ | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | ||
- | Utilisez la commande | + | 07:48:32 DEV |
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
- | | + | 07: |
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | |||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | </ | ||
+ | |||
+ | Les options de la commande sar sont : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# sar --help | ||
+ | Usage: sar [ options ] [ < | ||
+ | Main options and reports (report name between square brackets): | ||
+ | -B Paging statistics [A_PAGE] | ||
+ | -b I/O and transfer rate statistics [A_IO] | ||
+ | -d Block devices statistics [A_DISK] | ||
+ | -F [ MOUNT ] | ||
+ | Filesystems statistics [A_FS] | ||
+ | -H Hugepages utilization statistics [A_HUGE] | ||
+ | -I { < | ||
+ | Interrupts statistics [A_IRQ] | ||
+ | -m { < | ||
+ | Power management statistics [A_PWR_...] | ||
+ | Keywords are: | ||
+ | CPU CPU instantaneous clock frequency | ||
+ | FAN Fans speed | ||
+ | FREQ CPU average clock frequency | ||
+ | IN Voltage inputs | ||
+ | TEMP Devices temperature | ||
+ | USB USB devices plugged into the system | ||
+ | -n { < | ||
+ | Network statistics [A_NET_...] | ||
+ | Keywords are: | ||
+ | DEV | ||
+ | EDEV Network interfaces (errors) | ||
+ | NFS NFS client | ||
+ | NFSD NFS server | ||
+ | SOCK Sockets (v4) | ||
+ | IP IP traffic | ||
+ | EIP IP traffic | ||
+ | ICMP ICMP traffic | ||
+ | EICMP ICMP traffic | ||
+ | TCP TCP traffic | ||
+ | ETCP TCP traffic | ||
+ | UDP UDP traffic | ||
+ | SOCK6 | ||
+ | IP6 IP traffic | ||
+ | EIP6 IP traffic | ||
+ | ICMP6 ICMP traffic | ||
+ | EICMP6 | ||
+ | UDP6 UDP traffic | ||
+ | FC Fibre channel HBAs | ||
+ | SOFT Software-based network processing | ||
+ | -q Queue length and load average statistics [A_QUEUE] | ||
+ | -r [ ALL ] | ||
+ | Memory utilization statistics [A_MEMORY] | ||
+ | -S Swap space utilization statistics [A_MEMORY] | ||
+ | -u [ ALL ] | ||
+ | CPU utilization statistics [A_CPU] | ||
+ | -v Kernel tables statistics [A_KTABLES] | ||
+ | -W Swapping statistics [A_SWAP] | ||
+ | -w Task creation and system switching statistics [A_PCSW] | ||
+ | -y TTY devices statistics [A_SERIAL] | ||
+ | </ | ||
=====Modules usb===== | =====Modules usb===== | ||
Ligne 1345: | Ligne 1981: | ||
* INITrd, | * INITrd, | ||
- | * Le processus init, | + | * Le processus init (systemd), |
- | * kmod, d'une manière dynamique et transparente lors du branchement du périphérique, en utilisant le fichier **/ | + | * kmod, d'une manière dynamique et transparente lors du branchement du périphérique, |
* udev, | * udev, | ||
* manuellement. | * manuellement. | ||
- | |||
- | <WRAP center round todo> | ||
- | **A faire** : Branchez une clef USB avant de continuer. Si vous utilisez %%VirtualBox%%, | ||
- | </ | ||
=====udev===== | =====udev===== | ||
Ligne 1382: | Ligne 2014: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | # see udev(7) for details | + | # see udev.conf(5) for details |
+ | # | ||
+ | # udevd is also started in the initrd. | ||
+ | # also want to rebuild the initrd, so that it will include the modified configuration. | ||
# | # | ||
Ligne 1391: | Ligne 2026: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 10-dm.rules | + | 01-md-raid-creating.rules |
- | 11-dm-lvm.rules | + | 10-dm.rules |
- | 11-dm-mpath.rules | + | 11-dm-lvm.rules |
- | 13-dm-disk.rules | + | 11-dm-mpath.rules |
- | 40-libgphoto2.rules | + | 11-dm-parts.rules |
- | 40-redhat.rules | + | 13-dm-disk.rules |
- | 40-usb_modeswitch.rules | + | 39-usbmuxd.rules |
- | 42-usb-hid-pm.rules | + | 40-elevator.rules |
- | 50-rbd.rules | + | 40-libgphoto2.rules |
- | 50-udev-default.rules | + | 40-redhat.rules |
- | 56-hpmud.rules | + | 40-usb-blacklist.rules |
- | 60-alias-kmsg.rules | + | 40-usb_modeswitch.rules |
- | 60-cdrom_id.rules | + | 50-udev-default.rules |
- | 60-fprint-autosuspend.rules | + | 60-alias-kmsg.rules |
- | 60-keyboard.rules | + | 60-block.rules |
- | 60-net.rules | + | 60-cdrom_id.rules |
- | 60-persistent-alsa.rules | + | 60-drm.rules |
- | 60-persistent-input.rules | + | 60-evdev.rules |
- | 60-persistent-serial.rules | + | 60-fido-id.rules |
- | 60-persistent-storage.rules | + | 60-input-id.rules |
- | 60-persistent-storage-tape.rules | + | 60-libfprint-2-autosuspend.rules |
- | 60-persistent-v4l.rules | + | 60-net.rules |
- | 60-raw.rules | + | 60-persistent-alsa.rules |
- | 61-accelerometer.rules | + | 60-persistent-input.rules |
+ | 60-persistent-storage.rules | ||
+ | 60-persistent-storage-tape.rules | ||
+ | 60-persistent-v4l.rules | ||
+ | 60-raw.rules | ||
+ | 60-rdma-ndd.rules | ||
+ | 60-rdma-persistent-naming.rules | ||
+ | 60-sensor.rules | ||
+ | 60-serial.rules | ||
+ | 60-tpm-udev.rules | ||
+ | 61-gdm.rules | ||
+ | 61-gnome-bluetooth-rfkill.rules | ||
+ | 61-gnome-settings-daemon-rfkill.rules | ||
+ | 61-scsi-sg3_id.rules | ||
+ | 62-multipath.rules | ||
+ | 63-fc-wwpn-id.rules | ||
+ | 63-md-raid-arrays.rules | ||
+ | 63-scsi-sg3_symlink.rules | ||
+ | 64-btrfs.rules | ||
+ | 64-md-raid-assembly.rules | ||
+ | 65-libwacom.rules | ||
+ | 65-md-incremental.rules | ||
+ | 65-sane-backends.rules | ||
+ | 66-kpartx.rules | ||
+ | 68-del-part-nodes.rules | ||
+ | 69-btattach-bcm.rules | ||
+ | 69-cd-sensors.rules | ||
+ | 69-dm-lvm-metad.rules | ||
+ | 69-libmtp.rules | ||
+ | 69-md-clustered-confirm-device.rules | ||
+ | 70-hypervfcopy.rules | ||
+ | 70-hypervkvp.rules | ||
+ | 70-hypervvss.rules | ||
+ | 70-joystick.rules | ||
+ | 70-mouse.rules | ||
+ | 70-nvmf-autoconnect.rules | ||
+ | 70-power-switch.rules | ||
+ | 70-printers.rules | ||
+ | 70-spice-vdagentd.rules | ||
+ | 70-touchpad.rules | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Il vous est possible d' | **Important** : Il vous est possible d' | ||
</ | </ | ||
Ligne 1425: | Ligne 2099: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
# do not edit this file, it will be overwritten on update | # do not edit this file, it will be overwritten on update | ||
+ | |||
+ | # run a command on remove events | ||
+ | ACTION==" | ||
+ | ACTION==" | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
Ligne 1435: | Ligne 2113: | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
- | SUBSYSTEM==" | ||
ENV{MODALIAS}!="", | ENV{MODALIAS}!="", | ||
- | ACTION!=" | + | ACTION!=" |
SUBSYSTEM==" | SUBSYSTEM==" | ||
Ligne 1447: | Ligne 2124: | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
- | KERNEL==" | + | KERNEL==" |
SUBSYSTEM==" | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
- | SUBSYSTEM==" | + | SUBSYSTEM==" |
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | OPTIONS+=" | ||
--More-- | --More-- | ||
</ | </ | ||
Ligne 1486: | Ligne 2174: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | P: / | + | P: / |
N: sda | N: sda | ||
- | S: disk/ | + | S: disk/ |
- | E: DEVLINKS=/ | + | S: disk/ |
+ | S: disk/ | ||
+ | S: disk/ | ||
+ | S: disk/ | ||
+ | E: DEVLINKS=/ | ||
E: DEVNAME=/ | E: DEVNAME=/ | ||
- | E: DEVPATH=/ | + | E: DEVPATH=/ |
E: DEVTYPE=disk | E: DEVTYPE=disk | ||
E: ID_ATA=1 | E: ID_ATA=1 | ||
- | E: ID_ATA_FEATURE_SET_PM=1 | + | E: ID_ATA_FEATURE_SET_SMART=1 |
- | E: ID_ATA_FEATURE_SET_PM_ENABLED=1 | + | E: ID_ATA_FEATURE_SET_SMART_ENABLED=1 |
E: ID_ATA_SATA=1 | E: ID_ATA_SATA=1 | ||
- | E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1 | ||
E: ID_ATA_WRITE_CACHE=1 | E: ID_ATA_WRITE_CACHE=1 | ||
E: ID_ATA_WRITE_CACHE_ENABLED=1 | E: ID_ATA_WRITE_CACHE_ENABLED=1 | ||
E: ID_BUS=ata | E: ID_BUS=ata | ||
- | E: ID_MODEL=VBOX_HARDDISK | + | E: ID_MODEL=QEMU_HARDDISK |
- | E: ID_MODEL_ENC=VBOX\x20HARDDISK\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20 | + | E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 |
E: ID_PART_TABLE_TYPE=dos | E: ID_PART_TABLE_TYPE=dos | ||
- | E: ID_REVISION=1.0 | + | E: ID_PART_TABLE_UUID=b39ec5c8 |
- | E: ID_SERIAL=VBOX_HARDDISK_VBc40eec8a-49b6b6f3 | + | E: ID_PATH=pci-0000: |
- | E: ID_SERIAL_SHORT=VBc40eec8a-49b6b6f3 | + | E: ID_PATH_TAG=pci-0000_00_07_0-ata-1 |
+ | E: ID_REVISION=2.5+ | ||
+ | E: ID_SCSI=1 | ||
+ | E: ID_SCSI_INQUIRY=1 | ||
+ | E: ID_SERIAL=QEMU_HARDDISK_QM00005 | ||
+ | E: ID_SERIAL_SHORT=QM00005 | ||
E: ID_TYPE=disk | E: ID_TYPE=disk | ||
+ | E: ID_VENDOR=ATA | ||
+ | E: ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 | ||
E: MAJOR=8 | E: MAJOR=8 | ||
E: MINOR=0 | E: MINOR=0 | ||
- | E: MPATH_SBIN_PATH=/sbin | + | E: SCSI_IDENT_LUN_ATA=QEMU_HARDDISK_QM00005 |
+ | E: SCSI_IDENT_LUN_T10=ATA_QEMU_HARDDISK_QM00005 | ||
+ | E: SCSI_IDENT_LUN_VENDOR=QM00005 | ||
+ | E: SCSI_IDENT_SERIAL=QM00005 | ||
+ | E: SCSI_MODEL=QEMU_HARDDISK | ||
+ | E: SCSI_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | ||
+ | E: SCSI_REVISION=2.5+ | ||
+ | E: SCSI_TPGS=0 | ||
+ | E: SCSI_TYPE=disk | ||
+ | E: SCSI_VENDOR=ATA | ||
+ | E: SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 | ||
E: SUBSYSTEM=block | E: SUBSYSTEM=block | ||
E: TAGS=: | E: TAGS=: | ||
- | E: USEC_INITIALIZED=957366 | + | E: USEC_INITIALIZED=8735808 |
</ | </ | ||
Ligne 1522: | Ligne 2230: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Usage: | + | udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS] |
- | info query sysfs or the udev database | + | |
- | trigger | + | Send control commands or test the device manager. |
- | settle | + | |
- | control | + | Commands: |
- | monitor | + | info |
- | | + | trigger |
- | test test an event run | + | settle |
- | test-builtin | + | control |
+ | monitor | ||
+ | test | ||
+ | test-builtin | ||
+ | |||
+ | [root@centos8 ~]# udevadm info --help | ||
+ | udevadm info [OPTIONS] [DEVPATH|FILE] | ||
+ | |||
+ | Query sysfs or the udev database. | ||
- | [root@centos7 ~]# udevadm info --help | + | -h --help |
- | Usage: udevadm info OPTIONS | + | -V --version |
- | --query=< | + | |
- | name name of device node | + | |
- | symlink | + | |
- | path sys device path | + | |
- | property | + | |
- | all | + | |
- | --path=< | + | |
- | --name=< | + | |
- | --root | + | |
- | --attribute-walk | + | |
- | | + | of parent devices |
- | --device-id-of-file=< | + | |
- | --export | + | |
- | --export-prefix | + | |
- | --export-db | + | |
- | --cleanup-db | + | |
- | --help | + | |
</ | </ | ||
Ligne 1561: | Ligne 2276: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
total 0 | total 0 | ||
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
- | drwxr-xr-x. | + | drwxr-xr-x. |
</ | </ | ||
Ligne 1598: | Ligne 2313: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 409600 | + | 2097152 |
</ | </ | ||
Ce chiffre correspond aux nombre de secteurs. | Ce chiffre correspond aux nombre de secteurs. | ||
- | =====Limitation des ressources===== | + | =====LAB #4 - Limitation des ressources===== |
- | ====ulimit==== | + | ====4.1 - ulimit==== |
Les ressources disponibles aux utilisateurs peuvent être limitées par l' | Les ressources disponibles aux utilisateurs peuvent être limitées par l' | ||
Ligne 1617: | Ligne 2332: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
# / | # / | ||
# | # | ||
Ligne 1681: | Ligne 2396: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La valeur de la limite peut être un **nombre** ou le mot **unlimited**. | **Important** : La valeur de la limite peut être un **nombre** ou le mot **unlimited**. | ||
</ | </ | ||
Ligne 1703: | Ligne 2418: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | core file size (blocks, -c) 0 | + | core file size (blocks, -c) unlimited |
data seg size | data seg size | ||
scheduling priority | scheduling priority | ||
file size | file size | ||
- | pending signals | + | pending signals |
max locked memory | max locked memory | ||
max memory size | max memory size | ||
Ligne 1717: | Ligne 2432: | ||
stack size (kbytes, -s) 8192 | stack size (kbytes, -s) 8192 | ||
cpu time | cpu time | ||
- | max user processes | + | max user processes |
virtual memory | virtual memory | ||
file locks (-x) unlimited | file locks (-x) unlimited | ||
Ligne 1727: | Ligne 2442: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | ulimit: ulimit [-SHacdefilmnpqrstuvx] [limit] | + | ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit] |
Modify shell resource limits. | Modify shell resource limits. | ||
| | ||
Ligne 1735: | Ligne 2450: | ||
| | ||
Options: | Options: | ||
- | -S use the `soft' resource limit | + | -S use the `soft' resource limit |
- | -H use the `hard' resource limit | + | -H use the `hard' resource limit |
- | -a all current limits are reported | + | -a all current limits are reported |
- | -b the socket buffer size | + | -b the socket buffer size |
- | -c the maximum size of core files created | + | -c the maximum size of core files created |
- | -d the maximum size of a process' | + | -d the maximum size of a process' |
- | -e the maximum scheduling priority (`nice' | + | -e the maximum scheduling priority (`nice' |
- | -f the maximum size of files written by the shell and its children | + | -f the maximum size of files written by the shell and its children |
- | -i the maximum number of pending signals | + | -i the maximum number of pending signals |
- | -l the maximum size a process may lock into memory | + | -k the maximum number of kqueues allocated for this process |
- | -m the maximum resident set size | + | -l the maximum size a process may lock into memory |
- | -n the maximum number of open file descriptors | + | -m the maximum resident set size |
- | -p the pipe buffer size | + | -n the maximum number of open file descriptors |
- | -q the maximum number of bytes in POSIX message queues | + | -p the pipe buffer size |
- | -r the maximum real-time scheduling priority | + | -q the maximum number of bytes in POSIX message queues |
- | -s the maximum stack size | + | -r the maximum real-time scheduling priority |
- | -t the maximum amount of cpu time in seconds | + | -s the maximum stack size |
- | -u the maximum number of user processes | + | -t the maximum amount of cpu time in seconds |
- | -v the size of virtual memory | + | -u the maximum number of user processes |
- | -x the maximum number of file locks | + | -v the size of virtual memory |
+ | -x the maximum number of file locks | ||
+ | -P the maximum number of pseudoterminals | ||
+ | -T the maximum number of threads | ||
+ | |||
+ | Not all options are available on all platforms. | ||
| | ||
If LIMIT is given, it is the new value of the specified resource; the | If LIMIT is given, it is the new value of the specified resource; the | ||
Ligne 1770: | Ligne 2490: | ||
</ | </ | ||
- | ====Groupes de Contrôle==== | + | ====4.2 - Groupes de Contrôle==== |
- | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, | + | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, |
Les groupes de contrôle sont organisés de manière hiérarchique, | Les groupes de contrôle sont organisés de manière hiérarchique, | ||
- | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs | + | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs |
* **blkio** - utilisé pour établir des limites sur l' | * **blkio** - utilisé pour établir des limites sur l' | ||
Ligne 1789: | Ligne 2509: | ||
* **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | ||
- | Pour visualiser les hiérarchies, | + | Pour visualiser les hiérarchies, |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
+ | bash: lssubsys: command not found... | ||
+ | Install package ' | ||
+ | |||
+ | |||
+ | * Waiting in queue... | ||
+ | The following packages have to be installed: | ||
+ | | ||
+ | | ||
+ | Proceed with changes? [N/y] y | ||
+ | |||
+ | |||
+ | * Waiting in queue... | ||
+ | * Waiting for authentication... | ||
+ | * Waiting in queue... | ||
+ | * Downloading packages... | ||
+ | * Requesting data... | ||
+ | * Testing changes... | ||
+ | * Installing packages... | ||
cpuset / | cpuset / | ||
cpu,cpuacct / | cpu,cpuacct / | ||
+ | blkio / | ||
memory / | memory / | ||
devices / | devices / | ||
freezer / | freezer / | ||
- | net_cls / | + | net_cls, |
+ | perf_event / | ||
+ | hugetlb / | ||
+ | pids / | ||
+ | rdma / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# lssubsys -am | ||
+ | cpuset / | ||
+ | cpu,cpuacct / | ||
blkio / | blkio / | ||
+ | memory / | ||
+ | devices / | ||
+ | freezer / | ||
+ | net_cls, | ||
perf_event / | perf_event / | ||
hugetlb / | hugetlb / | ||
+ | pids / | ||
+ | rdma / | ||
</ | </ | ||
- | Sous RHEL/ | + | Sous RHEL/ |
En haut de l' | En haut de l' | ||
Ligne 1820: | Ligne 2575: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | UNIT | + | UNIT LOAD |
- | -.slice | + | -.slice |
- | system-getty.slice loaded active active system-getty.slice | + | machine.slice |
- | system.slice | + | system-getty.slice |
- | user-0.slice | + | system-lvm2\x2dpvscan.slice |
- | user-1000.slice | + | system-sshd\x2dkeygen.slice |
- | user.slice | + | system-systemd\x2dfsck.slice |
+ | system-systemd\x2dhibernate\x2dresume.slice loaded active active system-systemd\x2dhibernate\x2dresume.slice | ||
+ | system-user\x2druntime\x2ddir.slice | ||
+ | system-vncserver.slice | ||
+ | system.slice | ||
+ | user-1000.slice | ||
+ | user-42.slice | ||
+ | user.slice | ||
LOAD = Reflects whether the unit definition was properly loaded. | LOAD = Reflects whether the unit definition was properly loaded. | ||
Ligne 1833: | Ligne 2595: | ||
SUB = The low-level unit activation state, values depend on unit type. | SUB = The low-level unit activation state, values depend on unit type. | ||
- | 6 loaded units listed. Pass --all to see loaded but inactive units, too. | + | 13 loaded units listed. Pass --all to see loaded but inactive units, too. |
To show all installed unit files use ' | To show all installed unit files use ' | ||
</ | </ | ||
Ligne 1840: | Ligne 2602: | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | ├─1 | + | Control group /: |
+ | -.slice | ||
├─user.slice | ├─user.slice | ||
+ | │ ├─user-42.slice | ||
+ | │ │ ├─session-c1.scope | ||
+ | │ │ │ ├─1317 gdm-session-worker [pam/ | ||
+ | │ │ │ ├─1459 / | ||
+ | │ │ │ ├─1856 / | ||
+ | │ │ │ ├─1882 / | ||
+ | │ │ │ ├─2059 / | ||
+ | │ │ │ ├─2132 ibus-daemon --xim --panel disable | ||
+ | │ │ │ ├─2135 / | ||
+ | │ │ │ ├─2138 / | ||
+ | │ │ │ ├─2251 / | ||
+ | │ │ │ ├─2261 / | ||
+ | │ │ │ ├─2268 / | ||
+ | │ │ │ ├─2271 / | ||
+ | │ │ │ ├─2272 / | ||
+ | │ │ │ ├─2273 / | ||
+ | │ │ │ ├─2274 / | ||
+ | │ │ │ ├─2275 / | ||
+ | │ │ │ ├─2280 / | ||
+ | │ │ │ ├─2281 / | ||
+ | │ │ │ ├─2283 / | ||
+ | │ │ │ ├─2284 / | ||
+ | │ │ │ ├─2285 / | ||
+ | │ │ │ ├─2290 / | ||
+ | │ │ │ ├─2321 / | ||
+ | │ │ │ ├─2328 / | ||
+ | │ │ │ ├─2333 / | ||
+ | │ │ │ └─2432 / | ||
+ | │ │ └─user@42.service | ||
+ | │ │ | ||
+ | │ │ │ └─2170 / | ||
+ | │ │ | ||
+ | │ │ │ └─1455 / | ||
+ | │ │ | ||
+ | │ │ │ ├─1357 / | ||
+ | │ │ │ └─1377 (sd-pam) | ||
+ | │ │ | ||
+ | │ │ │ ├─2090 / | ||
+ | │ │ │ ├─2095 / | ||
+ | │ │ │ └─2098 / | ||
+ | │ │ | ||
+ | │ │ | ||
+ | │ │ | ||
│ └─user-1000.slice | │ └─user-1000.slice | ||
- | │ └─session-2.scope | + | │ |
- | │ ├─ | + | │ |
- | │ | + | │ |
- | │ ├─ 6167 -bash | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | │ | + | │ |
- | └─system.slice | + | │ │ │ ├─2605 /usr/libexec/evolution-calendar-factory |
- | ├─upower.service | + | │ |
- | │ └─3478 / | + | │ |
- | ├─polkit.service | + | │ |
- | │ └─822 /usr/lib/polkit-1/polkitd --no-debug | + | │ |
- | ├─wpa_supplicant.service | + | │ |
- | │ └─821 /usr/sbin/wpa_supplicant | + | │ │ │ └─1901 /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes |
- | ├─crond.service | + | │ │ ├─evolution-source-registry.service |
- | │ └─793 /usr/sbin/crond -n | + | │ │ │ └─2206 / |
- | ├─atd.service | + | │ │ ├─gvfs-udisks2-volume-monitor.service |
- | │ └─789 /usr/sbin/atd -f | + | │ |
- | ├─tuned.service | + | │ |
- | │ └─762 /usr/bin/python | + | │ │ │ ├─1239 /usr/lib/systemd/ |
- | ├─simplegateway.service | + | │ │ │ └─1318 (sd-pam) |
- | │ ├─ | + | │ │ ├─gvfs-gphoto2-volume-monitor.service |
- | │ ├─ 3202 /opt/JWrapper-Remote Access/JWrapper-Linux64JRE-00028603412-complete/bin/Remote Access -cp /opt/JWrapper-Remote Access/ | + | │ |
- | │ ├─ | + | │ |
- | │ ├─13111 /bin/sh / | + | │ |
- | | + | │ │ │ ├─1969 /usr/bin/dbus-daemon |
- | ├─postfix.service | + | │ |
- | │ ├─1810 | + | │ |
- | │ ├─1833 pickup | + | │ │ │ ├─1786 / |
- | │ └─1834 qmgr -l -t unix -u | + | │ │ │ ├─2183 /usr/libexec/ibus-portal |
- | ├─cups.service | + | │ │ │ ├─2201 /usr/libexec/gnome-shell-calendar-server |
- | │ └─756 /usr/sbin/cupsd -f | + | │ │ │ ├─2225 /usr/libexec/goa-daemon |
- | ├─sshd.service | + | │ │ │ ├─2397 /usr/libexec/goa-identity-service |
- | │ └─755 /usr/sbin/sshd -D | + | │ |
- | | + | │ │ ├─evolution-addressbook-factory.service |
- | | + | │ │ │ ├─2727 /usr/libexec/evolution-addressbook-factory |
- | │ ├─753 / | + | │ |
- | │ └─754 /usr/bin/forward-journald | + | │ |
- | ├─NetworkManager.service | + | lines 44-86 |
- | │ ├─ | + | |
- | │ └─1968 / | + | |
- | ├─abrt-xorg.service | + | |
- | │ └─586 /usr/bin/abrt-watch-log -F Backtrace / | + | |
- | ├─abrt-oops.service | + | |
- | │ └─582 / | + | |
- | | + | |
- | │ └─581 | + | |
- | ├─dbus.service | + | |
- | │ └─513 | + | |
- | ├─chronyd.service | + | |
- | │ └─525 | + | |
- | ├─firewalld.service | + | |
- | │ └─510 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | │ └─506 | + | |
- | ├─smartd.service | + | |
- | │ └─505 | + | |
- | ├─libstoragemgmt.service | + | |
- | │ └─494 /usr/bin/lsmd -d | + | |
- | ├─gssproxy.service | + | |
- | │ └─517 / | + | |
- | | + | |
- | │ └─492 / | + | |
- | | + | |
- | │ └─488 | + | |
- | ├─alsa-state.service | + | |
- | │ └─487 /usr/sbin/alsactl | + | |
- | ├─auditd.service | + | |
- | │ ├─463 / | + | |
- | │ ├─473 / | + | |
- | │ └─475 / | + | |
- | ├─systemd-udevd.service | + | |
- | │ └─381 / | + | |
- | ├─lvm2-lvmetad.service | + | |
- | │ └─378 | + | |
- | ├─systemd-journald.service | + | |
- | │ └─349 / | + | |
- | └─system-getty.slice | + | |
- | └─getty@tty1.service | + | |
- | | + | |
</ | </ | ||
Ligne 1939: | Ligne 2701: | ||
* **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Consultez le manuel systemd.resource-control(5) pour voir les paramètres CGroup qui peuvent être passés à systemctl. | **Important** : Consultez le manuel systemd.resource-control(5) pour voir les paramètres CGroup qui peuvent être passés à systemctl. | ||
</ | </ | ||
+ | ===Limitation de la Mémoire=== | ||
- | ===LAB #1 - Travailler | + | Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler |
- | Créez un service appelé **foo** | + | < |
+ | [root@centos8 ~]# vi hello-world.sh | ||
+ | [root@centos8 ~]# cat hello-world.sh | ||
+ | # | ||
+ | while [ 1 ]; do | ||
+ | echo "hello world" | ||
+ | sleep 360 | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | Rendez le script exécutable et testez-le | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | [root@centos8 |
- | [Unit] | + | hello world |
- | Description=The foo service that does nothing useful | + | ^C |
- | After=remote-fs.target nss-lookup.target | + | </ |
- | [Service] | + | Créez maintenant un CGroup dans le sous-système **memory** appelé **helloworld** : |
- | ExecStart=/ | + | |
- | ExecStop=/ | + | |
- | [Install] | + | < |
- | WantedBy=multi-user.target | + | [root@centos8 ~]# mkdir / |
</ | </ | ||
- | Consultez le statut du service foo : | + | Par défaut, ce CGroup héritera de l' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | ● foo.service - The foo service that does nothing useful | + | [root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld/memory.limit_in_bytes |
- | | + | 39997440 |
- | Active: inactive (dead) | + | |
</ | </ | ||
- | Démarrez et actives | + | <WRAP center round important 60%> |
+ | **Important** - Notez que les 40 000 000 demandés sont devenus 39 997 440 ce qui correspond à un nombre entier de pages mémoire du noyau de 4Ko. ( 39 997 440 / 4096 = 9 765 ). | ||
+ | </ | ||
+ | |||
+ | Lancez maintenant | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 ~]# systemctl enable foo.service | + | [1] 35148 |
- | Created symlink from / | + | |
- | [root@centos7 | + | [root@centos8 |
- | ● foo.service - The foo service that does nothing useful | + | [Entrée] |
- | | + | |
- | | + | |
- | Main PID: 22256 (sha1sum) | + | |
- | | + | |
- | | + | |
- | Jun 15 13:13:17 centos7.fenestros.loc systemd[1]: Started The foo service that does nothing useful. | + | [root@centos8 ~]# ps aux | grep hello-world |
- | Jun 15 13:13:17 centos7.fenestros.loc systemd[1]: Starting The foo service that does nothing useful... | + | root |
+ | root | ||
</ | </ | ||
- | Notez que notre service | + | Notez qu'il n' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Slice=system.slice | + | CGROUP |
+ | 12: | ||
</ | </ | ||
- | Utilisez ps pour voir le pourcentage du CPU utilisé par ce service | + | Insérer |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | PID COMMAND | + | |
- | 22256 sha1sum | + | |
</ | </ | ||
- | Fixez maintenant la valeur | + | Notez maintenant |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
+ | CGROUP | ||
+ | 12: | ||
</ | </ | ||
- | Cette limite est permenante et a été inscrite dans le fichier **50-CPUShares.conf** qui se trouve dans le répertoire **/ | + | Constatez ensuite l' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 50-CPUShares.conf | + | 274432 |
- | [root@centos7 ~]# cat /etc/systemd/ | + | |
- | [Service] | + | |
- | CPUShares=250 | + | |
</ | </ | ||
- | <WRAP center round important> | + | Tuez le script |
- | **Important** : En utilisant l' | + | |
- | </ | + | |
- | Appliquez cette modification en rechargeant systemd et en re-démarrant le service foo.service | + | < |
+ | [root@centos8 ~]# kill 35148 | ||
+ | [root@centos8 ~]# ps aux | grep hello-world | ||
+ | root | ||
+ | [1]+ Terminated | ||
+ | </ | ||
+ | |||
+ | Créez un second CGroup beaucoup plus restrictif | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | [root@centos8 |
+ | [root@centos8 ~]# cat / | ||
+ | 4096 | ||
</ | </ | ||
- | Vérifiez maintenant que la limite a été appliquée | + | Relancez le script **hello-world.sh** et insérez-le dans le nouveau CGroup |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | 250 | + | [1] 35389 |
- | [root@centos7 | + | |
- | MainPID=27233 | + | [root@centos8 |
- | [root@centos7 | + | [Entrée] |
- | 4: | + | |
- | 1: | + | [root@centos8 |
</ | </ | ||
- | Créez maintenant le service | + | Attendez la prochaine sortie de **hello world** sur le canal standard puis constatez que le script s' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 ~]# cat / | + | [Entrée] |
- | [Unit] | + | [1]+ Killed |
- | Description=The bar service that does nothing useful | + | </ |
- | After=remote-fs.target nss-lookup.target | + | |
- | [Service] | + | ===La Commande cgcreate=== |
- | ExecStart=/ | + | |
- | ExecStop=/bin/kill -WINCH ${MAINPID} | + | |
- | [Install] | + | Cette commande permet la création d'un CGroup : |
- | WantedBy=multi-user.target | + | |
+ | < | ||
+ | [root@centos8 ~]# cgcreate -g memory: | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.clone_children | ||
+ | --w--w----. 1 root root 0 Jul 13 10:39 cgroup.event_control | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.procs | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.failcnt | ||
+ | --w--w----. 1 root root 0 Jul 13 10:39 memory.force_empty | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.slabinfo | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.max_usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.memsw.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.move_charge_at_immigrate | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.numa_stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.oom_control | ||
+ | ----------. 1 root root 0 Jul 13 10:39 memory.pressure_level | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.soft_limit_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.swappiness | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.use_hierarchy | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 notify_on_release | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 tasks | ||
</ | </ | ||
- | Fixez maintenant la limite | + | Il n' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Failed to set unit properties on bar.service: | + | |
- | [root@centos7 ~]# systemctl start bar.service | + | |
- | [root@centos7 ~]# systemctl enable bar.service | + | |
- | Created symlink from /etc/systemd/system/multi-user.target.wants/bar.service to /etc/ | + | |
- | [root@centos7 ~]# systemctl set-property bar.service CPUShares=2000 | + | |
</ | </ | ||
- | Appliquez | + | ==La Commande cgexec== |
+ | |||
+ | Cette commande permet d' | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 ~]# systemctl restart bar.service | + | [1] 37670 |
- | [root@centos7 ~]# systemctl status bar.service | + | |
- | ● bar.service - The bar service that does nothing useful | + | |
- | | + | |
- | Drop-In: | + | |
- | | + | |
- | Active: active (running) since Wed 2016-06-15 13:37:54 CEST; 9s ago | + | |
- | Main PID: 29515 (md5sum) | + | |
- | | + | |
- | | + | |
- | Jun 15 13:37:54 centos7.fenestros.loc systemd[1]: Started The bar service that does nothing useful. | + | [root@centos8 ~]# hello world |
- | Jun 15 13:37:54 centos7.fenestros.loc systemd[1]: Starting The bar service that does nothing useful... | + | [Entrée] |
+ | |||
+ | [root@centos8 ~]# | ||
</ | </ | ||
- | Re-démarrer les services foo et bar : | + | ==La Commande cgdelete== |
+ | |||
+ | Une fois le script terminé, cette commande permet de supprimer le cgroup | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 ~]# systemctl status foo.service | + | root 37670 0.0 0.0 12724 3112 pts/1 S 10:41 |
- | ● foo.service - The foo service that does nothing useful | + | root |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Main PID: 652 (sha1sum) | + | |
- | | + | |
- | | + | |
- | Jun 15 13:50:08 centos7.fenestros.loc systemd[1]: Started The foo service that does nothing useful. | + | [root@centos8 |
- | Jun 15 13:50:08 centos7.fenestros.loc systemd[1]: Starting The foo service that does nothing useful... | + | |
- | [root@centos7 ~]# systemctl restart bar.service | + | |
- | [root@centos7 | + | |
- | ● bar.service - The bar service that does nothing useful | + | |
- | | + | |
- | Drop-In: / | + | |
- | | + | |
- | | + | |
- | Main PID: 810 (md5sum) | + | |
- | | + | |
- | | + | |
- | Jun 15 13:50:38 centos7.fenestros.loc systemd[1]: Started The bar service that does nothing useful. | + | root@centos8 ~]# ps aux | grep *.sh |
- | Jun 15 13:50:38 centos7.fenestros.loc systemd[1]: Starting The bar service that does nothing useful... | + | root |
+ | [1]+ Terminated | ||
+ | |||
+ | [root@centos8 ~]# cgdelete memory:helloworld2 | ||
+ | |||
+ | [root@centos8 ~]# ls -l / | ||
+ | ls: cannot access '/ | ||
</ | </ | ||
- | Utilisez ps pour voir le pourcentage | + | ==Le Fichier / |
+ | |||
+ | Afin de les rendre persistants, | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# vi / | ||
+ | [root@centos8 ~]# cat / | ||
+ | # | ||
+ | # Copyright IBM Corporation. 2007 | ||
+ | # | ||
+ | # Authors: | ||
+ | # This program is free software; you can redistribute it and/or modify it | ||
+ | # under the terms of version 2.1 of the GNU Lesser General Public License | ||
+ | # as published by the Free Software Foundation. | ||
+ | # | ||
+ | # This program is distributed in the hope that it would be useful, but | ||
+ | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | # | ||
+ | # | ||
+ | # By default, we expect systemd mounts everything on boot, | ||
+ | # so there is not much to do. | ||
+ | # See man cgconfig.conf for further details, how to create groups | ||
+ | # on system boot using this file. | ||
+ | group helloworld2 { | ||
+ | cpu { | ||
+ | cpu.shares = 100; | ||
+ | } | ||
+ | memory { | ||
+ | memory.limit_in_bytes = 40000; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** - Notez la création de **deux** limitations, | ||
+ | </ | ||
+ | |||
+ | Créez donc les deux CGroups concernés : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cgcreate -g memory: | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.clone_children | ||
+ | --w--w----. 1 root root 0 Jul 13 10:46 cgroup.event_control | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.procs | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.failcnt | ||
+ | --w--w----. 1 root root 0 Jul 13 10:46 memory.force_empty | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.slabinfo | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.max_usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.memsw.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.move_charge_at_immigrate | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.numa_stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.oom_control | ||
+ | ----------. 1 root root 0 Jul 13 10:46 memory.pressure_level | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.soft_limit_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.swappiness | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.use_hierarchy | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 notify_on_release | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 tasks | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cgcreate -g cpu: | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.clone_children | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.procs | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpuacct.usage | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_all | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_sys | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_user | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_sys | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_user | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_period_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_quota_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_period_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_runtime_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.shares | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpu.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 notify_on_release | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 tasks | ||
+ | </ | ||
+ | |||
+ | ==La Commande cgconfigparser== | ||
+ | |||
+ | Appliquez le contenu du fichier **/ | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | PID COMMAND | + | [root@centos8 ~]# cat / |
- | 652 sha1sum | + | 36864 |
- | 810 md5sum | + | [root@centos8 ~]# cat / |
+ | 100 | ||
</ | </ | ||
----- | ----- | ||
- | < | + | Copyright © 2022 Hugh Norris. |
- | <div align=" | + | |
- | Copyright © 2021 Hugh Norris. | + | |
- | </ | + |