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/05 04:50] – 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 |
- | FIXME: Add collectd | + | * **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 | ||
- | =====Contents===== | + | =====Présentation des Fichiers Spéciaux===== |
- | | + | Dans l' |
- | | + | |
- | | + | |
- | | + | |
- | * 1.2 - collectd | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * 3.1 - La Commande netstat | + | |
- | * 3.2 - Les Commandes uptime et w | + | |
- | =====LAB#1 - Interprétation des informations dans /proc===== | + | <WRAP center round important 60%> |
+ | **Important** : Les périphériques qui nécessitent à ce que l' | ||
+ | </ | ||
+ | |||
+ | 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' | ||
+ | |||
+ | < | ||
+ | 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 in use: virtio-pci | ||
+ | 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 in use: virtio-pci | ||
+ | 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 the following to stop low-level messages on console | ||
+ | # | ||
+ | |||
+ | ################################################################### | ||
+ | # 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# | ||
Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | ||
* free, | * free, | ||
+ | * uptime et w, | ||
* iostat, | * iostat, | ||
* hdparm, | * hdparm, | ||
Ligne 43: | Ligne 1186: | ||
* collectd. | * collectd. | ||
- | ====1.1 - La Commande free==== | + | ====3.1 - La Commande free==== |
La commande **free** permet de donner l’état de la mémoire totale, libre, partagée, swap et bufferisée. Saisissez donc la commande suivante : | La commande **free** permet de donner l’état de la mémoire totale, libre, partagée, swap et bufferisée. Saisissez donc la commande suivante : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# free -m |
- | total used free shared | + | |
- | Mem: 3735 1135 1818 14 | + | Mem: |
- | Swap: | + | Swap: |
</ | </ | ||
Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : | ||
- | * 3735 Mo de mémoire physique totale, | + | * 3931 Mo de mémoire physique totale, |
- | * 1135 Mo de mémoire physique utilisée et 1818 Mo de mémoire physique libre, | + | * 147 Mo de mémoire physique utilisée et 2543 Mo de mémoire physique libre, |
- | * 3279 Mo de mémoire swap totale et 0 Mo de swap utilisé | + | * 974 Mo de mémoire swap totale et 0 Mo de swap utilisé |
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# free --help |
Usage: | Usage: | ||
Ligne 94: | Ligne 1237: | ||
</ | </ | ||
- | ====1.2 - La Commande iostat==== | + | ====3.2 - Les Commandes uptime et w==== |
- | La commande **iostat** affiche | + | Chacune |
< | < | ||
- | [root@centos8 | + | root@debian11:~# uptime |
- | bash: iostat: command not found... | + | 15:51:36 up 4 days, 2:43, 1 user, load average: 0.10, 0.03, 0.01 |
- | Install package ' | + | |
+ | root@debian11: | ||
+ | | ||
+ | USER | ||
+ | trainee | ||
+ | </ | ||
- | * Waiting in queue... | + | Les valeurs |
- | The following packages have to be installed: | + | |
- | | + | |
- | | + | |
- | Proceed with changes? [N/y] y | + | |
+ | Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3, | ||
- | | + | * 2,48 processus en attente dans la dernière minute, |
- | | + | |
- | * Waiting | + | * 2,85 processus en attente dans les dernières 15 minutes. |
- | * Downloading packages... | + | |
- | * Requesting data... | + | Les options de ces commandes sont : |
- | * Testing changes... | + | |
- | | + | < |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | root@debian11: |
+ | |||
+ | Usage: | ||
+ | | ||
+ | |||
+ | Options: | ||
+ | -p, --pretty | ||
+ | -h, --help | ||
+ | -s, --since | ||
+ | -V, --version | ||
+ | |||
+ | For more details see uptime(1). | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | 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). | ||
+ | </ | ||
+ | |||
+ | ====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 | ||
</ | </ | ||
Ligne 148: | Ligne 1338: | ||
* Le nombre de blocs de KB lus par seconde. | * Le nombre de blocs de KB lus par seconde. | ||
* Le nombre de blocs de KB écrits par seconde. | * Le nombre de blocs de KB écrits par seconde. | ||
+ | * Le nombre de blocs de KB jetés par seconde. | ||
* Le nombre total de KB lus. | * Le nombre total de KB lus. | ||
* Le nombre total de KB écrits. | * Le nombre total de KB écrits. | ||
+ | * Le nombre total de KB jetés. | ||
| | ||
Dernièrement, | 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 | ||
</ | </ | ||
Ligne 168: | Ligne 1362: | ||
< | < | ||
- | [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 - La Commande hdparm==== | + | ====3.4 - La Commande hdparm==== |
Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# hdparm -t /dev/sdc |
- | /dev/sda: | + | root@debian11: |
- | | + | |
+ | root@debian11: | ||
+ | |||
+ | /dev/sdc: | ||
+ | | ||
</ | </ | ||
- | ====1.4 - La Commande vmstat==== | + | ====3.5 - La Commande vmstat==== |
La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur : | La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# vmstat 1 10 |
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Ligne 247: | Ligne 1446: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# vmstat --help |
Usage: | Usage: | ||
Ligne 275: | Ligne 1474: | ||
</ | </ | ||
- | ====1.5 - La Commande mpstat==== | + | ====3.6 - La Commande mpstat==== |
La commande **mpstat** affiche des statistiques détaillées sur le CPU : | La commande **mpstat** affiche des statistiques détaillées sur le CPU : | ||
< | < | ||
- | [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 |
</ | </ | ||
Ligne 290: | Ligne 1489: | ||
< | < | ||
- | [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: | + | |
</ | </ | ||
Ligne 308: | Ligne 1501: | ||
< | < | ||
- | [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: | + | |
</ | </ | ||
Ligne 381: | Ligne 1538: | ||
< | < | ||
- | [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 - La Commande sar==== | + | ====3.7 - La Commande sar==== |
- | La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l' | + | La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l' |
- | Sous RHEL/CentOS 8 la commande **/usr/lib64/sa/sadc** permet de collecter les informations : | + | ^ Option ^ Description ^ |
+ | | -u | Pourcentage d' | ||
+ | | -q | Nombre de processus en attente | | ||
+ | | -r | Utilisation de la mémoire centrale | | ||
+ | | -w | Surveillance du swapping | | ||
+ | | -p | Surveillance de la pagination | | ||
+ | | -b | Utilisation des tampons | | ||
+ | | -d | Utilisation des disques | | ||
+ | |||
+ | Sous Debian 11 la commande **/usr/lib/sysstat/sadc** permet de collecter les informations : | ||
< | < | ||
- | [root@centos8 | + | root@debian8:~# ls /usr/lib/sysstat/ |
- | sa1 sa2 sadc | + | debian-sa1 |
</ | </ | ||
- | Le script **/usr/lib64/sa/ | + | Le script **/usr/lib/sysstat/ |
^ Option ^ Description ^ | ^ Option ^ Description ^ | ||
- | | -t | L'intervalle | + | | -t | L'interval |
| -n | Nombre de collectes | | | -n | Nombre de collectes | | ||
- | Le script **/usr/lib64/sa/ | + | Le script **/usr/lib/sysstat/ |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# ls / | + | |
- | sa29 s | + | |
- | + | Sous Debian 11, l' | |
- | ar29 | + | |
- | </ | + | |
- | + | ||
- | Sous CentOS / RHEL 8, 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 437: | Ligne 1596: | ||
La valeur de **OnCalendar** indique un collecte toutes les dix minutes. | La valeur de **OnCalendar** indique un collecte toutes les dix minutes. | ||
- | Pour modifier l' | + | 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 | ||
Ligne 448: | Ligne 1611: | ||
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: | ||
</ | </ | ||
Ligne 458: | Ligne 1654: | ||
< | < | ||
- | [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: | ||
- | ... | ||
- | </ | ||
Saisissez la commande suivante : | 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: | + | |
</ | </ | ||
Ligne 569: | Ligne 1689: | ||
< | < | ||
- | [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: |
</ | </ | ||
Ligne 582: | Ligne 1702: | ||
< | < | ||
- | [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: |
</ | </ | ||
Ligne 595: | Ligne 1715: | ||
< | < | ||
- | [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: | ||
</ | </ | ||
Ligne 618: | Ligne 1739: | ||
< | < | ||
- | [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: |
</ | </ | ||
+ | |||
+ | HERE | ||
Utilisez l' | 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: |
</ | </ | ||
Ligne 646: | Ligne 1769: | ||
< | < | ||
- | [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: |
</ | </ | ||
Ligne 661: | Ligne 1784: | ||
< | < | ||
- | [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: | ||
</ | </ | ||
- | La colonne | + | 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: | + | |
</ | </ | ||
Ligne 731: | Ligne 1835: | ||
< | < | ||
- | [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 774: | Ligne 1878: | ||
FC Fibre channel HBAs | FC Fibre channel HBAs | ||
SOFT Software-based network processing | SOFT Software-based network processing | ||
- | -q Queue length and load average statistics [A_QUEUE] | + | -q [ < |
+ | 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 786: | Ligne 1896: | ||
</ | </ | ||
- | =====LAB #2 - Processus et Fichiers Ouverts===== | + | ====3.8 - La Commande collectd==== |
+ | |||
+ | collectd est une solution open sourceavec des plugins qui peuvent collecter des statistiques système pour une grande variété d' | ||
+ | |||
+ | Le paquet collectd n'est pas installé par défaut sous Debian 11 : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | Vérifiez que le service collectd est en cours d' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | ● collectd.service - Statistics collection and monitoring daemon | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | | ||
+ | Main PID: 2088 (collectd) | ||
+ | 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]: | ||
+ | </ | ||
+ | |||
+ | <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@debian11: | ||
+ | # Config file for collectd(1). | ||
+ | # | ||
+ | # Some plugins need additional configuration and are disabled by default. | ||
+ | # Please read collectd.conf(5) for details. | ||
+ | # | ||
+ | # You should also read / | ||
+ | # before enabling any more plugins. | ||
+ | |||
+ | ############################################################################## | ||
+ | # Global | ||
+ | # | ||
+ | # Global settings for the daemon. | ||
+ | ############################################################################## | ||
+ | |||
+ | #Hostname " | ||
+ | FQDNLookup true | ||
+ | #BaseDir "/ | ||
+ | #PluginDir "/ | ||
+ | #TypesDB "/ | ||
+ | |||
+ | # | ||
+ | # When enabled, plugins are loaded automatically with the default options | ||
+ | # when an appropriate <Plugin ...> block is encountered. | ||
+ | # Disabled by default. | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # When enabled, internal statistics are collected, using " | ||
+ | # plugin name. # | ||
+ | # Disabled by default. | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # Interval at which to query values. This may be overwritten on a per-plugin # | ||
+ | # base by using the ' | ||
+ | # < | ||
+ | # | ||
+ | # </ | ||
+ | # | ||
+ | #Interval 10 | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Limit the size of the write queue. Default is no limit. Setting up a limit | ||
+ | # is recommended for servers handling a high volume of traffic. | ||
+ | # | ||
+ | # | ||
+ | |||
+ | ############################################################################## | ||
+ | # Logging | ||
+ | # | ||
+ | # Plugins which provide logging functions should be loaded first, so log # | ||
+ | # messages generated when loading or configuring other plugins can be # | ||
+ | --More--(8%) | ||
+ | </ | ||
+ | |||
+ | D' | ||
+ | |||
+ | < | ||
+ | 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 60%> | ||
+ | **Important** : Il vous est possible d' | ||
+ | </ | ||
+ | |||
+ | Comme indique le nom de chaque fichier, le contenu est composé de règles à l' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | # do not edit this file, it will be overwritten on update | ||
+ | |||
+ | # run a command on remove events | ||
+ | ACTION==" | ||
+ | ACTION==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | |||
+ | # select " | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | mported" | ||
+ | ENV{MODALIAS}!="", | ||
+ | LABEL=" | ||
+ | |||
+ | ACTION!=" | ||
+ | |||
+ | 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@debian11: | ||
+ | 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: | ||
+ | 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===== | ||
- | ====2.1 - Présentation==== | + | =====Présentation===== |
Un processus est un fichier binaire ( binary file ) qui est chargé en mémoire centrale. Une fois chargé la mémoire exécute le programme en langage machine. Quand le programme est chargé, il a besoin du système d’exploitation qui lui fournit des informations pour qu’il puisse s’exécuter correctement. Ces informations sont appelées des **données d’identification**. | Un processus est un fichier binaire ( binary file ) qui est chargé en mémoire centrale. Une fois chargé la mémoire exécute le programme en langage machine. Quand le programme est chargé, il a besoin du système d’exploitation qui lui fournit des informations pour qu’il puisse s’exécuter correctement. Ces informations sont appelées des **données d’identification**. | ||
Ligne 808: | Ligne 2484: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cd /proc; ls -d [0-9]* |
- | 1 1113 1158 1464 1590 1601 163 | + | 1 |
- | 10 1125 12 1465 1594 162 | + | 10 |
- | 11 1126 13 15 16 1627 164 | + | 11 |
- | 1111 1135 14 1585 1600 1628 165 | + | 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 | ||
</ | </ | ||
Ligne 818: | Ligne 2501: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/proc# cd 1 ; ls -l |
total 0 | total 0 | ||
- | dr-xr-xr-x. 2 root root 0 Jun 3 09:01 attr | + | -r--r--r-- |
- | -rw-r--r--. 1 root root 0 Jun | + | dr-xr-xr-x |
- | -r--------. 1 root root 0 Jun | + | -rw-r--r-- |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 cgroup | + | -r-------- |
- | --w-------. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 cmdline | + | --w------- |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 comm | + | -r--r--r-- |
- | -rw-r--r--. 1 root root 0 Jun 3 09:02 coredump_filter | + | -rw-r--r-- |
- | -r--r--r--. 1 root root 0 Jun | + | -rw-r--r-- |
- | -r--r--r--. 1 root root 0 Jun | + | -r--r--r-- |
- | lrwxrwxrwx. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--------. 1 root root 0 Jun 3 09:01 environ | + | lrwxrwxrwx |
- | lrwxrwxrwx. 1 root root 0 Jun 3 09:01 exe -> / | + | -r-------- |
- | dr-x------. 2 root root 0 Jun 3 09:01 fd | + | lrwxrwxrwx |
- | dr-x------. 2 root root 0 Jun | + | dr-x------ |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 gid_map | + | dr-x------ |
- | -r--------. 1 root root 0 Jun | + | -rw-r--r-- |
- | -r--r--r--. 1 root root 0 Jun 3 09:02 limits | + | -r-------- |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 loginuid | + | -r--r--r-- |
- | dr-x------. 2 root root 0 Jun | + | -rw-r--r-- |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 maps | + | dr-x------ |
- | -rw-------. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 mountinfo | + | -rw------- |
- | -r--r--r--. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--------. 1 root root 0 Jun | + | -r--r--r-- |
- | dr-xr-xr-x. 6 root root 0 Jun 3 09:01 net | + | -r-------- |
- | dr-x--x--x. 2 root root 0 Jun | + | dr-xr-xr-x |
- | -r--r--r--. 1 root root 0 Jun | + | dr-x--x--x |
- | -rw-r--r--. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--r--r--. 1 root root 0 Jun | + | -rw-r--r-- |
- | -rw-r--r--. 1 root root 0 Jun 3 09:02 oom_score_adj | + | -r--r--r-- |
- | -r--------. 1 root root 0 Jun | + | -rw-r--r-- |
- | -r--------. 1 root root 0 Jun | + | -r-------- |
- | -r--------. 1 root root 0 Jun | + | -r-------- |
- | -rw-r--r--. 1 root root 0 Jun | + | -r-------- |
- | lrwxrwxrwx. 1 root root 0 Jun 3 09:01 root -> / | + | -rw-r--r-- |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 sched | + | lrwxrwxrwx |
- | -r--r--r--. 1 root root 0 Jun | + | -rw-r--r-- |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 sessionid | + | -r--r--r-- |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 setgroups | + | -r--r--r-- |
- | -r--r--r--. 1 root root 0 Jun | + | -rw-r--r-- |
- | -r--r--r--. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--------. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--r--r--. 1 root root 0 Jun | + | -r-------- |
- | -r--r--r--. 1 root root 0 Jun | + | -r--r--r-- |
- | -r--r--r--. 1 root root 0 Jun 3 09:01 status | + | -r--r--r-- |
- | -r--------. 1 root root 0 Jun | + | -r--r--r-- |
- | dr-xr-xr-x. 3 root root 0 Jun | + | -r-------- |
- | -r--r--r--. 1 root root 0 Jun | + | dr-xr-xr-x |
- | -rw-rw-rw-. 1 root root 0 Jun | + | -rw-r--r-- |
- | -rw-r--r--. 1 root root 0 Jun 3 09:01 uid_map | + | -r--r--r-- |
- | -r--r--r--. 1 root root 0 Jun | + | -rw-rw-rw- |
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** - Vous n'avez pas besoin de consulter le contenu des fichiers et des répertoires. Il convient tout simplement de savoir que ces données existent. | **Important** - Vous n'avez pas besoin de consulter le contenu des fichiers et des répertoires. Il convient tout simplement de savoir que ces données existent. | ||
</ | </ | ||
- | ====2.2 - Les Types de Processus==== | + | =====Les Types de Processus===== |
Il existe trois types de processus : | Il existe trois types de processus : | ||
Ligne 898: | Ligne 2583: | ||
* //zombie// – le processus a terminé son exécution et est prêt à mourir. | * //zombie// – le processus a terminé son exécution et est prêt à mourir. | ||
- | ====2.3 - La Commande ps==== | + | ====4.1 - La Commande ps==== |
Cette commande affiche les processus de l’utilisateur attaché au terminal : | Cette commande affiche les processus de l’utilisateur attaché au terminal : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
- | [root@centos8 | + | |
+ | 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:~# ps --forest | ||
PID TTY TIME CMD | PID TTY TIME CMD | ||
- | | + | 28309 pts/1 |
- | 1634 pts/0 | + | |
- | 1690 pts/0 | + | |
</ | </ | ||
Ligne 914: | Ligne 2606: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps -l |
F S | F S | ||
- | 4 S | + | 4 S |
- | 4 S | + | 4 S |
- | 0 R | + | 4 R |
</ | </ | ||
Ligne 941: | Ligne 2633: | ||
< | < | ||
- | [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 973: | Ligne 2665: | ||
^ RSS | La mémoire utilisée en kilobytes par le processus | | ^ RSS | La mémoire utilisée en kilobytes par le processus | | ||
^ STAT | La même chose que S dans l' | ^ STAT | La même chose que S dans l' | ||
- | |||
Avec des options a,u et x la commande affiche le résultat suivant : | Avec des options a,u et x la commande affiche le résultat suivant : | ||
< | < | ||
- | [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-- | ||
</ | </ | ||
Ligne 1014: | Ligne 2705: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps --help all |
Usage: | Usage: | ||
Ligne 1097: | Ligne 2788: | ||
</ | </ | ||
- | ====2.4 - La Commande pstree==== | + | ====4.2 - La Commande pstree==== |
Cette commande affiche les processus en forme d' | 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}] | ||
</ | </ | ||
Ligne 1137: | Ligne 2873: | ||
< | < | ||
- | [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 1166: | 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 | ||
</ | </ | ||
- | ====2.5 - La Commande top==== | + | ====4.3 - La Commande top==== |
Cette commande indique les processus en mémoire : | 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 | + | |
... | ... | ||
</ | </ | ||
Ligne 1242: | Ligne 2957: | ||
< | < | ||
- | 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 1257: | 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** - Pour revenir à l' | **Important** - Pour revenir à l' | ||
</ | </ | ||
Ligne 1275: | Ligne 2990: | ||
< | < | ||
- | [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 | ||
... | ... | ||
</ | </ | ||
Ligne 1289: | Ligne 3005: | ||
< | < | ||
- | [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 | + | |
... | ... | ||
</ | </ | ||
Ligne 1331: | Ligne 3046: | ||
< | < | ||
- | [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 | + | |
</ | </ | ||
Ligne 1351: | Ligne 3063: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# top --help |
top: inappropriate ' | top: inappropriate ' | ||
Usage: | Usage: | ||
- | top -hv | -bcEHiOSs1 | + | top -hv | -bcEeHiOSs1 |
</ | </ | ||
- | ====2.6 - La commande lsof==== | + | ====4.4 - La commande lsof==== |
La commande **lsof** affiche des informations sur les fichiers ouverts par des processus : | La commande **lsof** affiche des informations sur les fichiers ouverts par des processus : | ||
< | < | ||
- | [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] | ||
</ | </ | ||
Ligne 1394: | Ligne 3116: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# lsof --help |
lsof: illegal option character: - | lsof: illegal option character: - | ||
lsof: -e not followed by a file system path: " | lsof: -e not followed by a file system path: " | ||
Ligne 1403: | Ligne 3125: | ||
| | ||
[-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] | [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] | ||
- | [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [-Z [Z]] [--] [names] | + | [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names] |
Defaults in parentheses; | Defaults in parentheses; | ||
-?|-h list help -a AND selections (OR) -b avoid kernel blocks | -?|-h list help -a AND selections (OR) -b avoid kernel blocks | ||
Ligne 1435: | Ligne 3157: | ||
</ | </ | ||
- | =====LAB # 3 - Mesurer l' | + | =====LAB # 5 - Mesurer l' |
- | ====3.1 - La Commande netstat==== | + | ====5.1 - La Commande netstat==== |
Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** : | Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# apt install net-tools |
+ | |||
+ | root@debian11: | ||
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 | + | |
</ | </ | ||
Ligne 1453: | Ligne 3176: | ||
< | < | ||
- | [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 1489: | Ligne 3211: | ||
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) | inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) | ||
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) | netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) | ||
- | x25 (CCITT X.25) | + | x25 (CCITT X.25) |
- | </ | + | |
- | + | ||
- | ====3.2 - Les Commandes uptime et w==== | + | |
- | + | ||
- | Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# uptime | + | |
- | | + | |
- | + | ||
- | [root@centos8 ~]# w | + | |
- | | + | |
- | USER | + | |
- | trainee | + | |
- | </ | + | |
- | + | ||
- | Les valeurs **load average** ou //charge moyenne// indiquent le nombre moyen de processus en cours de traitement ou en attente pour la période concernée. | + | |
- | + | ||
- | Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3, | + | |
- | + | ||
- | * 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 ~]# 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). | + | |
</ | </ | ||