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:lpic:21:450:l101 [2022/10/03 05:16] – admin | elearning:workbooks:lpic:21:450:l101 [2022/11/01 07:25] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Updated: ~~LASTMOD~~ | Updated: ~~LASTMOD~~ | ||
- | ======Topic | + | ======Topic |
- | =====Contents===== | + | * **Topic 200: Capacity Planning** |
+ | * Présentation des Fichiers Spéciaux | ||
+ | * LAB #1 - Commandes | ||
+ | * 1.1 - La Commande lspci | ||
+ | * 1.2 - La Commande lsusb | ||
+ | * 1.3 - La Commande lsblk | ||
+ | * 1.4 - La Commande dmidecode | ||
+ | * LAB #2 - La Commande sysctl | ||
+ | * 2.1 - Répertoire /proc | ||
+ | * Fichiers | ||
+ | * Processeur | ||
+ | * Interruptions système | ||
+ | * Canaux DMA | ||
+ | * Plages d' | ||
+ | * Périphériques | ||
+ | * Modules | ||
+ | * Statistiques de l' | ||
+ | * Partitions | ||
+ | * Espaces de pagination | ||
+ | * Statistiques d' | ||
+ | * Statistiques d' | ||
+ | * Version du noyau | ||
+ | * Répertoires | ||
+ | * ide/scsi | ||
+ | * acpi | ||
+ | * bus | ||
+ | * net | ||
+ | * sys | ||
+ | * 2.2 - Utilisation de la Commande sysctl | ||
+ | * LAB #3 - Interprétation des informations dans /proc | ||
+ | * 3.1 - free | ||
+ | * 3.2 - uptime ou w | ||
+ | * 3.3 - iostat | ||
+ | * 3.4 - hdparm | ||
+ | * 3.5 - vmstat | ||
+ | * 3.6 - mpstat | ||
+ | * 3.7 - sar | ||
+ | * 3.8 - collectd | ||
+ | * Modules usb | ||
+ | * udev | ||
+ | * La Commande udevadm | ||
+ | * Système de fichiers /sys | ||
+ | * LAB #4 - Processus et fichiers ouverts | ||
+ | * Les Types de Processus | ||
+ | * 4.1 - La Commande ps | ||
+ | * 4.2 - La Commande pstree | ||
+ | * 4.3 - La Commande top | ||
+ | * 4.4 - La Commande lsof | ||
+ | * LAB # 5 - Mesurer l' | ||
+ | * 5.1 - La Commande netstat | ||
- | * **Topic 1 - Capacity Planning** | + | =====Présentation des Fichiers Spéciaux===== |
- | * Contents | + | |
- | * LAB #1 - Measuring System Resource Usage | + | |
- | * 1.1 - free | + | |
- | * 1.2 - iostat | + | |
- | * 1.3 - hdparm | + | |
- | * 1.4 - vmstat | + | |
- | * 1.5 - mpstat | + | |
- | * 1.6 - sar | + | |
- | * LAB #2 - Viewing Open Files and Running Processes | + | |
- | * 2.1 - Presentation | + | |
- | * 2.2 - Process Types | + | |
- | * 2.3 - Process Commands | + | |
- | * The ps Command | + | |
- | * The pstree Command | + | |
- | * The top Command | + | |
- | * The lsof Command | + | |
- | * LAB # 3 - Measuring Network Usage and System Availability | + | |
- | * 3.1 - The netstat Command | + | |
- | * 3.2 - The w Command | + | |
- | * 3.3 - The uptime Command | + | |
- | =====LAB#1 - Interpreting Information in /proc===== | + | Dans l' |
- | The information | + | <WRAP center round important 60%> |
+ | **Important** : Les périphériques qui nécessitent à ce que l' | ||
+ | </ | ||
+ | |||
+ | Consultez le contenu du répertoire /dev : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | total 0 | ||
+ | crw-r--r-- | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | crw-rw---- | ||
+ | drwxr-xr-x | ||
+ | lrwxrwxrwx | ||
+ | drwxr-xr-x | ||
+ | crw--w---- | ||
+ | lrwxrwxrwx | ||
+ | crw------- | ||
+ | crw------- | ||
+ | drwxr-xr-x | ||
+ | brw-rw---- | ||
+ | brw-rw---- | ||
+ | brw-rw---- | ||
+ | drwxr-xr-x | ||
+ | lrwxrwxrx | ||
+ | crw------- | ||
+ | crw-rw---- | ||
+ | lrwxrwxrwx | ||
+ | crw-rw-rw- | ||
+ | crw-rw-rw- | ||
+ | crw------- | ||
+ | crw------- | ||
+ | drwxr-xr-x | ||
+ | lrwxrwxrwx | ||
+ | drwxr-xr-x | ||
+ | crw-r--r-- | ||
+ | lrwxrwxrwx | ||
+ | crw-rw---- | ||
+ | drwxr-xr-x | ||
+ | crw-r----- | ||
+ | drwxrwxrwt | ||
+ | drwxr-xr-x | ||
+ | crw-rw-rw- | ||
+ | crw------- | ||
+ | crw-r----- | ||
+ | crw------- | ||
+ | crw------- | ||
+ | crw-rw-rw- | ||
+ | drwxr-xr-x | ||
+ | crw-rw-rw- | ||
+ | crw-rw-r-- | ||
+ | lrwxrwxrwx | ||
+ | crw------- | ||
+ | --More-- | ||
+ | [q] | ||
+ | </ | ||
+ | |||
+ | On peut noter dans la sortie de la commande que certains fichiers sont de type **bloc** (**b**), tandis que d' | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | brw-rw---- | ||
+ | ... | ||
+ | crw--w---- | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | La différence entre les deux repose sur le type de communication entre le système et le module. Dans le premier cas le système accède au périphérique par des coordonnées du bloc de données sur le support tandis que dans le deuxième cas la communication d' | ||
+ | |||
+ | Les deux informations clefs du fichier spécial sont situées à la place de la taille d'un fichier normal et se nomment le **majeur** et le **mineur** : | ||
+ | |||
+ | * le **majeur** identifie le pilote du périphérique et donc son contrôleur, | ||
+ | * le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque. | ||
+ | |||
+ | =====LAB #1 - Commandes===== | ||
+ | |||
+ | ====1.1 - La Commande lspci==== | ||
+ | |||
+ | Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 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.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/ | ||
+ | 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/ | ||
+ | 00:01.3 Bridge: Intel Corporation 82371AB/ | ||
+ | 00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) | ||
+ | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | ||
+ | 00:05.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI | ||
+ | 00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device | ||
+ | 00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge | ||
+ | 00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge | ||
+ | </ | ||
+ | |||
+ | Pour obtenir de l'information | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | ||
+ | Subsystem: Red Hat, Inc. Virtio memory balloon | ||
+ | Physical Slot: 3 | ||
+ | Flags: bus master, fast devsel, latency 0, IRQ 10 | ||
+ | I/O ports at e000 [size=64] | ||
+ | Memory at fe400000 (64-bit, prefetchable) [size=16K] | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Kernel driver | ||
+ | Kernel modules: virtio_pci | ||
+ | </ | ||
+ | |||
+ | ou : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | ||
+ | Subsystem: Red Hat, Inc. Virtio memory balloon | ||
+ | Physical Slot: 3 | ||
+ | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- | ||
+ | Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- | ||
+ | Latency: 0 | ||
+ | Interrupt: pin A routed to IRQ 10 | ||
+ | Region 0: I/O ports at e000 [size=64] | ||
+ | Region 4: Memory at fe400000 (64-bit, prefetchable) [size=16K] | ||
+ | Capabilities: | ||
+ | BAR=0 offset=00000000 size=00000000 | ||
+ | Capabilities: | ||
+ | BAR=4 offset=00003000 size=00001000 multiplier=00000004 | ||
+ | Capabilities: | ||
+ | BAR=4 offset=00002000 size=00001000 | ||
+ | Capabilities: | ||
+ | BAR=4 offset=00001000 size=00001000 | ||
+ | Capabilities: | ||
+ | BAR=4 offset=00000000 size=00001000 | ||
+ | Kernel driver | ||
+ | Kernel modules: virtio_pci | ||
+ | </ | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | lspci: invalid option -- ' | ||
+ | Usage: lspci [< | ||
+ | |||
+ | Basic display modes: | ||
+ | -mm | ||
+ | -t Show bus tree | ||
+ | |||
+ | Display options: | ||
+ | -v Be verbose (-vv or -vvv for higher verbosity) | ||
+ | -k Show kernel drivers handling each device | ||
+ | -x Show hex-dump of the standard part of the config space | ||
+ | -xxx Show hex-dump of the whole config space (dangerous; root only) | ||
+ | -xxxx Show hex-dump of the 4096-byte extended config space (root only) | ||
+ | -b Bus-centric view (addresses and IRQ's as seen by the bus) | ||
+ | -D Always show domain numbers | ||
+ | -P Display bridge path in addition to bus and device number | ||
+ | -PP | ||
+ | |||
+ | Resolving of device ID's to names: | ||
+ | -n Show numeric ID's | ||
+ | -nn Show both textual and numeric ID's (names & numbers) | ||
+ | -q Query the PCI ID database for unknown ID's via DNS | ||
+ | -qq As above, but re-query locally cached entries | ||
+ | -Q Query the PCI ID database for all ID's via DNS | ||
+ | |||
+ | Selection of devices: | ||
+ | -s [[[[< | ||
+ | -d [< | ||
+ | |||
+ | Other options: | ||
+ | -i < | ||
+ | -p < | ||
+ | -M Enable `bus mapping' | ||
+ | |||
+ | PCI access options: | ||
+ | -A < | ||
+ | -O < | ||
+ | -G Enable PCI access debugging | ||
+ | -H < | ||
+ | -F < | ||
+ | </ | ||
+ | |||
+ | ====1.2 - La Commande lsusb==== | ||
+ | |||
+ | Cette commande vous renseigne sur les adaptateurs reliés au bus usb : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet | ||
+ | Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | ||
+ | |||
+ | root@debian11: | ||
+ | /: Bus 01.Port 1: Dev 1, Class=root_hub, | ||
+ | ID 1d6b:0001 Linux Foundation 1.1 root hub | ||
+ | |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, | ||
+ | ID 0627:0001 Adomax Technology Co., Ltd | ||
+ | </ | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Usage: lsusb [options]... | ||
+ | List USB devices | ||
+ | -v, --verbose | ||
+ | Increase verbosity (show descriptors) | ||
+ | -s [[bus]: | ||
+ | Show only devices with specified device and/or | ||
+ | bus numbers (in decimal) | ||
+ | -d vendor: | ||
+ | Show only devices with the specified vendor and | ||
+ | product ID numbers (in hexadecimal) | ||
+ | -D device | ||
+ | Selects which device lsusb will examine | ||
+ | -t, --tree | ||
+ | Dump the physical USB device hierarchy as a tree | ||
+ | -V, --version | ||
+ | Show version of program | ||
+ | -h, --help | ||
+ | Show usage and help | ||
+ | </ | ||
+ | |||
+ | ====1.3 - La Commande lsblk==== | ||
+ | |||
+ | Cette commande vous renseigne sur les périphériques de type bloc : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | ||
+ | sda | ||
+ | ├─sda1 | ||
+ | ├─sda2 | ||
+ | └─sda5 | ||
+ | sdb | ||
+ | sdc | ||
+ | ├─sdc1 | ||
+ | ├─sdc2 | ||
+ | ├─sdc3 | ||
+ | ├─sdc4 | ||
+ | ├─sdc5 | ||
+ | ├─sdc6 | ||
+ | │ └─vg0-lv1 254:0 0 104M 0 lvm | ||
+ | ├─sdc7 | ||
+ | │ └─vg0-lv2 254:1 0 112M 0 lvm | ||
+ | ├─sdc8 | ||
+ | │ └─md1 | ||
+ | ├─sdc9 | ||
+ | │ └─vg0-lv2 254:1 0 112M 0 lvm | ||
+ | ├─sdc10 | ||
+ | │ └─md1 | ||
+ | ├─sdc11 | ||
+ | │ └─md1 | ||
+ | └─sdc12 | ||
+ | sr0 11:0 1 378M 0 rom | ||
+ | </ | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | Usage: | ||
+ | lsblk [options] [< | ||
+ | |||
+ | List information about block devices. | ||
+ | |||
+ | Options: | ||
+ | -D, --discard | ||
+ | -E, --dedup < | ||
+ | -I, --include < | ||
+ | -J, --json | ||
+ | -O, --output-all | ||
+ | -P, --pairs | ||
+ | -S, --scsi | ||
+ | -T, --tree[=< | ||
+ | -a, --all print all devices | ||
+ | -b, --bytes | ||
+ | -d, --nodeps | ||
+ | -e, --exclude < | ||
+ | -f, --fs | ||
+ | -i, --ascii | ||
+ | -l, --list | ||
+ | -M, --merge | ||
+ | -m, --perms | ||
+ | -n, --noheadings | ||
+ | -o, --output < | ||
+ | -p, --paths | ||
+ | -r, --raw use raw output format | ||
+ | -s, --inverse | ||
+ | -t, --topology | ||
+ | -z, --zoned | ||
+ | -x, --sort < | ||
+ | | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | Available output columns: | ||
+ | NAME device name | ||
+ | | ||
+ | PATH path to the device node | ||
+ | | ||
+ | | ||
+ | FSSIZE | ||
+ | FSTYPE | ||
+ | FSUSED | ||
+ | FSUSE% | ||
+ | | ||
+ | MOUNTPOINT | ||
+ | | ||
+ | UUID filesystem UUID | ||
+ | PTUUID | ||
+ | PTTYPE | ||
+ | PARTTYPE | ||
+ | | ||
+ | | ||
+ | PARTUUID | ||
+ | | ||
+ | RA read-ahead of the device | ||
+ | RO read-only device | ||
+ | RM removable device | ||
+ | | ||
+ | | ||
+ | SERIAL | ||
+ | SIZE size of the device | ||
+ | | ||
+ | | ||
+ | | ||
+ | MODE device node permissions | ||
+ | | ||
+ | MIN-IO | ||
+ | OPT-IO | ||
+ | | ||
+ | | ||
+ | ROTA rotational device | ||
+ | | ||
+ | | ||
+ | TYPE device type | ||
+ | DISC-ALN | ||
+ | | ||
+ | DISC-MAX | ||
+ | | ||
+ | | ||
+ | | ||
+ | RAND adds randomness | ||
+ | PKNAME | ||
+ | HCTL Host: | ||
+ | TRAN device transport type | ||
+ | SUBSYSTEMS | ||
+ | | ||
+ | VENDOR | ||
+ | | ||
+ | | ||
+ | |||
+ | For more details see lsblk(8). | ||
+ | </ | ||
+ | |||
+ | ====1.4 - La Commande dmidecode==== | ||
+ | |||
+ | La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface// | ||
+ | |||
+ | * l' | ||
+ | * les extensions possibles. | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | # dmidecode 3.3 | ||
+ | Getting SMBIOS data from sysfs. | ||
+ | SMBIOS 2.8 present. | ||
+ | 10 structures occupying 443 bytes. | ||
+ | Table at 0x000F58C0. | ||
+ | |||
+ | Handle 0x0000, DMI type 0, 24 bytes | ||
+ | BIOS Information | ||
+ | Vendor: SeaBIOS | ||
+ | Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org | ||
+ | Release Date: 04/ | ||
+ | Address: 0xE8000 | ||
+ | Runtime Size: 96 kB | ||
+ | ROM Size: 64 kB | ||
+ | Characteristics: | ||
+ | BIOS characteristics not supported | ||
+ | Targeted content distribution is supported | ||
+ | BIOS Revision: 0.0 | ||
+ | |||
+ | Handle 0x0100, DMI type 1, 27 bytes | ||
+ | System Information | ||
+ | Manufacturer: | ||
+ | Product Name: Standard PC (i440FX + PIIX, 1996) | ||
+ | Version: pc-i440fx-5.2 | ||
+ | Serial Number: Not Specified | ||
+ | UUID: ce816e48-faa4-4cb9-a03e-f0f58040c52b | ||
+ | Wake-up Type: Power Switch | ||
+ | SKU Number: Not Specified | ||
+ | Family: Not Specified | ||
+ | |||
+ | Handle 0x0300, DMI type 3, 22 bytes | ||
+ | Chassis Information | ||
+ | Manufacturer: | ||
+ | Type: Other | ||
+ | Lock: Not Present | ||
+ | Version: pc-i440fx-5.2 | ||
+ | Serial Number: Not Specified | ||
+ | Asset Tag: Not Specified | ||
+ | Boot-up State: Safe | ||
+ | Power Supply State: Safe | ||
+ | Thermal State: Safe | ||
+ | Security Status: Unknown | ||
+ | OEM Information: | ||
+ | Height: Unspecified | ||
+ | Number Of Power Cords: Unspecified | ||
+ | Contained Elements: 0 | ||
+ | SKU Number: Not Specified | ||
+ | |||
+ | Handle 0x0400, DMI type 4, 42 bytes | ||
+ | Processor Information | ||
+ | Socket Designation: | ||
+ | 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: 2 | ||
+ | Core Enabled: 2 | ||
+ | Thread Count: 1 | ||
+ | Characteristics: | ||
+ | |||
+ | Handle 0x1000, DMI type 16, 23 bytes | ||
+ | Physical Memory Array | ||
+ | Location: Other | ||
+ | Use: System Memory | ||
+ | Error Correction Type: Multi-bit ECC | ||
+ | Maximum Capacity: 4 GB | ||
+ | Error Information Handle: Not Provided | ||
+ | Number Of Devices: 1 | ||
+ | |||
+ | Handle 0x1100, DMI type 17, 40 bytes | ||
+ | Memory Device | ||
+ | Array Handle: 0x1000 | ||
+ | Error Information Handle: Not Provided | ||
+ | Total Width: Unknown | ||
+ | Data Width: Unknown | ||
+ | Size: 4 GB | ||
+ | Form Factor: DIMM | ||
+ | Set: None | ||
+ | Locator: DIMM 0 | ||
+ | Bank Locator: Not Specified | ||
+ | Type: RAM | ||
+ | Type Detail: Other | ||
+ | Speed: Unknown | ||
+ | Manufacturer: | ||
+ | Serial Number: Not Specified | ||
+ | Asset Tag: Not Specified | ||
+ | Part Number: Not Specified | ||
+ | Rank: Unknown | ||
+ | Configured Memory Speed: Unknown | ||
+ | Minimum Voltage: Unknown | ||
+ | Maximum Voltage: Unknown | ||
+ | Configured Voltage: Unknown | ||
+ | |||
+ | Handle 0x1300, DMI type 19, 31 bytes | ||
+ | Memory Array Mapped Address | ||
+ | Starting Address: 0x00000000000 | ||
+ | Ending Address: 0x000BFFFFFFF | ||
+ | Range Size: 3 GB | ||
+ | Physical Array Handle: 0x1000 | ||
+ | Partition Width: 1 | ||
+ | |||
+ | Handle 0x1301, DMI type 19, 31 bytes | ||
+ | Memory Array Mapped Address | ||
+ | Starting Address: 0x00100000000 | ||
+ | Ending Address: 0x0013FFFFFFF | ||
+ | Range Size: 1 GB | ||
+ | Physical Array Handle: 0x1000 | ||
+ | Partition Width: 1 | ||
+ | |||
+ | Handle 0x2000, DMI type 32, 11 bytes | ||
+ | System Boot Information | ||
+ | Status: No errors detected | ||
+ | |||
+ | Handle 0x7F00, DMI type 127, 4 bytes | ||
+ | End Of Table | ||
+ | </ | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Usage: dmidecode [OPTIONS] | ||
+ | Options are: | ||
+ | -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) | ||
+ | -h, --help | ||
+ | -q, --quiet | ||
+ | -s, --string KEYWORD | ||
+ | -t, --type TYPE Only display the entries of given type | ||
+ | -H, --handle HANDLE | ||
+ | -u, --dump | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -V, --version | ||
+ | </ | ||
+ | |||
+ | =====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. | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 1 128 24 | ||
+ | 10 | ||
+ | 11 | ||
+ | 116 16 | ||
+ | 119 17 | ||
+ | 12 | ||
+ | 120 177 29 | ||
+ | 121 18 | ||
+ | 122 2 30 | ||
+ | 123 20 | ||
+ | 126 214 32 | ||
+ | 127 23 | ||
+ | </ | ||
+ | |||
+ | ===Fichiers=== | ||
+ | |||
+ | ==Processeur== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 2399.982 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 0 | ||
+ | cpu cores : 2 | ||
+ | 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: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 2399.982 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 1 | ||
+ | cpu cores : 2 | ||
+ | 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: | ||
+ | </ | ||
+ | |||
+ | ==Interruptions système== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | | ||
+ | 0: | ||
+ | 1: 0 9 | ||
+ | 6: 0 3 | ||
+ | 8: 1 0 | ||
+ | 9: 0 0 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | NMI: 0 0 | ||
+ | LOC: 1701175 | ||
+ | SPU: 0 0 | ||
+ | PMI: 0 0 | ||
+ | IWI: 1 0 IRQ work interrupts | ||
+ | RTR: 0 0 APIC ICR read retries | ||
+ | RES: | ||
+ | CAL: 47419 21994 | ||
+ | TLB: 23047 13223 TLB shootdowns | ||
+ | TRM: 0 0 | ||
+ | THR: 0 0 | ||
+ | DFR: 0 0 | ||
+ | MCE: 0 0 | ||
+ | MCP: | ||
+ | ERR: 0 | ||
+ | MIS: 0 | ||
+ | PIN: 0 0 | ||
+ | NPI: 0 0 | ||
+ | PIW: 0 0 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : Un pilote de périphérique demande au processeur de fournir un service en utilisant un IRQ. Quand la demande est faite, le processeur interrompe ses activités et passe le contrôle au pilote identifié par l'IRQ. Techniquement l' | ||
+ | </ | ||
+ | |||
+ | ==Canaux DMA== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 2: floppy | ||
+ | 4: cascade | ||
+ | </ | ||
+ | |||
+ | ==Plages d' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 0000-0cf7 : PCI Bus 0000:00 | ||
+ | 0000-001f : dma1 | ||
+ | 0020-0021 : pic1 | ||
+ | 0040-0043 : timer0 | ||
+ | 0050-0053 : timer1 | ||
+ | 0060-0060 : keyboard | ||
+ | 0064-0064 : keyboard | ||
+ | 0070-0077 : rtc0 | ||
+ | 0080-008f : dma page reg | ||
+ | 00a0-00a1 : pic2 | ||
+ | 00c0-00df : dma2 | ||
+ | 00f0-00ff : fpu | ||
+ | 0170-0177 : 0000: | ||
+ | 0170-0177 : ata_piix | ||
+ | 01f0-01f7 : 0000: | ||
+ | 01f0-01f7 : ata_piix | ||
+ | 0376-0376 : 0000: | ||
+ | 0376-0376 : ata_piix | ||
+ | 03c0-03df : vga+ | ||
+ | 03f2-03f2 : floppy | ||
+ | 03f4-03f5 : floppy | ||
+ | 03f6-03f6 : 0000: | ||
+ | 03f6-03f6 : ata_piix | ||
+ | 03f7-03f7 : floppy | ||
+ | 0510-051b : QEMU0002: | ||
+ | 0510-051b : fw_cfg_io | ||
+ | 0600-063f : 0000: | ||
+ | 0600-0603 : ACPI PM1a_EVT_BLK | ||
+ | 0604-0605 : ACPI PM1a_CNT_BLK | ||
+ | 0608-060b : ACPI PM_TMR | ||
+ | 0700-070f : 0000: | ||
+ | 0700-0708 : piix4_smbus | ||
+ | 0cf8-0cff : PCI conf1 | ||
+ | 0d00-ffff : PCI Bus 0000:00 | ||
+ | afe0-afe3 : ACPI GPE0_BLK | ||
+ | c000-cfff : PCI Bus 0000:02 | ||
+ | d000-dfff : PCI Bus 0000:01 | ||
+ | e000-e03f : 0000: | ||
+ | e040-e07f : 0000: | ||
+ | e080-e09f : 0000: | ||
+ | e080-e09f : uhci_hcd | ||
+ | e0a0-e0bf : 0000: | ||
+ | e0c0-e0cf : 0000: | ||
+ | e0c0-e0cf : ata_piix | ||
+ | </ | ||
+ | |||
+ | <WRAP center round alert 60% > | ||
+ | **Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. | ||
+ | </ | ||
+ | |||
+ | ==Périphériques== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Character devices: | ||
+ | 1 mem | ||
+ | 4 /dev/vc/0 | ||
+ | 4 tty | ||
+ | 4 ttyS | ||
+ | 5 /dev/tty | ||
+ | 5 / | ||
+ | 5 /dev/ptmx | ||
+ | 6 lp | ||
+ | 7 vcs | ||
+ | 10 misc | ||
+ | 13 input | ||
+ | 21 sg | ||
+ | 29 fb | ||
+ | 99 ppdev | ||
+ | 128 ptm | ||
+ | 136 pts | ||
+ | 153 spi | ||
+ | 180 usb | ||
+ | 189 usb_device | ||
+ | 226 drm | ||
+ | 248 hidraw | ||
+ | 249 aux | ||
+ | 250 cec | ||
+ | 251 bsg | ||
+ | 252 rtc | ||
+ | 253 dax | ||
+ | 254 gpiochip | ||
+ | |||
+ | Block devices: | ||
+ | 2 fd | ||
+ | 8 sd | ||
+ | 9 md | ||
+ | 11 sr | ||
+ | 65 sd | ||
+ | 66 sd | ||
+ | 67 sd | ||
+ | 68 sd | ||
+ | 69 sd | ||
+ | 70 sd | ||
+ | 71 sd | ||
+ | 128 sd | ||
+ | 129 sd | ||
+ | 130 sd | ||
+ | 131 sd | ||
+ | 132 sd | ||
+ | 133 sd | ||
+ | 134 sd | ||
+ | 135 sd | ||
+ | 253 mdp | ||
+ | 254 device-mapper | ||
+ | 259 blkext | ||
+ | </ | ||
+ | |||
+ | ==Modules== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | ufs 94208 0 - Live 0xffffffffc0cde000 | ||
+ | qnx4 16384 0 - Live 0xffffffffc07a3000 | ||
+ | hfsplus 126976 0 - Live 0xffffffffc0d2b000 | ||
+ | hfs 73728 0 - Live 0xffffffffc0cc4000 | ||
+ | minix 45056 0 - Live 0xffffffffc0cb8000 | ||
+ | vfat 20480 0 - Live 0xffffffffc0cb2000 | ||
+ | msdos 20480 0 - Live 0xffffffffc0cac000 | ||
+ | fat 86016 2 vfat,msdos, Live 0xffffffffc0c8f000 | ||
+ | jfs 212992 0 - Live 0xffffffffc0cf6000 | ||
+ | xfs 1773568 0 - Live 0xffffffffc0add000 | ||
+ | xts 16384 1 - Live 0xffffffffc0ad2000 | ||
+ | dm_crypt 53248 1 - Live 0xffffffffc0ac4000 | ||
+ | cbc 16384 0 - Live 0xffffffffc0abf000 | ||
+ | aes_generic 36864 3 - Live 0xffffffffc0ab5000 | ||
+ | libaes 16384 1 aes_generic, | ||
+ | crypto_simd 16384 0 - Live 0xffffffffc0aab000 | ||
+ | cryptd 24576 1 crypto_simd, | ||
+ | glue_helper 16384 0 - Live 0xffffffffc08dd000 | ||
+ | ecb 16384 2 - Live 0xffffffffc0883000 | ||
+ | ecryptfs 122880 0 - Live 0xffffffffc0a80000 | ||
+ | btrfs 1568768 0 - Live 0xffffffffc0900000 | ||
+ | blake2b_generic 20480 0 - Live 0xffffffffc087d000 | ||
+ | raid1 53248 0 - Live 0xffffffffc08f2000 | ||
+ | dm_raid 45056 0 - Live 0xffffffffc08e6000 | ||
+ | raid456 180224 1 dm_raid, Live 0xffffffffc08b0000 | ||
+ | async_raid6_recov 24576 1 raid456, Live 0xffffffffc08a7000 | ||
+ | async_memcpy 20480 2 raid456, | ||
+ | async_pq 20480 2 raid456, | ||
+ | async_xor 20480 3 raid456, | ||
+ | async_tx 20480 5 raid456, | ||
+ | md_mod 180224 3 raid1, | ||
+ | xor 24576 2 btrfs, | ||
+ | raid6_pq 122880 4 btrfs, | ||
+ | libcrc32c 16384 3 xfs, | ||
+ | dm_snapshot 53248 0 - Live 0xffffffffc07b9000 | ||
+ | dm_bufio 36864 1 dm_snapshot, | ||
+ | dm_mod 163840 10 dm_crypt, | ||
+ | rfkill 28672 0 - Live 0xffffffffc07cb000 | ||
+ | joydev 28672 0 - Live 0xffffffffc0725000 | ||
+ | evdev 28672 2 - Live 0xffffffffc071d000 | ||
+ | virtio_balloon 24576 0 - Live 0xffffffffc06f7000 | ||
+ | sg 36864 0 - Live 0xffffffffc06cc000 | ||
+ | serio_raw 20480 0 - Live 0xffffffffc06ba000 | ||
+ | pcspkr 16384 0 - Live 0xffffffffc06b0000 | ||
+ | qemu_fw_cfg 20480 0 - Live 0xffffffffc06aa000 | ||
+ | parport_pc 40960 0 - Live 0xffffffffc0679000 | ||
+ | ppdev 24576 0 - Live 0xffffffffc0664000 | ||
+ | lp 20480 0 - Live 0xffffffffc066b000 | ||
+ | parport 69632 3 parport_pc, | ||
+ | fuse 167936 1 - Live 0xffffffffc0628000 | ||
+ | --More-- | ||
+ | [q] | ||
+ | </ | ||
+ | |||
+ | ==Statistiques de l' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 11 0 sr0 77 0 4235 23 0 0 0 0 0 68 23 0 0 0 0 0 0 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==Partitions== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | major minor # | ||
+ | |||
+ | 11 0 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==Espaces de pagination== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Filename | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ==Statistiques d' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 0.00 0.00 0.00 1/292 57813 | ||
+ | </ | ||
+ | |||
+ | ==Statistiques d' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | MemTotal: | ||
+ | MemFree: | ||
+ | MemAvailable: | ||
+ | Buffers: | ||
+ | Cached: | ||
+ | SwapCached: | ||
+ | Active: | ||
+ | Inactive: | ||
+ | Active(anon): | ||
+ | Inactive(anon): | ||
+ | Active(file): | ||
+ | Inactive(file): | ||
+ | Unevictable: | ||
+ | Mlocked: | ||
+ | SwapTotal: | ||
+ | SwapFree: | ||
+ | Dirty: | ||
+ | Writeback: | ||
+ | AnonPages: | ||
+ | Mapped: | ||
+ | Shmem: | ||
+ | KReclaimable: | ||
+ | Slab: | ||
+ | SReclaimable: | ||
+ | SUnreclaim: | ||
+ | KernelStack: | ||
+ | PageTables: | ||
+ | NFS_Unstable: | ||
+ | Bounce: | ||
+ | WritebackTmp: | ||
+ | CommitLimit: | ||
+ | Committed_AS: | ||
+ | VmallocTotal: | ||
+ | VmallocUsed: | ||
+ | VmallocChunk: | ||
+ | Percpu: | ||
+ | HardwareCorrupted: | ||
+ | AnonHugePages: | ||
+ | ShmemHugePages: | ||
+ | ShmemPmdMapped: | ||
+ | FileHugePages: | ||
+ | FilePmdMapped: | ||
+ | HugePages_Total: | ||
+ | HugePages_Free: | ||
+ | HugePages_Rsvd: | ||
+ | HugePages_Surp: | ||
+ | Hugepagesize: | ||
+ | Hugetlb: | ||
+ | DirectMap4k: | ||
+ | DirectMap2M: | ||
+ | </ | ||
+ | |||
+ | ==Version du noyau== | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Linux version 5.10.0-13-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.106-1 (2022-03-17) | ||
+ | </ | ||
+ | |||
+ | ===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@debian11: | ||
+ | # | ||
+ | # / | ||
+ | # See / | ||
+ | # See sysctl.conf (5) for information. | ||
+ | # | ||
+ | |||
+ | # | ||
+ | |||
+ | # Uncomment | ||
+ | # | ||
+ | |||
+ | ################################################################### | ||
+ | # Functions previously found in netbase | ||
+ | # | ||
+ | |||
+ | # Uncomment the next two lines to enable Spoof protection (reverse-path filter) | ||
+ | # Turn on Source Address Verification in all interfaces to | ||
+ | # prevent some spoofing attacks | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Uncomment the next line to enable TCP/IP SYN cookies | ||
+ | # See http:// | ||
+ | # Note: This may impact IPv6 TCP sessions too | ||
+ | # | ||
+ | |||
+ | # Uncomment the next line to enable packet forwarding for IPv4 | ||
+ | # | ||
+ | |||
+ | # Uncomment the next line to enable packet forwarding for IPv6 | ||
+ | # Enabling this option disables Stateless Address Autoconfiguration | ||
+ | # based on Router Advertisements for this host | ||
+ | # | ||
+ | |||
+ | |||
+ | ################################################################### | ||
+ | # Additional settings - these settings can improve the network | ||
+ | # security of the host and prevent against some network attacks | ||
+ | # including spoofing attacks and man in the middle attacks through | ||
+ | # redirection. Some network environments, | ||
+ | # settings are disabled so review and enable them as needed. | ||
+ | # | ||
+ | # Do not accept ICMP redirects (prevent MITM attacks) | ||
+ | # | ||
+ | # | ||
+ | # _or_ | ||
+ | # Accept ICMP redirects only for gateways listed in our default | ||
+ | # gateway list (enabled by default) | ||
+ | # net.ipv4.conf.all.secure_redirects = 1 | ||
+ | # | ||
+ | # Do not send ICMP redirects (we are not a router) | ||
+ | # | ||
+ | # | ||
+ | # Do not accept IP source route packets (we are not a router) | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Log Martian Packets | ||
+ | # | ||
+ | # | ||
+ | |||
+ | ################################################################### | ||
+ | # Magic system request Key | ||
+ | # 0=disable, 1=enable all, >1 bitmask of sysrq functions | ||
+ | # See https:// | ||
+ | # for what other values do | ||
+ | # | ||
+ | |||
+ | root@debian11: | ||
+ | total 4 | ||
+ | lrwxrwxrwx 1 root root 14 Mar 20 20:55 99-sysctl.conf -> ../ | ||
+ | -rw-r--r-- 1 root root 639 Apr 6 2021 README.sysctl | ||
+ | </ | ||
+ | |||
+ | Les options de la commande **sysctl** sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | 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). | ||
+ | </ | ||
+ | |||
+ | =====LAB#3 - Interprétation des informations dans / | ||
+ | |||
+ | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | ||
* free, | * free, | ||
* uptime et w, | * uptime et w, | ||
* iostat, | * iostat, | ||
- | * hdparm | + | * hdparm, |
* vmstat, | * vmstat, | ||
* mpstat, | * mpstat, | ||
- | * sar. | + | * sar, |
+ | * collectd. | ||
- | ====1.1 - The free Command==== | + | ====3.1 - La Commande |
- | The **free** | + | La commande |
< | < | ||
- | [root@centos8 | + | root@debian11:~# free -m |
- | total used free shared | + | |
- | Mem: 3735 1135 1818 14 | + | Mem: |
- | Swap: | + | Swap: |
</ | </ | ||
- | In the above example, you can see: | + | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre |
- | * 3735 MB of total physical memory, | + | * 3931 Mo de mémoire physique totale, |
- | * 1135 MB of used physical memory and 1818 MB of free physical memory, | + | * 147 Mo de mémoire physique utilisée et 2543 Mo de mémoire physique libre, |
- | * 3279 MB of swap space with 0MB being used. | + | * 974 Mo de mémoire |
- | The command line switches of this command are: | + | Les options de cette commande sont : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# free --help |
Usage: | Usage: | ||
Ligne 94: | Ligne 1237: | ||
</ | </ | ||
- | ====1.2 - The uptime | + | ====3.2 - Les Commandes |
- | Each of these commands show the load average over the past 1, 5 and 15 minutes: | + | Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis |
< | < | ||
- | [root@centos8 | + | root@debian11:~# uptime |
- | 04:39:03 up 1 day, 2:34, 1 user, load average: 0.00, 0.00, 0.00 | + | 15:51:36 up 4 days, 2:43, 1 user, load average: 0.10, 0.03, 0.01 |
- | + | ||
- | [root@centos8 | + | root@debian11:~# w |
- | 04:39:04 up 1 day, 2:34, 1 user, load average: 0.00, 0.00, 0.00 | + | 15:51:38 up 4 days, 2:43, 1 user, load average: 0.10, 0.03, 0.01 |
USER | USER | ||
- | trainee | + | trainee |
</ | </ | ||
- | ====1.2 - The iostat Command==== | + | Les valeurs **load average** ou //charge moyenne// indiquent le nombre moyen de processus en cours de traitement ou en attente pour la période concernée. |
- | The **iostat** command show disk, terminal and streamer statistics: | + | Par exemple si les valeurs sur un système muni d'un seul processeur étaient |
+ | |||
+ | * 2,48 processus en attente dans la dernière minute, | ||
+ | * 3,00 processus en attente dans les dernières 5 minutes, | ||
+ | * 2,85 processus en attente dans les dernières 15 minutes. | ||
+ | |||
+ | Les options de ces commandes sont : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# uptime --help |
- | bash: iostat: command not found... | + | |
- | Install package ' | + | |
+ | Usage: | ||
+ | | ||
- | * Waiting in queue... | + | Options: |
- | The following packages have to be installed: | + | -p, --pretty |
- | lm_sensors-libs-3.4.0-22.20180522git70f7e08.el8.x86_64 Lm_sensors core libraries | + | -h, --help |
- | sysstat-11.7.3-5.el8.x86_64 | + | -s, --since |
- | Proceed with changes? [N/y] y | + | -V, --version |
+ | For more details see uptime(1). | ||
- | * Waiting in queue... | + | root@debian11: |
- | * Waiting for authentication... | + | |
- | * Waiting in queue... | + | Usage: |
- | * Downloading packages... | + | w [options] |
- | * Requesting data... | + | |
- | * Testing changes... | + | Options: |
- | | + | -h, --no-header |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | -u, --no-current |
+ | -s, --short | ||
+ | -f, --from | ||
+ | -o, --old-style | ||
+ | -i, --ip-addr | ||
+ | |||
+ | | ||
+ | -V, --version | ||
+ | |||
+ | For more details see w(1). | ||
+ | </ | ||
+ | |||
+ | ====3.3 - La Commande iostat==== | ||
+ | |||
+ | La commande | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | -bash: iostat: command not found | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Linux 5.10.0-13-amd64 | ||
avg-cpu: | avg-cpu: | ||
- | 0.03 | + | 0.21 |
- | Device | + | Device |
- | sda 0.28 | + | dm-0 |
- | sdb 0.00 0.03 0.00 2995 0 | + | dm-1 0.02 0.29 |
- | scd0 | + | md1 0.00 0.08 0.00 |
- | dm-0 0.26 | + | sda |
- | dm-1 | + | sdb 0.02 |
+ | sdc | ||
+ | sr0 | ||
</ | </ | ||
+ | |||
+ | Au-dessous de la première ligne indiquant la version du noyau du système et son nom d' | ||
+ | |||
+ | * **%user** - Pourcentage de temps passé en mode utilisateur (exécutant des applications, | ||
+ | * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) | ||
+ | * **%system** - Pourcentage de temps passé en mode noyau | ||
+ | * **%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. | ||
+ | |||
+ | 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 KB lus par seconde. | ||
+ | * Le nombre de blocs de KB écrits par seconde. | ||
+ | * Le nombre de blocs de KB jetés par seconde. | ||
+ | * Le nombre total de KB lus. | ||
+ | * Le nombre total de KB écrits. | ||
+ | * Le nombre total de KB jetés. | ||
+ | | ||
+ | Dernièrement, | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# iostat -d -x |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | Device | + | Device |
- | sda | + | dm-0 0.01 0.29 |
- | sdb | + | dm-1 |
- | scd0 0.00 0.00 0.00 0.00 | + | md1 0.00 0.08 0.00 |
- | dm-0 | + | sda 0.84 |
- | dm-1 0.00 0.00 0.01 | + | sdb |
+ | sdc 0.34 145.15 34.70 99.02 2.62 | ||
+ | sr0 0.01 0.14 0.00 | ||
</ | </ | ||
- | The command line switches of this command are: | + | Les options de cette commande sont : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# iostat --help |
Usage: iostat [ options ] [ < | Usage: iostat [ options ] [ < | ||
Options are: | Options are: | ||
[ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] | [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] | ||
- | [ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ] | + | [ { -f | +f } < |
+ | [ --dec={ 0 | 1 | 2 } ] [ --human | ||
[ [ -H ] -g < | [ [ -H ] -g < | ||
[ < | [ < | ||
</ | </ | ||
- | ====1.3 - The hdparm | + | ====3.4 - La Commande |
- | The hdparm | + | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# hdparm -t /dev/sdc |
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
- | /dev/sda: | + | /dev/sdc: |
- | | + | |
</ | </ | ||
- | ====1.4 - La Commande vmstat==== | + | ====3.5 - La Commande vmstat==== |
- | The **vmstat** | + | La commande |
< | < | ||
- | [root@centos8 | + | root@debian11:~# vmstat 1 10 |
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
- | The command line switches of this command are: | + | La première ligne subdivise le champ en six catégories à savoir : processus, mémoire, swap, E/S, système et CPU sur lesquelles elle donne des statistiques. La seconde ligne identifie de manière encore plus détaillée chacun des champs, permettant ainsi de parcourir simplement et rapidement l' |
+ | |||
+ | Les champs relatifs aux processus sont les suivants : | ||
+ | |||
+ | * r — Le nombre de processus exécutables attendant d' | ||
+ | * b — Le nombre de processus exécutables dans un état de veille qui ne peut être interrompu | ||
+ | |||
+ | Les champs relatifs à la mémoire sont les suivants : | ||
+ | |||
+ | * swpd — La quantité de mémoire virtuelle utilisée | ||
+ | * free — La quantité de mémoire libre | ||
+ | * buff — La quantité de mémoire utilisée par les tampons (ou buffers) | ||
+ | * cache — La quantité de mémoire utilisée comme cache de pages | ||
+ | |||
+ | Les champs relatifs au swap sont les suivants : | ||
+ | |||
+ | * si — La quantité de mémoire chargée depuis le disque | ||
+ | * so — La quantité de mémoire déchargée sur le disque | ||
+ | |||
+ | Les champs relatifs aux Entrées/ | ||
+ | |||
+ | * bi — Blocs envoyés vers un périphérique blocs | ||
+ | * bo— Blocs reçus d'un périphérique blocs | ||
+ | |||
+ | Les champs relatifs au système sont les suivants : | ||
+ | |||
+ | * in — Nombre d' | ||
+ | * cs — Nombre de changements de contexte par seconde | ||
+ | |||
+ | Les champs relatifs au CPU sont les suivants : | ||
+ | |||
+ | * us — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau utilisateur | ||
+ | * sy — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau système | ||
+ | * id — Le pourcentage de temps pendant lequel le CPU était inoccupé | ||
+ | * wa — Attente d' | ||
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# vmstat --help |
Usage: | Usage: | ||
Ligne 228: | Ligne 1471: | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : By default | + | **Important** : Par défaut la commande |
</ | </ | ||
- | ====1.5 - The 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@centos8 | + | root@debian11:~# mpstat |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 04:53:22 CPU %usr | + | 04:10:45 PM |
- | 04:53:22 all 0.03 | + | 04:10:45 PM |
</ | </ | ||
- | If there are several CPU's in the system, statistics can be viewed by core and as an average: | + | Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mpstat -P ALL |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 04:54:28 CPU %usr | + | 04:11:05 PM |
- | 04:54:28 all 0.03 | + | 04:11:05 PM |
- | 04: | + | 04:11:05 PM |
- | 04:54:28 | + | 04:11:05 PM 1 |
- | 04: | + | |
- | 04: | + | |
- | 04:54:28 | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
</ | </ | ||
- | Finally, mpstat is capable of showing statistics over time. In the following example you can see 5 data sets, one taken every 2 seconds: | + | Pour afficher |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mpstat -P ALL 2 5 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 04:55:11 | + | 04:11:24 PM |
- | 04:55:13 all | + | 04:11:26 PM |
- | 04: | + | 04:11:26 PM |
- | 04:55:13 | + | 04:11:26 PM 1 |
- | 04: | + | |
- | 04:55:13 | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04:55:13 CPU %usr | + | 04:11:26 PM |
- | 04:55:15 all 0.00 0.00 0.00 | + | 04:11:28 PM |
- | 04:55:15 | + | 04:11:28 PM |
- | 04: | + | 04:11:28 PM 1 |
- | 04:55:15 | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04:55:15 CPU %usr | + | 04:11:28 PM |
- | 04:55:17 all 0.00 0.00 0.00 | + | 04:11:30 PM |
- | 04:55:17 | + | 04:11:30 PM |
- | 04: | + | 04:11:30 PM 1 |
- | 04: | + | |
- | 04:55:17 | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04:55:17 CPU %usr | + | 04:11:30 PM |
- | 04:55:19 all 0.00 | + | 04:11:32 PM |
- | 04:55:19 | + | 04:11:32 PM |
- | 04: | + | 04:11:32 PM 1 |
- | 04:55:19 | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04:55:19 CPU %usr | + | 04:11:32 PM |
- | 04:55:21 all | + | 04:11:34 PM |
- | 04: | + | 04:11:34 PM |
- | 04:55:21 | + | 04:11:34 PM 1 |
- | 04: | + | |
- | 04:55:21 | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
Average: | Average: | ||
- | Average: | + | Average: |
- | Average: | + | Average: |
- | Average: | + | Average: |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
</ | </ | ||
- | The command line switches of this command are: | + | Les options de cette commande sont : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mpstat --help |
Usage: mpstat [ options ] [ < | Usage: mpstat [ options ] [ < | ||
Options are: | Options are: | ||
- | [ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] | + | [ -A ] [ -n ] [ -T ] [ -u ] [ -V ] |
- | [ -N { < | + | [ -I { SUM | CPU | SCPU | ALL } ] [ -N { < |
+ | [ --dec={ 0 | 1 | 2 } ] [ -o JSON ] [ -P { < | ||
</ | </ | ||
- | ====1.6 - The sar Command==== | + | ====3.7 - La Commande |
- | The **sar** | + | La commande |
- | ^ Switch | + | ^ Option |
- | | -u | CPU usage in % | | + | | -u | Pourcentage d' |
- | | -q | Number of processes in the process queue | | + | | -q | Nombre de processus en attente |
- | | -r | Memory usage | | + | | -r | Utilisation de la mémoire centrale |
- | | -w | Swap usage | | + | | -w | Surveillance du swapping |
- | | -p | Pagination usage | | + | | -p | Surveillance de la pagination |
- | | -b | Buffer usage | | + | | -b | Utilisation des tampons |
- | | -d | Disk usage | | + | | -d | Utilisation des disques |
- | The **/usr/lib64/sa/ | + | Sous Debian 11 la commande |
< | < | ||
- | [root@centos8 | + | root@debian8:~# ls /usr/lib/sysstat/ |
- | sa1 sa2 sadc | + | debian-sa1 |
</ | </ | ||
- | The **/usr/lib64/sa/ | + | Le script |
- | ^ Switch | + | ^ Option |
- | | -t | Interval | + | | -t | L' |
- | | -n | Count | | + | | -n | Nombre de collectes |
- | The **/usr/lib64/sa/ | + | Le script |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# ls / | + | |
- | sa29 s | + | |
- | + | ||
- | + | ||
- | ar29 | + | |
- | </ | + | |
- | Using CentOS / RHEL 8, the interval between collects is configured using systemd | + | Sous Debian 11, l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# cat / |
- | # /usr/ | + | # / |
# (C) 2014 Tomasz Torcz < | # (C) 2014 Tomasz Torcz < | ||
# | # | ||
- | # sysstat-11.7.3 systemd unit file: | + | # sysstat-12.5.2 systemd unit file: |
# Activates activity collector every 10 minutes | # Activates activity collector every 10 minutes | ||
Ligne 400: | Ligne 1594: | ||
</ | </ | ||
- | The **OnCalendar** | + | La valeur de **OnCalendar** |
- | To change this value, you need to create an **override** | + | Pour modifier l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# EDITOR=/ |
- | [root@centos8 ~]# cat / | + | root@debian11: |
+ | root@debian11: | ||
+ | ### Editing | ||
+ | ### Anything between here and the comment below will become the new contents of the file | ||
[Unit] | [Unit] | ||
Description=Run system activity accounting tool every 2 minutes | Description=Run system activity accounting tool every 2 minutes | ||
- | Interpreting Information in /proc | + | |
[Timer] | [Timer] | ||
OnCalendar= | OnCalendar= | ||
OnCalendar=*: | OnCalendar=*: | ||
- | AccuracySec=0 | + | |
+ | [Install] | ||
+ | WantedBy=sysstat.service | ||
+ | |||
+ | ### Lines below this comment will be discarded | ||
+ | |||
+ | ### / | ||
+ | # # / | ||
+ | # # (C) 2014 Tomasz Torcz < | ||
+ | # # | ||
+ | # # sysstat-12.5.2 systemd unit file: | ||
+ | # # Activates activity collector every 10 minutes | ||
+ | # | ||
+ | # [Unit] | ||
+ | # Description=Run system activity accounting tool every 10 minutes | ||
+ | # | ||
+ | # [Timer] | ||
+ | # OnCalendar=*: | ||
+ | # | ||
+ | # [Install] | ||
+ | # WantedBy=sysstat.service | ||
+ | [Escape] [:] [x] <<<<<<<<<<<<<<<<<<<<<<<< | ||
+ | |||
+ | |||
+ | root@debian11: | ||
+ | [Unit] | ||
+ | Description=Run system activity accounting tool every 2 minutes | ||
+ | |||
+ | [Timer] | ||
+ | OnCalendar= | ||
+ | OnCalendar=*: | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=sysstat.serviceroot@debian11: | ||
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Note the line **OnCalendar=** | + | **Important** : Notez la ligne **OnCalendar=** |
</ | </ | ||
- | Now check if the configuration | + | Vérifiez ensuite la prise en compte de la configuration : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# systemctl status sysstat-collect.timer |
● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | ||
- | Loaded: loaded (/usr/ | + | Loaded: loaded (/ |
- | Drop-In: / | + | Drop-In: / |
- | | + | |
- | | + | |
- | Trigger: | + | Trigger: n/a |
+ | Triggers: ● sysstat-collect.service | ||
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | ||
+ | | ||
+ | Drop-In: / | ||
+ | | ||
+ | Active: active (waiting) since Sat 2022-04-30 16:30:54 CEST; 2s ago | ||
+ | Trigger: | ||
+ | | ||
- | Jun 29 06:16:04 centos8.ittraining.loc | + | Apr 30 16:30:54 debian11 |
</ | </ | ||
< | < | ||
- | [root@centos8 ~]# journalctl -g sysstat-collect.service | ||
- | -- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- | ||
- | Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
- | 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: | ||
- | Jun 29 07:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | ||
- | 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: | ||
- | ... | ||
- | </ | ||
- | Execute the sar command: | + | Saisissez la commande suivante |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | + | ||
- | 06: | + | |
- | + | ||
- | 06: | + | |
- | 06: | + | |
- | 06: | + | |
- | 06: | + | |
- | 06: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | Average: | + | |
- | + | ||
- | 07: | + | |
- | + | ||
- | 07: | + | |
- | 07: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | + | ||
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
</ | </ | ||
- | ===CPU | + | ===Statistiques d' |
- | Use the -u switch: | + | Visualisez maintenant les statistiques d' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar -u 5 3 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 09:22:52 | + | 04:33:15 PM CPU |
- | 09:22:57 | + | 04:33:20 PM all 0.00 |
- | 09:23:02 | + | 04:33:25 PM all 0.00 |
- | 09:23:07 | + | 04:33:30 PM all 0.00 0.00 0.00 |
- | Average: | + | Average: |
</ | </ | ||
- | More information can be shown by using the **ALL** | + | D' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar -u ALL 5 3 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 01:49:14 | + | 04:33:53 PM CPU %usr |
- | 01:49:19 | + | 04:33:58 PM all 0.00 |
- | 01:49:24 | + | 04:34:03 PM all 0.10 |
- | 01:49:29 | + | 04:34:08 PM all 0.00 0.00 0.00 0.00 |
- | Average: | + | Average: |
</ | </ | ||
- | To see the statistics from a specific core, use the **-P** | + | Pour consulter les statistiques d'un coeur spécifique, utilisez l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar -u -P 0 5 3 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 01:51:52 | + | 04:35:14 PM CPU |
- | 01:51:57 1 | + | 04:35:19 PM |
- | 01:52:02 1 0.20 | + | 04:35:24 PM |
- | 01:52:07 1 | + | 04:35:29 PM |
- | Average: | + | Average: |
- | [root@centos8 ~]# sar -u -P 5 5 3 | + | |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | 01:52:16 | + | root@debian11:~# sar -u -P 1 5 3 |
- | 01:52:21 5 | + | Linux 5.10.0-13-amd64 (debian11) |
- | 01:52:26 5 | + | |
- | 01:52:31 5 | + | 04:34:39 PM CPU |
- | Average: | + | 04:34:44 PM |
+ | 04:34:49 PM | ||
+ | 04:34:54 PM | ||
+ | Average: | ||
</ | </ | ||
- | ===Memory and Swap Statistics=== | + | ===Statistiques d' |
- | Use the **-r** | + | Utilisez l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar -r 5 3 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 07:33:32 | + | 04:35:58 PM kbmemfree |
- | 07:33:37 1647240 | + | 04:36:03 PM |
- | 07:33:42 1647232 | + | 04:36:08 PM |
- | 07:33:47 1647232 | + | 04:36:13 PM |
- | Average: | + | Average: |
</ | </ | ||
- | Use the **-S** | + | HERE |
+ | |||
+ | Utilisez l' | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar -S 5 3 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 07:31:58 | + | 04:39:41 PM kbswpfree kbswpused |
- | 07:32:03 3358716 | + | 04:39:46 PM 998396 |
- | 07:32:08 3358716 | + | 04:39:51 PM 998396 |
- | 07:32:13 3358716 | + | 04:39:56 PM 998396 |
- | Average: | + | Average: |
</ | </ | ||
- | ===I/O Statistics=== | + | ===Statistiques des E/S=== |
- | Use the **-b** | + | Utilisez l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar -b 5 3 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 09:24:49 | + | 04:40:19 PM tps rtps wtps |
- | 09:24:54 0.00 | + | 04:40:24 PM |
- | 09:24:59 1.20 | + | 04:40:29 PM 0.00 |
- | 09:25:04 0.00 0.00 0.00 0.00 0.00 | + | 04:40:34 PM 0.00 0.00 |
- | Average: | + | Average: |
</ | </ | ||
- | ===Disk I/O Statistics=== | + | ===Statistiques des E/S par Disque=== |
- | Use the **-d** | + | Utilisez l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar -d 5 3 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Linux 5.10.0-13-amd64 |
- | 09:25:45 | + | 02:48:27 PM DEV |
- | 09:25:50 | + | 02:48:32 PM |
- | 09:25:50 dev8-16 | + | 02:48:32 PM |
- | 09:25:50 dev11-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | 02:48:32 PM |
- | 09:25:50 | + | 02:48:32 PM |
- | 09:25:50 | + | 02:48:32 PM dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
+ | 02:48:32 PM dm-1 | ||
+ | 02:48:32 PM | ||
- | 09:25:50 | + | 02:48:32 PM DEV |
- | 09:25:55 | + | 02:48:37 PM |
- | 09:25:55 dev8-16 | + | 02:48:37 PM |
- | 09:25:55 dev11-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | 02:48:37 PM |
- | 09:25:55 | + | 02:48:37 PM |
- | 09:25:55 | + | 02:48:37 PM dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
+ | 02:48:37 PM dm-1 | ||
+ | 02:48:37 PM | ||
- | 09:25:55 | + | 02:48:37 PM DEV |
- | 09:26:00 | + | 02:48:42 PM |
- | 09:26:00 dev8-16 | + | 02:48:42 PM |
- | 09:26:00 | + | 02:48:42 PM |
- | 09:26:00 | + | 02:48:42 PM |
- | 09:26:00 | + | 02:48:42 PM dm-0 0.00 |
+ | 02:48:42 PM dm-1 | ||
+ | 02:48:42 PM | ||
- | Average: | + | Average: |
- | Average: | + | Average: |
- | Average: | + | Average: |
- | Average: | + | Average: |
- | Average: | + | Average: |
- | Average: | + | Average: |
+ | Average: | ||
+ | Average: | ||
</ | </ | ||
- | The **DEV** column identifies the disks by their major/minor numbers. To see the names of the disks add the, **-p** switch: | + | Dernièrement, |
< | < | ||
- | [root@centos8 | + | root@debian11:~# ls -l /var/log/sysstat/ |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | total 16 |
- | + | -rw-r--r-- 1 root root 14284 Apr 30 16:44 sa30 | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | + | ||
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | + | ||
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | + | ||
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
</ | </ | ||
- | The command line switches of this command are: | + | Les options de la commande sar sont : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# sar --help |
Usage: sar [ options ] [ < | Usage: sar [ options ] [ < | ||
Main options and reports (report name between square brackets): | Main options and reports (report name between square brackets): | ||
Ligne 739: | Ligne 1878: | ||
FC Fibre channel HBAs | FC Fibre channel HBAs | ||
SOFT Software-based network processing | SOFT Software-based network processing | ||
- | -q Queue length and load average statistics [A_QUEUE] | + | -q [ < |
+ | System load and pressure-stall statistics | ||
+ | Keywords are: | ||
+ | LOAD | ||
+ | CPU | ||
+ | IO Pressure-stall I/O statistics [A_PSI_IO] | ||
+ | MEM | ||
-r [ ALL ] | -r [ ALL ] | ||
Memory utilization statistics [A_MEMORY] | Memory utilization statistics [A_MEMORY] | ||
Ligne 751: | Ligne 1896: | ||
</ | </ | ||
- | =====LAB #2 - Viewing Open Files and Running Processes===== | + | ====3.8 - La Commande collectd==== |
- | =====2.1 - Presentation===== | + | collectd est une solution open sourceavec des plugins qui peuvent collecter des statistiques système pour une grande variété d' |
- | A process is a binary file that is loaded into memory and executed. When the file is loaded it needs the operating system to supply it with information such that it can execute correctly. Collectively, | + | Le paquet collectd n'est pas installé par défaut sous Debian 11 : |
- | * A unique process ID (PID), | + | < |
- | * The Parent PID (PPID), | + | root@debian11: |
- | * A User ID (UID), | + | </ |
- | * A Groupe ID (GID), | + | |
- | * Processing time, | + | |
- | * The process priority, | + | |
- | * The current working directory, | + | |
- | * A list of open files. | + | |
- | This information is stored in **/proc**: | + | Vérifiez que le service collectd est en cours d' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# systemctl status collectd |
- | 1 1113 1158 1464 1590 1601 163 | + | ● collectd.service - Statistics collection and monitoring daemon |
- | 10 1125 12 1465 1594 162 | + | |
- | 11 1126 13 15 16 1627 164 | + | |
- | 1111 1135 14 1585 1600 1628 165 | + | Docs: man: |
+ | | ||
+ | | ||
+ | | ||
+ | Tasks: 12 (limit: 19155) | ||
+ | | ||
+ | CPU: 269ms | ||
+ | | ||
+ | | ||
+ | |||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
+ | Oct 09 19:31:24 debian11 systemd[1]: Started Statistics collection and monitoring dae> | ||
+ | Oct 09 19:31:24 debian11 collectd[2088]: | ||
</ | </ | ||
- | Each directory has as a name the PID of the process it refers to. Looking into one of the directories, | + | <WRAP center round important 60%> |
+ | **Important** - notez que collectd récolte des données toutes les 10 secondes. | ||
+ | </ | ||
+ | |||
+ | Le fichier principal de configuration de collectd est **/ | ||
< | < | ||
- | [root@centos8 proc]# cd 1 ; ls -l | + | root@debian11:~# more / |
- | total 0 | + | # Config file for collectd(1). |
- | dr-xr-xr-x. 2 root root 0 Jun 3 09:01 attr | + | # |
- | -rw-r--r--. 1 root root 0 Jun 3 09:02 autogroup | + | # Some plugins need additional configuration and are disabled by default. |
- | -r--------. 1 root root 0 Jun 3 09:02 auxv | + | # Please read collectd.conf(5) for details. |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 cgroup | + | # |
- | --w-------. 1 root root 0 Jun 3 09:02 clear_refs | + | # You should also read / |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 cmdline | + | # before enabling any more plugins. |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 comm | + | |
- | -rw-r--r--. 1 root root 0 Jun 3 09:02 coredump_filter | + | ############################################################################## |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 cpu_resctrl_groups | + | # Global |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 cpuset | + | #----------------------------------------------------------------------------# |
- | lrwxrwxrwx. 1 root root 0 Jun 3 09:02 cwd -> / | + | # Global settings for the daemon. # |
- | -r--------. 1 root root 0 Jun 3 09:01 environ | + | ############################################################################## |
- | lrwxrwxrwx. 1 root root 0 Jun 3 09:01 exe -> /usr/lib/systemd/systemd | + | |
- | dr-x------. 2 root root 0 Jun 3 09:01 fd | + | #Hostname " |
- | dr-x------. 2 root root 0 Jun 3 09:01 fdinfo | + | FQDNLookup true |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 gid_map | + | #BaseDir "/ |
- | -r--------. 1 root root 0 Jun 3 09:02 io | + | #PluginDir "/usr/lib/collectd" |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 limits | + | #TypesDB "/usr/ |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 loginuid | + | |
- | dr-x------. 2 root root 0 Jun 3 09:02 map_files | + | #----------------------------------------------------------------------------# |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 maps | + | # When enabled, plugins are loaded automatically with the default options |
- | -rw-------. 1 root root 0 Jun 3 09:02 mem | + | # when an appropriate < |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 mountinfo | + | # Disabled by default. |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 mounts | + | #----------------------------------------------------------------------------# |
- | -r--------. 1 root root 0 Jun 3 09:02 mountstats | + | # |
- | dr-xr-xr-x. 6 root root 0 Jun 3 09:01 net | + | |
- | dr-x--x--x. 2 root root 0 Jun 3 09:02 ns | + | #----------------------------------------------------------------------------# |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 numa_maps | + | # When enabled, internal statistics are collected, using " |
- | -rw-r--r--. 1 root root 0 Jun 3 09:02 oom_adj | + | # plugin name. # |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 oom_score | + | # Disabled by default. |
- | -rw-r--r--. 1 root root 0 Jun 3 09:02 oom_score_adj | + | #----------------------------------------------------------------------------# |
- | -r--------. 1 root root 0 Jun 3 09:02 pagemap | + | # |
- | -r--------. | + | |
- | -r--------. 1 root root 0 Jun 3 09:02 personality | + | #----------------------------------------------------------------------------# |
- | -rw-r--r--. 1 root root 0 Jun 3 09:02 projid_map | + | # Interval at which to query values. This may be overwritten on a per-plugin # |
- | lrwxrwxrwx. 1 root root 0 Jun 3 09:01 root -> / | + | # base by using the ' |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 sched | + | # < |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 schedstat | + | # |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 sessionid | + | # </LoadPlugin> |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 setgroups | + | #----------------------------------------------------------------------------# |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 smaps | + | #Interval 10 |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 smaps_rollup | + | |
- | -r--------. 1 root root 0 Jun 3 09:02 stack | + | # |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 stat | + | # |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 statm | + | # |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 status | + | # |
- | -r--------. 1 root root 0 Jun 3 09:02 syscall | + | |
- | dr-xr-xr-x. 3 root root 0 Jun 3 09:01 task | + | # Limit the size of the write queue. Default is no limit. Setting up a limit |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 timers | + | # is recommended for servers handling a high volume of traffic. |
- | -rw-rw-rw-. 1 root root 0 Jun 3 09:02 timerslack_ns | + | # |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 uid_map | + | # |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 wchan | + | |
+ | ############################################################################## | ||
+ | # Logging | ||
+ | #----------------------------------------------------------------------------# | ||
+ | # Plugins which provide logging functions should be loaded first, so log # | ||
+ | # messages generated when loading or configuring other plugins can be # | ||
+ | --More--(8%) | ||
</ | </ | ||
- | <WRAP center round important> | + | D' |
- | **Important** - Note that the content of the files is of little or of no direct use to a System Administrator. | + | |
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | #<Plugin zookeeper> | ||
+ | # Host " | ||
+ | # Port " | ||
+ | #</ | ||
+ | |||
+ | <Include "/ | ||
+ | Filter " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | total 8 | ||
+ | -rw-r--r-- 1 root root 656 Jun 1 2021 filters.conf | ||
+ | -rw-r--r-- 1 root root 836 Jun 1 2021 thresholds.conf | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | # Filter configuration for collectd(1). | ||
+ | # | ||
+ | # See the section " | ||
+ | |||
+ | # | ||
+ | # | ||
+ | |||
+ | #LoadPlugin match_empty_counter | ||
+ | #LoadPlugin match_hashed | ||
+ | #LoadPlugin match_regex | ||
+ | #LoadPlugin match_timediff | ||
+ | #LoadPlugin match_value | ||
+ | |||
+ | #LoadPlugin target_notification | ||
+ | #LoadPlugin target_replace | ||
+ | #LoadPlugin target_scale | ||
+ | #LoadPlugin target_set | ||
+ | #LoadPlugin target_v5upgrade | ||
+ | |||
+ | #<Chain " | ||
+ | # < | ||
+ | # < | ||
+ | # Host " | ||
+ | # | ||
+ | # </ | ||
+ | # | ||
+ | # </ | ||
+ | #</ | ||
+ | |||
+ | # Default behavior: | ||
+ | #<Chain " | ||
+ | # | ||
+ | #</ | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | Décommentez donc les deux lignes suivantes : | ||
+ | |||
+ | * LoadPlugin cpufreq | ||
+ | * LoadPlugin thermal | ||
+ | |||
+ | Ensuite re-démarrez le service collectd : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | ● collectd.service - Statistics collection and monitoring daemon | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | | ||
+ | Process: 10521 ExecStartPre=/ | ||
+ | Main PID: 10522 (collectd) | ||
+ | Tasks: 12 (limit: 19155) | ||
+ | | ||
+ | CPU: 52ms | ||
+ | | ||
+ | | ||
+ | |||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 collectd[10522]: | ||
+ | Oct 09 19:40:35 debian11 systemd[1]: Started Statistics collection and monitoring dae> | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | La consultation des données collectées par collectd peut se faire à l'aide du logiciel **kcollectd** : | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Dernièrement, | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | collectd: invalid option -- ' | ||
+ | Usage: collectd [OPTIONS] | ||
+ | |||
+ | Available options: | ||
+ | General: | ||
+ | -C < | ||
+ | Default: / | ||
+ | -t Test config and exit. | ||
+ | -T Test plugin read and exit. | ||
+ | -P < | ||
+ | Default: / | ||
+ | -f Don't fork to the background. | ||
+ | -B Don't create the BaseDir | ||
+ | -h Display help (this message) | ||
+ | |||
+ | Builtin defaults: | ||
+ | Config file / | ||
+ | PID file / | ||
+ | Plugin directory | ||
+ | Data directory | ||
+ | |||
+ | collectd 5.12.0.git, http:// | ||
+ | by Florian octo Forster < | ||
+ | for contributions see `AUTHORS' | ||
+ | </ | ||
+ | |||
+ | =====Modules usb===== | ||
+ | |||
+ | L' | ||
+ | |||
+ | ^ Version USB ^ Module ^ Nom Complet ^ | ||
+ | | 1.0\1.1 | ||
+ | | ::: | **OHCI** | //Open Controller Host Interface// | | ||
+ | | 2.0 | **EHCI** | //Enhanced Host Controller Interface// | | ||
+ | | 3.0 | **XHCI** | // | ||
+ | |||
+ | Le tableau suivant liste les modules courrament chargés en fonction du périphérique utilisé : | ||
+ | |||
+ | ^ Module ^ Type de Périphérique ^ | ||
+ | | **usb_storage** | ||
+ | | **usbhid** | ||
+ | | **snd-usb-audio** | ||
+ | | **usbvidéo** | ||
+ | | **irda-usb** | ||
+ | | **usbnet** | ||
+ | |||
+ | Les modules peuvent être chargés par un des moyens suivants : | ||
+ | |||
+ | * INITrd, | ||
+ | * Le processus init (systemd), | ||
+ | * kmod, d'une manière dynamique et transparente lors du branchement du périphérique, | ||
+ | * udev, | ||
+ | * manuellement. | ||
+ | |||
+ | =====udev===== | ||
+ | |||
+ | Depuis le noyau Linux 2.6 Linux est capable de détecter des périphériques branchés à chaud. Cette technologie s' | ||
+ | |||
+ | * Udev, | ||
+ | * HAL, | ||
+ | * Dbus. | ||
+ | |||
+ | Les rôles de chaque composant sont les suivants : | ||
+ | |||
+ | * Udev se charge de créer et supprimer d'une manière dynamique les nœuds dans le répertoire **/dev**, | ||
+ | * HAL obtient des informations à partir d'Udev et créé un fichier au format XML représentant le périphérique branché. Il informe ensuite Nautilus en utilisant le Dbus, | ||
+ | * Dbus joue le rôle d'un bus système qui est utilisé pour la communication inter-processus. | ||
+ | |||
+ | Lors de démarrage de Linux, Udev joue un rôle important : | ||
+ | |||
+ | * Au démarrage **tmpfs** est monté sur /dev, | ||
+ | * Udev copie les éventuels nœuds statiques de **/ | ||
+ | * le démon **udevd** collecte des données appelées **uevents** du noyau et cherche une règle correspondante dans le répertoire **/ | ||
+ | * Udev crée les nœuds et liens symboliques spécifiés dans la règle identifiée, | ||
+ | * Udev stocke les règles contenues dans **/ | ||
+ | * En cas de modification des ces règles, Udev met à jour la mémoire. | ||
+ | |||
+ | Udev repose sur le filesystem **sysfs** monté sur /sys qui permet de rendre les périphériques visibles à Udev dans l'// | ||
+ | |||
+ | Le fichier de configuration principal d'Udev est **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | # 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. | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | Les fichiers de règles se trouvent dans **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 39-usbmuxd.rules | ||
+ | 40-usb_modeswitch.rules | ||
+ | 50-firmware.rules | ||
+ | 50-udev-default.rules | ||
+ | 55-dm.rules | ||
+ | 56-lvm.rules | ||
+ | 60-autosuspend.rules | ||
+ | 60-block.rules | ||
+ | 60-cdrom_id.rules | ||
+ | 60-drm.rules | ||
+ | 60-evdev.rules | ||
+ | 60-fido-id.rules | ||
+ | 60-input-id.rules | ||
+ | 60-libgphoto2-6.rules | ||
+ | 60-libopenni2-0.rules | ||
+ | 60-libsane1.rules | ||
+ | 60-persistent-alsa.rules | ||
+ | 60-persistent-input.rules | ||
+ | 60-persistent-storage-dm.rules | ||
+ | 60-persistent-storage.rules | ||
+ | 60-persistent-storage-tape.rules | ||
+ | 60-persistent-v4l.rules | ||
+ | 60-qemu-guest-agent.rules | ||
+ | 60-sensor.rules | ||
+ | 60-serial.rules | ||
+ | 64-btrfs-dm.rules | ||
+ | 64-btrfs.rules | ||
+ | 64-xorg-xkb.rules | ||
+ | 65-libwacom.rules | ||
+ | 69-cd-sensors.rules | ||
+ | 69-lvm-metad.rules | ||
+ | 69-wacom.rules | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important | ||
+ | **Important** | ||
</ | </ | ||
- | =====2.2 - Process Types===== | + | Comme indique le nom de chaque fichier, le contenu est composé de règles à l' |
- | There are three types of processes: | + | < |
+ | root@debian11:~# cat / | ||
+ | # do not edit this file, it will be overwritten on update | ||
- | * **interactive** - processes generated by typing | + | # run a command |
- | * **batch** - processes generated by the system itself, | + | ACTION==" |
- | * **daemon** - processes that do not have a parent terminal. | + | ACTION==" |
- | A process can be in any one of 9 //process states//: | + | SUBSYSTEM==" |
- | * //user mode// - the process is executing in user mode, | + | # select " |
- | * //kernel mode//- the process is executing in kernel mode, | + | SUBSYSTEM==" |
- | * // | + | SUBSYSTEM==" |
- | * //swap// - the process is sleeping in swap, | + | |
- | * //new// - the process is new, | + | |
- | * //waiting// – the process is waiting for a ressource other than the processor, | + | |
- | * // | + | |
- | * //elected// – the process is in the processor, | + | |
- | * //zombie// – the process has terminated and is waiting to be killed by the system. | + | |
- | =====2.3 - Process Commands===== | + | SUBSYSTEM==" |
+ | mported" | ||
+ | ENV{MODALIAS}!="", | ||
+ | LABEL=" | ||
- | ====The ps Command==== | + | ACTION!=" |
- | The output from this command shows the processes attached | + | SUBSYSTEM==" |
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | KERNEL==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | # When using static_node= with non-default permissions, | ||
+ | # tmpfiles.d/ | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | OPTIONS+=" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | --More-- | ||
+ | [q] | ||
+ | </ | ||
+ | |||
+ | Chaque règle prend la forme suivante : | ||
+ | |||
+ | KEY, [KEY, ...] NAME [, SYMLINK] | ||
+ | |||
+ | Chaque KEY est un champ au format **type=valeur** qui doit correspondre à un périphérique unique. La valeur de type peut prendre plusieurs formes : | ||
+ | |||
+ | ^ Type ^ Description ^ Exemples ^ | ||
+ | | BUS | Type de bus | usb, scsi, ide | | ||
+ | | KERNEL | Le nom par défault du périphérique donné par le noyau | hda, ttyUSB0, lp0 | | ||
+ | | SUBSYSTEM | Le nom noyau du sous-système, | ||
+ | | DRIVER | Le nom du pilote qui contrôle le périphérique | usb-storage | | ||
+ | | ID | Le numéro du périphérique sur son bus | PCI bus id, USB id | | ||
+ | | PLACE | Ne concerne que les périphériques USB et donne la position topologique du périphérique sur son bus | S/O | | ||
+ | | SYSFS{filename} | Le nom du fichier dans /sys pour le périphérique. Ce fichier contient le fabricant, le label, le numéro de série et UUID du périphérique. La vérification de jusqu' | ||
+ | | PROGRAM | Ceci permet à Udev d' | ||
+ | | RESULT | Valeur à comparer au résultat de PROGRAM | S/O | | ||
+ | |||
+ | NAME et SYMLINK sont utilisées pour stipuler ce que Udev doit faire avec le périphérique : | ||
+ | |||
+ | ^ Type ^ Description ^ Exemples ^ | ||
+ | | NAME | Le nome du nœud dans /dev | S/O | | ||
+ | | SYMLINK | Le ou les lien(s) symbolique(s) qui pointe(nt) vers le NAME | S/O | | ||
+ | |||
+ | ====La commande udevadm==== | ||
+ | |||
+ | Pour obtenir de l' | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# udevadm info --query=all -n /dev/sdc |
- | [root@centos8 | + | P: / |
+ | N: sdc | ||
+ | L: 0 | ||
+ | S: disk/ | ||
+ | S: disk/ | ||
+ | E: DEVPATH=/ | ||
+ | E: DEVNAME=/ | ||
+ | E: DEVTYPE=disk | ||
+ | E: MAJOR=8 | ||
+ | E: MINOR=32 | ||
+ | E: SUBSYSTEM=block | ||
+ | E: USEC_INITIALIZED=1712598 | ||
+ | E: ID_SCSI=1 | ||
+ | E: ID_VENDOR=QEMU | ||
+ | E: ID_VENDOR_ENC=QEMU\x20\x20\x20\x20 | ||
+ | E: ID_MODEL=QEMU_HARDDISK | ||
+ | E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | ||
+ | E: ID_REVISION=2.5+ | ||
+ | E: ID_TYPE=disk | ||
+ | E: ID_SERIAL=0QEMU_QEMU_HARDDISK_drive-scsi1 | ||
+ | E: ID_SERIAL_SHORT=drive-scsi1 | ||
+ | E: ID_BUS=scsi | ||
+ | E: ID_PATH=pci-0000: | ||
+ | E: ID_PATH_TAG=pci-0000_00_05_0-scsi-0_0_0_1 | ||
+ | E: ID_PART_TABLE_UUID=304308a3 | ||
+ | E: ID_PART_TABLE_TYPE=dos | ||
+ | E: DEVLINKS=/ | ||
+ | E: TAGS=: | ||
+ | E: CURRENT_TAGS=: | ||
+ | </ | ||
+ | |||
+ | Les options de la commande udevadm sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS] | ||
+ | |||
+ | Send control commands or test the device manager. | ||
+ | |||
+ | Commands: | ||
+ | info Query sysfs or the udev database | ||
+ | trigger | ||
+ | settle | ||
+ | control | ||
+ | monitor | ||
+ | test Test an event run | ||
+ | test-builtin | ||
+ | |||
+ | See the udevadm(8) man page for details. | ||
+ | |||
+ | root@debian11: | ||
+ | udevadm info [OPTIONS] [DEVPATH|FILE] | ||
+ | |||
+ | Query sysfs or the udev database. | ||
+ | |||
+ | -h --help | ||
+ | -V --version | ||
+ | -q --query=TYPE | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -p --path=SYSPATH | ||
+ | -n --name=NAME | ||
+ | -r --root | ||
+ | -a --attribute-walk | ||
+ | of parent devices | ||
+ | -d --device-id-of-file=FILE Print major:minor of device containing this file | ||
+ | -x --export | ||
+ | -P --export-prefix | ||
+ | -e --export-db | ||
+ | -c --cleanup-db | ||
+ | -w --wait-for-initialization[=SECONDS] | ||
+ | Wait for device to be initialized | ||
+ | </ | ||
+ | |||
+ | =====Système de fichiers /sys===== | ||
+ | |||
+ | Le système de fichiers virtuel **/sys** a été introduit avec le noyau Linux **2.6**. Son rôle est de décrire le matériel pour udev. | ||
+ | |||
+ | Saisissez la commande suivante : | ||
+ | |||
+ | < | ||
+ | root@debian11:~# ls -l /sys | ||
+ | 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 151 root root 0 Apr 30 16:21 module | ||
+ | drwxr-xr-x | ||
+ | </ | ||
+ | |||
+ | Chaque répertoire contient des informations : | ||
+ | |||
+ | * **block** | ||
+ | * contient des informations sur les périphériques bloc | ||
+ | * **bus** | ||
+ | * contient des informations sur les bus de données | ||
+ | * **class** | ||
+ | * contient des informations sur des classes de matériel | ||
+ | * **devices** | ||
+ | * contient des informations sur la position des périphériques sur les bus | ||
+ | * **firmware** | ||
+ | * contient, entre autre, des informations sur l' | ||
+ | * **module** | ||
+ | * contient des informations sur les modules du noyau | ||
+ | * **power** | ||
+ | * contient des informations sur la gestion de l' | ||
+ | * **fs** | ||
+ | * contient des informations sur les systèmes de fichiers | ||
+ | |||
+ | Pour illustrer ceci, saisissez la commande suivante : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 204800 | ||
+ | </ | ||
+ | |||
+ | Ce chiffre correspond aux nombre de secteurs. | ||
+ | |||
+ | =====LAB #4 - Processus et Fichiers Ouverts===== | ||
+ | |||
+ | =====Présentation===== | ||
+ | |||
+ | Un processus est un fichier binaire ( binary file ) qui est chargé en mémoire centrale. Une fois chargé la mémoire exécute le programme en langage machine. Quand le programme est chargé, il a besoin du système d’exploitation qui lui fournit des informations pour qu’il puisse s’exécuter correctement. Ces informations sont appelées des **données d’identification**. | ||
+ | |||
+ | L’ensemble des **données d’identification** est appelé l’**environnement de processus** : | ||
+ | |||
+ | * Un numéro de processus unique (PID), | ||
+ | * Un numéro de processus parent (PPID), | ||
+ | * Un numéro d' | ||
+ | * Un numéro de groupe (GID), | ||
+ | * La durée de traitement, | ||
+ | * La priorité du processus, | ||
+ | * Le répertoire de travail actif, | ||
+ | * Les fichiers ouverts. | ||
+ | |||
+ | Ces informations sont stockés 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. | ||
+ | |||
+ | Saisissez la commande suivante : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 1 128 213 21985 22049 22095 22976 23037 28304 30129 368 453 59 | ||
+ | 10 | ||
+ | 11 | ||
+ | 119 15 | ||
+ | 12 | ||
+ | 120 17 | ||
+ | 121 175 21920 22024 22066 22146 23 | ||
+ | 122 176 21921 22027 22076 22151 23008 27915 29345 32 | ||
+ | 123 18 | ||
+ | 125 2 21970 22040 22093 22970 23015 28194 3 364 433 57 | ||
+ | 127 20 | ||
+ | </ | ||
+ | |||
+ | Chaque répertoire fait référence à un PID d'un processus. Les données de l’**environnement de processus** y sont présentes, par exemple : | ||
+ | |||
+ | < | ||
+ | root@debian11:/ | ||
+ | total 0 | ||
+ | -r--r--r-- | ||
+ | dr-xr-xr-x | ||
+ | -rw-r--r-- | ||
+ | -r-------- | ||
+ | -r--r--r-- | ||
+ | --w------- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | lrwxrwxrwx | ||
+ | -r-------- | ||
+ | lrwxrwxrwx | ||
+ | dr-x------ | ||
+ | dr-x------ | ||
+ | -rw-r--r-- | ||
+ | -r-------- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | dr-x------ | ||
+ | -r--r--r-- | ||
+ | -rw------- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -r-------- | ||
+ | dr-xr-xr-x 54 root root 0 May 10 14:37 net | ||
+ | dr-x--x--x | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r-------- | ||
+ | -r-------- | ||
+ | -r-------- | ||
+ | -rw-r--r-- | ||
+ | lrwxrwxrwx | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -r-------- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -r-------- | ||
+ | dr-xr-xr-x | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-rw-rw- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** - Vous n'avez pas besoin de consulter le contenu des fichiers et des répertoires. Il convient tout simplement de savoir que ces données existent. | ||
+ | </ | ||
+ | |||
+ | =====Les Types de Processus===== | ||
+ | |||
+ | Il existe trois types de processus : | ||
+ | |||
+ | * **interactif** qui est lancé par le shell dans une console en premier plan ou en tâche de fond | ||
+ | * **batch** qui est lancé par le système au moment propice | ||
+ | * **daemon** qui est lancé au démarrage par le système ( lpd, dns etc ) | ||
+ | |||
+ | Un processus peut être dans un de neuf états ou //process states// : | ||
+ | |||
+ | * //user mode// - le processus s' | ||
+ | * //kernel mode//- le processus s' | ||
+ | * //waiting// – le processus est en attente pour une ressource autre que le processeur, | ||
+ | * // | ||
+ | * // | ||
+ | * //swap// - le processus est endormi dans la mémoire virtuelle, | ||
+ | * //new// - le processus est nouveau, | ||
+ | * //elected// – le processus a le contrôle du processeur, | ||
+ | * //zombie// – le processus a terminé son exécution et est prêt à mourir. | ||
+ | |||
+ | ====4.1 - La Commande ps==== | ||
+ | |||
+ | Cette commande affiche les processus de l’utilisateur attaché au terminal : | ||
+ | |||
+ | < | ||
+ | root@debian11:/ | ||
+ | |||
+ | root@debian11: | ||
+ | PID TTY TIME CMD | ||
+ | 28309 pts/1 00:00:00 su | ||
+ | 28310 pts/1 00:00:00 bash | ||
+ | 30237 pts/1 00:00:00 ps | ||
+ | |||
+ | root@debian11: | ||
PID TTY TIME CMD | PID TTY TIME CMD | ||
- | | + | 28309 pts/1 |
- | 1634 pts/0 | + | |
- | 1690 pts/0 | + | |
</ | </ | ||
- | You can get more details by using the **-l** | + | Pour plus de détails, il convient d' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps -l |
F S | F S | ||
- | 4 S | + | 4 S |
- | 4 S | + | 4 S |
- | 0 R | + | 4 R |
</ | </ | ||
- | This output shows some usefull information: | + | On note dans cette sortie |
- | ^ F | Process flag. The value of 4 means the process is using root privileges. | + | ^ F | Drapeaux du processus. La valeur |
- | ^ S | The process state - S (sleeping), R (In run queue), Z (zombie), N (low priority), D (uninterruptible sleep), T (Traced) | | + | ^ S | État du processus |
- | ^ UID | User ID of the user who has stated the process | + | ^ UID | Numéro de l’Utilisateur |
- | ^ PID | Process ID | | + | ^ PID | Numéro Unique de Processus |
- | ^ PPID | Parent | + | ^ PPID | PID du processus parent |
- | ^ C | Prority factor | + | ^ C | Facteur de priorité du processus |
- | ^ PRI | Process priority | + | ^ PRI | Priorité du processus |
- | ^ NI | Process | + | ^ NI | La valeur de nice | |
- | ^ ADDR | Memory address | + | ^ ADDR | Adresse mémoire du processus |
- | ^ SZ | Virtual memory usage | | + | ^ SZ | Utilisation de la mémoire virtuelle |
- | ^ WCHAN | Name of the kernel function in which the process is asleep | + | ^ WCHAN | Nom de la fonction du noyau dans laquelle le processus est endormi |
- | ^ TTY | Name of the terminal | + | ^ TTY | Nom du terminal |
- | ^ TIME | Processing time | | + | ^ TIME | Durée d' |
- | ^ CMD | The command that generated the process | + | ^ CMD | Commande exécutée |
- | To see the process | + | Pour visualiser la table des processus, utilisez la commande ps avec les options |
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps lx | more |
F | F | ||
- | 4 | + | 4 |
1 | 1 | ||
1 | 1 | ||
1 | 1 | ||
- | 1 | + | 1 |
- | 1 | + | nts_highpri] |
- | 1 | + | 1 |
- | 1 | + | 1 |
- | 1 | + | 1 |
- | 1 | + | 1 |
- | 1 | + | 1 |
- | 1 | + | 1 |
- | 5 | + | 1 |
- | 1 | + | 1 |
- | 1 | + | 1 |
- | 5 | + | |
- | 1 | + | |
1 | 1 | ||
- | 1 | + | 1 |
- | 1 | + | nts_highpri] |
- | 1 | + | 5 |
- | 5 0 | + | 1 |
+ | 1 | ||
+ | 1 0 | ||
--More-- | --More-- | ||
</ | </ | ||
Ligne 933: | Ligne 2662: | ||
On note dans cette sortie certaines informations supplémentaires : | On note dans cette sortie certaines informations supplémentaires : | ||
- | ^ VSZ | The same thing as SZ in the previous example | + | ^ VSZ | La même chose que SZ dans l' |
- | ^ RSS | Memory in KB used by the process | + | ^ RSS | La mémoire utilisée en kilobytes par le processus |
- | ^ STAT | The same thing as S in the previous example | + | ^ STAT | La même chose que S dans l' |
- | Using the a, u and x switches you obtain the following output: | + | Avec des options |
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps aux | more |
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | ||
- | root | + | root |
- | root | + | root |
- | root | + | root |
- | root | + | root |
- | root | + | root |
- | root | + | ghpri] |
- | root | + | root |
- | root | + | root |
- | root | + | root 10 0.0 0.0 0 0 ? S |
- | root 10 0.0 0.0 0 0 ? S | + | root 11 0.0 0.0 0 0 ? |
- | root 11 0.0 0.0 0 0 ? | + | root 12 0.0 0.0 0 0 ? |
- | root 12 0.0 0.0 0 0 ? | + | root 13 0.0 0.0 0 0 ? S |
- | root 13 0.0 0.0 0 0 ? S | + | root |
- | root | + | root |
- | root | + | root |
- | root | + | root |
- | root | + | root |
- | root | + | ghpri] |
- | root | + | root |
- | root | + | root |
- | root | + | root |
- | root | + | root |
--More-- | --More-- | ||
</ | </ | ||
- | This output provides further usefull information: | + | On note dans cette sortie certaines informations supplémentaires |
- | + | ||
- | ^ USER | The user associated with the process | | + | |
- | ^ %CPU | % of the processor ressources used by the process | | + | |
- | ^ %MEM | % of the memory ressources used by the process | | + | |
- | ===Command Line Switches=== | + | ^ USER | L' |
+ | ^ %CPU | Ressources du microprocesseur utilisées par le processus | | ||
+ | ^ %MEM | Ressources en mémoire vive utilisées par le processus | | ||
- | The command line switches for the ps command are : | + | Les options de cette commande sont : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps --help all |
Usage: | Usage: | ||
Ligne 1061: | Ligne 2788: | ||
</ | </ | ||
- | ====The pstree | + | ====4.2 - La Commande |
- | This command shows the processes as a tree: | + | Cette commande affiche les processus en forme d' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# pstree |
- | systemd─┬─NetworkManager───2*[{NetworkManager}] | + | systemd─┬─ModemManager───2*[{ModemManager}] |
+ | ├─NetworkManager───2*[{NetworkManager}] | ||
├─agetty | ├─agetty | ||
├─atd | ├─atd | ||
- | ├─auditd─┬─sedispatch | + | ├─avahi-daemon───avahi-daemon |
- | | + | |
- | ├─chronyd | + | ├─cron |
- | ├─crond | + | ├─cups-browsed───2*[{cups-browsed}] |
- | ├─dbus-daemon───{dbus-daemon} | + | ├─cupsd |
- | ├─dnsmasq───dnsmasq | + | ├─dbus-daemon |
- | ├─firewalld───{firewalld} | + | ├─exim4 |
- | ├─gssproxy───5*[{gssproxy}] | + | ├─lightdm─┬─2*[Xorg───9*[{Xorg}]] |
- | ├─irqbalance───{irqbalance} | + | │ |
- | ├─ksmtuned───sleep | + | |
- | ├─lsmd | + | │ |
- | ├─mcelog | + | |
- | ├─polkitd───7*[{polkitd}] | + | |
- | ├─rngd───4*[{rngd}] | + | |
- | ├─rpcbind | + | │ |
- | ├─rsyslogd───2*[{rsyslogd}] | + | |
- | ├─smartd | + | |
+ | | ||
+ | | ||
+ | │ | ||
+ | │ | ||
+ | | ||
+ | | ||
+ | | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | ├─packagekitd───2*[{packagekitd}] | ||
+ | ├─polkitd───2*[{polkitd}] | ||
+ | ├─rsyslogd───3*[{rsyslogd}] | ||
+ | ├─rtkit-daemon───2*[{rtkit-daemon}] | ||
├─sshd───sshd───sshd───bash───su───bash───pstree | ├─sshd───sshd───sshd───bash───su───bash───pstree | ||
- | ├─sssd─┬─sssd_be | + | ├─systemd─┬─(sd-pam) |
- | │ └─sssd_nss | + | │ ├─at-spi-bus-laun─┬─dbus-daemon |
- | ├─systemd───(sd-pam) | + | │ |
+ | | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | ├─systemd─┬─(sd-pam) | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
├─systemd-journal | ├─systemd-journal | ||
├─systemd-logind | ├─systemd-logind | ||
- | ├─systemd-machine | + | ├─systemd-timesyn───{systemd-timesyn} |
├─systemd-udevd | ├─systemd-udevd | ||
- | └─tuned───3*[{tuned}] | + | |
+ | ├─upowerd───2*[{upowerd}] | ||
+ | ├─wpa_supplicant | ||
+ | | ||
+ | └─2*[{xfce4-terminal}] | ||
</ | </ | ||
- | ===Command Line Switches=== | + | Les options de cette commande sont : |
- | + | ||
- | The command line switches for the pstree command are : | + | |
< | < | ||
- | [root@centos8 | + | root@debian11:~# pstree --help |
pstree: unrecognized option ' | pstree: unrecognized option ' | ||
- | Usage: pstree [-acglpsStuZ] [ -h | -H PID ] [ -n | -N type ] | + | Usage: pstree [-acglpsStTuZ] [ -h | -H PID ] [ -n | -N type ] |
[ -A | -G | -U ] [ PID | USER ] | [ -A | -G | -U ] [ PID | USER ] | ||
- | pstree -V | + | |
Display a tree of processes. | Display a tree of processes. | ||
-a, --arguments | -a, --arguments | ||
-A, --ascii | -A, --ascii | ||
- | -c, --compact | + | -c, --compact-not don't compact identical subtrees |
- | -h, --highlight-all highlight current | + | -C, --color=TYPE |
- | -H PID, | + | (age) |
- | --highlight-pid=PID highlight this process and its ancestors | + | |
-g, --show-pgids | -g, --show-pgids | ||
-G, --vt100 | -G, --vt100 | ||
+ | -h, --highlight-all highlight current process and its ancestors | ||
+ | -H PID, --highlight-pid=PID | ||
+ | highlight this process and its ancestors | ||
-l, --long | -l, --long | ||
-n, --numeric-sort | -n, --numeric-sort | ||
- | -N type, | + | -N TYPE, --ns-sort=TYPE |
- | | + | |
- | | + | |
-p, --show-pids | -p, --show-pids | ||
-s, --show-parents | -s, --show-parents | ||
Ligne 1132: | Ligne 2905: | ||
-V, --version | -V, --version | ||
-Z, --security-context | -Z, --security-context | ||
- | show SELinux | + | show security |
PID start at this PID; default is 1 (init) | PID start at this PID; default is 1 (init) | ||
USER show only trees rooted at processes of this user | USER show only trees rooted at processes of this user | ||
</ | </ | ||
- | ====The top Command==== | + | ====4.3 - La Commande |
- | **top** shows a continuous real time list of running processes: | + | Cette commande indique les processus en mémoire |
< | < | ||
- | [root@centos8 | + | root@debian11:~# top |
- | top - 09:10:02 up 8 min, | + | top - 09:22:03 up 26 days, 18:44, |
- | Tasks: | + | Tasks: |
- | %Cpu(s): | + | %Cpu(s): |
- | MiB Mem : 3737.7 total, | + | MiB Mem : 3931.2 total, |
- | MiB Swap: 2000.0 total, | + | MiB Swap: 975.0 total, |
- | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | + | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
- | | + | |
- | 827 polkitd | + | 22994 lightdm |
- | 834 dbus | + | 28304 trainee |
- | 1789 root 20 | + | |
- | 2 root 20 | + | 2 root 20 |
- | 3 root 0 -20 | + | 3 root 0 -20 |
- | 4 root 0 -20 | + | 4 root 0 -20 |
- | 6 root 0 -20 | + | 6 root 0 -20 |
- | | + | |
- | 9 root 0 -20 | + | 9 root 20 0 0 0 0 S 0.0 |
- | 10 root 20 | + | 10 root 20 |
- | 11 root 20 | + | 11 root 20 |
- | 12 root | + | 12 root |
- | 13 root rt | + | 13 root rt |
- | 14 root 20 | + | 15 root 20 |
- | 15 root 20 | + | 16 root 20 |
- | 16 root rt | + | 17 root rt |
- | 17 root rt | + | 18 root 20 |
- | 18 root 20 | + | 20 root 0 -20 |
- | 20 root 0 -20 | + | 23 root 20 |
- | 21 root 20 | + | 24 root 0 -20 |
- | 22 root rt | + | 25 root 20 |
- | | + | 27 root 20 |
- | 24 root 20 | + | 28 root 20 |
- | 26 root 0 -20 | + | 29 root 0 -20 |
- | 27 root 20 | + | 30 root 20 |
- | 28 root rt | + | |
- | 29 root rt | + | |
- | 30 root 20 | + | |
- | 32 root 0 -20 | + | |
- | | + | |
- | 36 root 0 -20 | + | |
- | 37 root 20 | + | |
- | 38 root 20 | + | |
- | 39 root 20 | + | |
- | 40 root 0 -20 | + | |
- | 41 root 20 | + | |
- | 42 root 25 | + | |
- | 43 root 39 19 | + | |
- | 44 root 0 -20 | + | |
- | 45 root 0 -20 | + | |
- | 46 root 0 -20 | + | |
- | 47 root 0 -20 | + | |
- | 48 root 0 -20 | + | |
- | 49 root 0 -20 | + | |
- | 50 root 0 -20 | + | |
- | 51 root rt | + | |
- | 53 root 0 -20 | + | |
- | 69 root 20 | + | |
- | 162 root 0 -20 | + | |
- | 163 root 0 -20 | + | |
... | ... | ||
</ | </ | ||
- | To see top's help, use the **h** key: | + | Pour afficher l'aide de la commande **top**, appuyez sur la touche |
< | < | ||
- | Help for Interactive Commands - procps-ng 3.3.15 | + | Help for Interactive Commands - procps-ng 3.3.17 |
Window 1:Def: Cumulative mode Off. System: Delay 3.0 secs; Secure mode Off. | Window 1:Def: Cumulative mode Off. System: Delay 3.0 secs; Secure mode Off. | ||
Z, | Z, | ||
- | l,t,m | + | l,t,m,I Toggle: ' |
- | 0,1,2,3,I Toggle: ' | + | 0,1,2,3,4 Toggle: ' |
f,F,X | f,F,X | ||
L,&,<,> | L,&,<,> | ||
- | R,H,V,J . Toggle: ' | + | R,H,J,C . Toggle: ' |
c,i,S,j . Toggle: ' | c,i,S,j . Toggle: ' | ||
x,y . Toggle highlights: ' | x,y . Toggle highlights: ' | ||
Ligne 1223: | Ligne 2972: | ||
u,U,o,O . Filter by: ' | u,U,o,O . Filter by: ' | ||
n,#, | n,#, | ||
- | | + | |
k,r | k,r | ||
d or s Set update interval | d or s Set update interval | ||
- | W,Y | + | W,Y,! Write config |
q Quit | q Quit | ||
( commands shown with ' | ( commands shown with ' | ||
Press ' | Press ' | ||
- | Type ' | + | Type ' |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
- | **Important** - To return to the previous display,use **q** or **escape**. | + | **Important** - Pour revenir à l' |
</ | </ | ||
- | When launched top's refresh rate is 3 seconds. To change this to 1 second, use the **s** key: | + | Au lancement, le temps de rafraîchissement de la liste est de 3 secondes. Pour modifier ce temps à 1 seconde, appuyez sur la touche |
< | < | ||
- | [root@centos8 | + | root@debian11:~# top |
... | ... | ||
- | top - 09:11:24 up 10 min, | + | top - 09:24:04 up 26 days, 18:46, |
- | Tasks: | + | Tasks: |
- | %Cpu(s): | + | %Cpu(s): |
- | MiB Mem : 3737.7 total, | + | MiB Mem : 3931.2 total, |
- | MiB Swap: 2000.0 total, | + | MiB Swap: 975.0 total, |
Change delay from 3.0 to 1 | Change delay from 3.0 to 1 | ||
+ | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | ||
... | ... | ||
</ | </ | ||
- | To sort the list by memory usage, use the **M** key: | + | Pour trier la liste selon l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# top |
... | ... | ||
- | top - 09:12:07 up 10 min, | + | top - 09:25:13 up 26 days, 18:48, |
- | Tasks: | + | Tasks: |
- | %Cpu(s): | + | %Cpu(s): |
- | MiB Mem : 3737.7 total, | + | MiB Mem : 3931.2 total, |
- | MiB Swap: 2000.0 total, | + | MiB Swap: 975.0 total, |
- | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | + | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
- | 874 root | + | 22994 lightdm |
- | | + | |
- | 902 root | + | 22007 trainee |
- | 827 polkitd | + | 22947 root |
- | 884 root | + | 22045 trainee |
- | 866 root | + | 22036 trainee |
- | 840 root | + | 22146 trainee |
- | 1 root | + | 22051 trainee |
- | 1627 root | + | 22096 trainee |
- | 666 root | + | 22052 trainee |
- | 1585 root | + | 22094 trainee |
- | 1590 trainee | + | |
- | | + | |
- | 632 root | + | 22093 trainee |
- | 837 root | + | 22040 trainee |
- | 905 root | + | 22024 trainee |
- | 847 rngd | + | 22119 trainee |
- | 828 root | + | 22063 trainee |
- | 1600 trainee | + | |
- | 1601 trainee | + | |
- | 834 dbus | + | 12807 root |
- | 1634 root | + | 22060 trainee |
- | | + | |
- | 1594 trainee | + | |
- | 1113 root | + | 22122 trainee |
- | | + | 22084 colord |
- | 1803 root 20 | + | |
... | ... | ||
</ | </ | ||
- | To see the zombie and waiting processes, use the **i** key: | + | Pour ne pas visualiser les processus zombies ou les processus en attente, appuyez sur la touche |
< | < | ||
- | [root@centos8 | + | root@debian11:~# top |
... | ... | ||
- | top - 09:13:01 up 11 min, | + | top - 09:26:38 up 26 days, 18:49, |
- | Tasks: | + | Tasks: |
- | %Cpu(s): | + | %Cpu(s): |
- | MiB Mem : 3737.7 total, | + | MiB Mem : 3931.2 total, |
- | MiB Swap: 2000.0 total, | + | MiB Swap: 975.0 total, |
- | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | + | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
- | 827 polkitd | + | |
- | 1 root 20 | + | |
- | 823 root 20 | + | |
- | 1803 root 20 | + | |
</ | </ | ||
- | To leave top, use the **q** key. | + | Pour quitter |
- | ===Command Line Switches=== | + | Les options de cette commande sont : |
- | + | ||
- | The command line switches for the top command are : | + | |
< | < | ||
- | [root@centos8 | + | root@debian11:~# top --help |
top: inappropriate ' | top: inappropriate ' | ||
Usage: | Usage: | ||
- | top -hv | -bcEHiOSs1 | + | top -hv | -bcEeHiOSs1 |
</ | </ | ||
- | ====The lsof Command==== | + | ====4.4 - La commande |
- | This command' | + | La commande **lsof** affiche des informations sur les fichiers ouverts par des processus |
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:/tmp$ su - |
Password: fenestros | Password: fenestros | ||
- | [root@centos8 | + | root@debian11:~# lsof | more |
- | COMMAND | + | COMMAND |
- | SIZE/ | + | systemd |
- | systemd | + | systemd |
- | 224 128 / | + | systemd |
- | systemd | + | systemd |
- | 224 128 / | + | .0.29.0 |
- | systemd | + | systemd |
- | | + | 1 |
- | systemd | + | systemd |
- | | + | 0.0 |
- | systemd | + | systemd |
- | 628744 | + | .10.1 |
- | systemd | + | systemd |
- | | + | .so |
- | systemd | + | systemd |
- | | + | systemd |
- | systemd | + | 5 |
- | 303944 | + | systemd |
- | systemd | + | 8 |
- | 145984 | + | systemd |
- | systemd | + | systemd |
- | 71528 | + | .0 |
- | systemd | + | systemd |
+ | .2.8 | ||
+ | systemd | ||
+ | .0 | ||
+ | systemd | ||
+ | systemd | ||
+ | .0 | ||
+ | systemd | ||
+ | 253 | ||
+ | systemd | ||
--More-- | --More-- | ||
+ | [q] | ||
</ | </ | ||
- | ===Command Line Switches=== | + | Les options de cette commande sont : |
- | <WRAP center round todo 60%> | + | <code> |
- | **To do** : Use the **--help** | + | root@debian11:~# lsof --help |
- | </WRAP> | + | lsof: illegal option character: - |
+ | lsof: -e not followed by a file system path: " | ||
+ | lsof 4.93.2 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] | ||
+ | [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names] | ||
+ | Defaults in parentheses; | ||
+ | -?|-h list help -a AND selections (OR) -b avoid kernel blocks | ||
+ | -c c cmd c ^c / | ||
+ | -d s select by FD set +D D dir D tree *SLOW?* +|-e s exempt s *RISKY* | ||
+ | -i select IPv[46] files -K [i] list|(i)gn tasKs -l list UID numbers | ||
+ | -n no host names -N select NFS files -o list file offset | ||
+ | -O no overhead | ||
+ | -s list file size -t terse listing | ||
+ | -U select Unix socket | ||
+ | +|-w Warnings (+) -X skip TCP& | ||
+ | -- end option scan | ||
+ | -E display endpoint info +E display endpoint info and files | ||
+ | +f|-f +filesystem or -file names | ||
+ | -F [f] select fields; -F? for help | ||
+ | +|-L [l] list (+) suppress (-) link counts < l (0 = all; default = 0) | ||
+ | +m [m] use|create mount supplement | ||
+ | +|-M | ||
+ | -p s | ||
+ | -T qs TCP/TPI Q,St (s) info | ||
+ | -g [s] exclude(^)|select and print process group IDs | ||
+ | -i i | ||
+ | +|-r [t[m< | ||
+ | An optional suffix | ||
+ | <fmt> is an strftime(3) format for the marker | ||
+ | -s p:s exclude(^)|select protocol (p = TCP|UDP) states by name(s). | ||
+ | -u s | ||
+ | -x [fl] cross over +d|+D File systems or symbolic Links | ||
+ | names select named files or files on named file systems | ||
+ | Anyone can list all files; /dev warnings disabled; kernel ID check disabled. | ||
+ | </code> | ||
+ | =====LAB # 5 - Mesurer l' | ||
- | =====LAB # 3 - Measuring Network Usage and System Availability===== | + | ====5.1 - La Commande netstat==== |
- | ====3.1 - The netstat | + | Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** : |
- | ====netstat | + | < |
+ | root@debian11: | ||
- | To see networking statistics, use the **netstat** command: | + | root@debian11:~# netstat -i |
- | + | ||
- | < | + | |
- | [root@centos8 | + | |
Kernel Interface table | Kernel Interface table | ||
- | Iface | + | Iface MTU RX-OK RX-ERR RX-DRP RX-OVR |
- | ens18 1500 476056 | + | ens18 |
- | lo 65536 | + | lo |
- | virbr0 | + | |
</ | </ | ||
- | ===Command Line Switches=== | + | Les options de cette commande sont : |
- | + | ||
- | The command line switches of this command are: | + | |
< | < | ||
- | [root@centos8 | + | root@debian11:~# netstat --help |
usage: netstat [-vWeenNcCF] [< | usage: netstat [-vWeenNcCF] [< | ||
| | ||
- | | + | |
-r, --route | -r, --route | ||
- | -I, --interfaces=< | ||
-i, --interfaces | -i, --interfaces | ||
-g, --groups | -g, --groups | ||
Ligne 1424: | Ligne 3211: | ||
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) | inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) | ||
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) | netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) | ||
- | x25 (CCITT X.25) | + | x25 (CCITT X.25) |
- | </ | + | |
- | + | ||
- | ====3.2 - The w Command==== | + | |
- | + | ||
- | This command outputs the same data as the **uptime** command on the first line and then complements this information with the details of each user connected to the system, including what each user is currently doing. This is the replacement under Linux for the Unix command **whodo**: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# w | + | |
- | | + | |
- | USER | + | |
- | trainee | + | |
- | </ | + | |
- | + | ||
- | The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs. | + | |
- | + | ||
- | The PCPU time is the time used by the current process, named in the **what** field. | + | |
- | + | ||
- | ===Command Line Switches=== | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | **To do** : Use the **--help** option of the **w** command to view the command line switches. | + | |
- | </ | + | |
- | + | ||
- | ====3.3 - The uptime Command==== | + | |
- | + | ||
- | This command prints to standard output the current time, the length of time the system has been up, the number of users on the system and the average number of jobs in the run queue over the last 1, 5 and 15 minutes: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# uptime | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | If the load average of a single-core system was **3.48 | + | |
- | + | ||
- | * 2.48 processes would have been waiting to be executed over the last minute, | + | |
- | * 3.00 processes would have been waiting to be executed over the last 5 minutes, | + | |
- | * 2.85 processes would have been waiting to be executed over the last 15 minutes, | + | |
- | + | ||
- | The command line switches of these commands are: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# uptime --help | + | |
- | + | ||
- | Usage: | + | |
- | | + | |
- | + | ||
- | Options: | + | |
- | -p, --pretty | + | |
- | -h, --help | + | |
- | -s, --since | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see uptime(1). | + | |
- | + | ||
- | [root@centos8 ~]# w --help | + | |
- | + | ||
- | Usage: | + | |
- | w [options] | + | |
- | + | ||
- | Options: | + | |
- | -h, --no-header | + | |
- | -u, --no-current | + | |
- | -s, --short | + | |
- | -f, --from | + | |
- | -o, --old-style | + | |
- | -i, --ip-addr | + | |
- | + | ||
- | | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see w(1). | + | |
</ | </ | ||