Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:redhat:rh134:l102 [2024/09/26 13:29] – created admin | elearning:workbooks:redhat:rh134:l102 [2024/10/24 12:56] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======RH12411 | + | ======RH13403 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **RH12411 | + | * **RH13403 |
- | * Présentation | + | * Contenu du Module |
- | * La Commande dmesg | + | * Présentation des Fichiers Spéciaux |
- | * LAB #1 - Surveillance Sécuritaire | + | * LAB #1 - Découvrir le Matériel |
- | * 1.1 - La Commande | + | * 1.1 - La Commande |
- | * 1.2 - La Commande | + | * 1.2 - La Commande |
- | * 1.3 - La Commande | + | * 1.3 - La Commande |
- | * 1.4 - Le Fichier / | + | * 1.4 - La Commande lsscsi |
- | * 1.5 - Gestion des évènements audit | + | * 1.5 - La Commande lscpu |
- | * Le fichier / | + | * 1.6 - La Commande lshw |
- | * auditd | + | * 1.7 - La Commande dmidecode |
- | * auditctl | + | * 1.8 - La Commande smartctl |
- | * audispd | + | * 1.9 - Les Commandes accton et dump-acct |
- | * La consultation des événements audit | + | * 1.10 - La Commande lastcomm |
- | * La Commande | + | * 1.11 - La Commande |
- | * La Commande | + | * 1.12 - La Commande |
- | * Le fichier / | + | * LAB #2 - Réglage de la performance du système |
- | * Applications | + | * 2.1 - Présentation |
- | * LAB #2 - rsyslog | + | * 2.2 - Le fichier / |
- | * 2.1 - Priorités | + | * 2.3 - Profils |
- | * 2.2 - Sous-systèmes applicatifs | + | * LAB #3 - La Commande sysctl |
- | * 2.3 - / | + | * 3.1 - Répertoire /proc |
- | * Modules | + | * Fichiers |
- | * Directives Globales | + | * Processeur |
- | * Règles | + | * Interruptions |
- | * Sous-système applicatif.Priorité | + | * Canaux DMA |
- | * Sous-système | + | * Plages d' |
- | * Sous-système applicatif=Priorité | + | * Périphériques |
- | * L' | + | * Modules |
- | * n Sous-systèmes avec la même priorité | + | * Statistiques de l' |
- | * n Sélecteurs avec la même Action | + | |
- | * LAB #3 - La Commande | + | * Espaces de pagination |
- | * LAB #4 - La Commande logrotate | + | * Statistiques d' |
- | * LAB #5 - La Journalisation avec journald | + | * Statistiques d' |
- | * 5.1 - Consultation des Journaux | + | * Version du noyau |
- | * 5.2 - Consultation des Journaux d'une Application Spécifique | + | * Répertoires |
- | * 5.3 - Consultation des Journaux depuis le Dernier Démarrage | + | * ide/scsi |
- | * 5.4 - Consultation des Journaux d'une Priorité Spécifique | + | * acpi |
- | * 5.5 - Consultation des Journaux d'une Plage de Dates ou d' | + | * bus |
- | * 5.6 - Consultation des Journaux en Live | + | * net |
- | * 5.7 - Consultation des Journaux avec des Mots Clefs | + | * sys |
+ | | ||
+ | * LAB #4 - Interprétation des informations dans /proc | ||
+ | * 4.1 - free | ||
+ | * 4.2 - uptime ou w | ||
+ | * 4.3 - iostat | ||
+ | * 4.4 - hdparm | ||
+ | * 4.5 - vmstat | ||
+ | * 4.6 - mpstat | ||
+ | * 4.7 - sar | ||
+ | * Modules usb | ||
+ | * udev | ||
+ | * La Commande udevadm | ||
+ | * Système | ||
+ | * LAB #5 - Limiter les Ressources | ||
+ | * 5.1 - ulimit | ||
+ | * 5.2 - Groupes de Contrôle | ||
- | =====Présentation===== | + | =====Présentation |
- | La majorité | + | Dans l' |
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Il est conseillé de déplacer le point de montage du répertoire | + | **Important** : Les périphériques qui nécessitent à ce que l' |
</ | </ | ||
- | =====La Commande / | + | Consultez le contenu |
- | + | ||
- | Cette commande retourne les messages | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [ | + | total 0 |
- | CC)) #1 SMP Thu Apr 8 19:01:30 UTC 2021 | + | crw-r--r--. 1 root root 10, 235 Oct 22 11:01 autofs |
- | [ 0.000000] Command line: BOOT_IMAGE=(hd0, | + | drwxr-xr-x. 2 root root 160 Oct 22 11:01 block |
- | shkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet | + | drwxr-xr-x. 2 root root 80 Oct 22 11:01 bsg |
- | [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | + | drwxr-xr-x. 3 root root 60 Oct 22 11:01 bus |
- | [ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | + | lrwxrwxrwx. 1 root root 3 Oct 22 11:01 cdrom -> sr0 |
- | [ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | + | drwxr-xr-x. 2 root root 2980 Oct 22 11:02 char |
- | [ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 | + | crw--w----. 1 root tty 5, 1 Oct 22 11:01 console |
- | [ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using ' | + | lrwxrwxrwx. 1 root root 11 Oct 22 11:01 core -> /proc/ |
- | [ 0.000000] BIOS-provided physical RAM map: | + | drwxr-xr-x. 6 root root 120 Oct 22 11:01 cpu |
- | [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable | + | crw-------. 1 root root 10, 124 Oct 22 11:01 cpu_dma_latency |
- | [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved | + | drwxr-xr-x. 7 root root 140 Oct 22 11:01 disk |
- | [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved | + | brw-rw----. 1 root disk 253, 0 Oct 22 11:01 dm-0 |
- | [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable | + | brw-rw----. 1 root disk 253, 1 Oct 22 11:01 dm-1 |
- | [ 0.000000] BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data | + | drwxr-xr-x. 2 root root 60 Oct 22 11:01 dma_heap |
- | [ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved | + | drwxr-xr-x. 3 root root 80 Oct 22 11:01 dri |
- | [ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved | + | crw-rw----. 1 root video 29, 0 Oct 22 11:01 fb0 |
- | [ | + | lrwxrwxrwx. 1 root root 13 Oct 22 11:01 fd -> /proc/ |
- | [ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable | + | crw-rw-rw-. 1 root root 1, 7 Oct 22 11:01 full |
- | [ 0.000000] NX (Execute Disable) protection: active | + | crw-rw-rw-. 1 root root 10, 229 Oct 22 11:01 fuse |
- | [ | + | crw-------. 1 root root 242, 0 Oct 22 11:01 hidraw0 |
- | [ 0.000000] DMI: innotek GmbH VirtualBox/ | + | crw-------. 1 root root 10, 228 Oct 22 11:01 hpet |
- | [ 0.000000] Hypervisor detected: KVM | + | drwxr-xr-x. |
+ | crw-------. 1 root root 10, 183 Oct 22 11:01 hwrng | ||
+ | lrwxrwxrwx. 1 root root 12 Oct 22 11:01 initctl -> / | ||
+ | drwxr-xr-x. 4 root root 280 Oct 22 11:01 input | ||
+ | crw-r--r--. 1 root root 1, 11 Oct 22 11:01 kmsg | ||
+ | crw-rw-rw-. 1 root kvm 10, 232 Oct 22 11:01 kvm | ||
+ | lrwxrwxrwx. 1 root root 28 Oct 22 11:01 log -> / | ||
+ | crw-rw----. 1 root disk 10, 237 Oct 22 11:01 loop-control | ||
+ | crw-rw----. 1 root lp 6, 0 Oct 22 11:01 lp0 | ||
+ | crw-rw----. 1 root lp 6, 1 Oct 22 11:01 lp1 | ||
+ | crw-rw----. 1 root lp 6, 2 Oct 22 11:01 lp2 | ||
+ | crw-rw----. 1 root lp 6, 3 Oct 22 11:01 lp3 | ||
+ | drwxr-xr-x. 2 root root 100 Oct 22 11:01 mapper | ||
+ | crw-------. 1 root root 10, 227 Oct 22 11:01 mcelog | ||
+ | crw-r-----. 1 root kmem 1, 1 Oct 22 11:01 mem | ||
+ | drwxrwxrwt. 2 root root 40 Oct 22 11:01 mqueue | ||
+ | drwxr-xr-x. 2 root root 60 Oct 22 11:01 net | ||
+ | crw-rw-rw-. 1 root root 1, 3 Oct 22 11:01 null | ||
+ | crw-------. 1 root root 10, 144 Oct 22 11:01 nvram | ||
+ | crw-r-----. 1 root kmem 1, 4 Oct 22 11:01 port | ||
+ | crw-------. 1 root root 108, 0 Oct 22 11:01 ppp | ||
+ | crw-rw-rw-. 1 root tty | ||
+ | drwxr-xr-x. 2 root root 0 Oct 22 11:01 pts | ||
+ | crw-rw-rw-. 1 root root 1, 8 Oct 22 11:01 random | ||
+ | crw-rw-r--+ 1 root root 10, 242 Oct 22 11:02 rfkill | ||
+ | drwxr-xr-x. 2 root root 80 Oct 22 11:01 rhel | ||
+ | lrwxrwxrwx. 1 root root 4 Oct 22 11:01 rtc -> rtc0 | ||
+ | crw-------. 1 root root 250, 0 Oct 22 11:01 rtc0 | ||
+ | brw-rw----. 1 root disk 8, 0 Oct 22 11:01 sda | ||
+ | brw-rw----. 1 root disk 8, 1 Oct 22 11:01 sda1 | ||
+ | brw-rw----. 1 root disk 8, 2 Oct 22 11:01 sda2 | ||
+ | crw-rw----. 1 root disk 21, 0 Oct 22 11:01 sg0 | ||
+ | crw-rw----+ 1 root cdrom 21, 1 Oct 22 11:01 sg1 | ||
--More-- | --More-- | ||
</ | </ | ||
- | Les option | + | On peut noter dans la sortie |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | brw-rw----. 1 root disk 8, 1 Oct 22 11:01 sda1 | ||
- | Usage: | + | [root@redhat9 ~]# ls -l /dev | grep tty0 |
- | | + | crw--w----. 1 root tty |
+ | </ | ||
- | Display or control the kernel ring buffer. | + | 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' |
- | Options: | + | Les deux informations clefs du fichier spécial sont situées à la place de la taille |
- | -C, --clear | + | |
- | -c, --read-clear | + | |
- | -D, --console-off | + | |
- | -E, --console-on | + | |
- | -F, --file < | + | |
- | -f, --facility < | + | |
- | -H, --human | + | |
- | -k, --kernel | + | |
- | -L, --color[=< | + | |
- | | + | |
- | -l, --level < | + | |
- | -n, --console-level < | + | |
- | -P, --nopager | + | |
- | -p, --force-prefix | + | |
- | -r, --raw print the raw message buffer | + | |
- | -S, --syslog | + | |
- | -s, --buffer-size < | + | |
- | -u, --userspace | + | |
- | -w, --follow | + | |
- | -x, --decode | + | |
- | -d, --show-delta | + | |
- | -e, --reltime | + | |
- | -T, --ctime | + | |
- | -t, --notime | + | |
- | | + | |
- | | + | |
- | Suspending/ | + | |
- | -h, --help | + | * le **majeur** identifie le pilote du périphérique et donc son contrôleur, |
- | -V, --version | + | * le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque. |
- | Supported log facilities: | + | =====LAB #1 - Découvrir le Matériel===== |
- | kern - kernel messages | + | |
- | user - random user-level messages | + | |
- | mail - mail system | + | |
- | daemon - system daemons | + | |
- | auth - security/ | + | |
- | syslog - messages generated internally by syslogd | + | |
- | lpr - line printer subsystem | + | |
- | news - network news subsystem | + | |
- | Supported log levels (priorities): | + | ====1.1 |
- | | + | |
- | alert - action must be taken immediately | + | |
- | crit - critical conditions | + | |
- | err - error conditions | + | |
- | warn - warning conditions | + | |
- | notice - normal but significant condition | + | |
- | info - informational | + | |
- | debug - debug-level messages | + | |
- | For more details see dmesg(1). | + | Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express : |
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# lspci | ||
+ | 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] | ||
+ | 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 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge | ||
+ | 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 | ||
+ | 01:01.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI | ||
</ | </ | ||
- | =====LAB #1 - Surveillance Sécuritaire===== | + | Pour obtenir de l' |
- | ====1.1 - La Commande last==== | + | < |
+ | [root@redhat9 ~]# lspci -v -s 00:03.0 | ||
+ | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | ||
+ | Subsystem: Red Hat, Inc. Device 0005 | ||
+ | Physical Slot: 3 | ||
+ | Flags: bus master, fast devsel, latency 0, IRQ 10 | ||
+ | I/O ports at f000 [size=64] | ||
+ | Memory at fd600000 (64-bit, prefetchable) [size=16K] | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Kernel driver in use: virtio-pci | ||
+ | </ | ||
- | Cette commande indique les dates et heures des connexions des utilisateurs à partir du contenu du fichier **/ | + | ou : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | trainee | + | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon |
- | reboot | + | Subsystem: Red Hat, Inc. Device 0005 |
- | trainee | + | Physical Slot: 3 |
- | trainee | + | |
- | reboot | + | |
- | trainee | + | Latency: 0 |
- | reboot | + | |
- | trainee | + | |
- | reboot | + | |
- | trainee | + | |
- | trainee | + | BAR=0 offset=00000000 size=00000000 |
- | reboot | + | Capabilities: [70] Vendor Specific Information: VirtIO: Notify |
- | trainee | + | BAR=4 offset=00003000 size=00001000 multiplier=00000004 |
- | trainee | + | |
- | trainee | + | BAR=4 offset=00002000 size=00001000 |
- | trainee | + | |
- | reboot | + | BAR=4 offset=00001000 size=00001000 |
- | trainee | + | Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg |
- | trainee | + | BAR=4 offset=00000000 size=00001000 |
- | trainee | + | |
- | trainee | + | </code> |
- | trainee | + | |
- | trainee | + | ===Options de la commande=== |
- | trainee | + | |
- | trainee | + | Les options de cette commande sont : |
- | trainee | + | |
- | reboot | + | < |
- | trainee | + | [root@redhat9 ~]# lspci --help |
- | reboot | + | lspci: invalid option |
- | trainee | + | Usage: lspci [< |
- | reboot | + | |
- | reboot | + | Basic display modes: |
+ | -mm | ||
+ | -t Show bus tree | ||
+ | |||
+ | Display options: | ||
+ | -v Be verbose | ||
+ | -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' | ||
+ | -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' | ||
- | wtmp begins Fri May 8 08:13:49 2020 | + | PCI access options: |
+ | -A < | ||
+ | -O < | ||
+ | -G Enable PCI access debugging | ||
+ | -H < | ||
+ | -F < | ||
</ | </ | ||
- | Les option | + | ====1.2 - La Commande lsusb==== |
+ | |||
+ | Cette commande vous renseigne sur les adaptateurs reliés au bus usb : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# lsusb | ||
+ | Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet | ||
+ | Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | ||
+ | |||
+ | [root@redhat9 ~]# lsusb -vt | ||
+ | /: 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 | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# lsusb --help | ||
+ | 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 rensigne sur les partitions des disques : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# lsblk | ||
+ | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | ||
+ | sda | ||
+ | ├─sda1 | ||
+ | └─sda2 | ||
+ | ├─rhel-root 253:0 0 | ||
+ | └─rhel-swap 253:1 0 5G 0 lvm [SWAP] | ||
+ | sdb | ||
+ | sdc | ||
+ | sdd | ||
+ | sde | ||
+ | sr0 11:0 1 1024M 0 rom | ||
+ | |||
+ | [root@redhat9 ~]# lsblk -l | ||
+ | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS | ||
+ | sda | ||
+ | sda1 8:1 0 1G 0 part /boot | ||
+ | sda2 8:2 0 | ||
+ | sr0 11:0 1 1024M 0 rom | ||
+ | rhel-root 253:0 0 | ||
+ | rhel-swap 253:1 0 5G 0 lvm [SWAP] | ||
+ | sdb | ||
+ | sdc | ||
+ | sdd | ||
+ | sde | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
Usage: | Usage: | ||
- | last [options] [<username> | + | lsblk [options] [<device> ...] |
- | Show a listing of last logged in users. | + | List information about block devices. |
Options: | Options: | ||
- | -<number> how many lines to show | + | -D, --discard |
- | -a, --hostlast | + | -E, --dedup |
- | -d, --dns translate the IP number back into a hostname | + | -I, --include <list> show only devices with specified major numbers |
- | -f, --file <file> use a specific file instead of / | + | -J, --json use JSON output format |
- | -F, --fulltimes | + | -O, --output-all |
- | -i, --ip | + | -P, --pairs use key=" |
- | -n, --limit <number> how many lines to show | + | -S, --scsi |
- | -R, --nohostname | + | -T, --tree[=<column>] use tree format output |
- | -s, --since <time> display the lines since the specified time | + | -a, --all |
- | -t, --until < | + | -b, --bytes print SIZE in bytes rather than in human readable format |
- | -p, --present | + | -d, --nodeps |
- | -w, --fullnames | + | -e, --exclude |
- | -x, --system | + | -f, --fs |
- | --time-format | + | -i, --ascii |
- | | + | -l, --list |
+ | -M, --merge | ||
+ | -m, --perms | ||
+ | -n, --noheadings | ||
+ | -o, --output | ||
+ | -p, --paths | ||
+ | -r, --raw use raw output format | ||
+ | -s, --inverse | ||
+ | -t, --topology | ||
+ | -w, --width <num> | ||
+ | -x, --sort < | ||
+ | -z, --zoned print zone model | ||
+ | --sysroot | ||
-h, --help | -h, --help | ||
-V, --version | -V, --version | ||
- | For more details see last(1). | + | Available output columns: |
+ | | ||
+ | KNAME internal kernel device name | ||
+ | | ||
+ | MAJ: | ||
+ | FSAVAIL | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | FSROOTS | ||
+ | FSVER filesystem version | ||
+ | | ||
+ | MOUNTPOINTS | ||
+ | LABEL filesystem LABEL | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | PARTLABEL | ||
+ | | ||
+ | PARTFLAGS | ||
+ | | ||
+ | | ||
+ | | ||
+ | HOTPLUG | ||
+ | MODEL device identifier | ||
+ | | ||
+ | | ||
+ | STATE state of the device | ||
+ | OWNER user name | ||
+ | GROUP group name | ||
+ | | ||
+ | ALIGNMENT | ||
+ | | ||
+ | | ||
+ | PHY-SEC | ||
+ | LOG-SEC | ||
+ | | ||
+ | SCHED I/O scheduler name | ||
+ | RQ-SIZE | ||
+ | | ||
+ | | ||
+ | DISC-GRAN | ||
+ | | ||
+ | DISC-ZERO | ||
+ | WSAME write same max bytes | ||
+ | WWN unique storage identifier | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | REV device revision | ||
+ | | ||
+ | ZONED zone model | ||
+ | DAX dax-capable device | ||
+ | |||
+ | For more details see lsblk(8). | ||
</ | </ | ||
- | ====1.2 - La Commande | + | ====1.4 - La Commande |
- | Cette commande indique | + | Cette commmande vous renseigne sur les périphériques SCSI et NVMe : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Username | + | [0: |
- | root pts/0 Thu Jun 3 09:01:46 -0400 2021 | + | [2:0:0:0] cd/ |
- | bin **Never logged in** | + | [3:0:0:0] disk ATA QEMU HARDDISK |
- | daemon | + | |
- | adm **Never logged in** | + | |
- | lp | + | |
- | sync | + | |
- | shutdown | + | |
- | halt | + | |
- | mail | + | |
- | operator | + | |
- | games **Never logged in** | + | |
- | ftp **Never logged in** | + | |
- | nobody | + | |
- | dbus | + | |
- | systemd-coredump | + | |
- | systemd-resolve | + | |
- | tss **Never logged in** | + | |
- | polkitd | + | |
- | unbound | + | |
- | libstoragemgmt | + | |
- | cockpit-ws | + | |
- | sssd | + | |
- | setroubleshoot | + | |
- | sshd | + | |
- | chrony | + | |
- | tcpdump | + | |
- | trainee | + | |
- | cockpit-wsinstance | + | |
- | rngd | + | |
- | gluster | + | |
- | qemu | + | |
- | rpc **Never logged in** | + | |
- | rpcuser | + | |
- | saslauth | + | |
- | radvd **Never logged in** | + | |
- | dnsmasq | + | |
- | fenestros2 | + | |
- | fenestros1 | + | |
- | apache | + | |
</ | </ | ||
- | Les option | + | ===Options de la commande=== |
+ | |||
+ | Les options | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Usage: | + | Usage: |
+ | [--help] [--hosts] [--kname] [--list] [--long] [--long-unit] | ||
+ | [--lunhex] [--no-nvme] [--pdt] [--protection] [--prot-mode] | ||
+ | [--scsi_id] [--size] [--sz-lbs] [--sysfsroot=PATH] [--transport] | ||
+ | [--unit] [--verbose] [--version] [--wwn] | ||
+ | where: | ||
+ | --brief|-b | ||
+ | --classic|-c | ||
+ | --controllers|-C | ||
+ | like SCSI hosts | ||
+ | --device|-d | ||
+ | --generic|-g | ||
+ | --help|-h | ||
+ | --hosts|-H | ||
+ | --kname|-k | ||
+ | --list|-L | ||
+ | attribute=value per line | ||
+ | --long|-l | ||
+ | --long-unit|-U | ||
+ | ' | ||
+ | --lunhex|-x | ||
+ | use twice to get full 16 digit hexadecimal LUN | ||
+ | --no-nvme|-N | ||
+ | --pdt|-D | ||
+ | --protection|-p | ||
+ | --protmode|-P | ||
+ | --scsi_id|-i | ||
+ | --size|-s | ||
+ | twice for power of two (e.g. 2.7 GiB), | ||
+ | thrice for number of blocks)) | ||
+ | --sysfsroot=PATH|-y PATH set sysfs mount point to PATH (def: /sys) | ||
+ | --sz-lbs|-S | ||
+ | adds comma followed by logical block size in bytes | ||
+ | --transport|-t | ||
+ | given, for initiator | ||
+ | --unit|-u | ||
+ | --verbose|-v | ||
+ | --version|-V | ||
+ | --wwn|-w | ||
+ | < | ||
+ | < | ||
+ | <' | ||
- | Options: | + | List SCSI devices or hosts, followed by NVMe namespaces or controllers. |
- | -b, --before DAYS print only lastlog records older than DAYS | + | Many storage devices |
- | -C, --clear | + | command sets and hence are also listed by this utility. Hyphenated long |
- | -h, --help | + | options can also take underscore |
- | -R, --root CHROOT_DIR | + | |
- | -S, --set set lastlog record to current time (usable only with -u) | + | |
- | -t, --time DAYS print only lastlog records more recent than DAYS | + | |
- | -u, --user LOGIN print lastlog record of the specified LOGIN | + | |
</ | </ | ||
- | ====1.3 - La Commande | + | ====1.5 - La Commande |
- | Cette commande | + | Cett commande |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | trainee | + | Architecture: |
- | trainee | + | |
- | trqinee | + | Address sizes: 46 bits physical, 48 bits virtual |
- | + | Byte Order: | |
- | btmp begins Thu Jun | + | CPU(s): 4 |
+ | On-line CPU(s) list: 0-3 | ||
+ | Vendor ID: | ||
+ | | ||
+ | Model name: | ||
+ | BIOS Model name: | ||
+ | CPU family: | ||
+ | Model: | ||
+ | Thread(s) per core: | ||
+ | Core(s) per socket: 2 | ||
+ | Socket(s): 2 | ||
+ | | ||
+ | BogoMIPS: | ||
+ | Flags: | ||
+ | uid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_f | ||
+ | ault pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat vnmi umip md_clear arch_ | ||
+ | | ||
+ | Virtualization features: | ||
+ | Virtualization: | ||
+ | Hypervisor vendor: KVM | ||
+ | Virtualization type: | ||
+ | Caches | ||
+ | L1d: 128 KiB (4 instances) | ||
+ | | ||
+ | | ||
+ | L3: 32 MiB (2 instances) | ||
+ | NUMA: | ||
+ | NUMA node(s): | ||
+ | NUMA node0 CPU(s): | ||
+ | Vulnerabilities: | ||
+ | Gather data sampling: | ||
+ | Itlb multihit: | ||
+ | L1tf: Mitigation; PTE Inversion; VMX flush not necessary, SMT disabled | ||
+ | Mds: | ||
+ | Meltdown: | ||
+ | Mmio stale data: | ||
+ | Retbleed: | ||
+ | Spec rstack overflow: | ||
+ | Spec store bypass: | ||
+ | Spectre v1: Mitigation; usercopy/ | ||
+ | Spectre v2: Mitigation; Retpolines, IBPB conditional, | ||
+ | Srbds: | ||
+ | Tsx async abort: Mitigation; Clear CPU buffers; SMT Host state unknown | ||
</ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
Usage: | Usage: | ||
- | lastb [options] [< | + | lscpu [options] |
- | Show a listing of last logged in users. | + | Display information about the CPU architecture. |
Options: | Options: | ||
- | -< | + | -a, --all print both online and offline CPUs (default for -e) |
- | -a, --hostlast | + | -b, --online |
- | -d, --dns translate the IP number back into a hostname | + | -B, --bytes print sizes in bytes rather than in human readable format |
- | -f, --file < | + | -C, --caches[=< |
- | -F, --fulltimes | + | -c, --offline |
- | -i, --ip | + | -J, --json use JSON for default or extended format |
- | -n, --limit < | + | -e, --extended[=<list>] print out an extended readable format |
- | -R, --nohostname | + | -p, --parse[=<list>] print out a parsable format |
- | -s, --since <time> display the lines since the specified time | + | -s, --sysroot |
- | -t, --until <time> display the lines until the specified time | + | -x, --hex print hexadecimal masks rather than lists of CPUs |
- | -p, --present | + | -y, --physical |
- | -w, --fullnames | + | --output-all print all available columns for -e, -p or -C |
- | -x, --system | + | |
- | --time-format < | + | |
- | | + | |
- | -h, --help | + | -h, --help |
- | -V, --version | + | -V, --version |
+ | |||
+ | Available output columns for -e or -p: | ||
+ | BOGOMIPS | ||
+ | | ||
+ | CORE logical core number | ||
+ | SOCKET | ||
+ | | ||
+ | NODE logical NUMA node number | ||
+ | BOOK logical book number | ||
+ | DRAWER | ||
+ | | ||
+ | POLARIZATION | ||
+ | | ||
+ | CONFIGURED | ||
+ | ONLINE | ||
+ | | ||
+ | SCALMHZ% | ||
+ | MAXMHZ | ||
+ | MINMHZ | ||
+ | |||
+ | Available output columns for -C: | ||
+ | ALL-SIZE | ||
+ | | ||
+ | NAME cache name | ||
+ | ONE-SIZE | ||
+ | TYPE cache type | ||
+ | WAYS ways of associativity | ||
+ | ALLOC-POLICY | ||
+ | WRITE-POLICY | ||
+ | PHY-LINE | ||
+ | SETS number of sets in the cache; set lines has the same cache index | ||
+ | | ||
- | For more details see last(1). | + | For more details see lscpu(1). |
</ | </ | ||
- | ====1.4 - Le Fichier / | + | ====1.6 - La Command lshw==== |
- | Sous RHEL/CentOS ce fichier contient | + | Cette commande vous renseigne sur le matériel selon la **classe** |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Jun 3 09:01:20 centos8 sshd[905]: Server listening on :: port 22. | + | Bus info Device |
- | Jun 3 09:01:39 centos8 sshd[1585]: Accepted password for trainee from 10.0.2.2 port 52734 ssh2 | + | ==================================================== |
- | Jun 3 09:01:39 centos8 systemd[1590]: | + | |
- | Jun 3 09:01:39 centos8 sshd[1585]: pam_unix(sshd: | + | bus Motherboard |
- | Jun 3 09:01:46 centos8 su[1627]: pam_systemd(su-l: | + | memory |
- | Jun 3 09:01:46 centos8 su[1627]: pam_unix(su-l:session): session opened for user root by trainee(uid=1000) | + | cpu@0 |
- | Jun 3 09:51:05 centos8 login[1158]: pam_unix(login: | + | cpu@1 |
- | Jun 3 09:51:05 centos8 login[1158]: | + | |
- | Jun 3 09:51:07 centos8 login[1158]: FAILED LOGIN 1 FROM tty1 FOR trqinee, Authentication failure | + | memory |
- | Jun 3 09:51:18 centos8 unix_chkpwd[2400]: | + | pci@0000:00:00.0 bridge |
- | Jun 3 09:51:18 centos8 login[1158]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=tty1 ruser= rhost= | + | pci@0000:00:01.0 bridge |
- | Jun 3 09:51:20 centos8 login[1158]: FAILED LOGIN 2 FROM tty1 FOR trainee, Authentication failure | + | input PnP device PNP0303 |
- | Jun 3 09:51:45 centos8 login[1158]: pam_unix(login:auth): check pass; user unknown | + | input PnP device PNP0f13 |
- | Jun 3 09:51:45 centos8 login[1158]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=tty1 ruser= rhost= | + | storage |
- | Jun 3 09:51:47 centos8 login[1158]: | + | system |
+ | pci@0000:00:01.1 scsi2 | ||
+ | scsi@2:0.0.0 / | ||
+ | pci@0000:00:01.2 bus 82371SB PIIX3 USB [Natoma/ | ||
+ | usb@1 | ||
+ | usb@1:1 input5 | ||
+ | pci@0000:00:01.3 bridge | ||
+ | pci@0000:00:02.0 / | ||
+ | pci@0000:00:03.0 | ||
+ | virtio@0 | ||
+ | pci@0000:00:05.0 bridge | ||
+ | pci@0000:01: | ||
+ | virtio@2 | ||
+ | scsi@0:0.0.0 / | ||
+ | scsi@0:0.0.0, | ||
+ | scsi@0:0.0.0, | ||
+ | pci@0000:00:12.0 network | ||
+ | virtio@1 | ||
+ | pci@0000:00:1e.0 bridge | ||
+ | pci@0000:00:1f.0 | ||
+ | input0 | ||
+ | | ||
+ | input3 | ||
+ | input4 | ||
+ | input6 | ||
</ | </ | ||
- | ====1.5 - Gestion des Evénements audit==== | + | Consultez maintenant le matériel de la classe **system** : |
- | ===Le fichier | + | < |
+ | [root@redhat9 ~]# lshw -c system | ||
+ | redhat9.ittraining.loc | ||
+ | description: | ||
+ | product: Standard PC (i440FX + PIIX, 1996) | ||
+ | vendor: QEMU | ||
+ | version: pc-i440fx-7.2 | ||
+ | width: 64 bits | ||
+ | capabilities: | ||
+ | configuration: | ||
+ | *-pnp00: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </code> | ||
- | Ce fichier contient les messages du système d' | + | Consultez maintenant |
- | * des appels système, | + | < |
- | * des accès aux fichiers, | + | [root@redhat9 ~]# lshw -c memory |
- | * des informations en provenance de %%SELinux%%. | + | *-firmware |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | date: 04/ | ||
+ | size: 96KiB | ||
+ | *-memory | ||
+ | | ||
+ | | ||
+ | size: 8GiB | ||
+ | | ||
+ | | ||
+ | | ||
+ | description: | ||
+ | vendor: QEMU | ||
+ | physical id: 0 | ||
+ | slot: DIMM 0 | ||
+ | size: 8GiB | ||
- | Consultez maintenant le fichier | + | [root@redhat9 ~]# lshw -c video |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | [root@redhat9 ~]# lshw -c storage | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-ide | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-scsi | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@redhat9 ~]# lshw -c disk | ||
+ | *-cdrom | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@0: | ||
+ | | ||
+ | | ||
+ | size: 50GiB (53GB) | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@redhat9 ~]# lshw -c volume | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@0: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-volume: | ||
+ | | ||
+ | | ||
+ | bus info: scsi@0: | ||
+ | | ||
+ | | ||
+ | size: 48GiB | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@redhat9 ~]# lshw -c network | ||
+ | *-network | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | description: | ||
+ | physical id: 0 | ||
+ | bus info: virtio@1 | ||
+ | logical name: ens18 | ||
+ | serial: 92: | ||
+ | capabilities: | ||
+ | configuration: | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | type=PROCTITLE msg=audit(1622728321.894: | + | Hardware Lister |
- | type=USER_START msg=audit(1622728321.901: | + | usage: lshw [-format] [-options |
- | type=CRED_REFR msg=audit(1622728321.902:457): pid=2420 uid=0 auid=1000 ses=53 subj=system_u: | + | lshw -version |
- | type=CRED_DISP msg=audit(1622728321.908:458): pid=2420 uid=0 auid=1000 ses=53 subj=system_u: | + | |
- | type=USER_END msg=audit(1622728321.910:459): pid=2420 uid=0 auid=1000 ses=53 subj=system_u: | + | -version |
- | type=SERVICE_STOP msg=audit(1622728330.965: | + | |
- | type=USER_ACCT msg=audit(1622728381.954:461): pid=2439 uid=0 auid=4294967295 ses=4294967295 subj=system_u: | + | format can be |
- | type=CRED_ACQ msg=audit(1622728381.954:462): pid=2439 uid=0 auid=4294967295 ses=4294967295 subj=system_u: | + | |
- | type=LOGIN msg=audit(1622728381.954: | + | -xml output hardware tree as XML |
- | type=SYSCALL msg=audit(1622728381.954: | + | |
- | type=PROCTITLE msg=audit(1622728381.954: | + | |
- | type=USER_START msg=audit(1622728381.960: | + | |
- | type=CRED_REFR msg=audit(1622728381.962: | + | |
- | type=CRED_DISP msg=audit(1622728381.966:466): pid=2439 uid=0 auid=1000 ses=54 subj=system_u: | + | options can be |
- | type=USER_END msg=audit(1622728381.968:467): pid=2439 uid=0 auid=1000 ses=54 subj=system_u: | + | |
+ | | ||
+ | -C CLASS same as '-class CLASS' | ||
+ | -c CLASS same as '-class CLASS' | ||
+ | | ||
+ | | ||
+ | -quiet | ||
+ | | ||
+ | | ||
+ | -notime | ||
</ | </ | ||
- | La gestion des événements audit se repose sur trois exécutables : | + | ====1.7 - La Commande dmidecode==== |
- | ===auditd=== | + | La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface// |
- | Cet exécutable est le daemon | + | * l' |
+ | | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # | + | # dmidecode 3.5 |
- | # This file controls the configuration of the audit daemon | + | Getting SMBIOS data from sysfs. |
- | # | + | SMBIOS 2.8 present. |
+ | 11 structures occupying 511 bytes. | ||
+ | Table at 0x000F59C0. | ||
- | local_events = yes | + | Handle 0x0000, DMI type 0, 24 bytes |
- | write_logs = yes | + | BIOS Information |
- | log_file = /var/log/ | + | |
- | log_group = root | + | Version: rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org |
- | log_format = ENRICHED | + | Release Date: 04/01/2014 |
- | flush = INCREMENTAL_ASYNC | + | Address: 0xE8000 |
- | freq = 50 | + | Runtime Size: 96 kB |
- | max_log_file = 8 | + | ROM Size: 64 kB |
- | num_logs = 5 | + | Characteristics: |
- | priority_boost = 4 | + | BIOS characteristics not supported |
- | name_format = NONE | + | Targeted content distribution is supported |
- | ##name = mydomain | + | BIOS Revision: 0.0 |
- | max_log_file_action = ROTATE | + | |
- | space_left = 75 | + | Handle 0x0100, DMI type 1, 27 bytes |
- | space_left_action = SYSLOG | + | System Information |
- | verify_email = yes | + | |
- | action_mail_acct = root | + | |
- | admin_space_left = 50 | + | |
- | admin_space_left_action = SUSPEND | + | |
- | disk_full_action = SUSPEND | + | UUID: 6c89e267-fb34-42a1-9b13-15fa7185048f |
- | disk_error_action = SUSPEND | + | Wake-up Type: Power Switch |
- | use_libwrap = yes | + | SKU Number: Not Specified |
- | ## | + | Family: Not Specified |
- | tcp_listen_queue = 5 | + | |
- | tcp_max_per_addr = 1 | + | Handle 0x0300, DMI type 3, 22 bytes |
- | ## | + | Chassis Information |
- | tcp_client_max_idle = 0 | + | Manufacturer: |
- | transport = TCP | + | Type: Other |
- | krb5_principal = auditd | + | Lock: Not Present |
- | ## | + | Version: pc-i440fx-7.2 |
- | distribute_network = no | + | Serial Number: Not Specified |
- | q_depth = 400 | + | Asset Tag: Not Specified |
- | overflow_action = SYSLOG | + | Boot-up State: Safe |
- | max_restarts = 10 | + | Power Supply State: Safe |
- | plugin_dir = / | + | 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 | ||
+ | | ||
+ | Type: Central Processor | ||
+ | | ||
+ | | ||
+ | ID: 63 06 05 00 FF FB 8B 0F | ||
+ | | ||
+ | | ||
+ | | ||
+ | Max Speed: 2000 MHz | ||
+ | | ||
+ | | ||
+ | | ||
+ | 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: 2 | ||
+ | Characteristics: | ||
+ | |||
+ | Handle 0x0401, DMI type 4, 42 bytes | ||
+ | Processor Information | ||
+ | | ||
+ | Type: Central Processor | ||
+ | Family: Other | ||
+ | Manufacturer: | ||
+ | ID: 63 06 05 00 FF FB 8B 0F | ||
+ | Version: pc-i440fx-7.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: 2 | ||
+ | Characteristics: | ||
+ | |||
+ | Handle 0x1000, DMI type 16, 23 bytes | ||
+ | Physical Memory Array | ||
+ | Location: Other | ||
+ | Use: System Memory | ||
+ | Error Correction Type: Multi-bit ECC | ||
+ | Maximum Capacity: 8 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: 8 GB | ||
+ | Form Factor: DIMM | ||
+ | Set: None | ||
+ | | ||
+ | Bank Locator: Not Specified | ||
+ | Type: RAM | ||
+ | Type Detail: Other | ||
+ | | ||
+ | | ||
+ | | ||
+ | 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: 0x0023FFFFFFF | ||
+ | Range Size: 5 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 option | + | ===Options de la commande=== |
+ | |||
+ | Les options | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | auditd: unrecognized option '--help' | + | Usage: dmidecode [OPTIONS] |
- | Usage: auditd [-f] [-l] [-n] [-s disable|enable|nochange] [-c < | + | Options are: |
+ | -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) | ||
+ | | ||
+ | -q, --quiet Less verbose output | ||
+ | | ||
+ | -s, --string KEYWORD | ||
+ | -t, --type TYPE Only display the entries of given type | ||
+ | -H, --handle HANDLE | ||
+ | -u, --dump | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -V, --version | ||
</ | </ | ||
- | ===auditctl=== | + | ====1.8 - La Commande smartctl==== |
+ | |||
+ | **smartctl** contrôle le système SMART (Self-Monitoring, | ||
- | Cet exécutable est utilisé pour configurer les règles du système audit. Au démarrage, auditctl lit et applique les règles contunues dans le fichier **/ | + | Activez smartctl |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | ## This file is automatically generated from / | + | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.14.0-427.37.1.el9_4.x86_64] (local build) |
- | -D | + | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org |
- | -b 8192 | + | |
- | -f 1 | + | |
- | --backlog_wait_time 60000 | + | |
+ | === START OF ENABLE/ | ||
+ | SMART Enabled. | ||
+ | SMART Attribute Autosave Enabled. | ||
+ | SMART Automatic Timers not supported | ||
+ | |||
+ | SMART Enable Automatic Offline failed: scsi error badly formed scsi parameters | ||
+ | |||
+ | [root@redhat9 ~]# smartctl -a /dev/sdb | ||
+ | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.14.0-427.37.1.el9_4.x86_64] (local build) | ||
+ | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org | ||
+ | |||
+ | === START OF INFORMATION SECTION === | ||
+ | Device Model: | ||
+ | Serial Number: | ||
+ | Firmware Version: 2.5+ | ||
+ | User Capacity: | ||
+ | Sector Size: 512 bytes logical/ | ||
+ | TRIM Command: | ||
+ | Device is: Not in smartctl database [for details use: -P showall] | ||
+ | ATA Version is: | ||
+ | Local Time is: Tue Oct 22 15:38:47 2024 CEST | ||
+ | SMART support is: Available - device has SMART capability. | ||
+ | SMART support is: Enabled | ||
+ | |||
+ | === START OF READ SMART DATA SECTION === | ||
+ | SMART overall-health self-assessment test result: PASSED | ||
+ | |||
+ | General SMART Values: | ||
+ | Offline data collection status: | ||
+ | was completed without error. | ||
+ | Auto Offline Data Collection: Disabled. | ||
+ | Self-test execution status: | ||
+ | without error or no self-test has ever | ||
+ | been run. | ||
+ | Total time to complete Offline | ||
+ | data collection: | ||
+ | Offline data collection | ||
+ | capabilities: | ||
+ | No Auto Offline data collection support. | ||
+ | Suspend Offline collection upon new | ||
+ | command. | ||
+ | Offline surface scan supported. | ||
+ | Self-test supported. | ||
+ | No Conveyance Self-test supported. | ||
+ | No Selective Self-test supported. | ||
+ | SMART capabilities: | ||
+ | power-saving mode. | ||
+ | Supports SMART auto save timer. | ||
+ | Error logging capability: | ||
+ | No General Purpose Logging support. | ||
+ | Short self-test routine | ||
+ | recommended polling time: ( 2) minutes. | ||
+ | Extended self-test routine | ||
+ | recommended polling time: ( 54) minutes. | ||
+ | |||
+ | SMART Attributes Data Structure revision number: 1 | ||
+ | Vendor Specific SMART Attributes with Thresholds: | ||
+ | ID# ATTRIBUTE_NAME | ||
+ | 1 Raw_Read_Error_Rate | ||
+ | 3 Spin_Up_Time | ||
+ | 4 Start_Stop_Count | ||
+ | 5 Reallocated_Sector_Ct | ||
+ | 9 Power_On_Hours | ||
+ | 12 Power_Cycle_Count | ||
+ | 190 Airflow_Temperature_Cel 0x0003 | ||
+ | |||
+ | SMART Error Log Version: 1 | ||
+ | No Errors Logged | ||
+ | |||
+ | SMART Self-test log structure revision number 1 | ||
+ | No self-tests have been logged. | ||
+ | |||
+ | Selective Self-tests/ | ||
</ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | usage: auditctl | + | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.14.0-427.37.1.el9_4.x86_64] (local build) |
- | -a <l,a> Append rule to end of < | + | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org |
- | -A <l,a> Add rule at beginning | + | |
- | -b < | + | Usage: smartctl |
- | | + | |
- | -c Continue through errors in rules | + | ============================================ SHOW INFORMATION OPTIONS ===== |
- | -C f=f Compare collected fields | + | |
- | Field name, operator(=,!=), field name | + | |
- | -d <l,a> Delete rule from < | + | |
- | l=task,exit,user,exclude | + | |
- | | + | -V, --version, --copyright, |
- | -D Delete all rules and watches | + | Print license, copyright, and version information and exit |
- | | + | |
- | -f [0..2] Set failure flag | + | -i, --info |
- | 0=silent 1=printk 2=panic | + | Show identity information for device |
- | -F f=v Build rule: field name, operator(=,!=,<,>,<=, | + | |
- | >=,&,&=) value | + | --identify[=[w][nvb]] |
- | -h Help | + | Show words and bits from IDENTIFY DEVICE data (ATA) |
- | -i Ignore errors when reading rules from file | + | |
- | -k < | + | -g NAME, --get=NAME |
- | -l List rules | + | Get device setting: all, aam, apm, dsn, lookahead, security, |
- | -m text Send a user-space message | + | wcache, rcache, wcreorder, wcache-sct |
- | -p [r|w|x|a] | + | |
- | r=read, w=write, x=execute, a=attribute | + | -a, --all |
- | -q < | + | Show all SMART information for device |
- | -r < | + | |
- | -R < | + | -x, --xall |
- | -s Report status | + | Show all information for device |
- | -S syscall | + | |
- | | + | --scan |
- | -v Version | + | Scan for devices |
- | -w < | + | |
- | -W < | + | --scan-open |
- | --loginuid-immutable | + | Scan for devices and try to open each device |
- | --backlog_wait_time | + | |
- | --reset-lost | + | ================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS ===== |
+ | |||
+ | -j, --json[=cgiosuvy] | ||
+ | Print output in JSON or YAML format | ||
+ | |||
+ | -q TYPE, --quietmode=TYPE | ||
+ | Set smartctl quiet mode to one of: errorsonly, silent, noserial | ||
+ | |||
+ | | ||
+ | | ||
+ | ata, scsi[+TYPE], | ||
+ | |||
+ | -T TYPE, --tolerance=TYPE | ||
+ | | ||
+ | |||
+ | | ||
+ | Set action on bad checksum to one of: warn, exit, ignore | ||
+ | |||
+ | -r TYPE, --report=TYPE | ||
+ | Report transactions (see man page) | ||
+ | |||
+ | | ||
+ | No check if: never, sleep, standby, idle (see man page) | ||
+ | |||
+ | ============================== DEVICE FEATURE ENABLE/ | ||
+ | |||
+ | -s VALUE, --smart=VALUE | ||
+ | Enable/ | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | -S VALUE, --saveauto=VALUE (ATA) | ||
+ | Enable/ | ||
+ | |||
+ | -s NAME[,VALUE], --set=NAME[,VALUE] | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | ======================================= READ AND DISPLAY DATA OPTIONS ===== | ||
+ | |||
+ | -H, --health | ||
+ | Show device SMART health status | ||
+ | |||
+ | -c, --capabilities | ||
+ | Show device SMART capabilities | ||
+ | |||
+ | -A, --attributes | ||
+ | Show device SMART vendor-specific Attributes and values | ||
+ | |||
+ | | ||
+ | Set output format for attributes: old, brief, hex[, | ||
+ | |||
+ | -l TYPE, --log=TYPE | ||
+ | Show device log. TYPE: error, selftest, selective, directory[, | ||
+ | xerror[, | ||
+ | sasphy[, | ||
+ | scttempint, | ||
+ | gplog, | ||
+ | |||
+ | -v N,OPTION , --vendorattribute=N,OPTION | ||
+ | Set display OPTION for vendor Attribute N (see man page) | ||
+ | |||
+ | -F TYPE, --firmwarebug=TYPE | ||
+ | Use firmware bug workaround: | ||
+ | none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid | ||
+ | |||
+ | -P TYPE, --presets=TYPE (ATA) | ||
+ | Drive-specific presets: use, ignore, show, showall | ||
+ | |||
+ | | ||
+ | Read and replace [add] drive database | ||
+ | | ||
+ | and then / | ||
+ | |||
+ | ============================================ DEVICE SELF-TEST OPTIONS ===== | ||
+ | |||
+ | | ||
+ | Run test. TEST: offline, short, long, conveyance, force, vendor,N, | ||
+ | select,M-N, pending,N, afterselect, | ||
+ | |||
+ | -C, --captive | ||
+ | Do test in captive mode (along with -t) | ||
+ | |||
+ | -X, --abort | ||
+ | Abort any non-captive test on device | ||
+ | |||
+ | =================================================== SMARTCTL EXAMPLES ===== | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | smartctl | ||
+ | |||
+ | smartctl | ||
+ | | ||
+ | | ||
+ | | ||
+ | smartctl --all --device=3ware, | ||
+ | | ||
+ | (Prints all SMART info for 3rd ATA disk on 3ware RAID controller) | ||
+ | smartctl --all --device=hpt, | ||
+ | (Prints all SMART info for the SATA disk attached to the 3rd PMPort | ||
+ | of the 1st channel on the 1st HighPoint RAID controller) | ||
+ | smartctl | ||
+ | (Prints all SMART info for 3rd ATA disk of the 1st enclosure | ||
+ | on Areca RAID controller) | ||
</ | </ | ||
- | ===La consultation des événements audit=== | + | ====1.9 - Les Commandes accton et dump-acct==== |
- | La consultation | + | Cette commande permet d' |
- | ==La Commande aureport== | + | < |
+ | [root@redhat9 ~]# accton on | ||
+ | Turning on process accounting, file set to the default '/ | ||
+ | |||
+ | [root@redhat9 ~]# systemctl status psacct | ||
+ | ○ psacct.service - Kernel process accounting | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@redhat9 ~]# systemctl enable --now psacct | ||
+ | Created symlink / | ||
+ | |||
+ | [root@redhat9 ~]# systemctl status psacct | ||
+ | ● psacct.service - Kernel process accounting | ||
+ | | ||
+ | | ||
+ | Process: 2249 ExecStartPre=/ | ||
+ | Process: 2250 ExecStart=/ | ||
+ | Main PID: 2250 (code=exited, | ||
+ | CPU: 4ms | ||
+ | |||
+ | Oct 22 15:41:45 redhat9.ittraining.loc systemd[1]: Starting Kernel process accounting... | ||
+ | Oct 22 15:41:45 redhat9.ittraining.loc accton[2250]: | ||
+ | Oct 22 15:41:45 redhat9.ittraining.loc systemd[1]: Finished Kernel process accounting. | ||
+ | </ | ||
- | Cette commande est utilisée pour générer des rapports | + | Par contre le fichier **/ |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | vg?H | ||
+ | _selinuxenablg(systemd-debugg? | ||
+ | acctg@@(systemd-tty-asgANsystemcg? | ||
+ | | ||
+ | gE(gmain | ||
+ | | ||
+ | gE' | ||
+ | | ||
+ | gE' | ||
+ | | ||
+ | gE*gmain | ||
+ | | ||
+ | PpackagekitdrgBGkworker/ | ||
+ | </ | ||
- | Summary Report | + | La commande **dump-acct** permet de voir son contenu mais pas de l' |
- | ====================== | + | |
- | Range of time in logs: 05/08/2020 08:13:52.320 - 06/03/2021 10:20:02.028 | + | < |
- | Selected time for report: 05/08/2020 08:13:52 - 06/03/2021 10:20:02.028 | + | [root@redhat9 ~]# dump-acct |
- | Number of changes in configuration: 46 | + | accton |
- | Number of changes to accounts, groups, or roles: 56 | + | less |v3| 0.00| |
- | Number of logins: 21 | + | systemctl |
- | Number of failed logins: 5 | + | systemd-fstab-g |v3| 0.00| |
- | Number of authentications: 50 | + | selinuxenabled |
- | Number of failed authentications: 8 | + | systemd-debug-g |v3| |
- | Number of users: 3 | + | podman-system-g |v3| |
- | Number of terminals: 10 | + | grep |v3| |
- | Number of host names: 4 | + | selinux-autorel |v3| |
- | Number of executables: 22 | + | systemd-hiberna |v3| |
- | Number of commands: 11 | + | systemd-veritys |v3| |
- | Number of files: 0 | + | systemd-run-gen |v3| |
- | Number of AVC's: 0 | + | systemd-integri |v3| |
- | Number of MAC events: 35 | + | systemd-getty-g |v3| |
- | Number of failed syscalls: 0 | + | systemd-sysv-ge |v3| |
- | Number of anomaly events: 7 | + | systemd-system- |v3| |
- | Number of responses to anomaly events: 0 | + | ostree-system-g |v3| |
- | Number of crypto events: 287 | + | systemd-cryptse |v3| |
- | Number of integrity events: 0 | + | sed |
- | Number of virt events: 0 | + | kdump-dep-gener |v3| |
- | Number of keys: 0 | + | systemd-rc-loca |v3| |
- | Number of process IDs: 616 | + | grep |v3| |
- | Number of events: 6030 | + | kdump-dep-gener |v3| |
+ | systemd-bless-b |v3| | ||
+ | systemd-gpt-aut |v3| | ||
+ | (sd-executor) | ||
+ | accton-create | ||
+ | accton | ||
+ | accton | ||
+ | systemd-tty-ask |v3| | ||
+ | systemctl | ||
+ | less |v3| | ||
+ | systemctl | ||
+ | unix_chkpwd | ||
+ | gmain | ||
+ | pwd | ||
+ | sh |v3| | ||
+ | crond | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | packagekitd | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | cat | ||
+ | systemd-tmpfile |v3| 0.00| | ||
+ | systemd-tmpfile |v3| | ||
+ | unix_chkpwd | ||
+ | gmain | ||
+ | pwd | ||
+ | sh |v3| | ||
+ | crond | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
+ | gmain | ||
</ | </ | ||
- | Les options de cette commande | + | ====1.10 - La Commande lastcomm==== |
+ | |||
+ | Cette commande | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | usage: aureport [options] | + | man root |
- | -a, | + | dump-acct root |
- | -au, | + | gmain X polkitd |
- | --comm Commands run report | + | gmain X polkitd |
- | -c, | + | gmain X polkitd |
- | -cr, | + | gmain X polkitd |
- | -e, | + | gmain X polkitd |
- | -f, | + | gmain X polkitd |
- | --failed only failed events in report | + | gmain X polkitd |
- | -h, | + | gmain X polkitd |
- | --help help | + | crond SF root |
- | -i, | + | sh |
- | -if,--input <Input File name> | + | pwd trainee |
- | --input-logs Use the logs even if stdin is a pipe | + | gmain X polkitd |
- | --integrity Integrity event report | + | unix_chkpwd |
- | -l, | + | dump-acct root |
- | -k, | + | gmain X polkitd |
- | -m,--mods Modification to accounts report | + | gmain X polkitd |
- | -ma, | + | gmain X polkitd |
- | -n,--anomaly aNomaly report | + | gmain X polkitd |
- | -nc,--no-config Don' | + | gmain X polkitd |
- | --node <node name> | + | gmain X polkitd |
- | -p,--pid Pid report | + | gmain X polkitd |
- | -r, | + | gmain X polkitd |
- | -s,--syscall Syscall report | + | crond SF root |
- | --success only success events in report | + | sh |
- | --summary sorted totals for main object in report | + | pwd trainee |
- | -t,--log Log time range report | + | gmain X polkitd |
- | -te,--end [end date] [end time] ending date & time for reports | + | unix_chkpwd |
- | -tm,--terminal TerMinal name report | + | systemd-tmpfile |
- | -ts,--start [start date] [start time] starting data & time for reports | + | systemd-tmpfile |
- | --tty Report about tty keystrokes | + | cat root |
- | -u, | + | kworker/ |
- | -v,--version Version | + | kworker/ |
- | --virt Virtualization report | + | kworker/ |
- | -x,--executable eXecutable name report | + | packagekitd |
- | If no report is given, the summary report will be displayed | + | kworker/ |
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | gmain X polkitd | ||
+ | gmain X polkitd | ||
+ | gmain X polkitd | ||
+ | gmain X polkitd | ||
+ | gmain X polkitd | ||
+ | gmain X polkitd | ||
+ | gmain X polkitd | ||
+ | gmain X polkitd | ||
+ | crond SF root | ||
+ | sh | ||
+ | pwd trainee | ||
+ | gmain X polkitd | ||
+ | unix_chkpwd | ||
+ | systemctl | ||
+ | less | ||
+ | systemctl | ||
+ | systemd-tty-ask S | ||
+ | accton | ||
+ | accton | ||
+ | accton-create | ||
+ | (sd-executor) | ||
+ | systemd-gpt-aut S | ||
+ | systemd-bless-b S | ||
+ | kdump-dep-gener S | ||
+ | grep | ||
+ | systemd-rc-loca S | ||
+ | kdump-dep-gener | ||
+ | sed root | ||
+ | systemd-cryptse | ||
+ | ostree-system-g S | ||
+ | systemd-system- | ||
+ | systemd-sysv-ge S | ||
+ | systemd-getty-g S | ||
+ | systemd-integri | ||
+ | systemd-run-gen S | ||
+ | systemd-veritys | ||
+ | systemd-hiberna | ||
+ | selinux-autorel | ||
+ | grep | ||
+ | podman-system-g S X root | ||
+ | systemd-debug-g S | ||
+ | selinuxenabled | ||
+ | systemd-fstab-g S | ||
+ | systemctl | ||
+ | less | ||
+ | accton | ||
+ | |||
+ | [root@redhat9 ~]# lastcomm grep | ||
+ | grep | ||
+ | grep | ||
</ | </ | ||
- | ==La Commande | + | ====1.11 - La Commande |
- | Cette commande | + | Cette commande |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | ---- | + | root 0.00 cpu 658k mem 0 io accton |
- | time-> | + | root 0.00 cpu 55328k mem 0 io less |
- | type=USER_AUTH msg=audit(1598972728.209:77): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 59200k mem 0 io systemctl |
- | omain addr=? terminal=pts/ | + | root 0.00 cpu 4560k mem 0 io systemd-fstab-g |
- | ---- | + | root 0.00 cpu 859k mem 0 io selinuxenabled |
- | time->Tue Sep 1 11:05:28 2020 | + | root 0.00 cpu 4550k mem 0 io systemd-debug-g |
- | type=USER_ACCT msg=audit(1598972728.214:78): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu |
- | ost.localdomain addr=? terminal=pts/ | + | root 0.00 cpu 55456k mem 0 io grep |
- | ---- | + | root 0.00 cpu 55632k mem 0 io selinux-autorel |
- | time->Tue Sep 1 11:05:28 2020 | + | root 0.00 cpu 4548k mem 0 io systemd-hiberna |
- | type=CRED_ACQ msg=audit(1598972728.218:79): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 4556k mem 0 io systemd-veritys |
- | dr=? terminal=pts/ | + | root 0.00 cpu 4550k mem 0 io systemd-run-gen |
- | ---- | + | root 0.00 cpu 4552k mem 0 io systemd-integri |
- | time->Tue Sep 1 11:05:28 2020 | + | root 0.00 cpu 4550k mem 0 io systemd-getty-g |
- | type=USER_START msg=audit(1598972728.223:80): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 4556k mem 0 io systemd-sysv-ge |
- | ,pam_xauth acct="root" exe="/ | + | root 0.00 cpu 4548k mem 0 io systemd-system- |
- | ---- | + | root 0.00 cpu 6932k mem 0 io ostree-system-g |
- | time-> | + | root 0.00 cpu 4556k mem 0 io systemd-cryptse |
- | type=USER_END msg=audit(1598973013.687:87): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 55488k mem 0 io sed |
- | pam_xauth acct="root" exe="/ | + | root 0.00 cpu 55792k mem 0 io kdump-dep-gener * |
- | ---- | + | root 0.00 cpu 4550k mem 0 io systemd-rc-loca |
- | time->Tue Sep 1 11:10:13 2020 | + | root 0.00 cpu 55424k mem 0 io grep |
- | type=CRED_DISP msg=audit(1598973013.687:88): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 55792k mem 0 io kdump-dep-gener |
- | ddr=? terminal=pts/ | + | root 0.00 cpu 4550k mem 0 io systemd-bless-b |
- | ---- | + | root 0.00 cpu 4552k mem 0 io systemd-gpt-aut |
- | time-> | + | root 0.00 cpu 43520k mem 0 io (sd-executor) |
- | type=USER_AUTH msg=audit(1618847281.847:77): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 55632k mem 0 io accton-create |
- | ng.loc addr=? terminal=pts/ | + | root 0.00 cpu 0k mem 0 io accton |
- | ---- | + | root 0.00 cpu 658k mem 0 io accton |
- | time-> | + | root 0.00 cpu 4556k mem 0 io systemd-tty-ask |
- | type=USER_ACCT msg=audit(1618847281.847:78): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 59424k mem 0 io systemctl |
- | 8.ittraining.loc addr=? terminal=pts/0 res=success' | + | root 0.00 cpu 55328k mem 0 io less |
- | ---- | + | root 0.00 cpu 59200k mem 0 io systemctl |
- | time-> | + | root 0.00 cpu 977k mem 0 io unix_chkpwd |
- | type=CRED_ACQ msg=audit(1618847281.847:79): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.01 cpu 57776k mem 0 io crond * |
- | ddr=? terminal=pts/ | + | root 0.00 cpu 0k mem 0 io kworker/ |
- | ---- | + | root 0.00 cpu 0k mem 0 io kworker/ |
- | time-> | + | root 0.00 cpu 0k mem 0 io kworker/dying * |
- | type=USER_START msg=audit(1618847281.883:80): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.00 cpu 0k mem 0 io kworker/dying * |
- | ,pam_xauth acct="root" exe="/ | + | root 0.00 cpu 0k mem 0 io kworker/dying * |
- | ---- | + | root 0.00 cpu 0k mem 0 io kworker/ |
- | time-> | + | root 0.00 cpu 0k mem 0 io kworker/dying * |
- | type=USER_END msg=audit(1618848279.544:541): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u: | + | root 0.01 cpu 0k mem 0 io kworker/ |
- | ,pam_xauth acct="root" exe="/ | + | root 0.00 cpu 0k mem 0 io kworker/ |
- | ---- | + | root 0.00 cpu 0k mem 0 io kworker/ |
- | time-> | + | root 0.00 cpu 0k mem 0 io kworker/ |
- | type=CRED_DISP msg=audit(1618848279.544: | + | root 0.12 cpu |
- | addr=? terminal=pts/ | + | root 0.00 cpu 0k mem 0 io kworker/dying * |
- | ---- | + | root 0.00 cpu 0k mem 0 io kworker/dying * |
- | time->Mon Apr 19 12:05:57 2021 | + | root 0.00 cpu 0k mem 0 io kworker/dying * |
- | type=USER_AUTH msg=audit(1618848357.204: | + | root 0.00 cpu 55232k mem 0 io cat |
- | addr=? terminal=pts/ | + | root 0.00 cpu 977k mem 0 io unix_chkpwd |
- | ---- | + | root 0.00 cpu 57776k mem 0 io crond * |
- | time-> | + | root 0.00 cpu 759k mem 0 io dump-acct |
- | type=USER_AUTH msg=audit(1618848363.134: | + | root 0.00 cpu 977k mem 0 io unix_chkpwd |
- | ng.loc addr=? terminal=pts/ | + | root 0.00 cpu 57776k mem 0 io crond * |
- | ---- | + | root 0.00 cpu 660k mem 0 io dump-acct |
- | --More-- | + | root 0.00 cpu 55552k mem 0 io man |
- | </ | + | root 0.00 cpu 760k mem 0 io lastcomm |
+ | root 0.00 cpu 977k mem 0 io unix_chkpwd | ||
+ | root 0.00 cpu 57776k mem 0 io crond * | ||
+ | root 0.00 cpu 760k mem 0 io lastcomm | ||
+ | root 0.00 cpu 977k mem 0 io unix_chkpwd | ||
+ | root 0.01 cpu 57776k mem 0 io crond * | ||
+ | root 0.00 cpu 661k mem 0 io lastcomm | ||
+ | </ | ||
+ | |||
+ | ====1.12 - La Commande ac==== | ||
+ | |||
+ | Cette commande vous renseigne sur les statistiques des temps de connexion des utilisateurs : | ||
+ | |||
+ | <code> | ||
+ | [root@redhat9 ~]# ac -p | ||
+ | trainee | ||
+ | total 20.30 | ||
+ | |||
+ | [root@redhat9 ~]# ac -d | ||
+ | Oct 19 | ||
+ | Sep 25 total | ||
+ | Sep 30 total 0.04 | ||
+ | Oct 21 total 6.08 | ||
+ | Today | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | usage: ausearch | + | |
- | -a,--event <Audit event id> | + | Usage: ac [OPTION] ... |
- | --arch < | + | |
- | -c,--comm <Comm name> | + | OPTIONS: |
- | --checkpoint < | + | |
- | --debug Write malformed events that are skipped to stderr | + | -p, --individual-totals |
- | -e, | + | -f, --file <file> Read from <file> |
- | -f, | + | --complain |
- | --format [raw|default|interpret|csv|text] results format options | + | --reboots |
- | -ga, | + | --supplants |
- | -ge, | + | --timewarps |
- | group id | + | --compatibility |
- | -gi,--gid <Group Id> | + | -a, --all-days Do not skip days without |
- | -h,--help help | + | --tw-leniency |
- | -hn,--host <Host Name> | + | --tw-suspicious |
- | -i, | + | --print-year Print year when displaying dates |
- | -if, | + | --print-zeros Don't suppress zeros in category totals |
- | --input-logs Use | + | --debug Print verbose internal information |
- | --just-one Emit just one event | + | -V, --version |
- | -k, | + | -h, --help Show help and exit |
- | -l, --line-buffered Flush output | + | |
- | -m, | + | The system' |
- | -n,--node <Node name> | + | |
- | -o, | + | |
- | -p,--pid <Process id> | + | |
- | -pp,--ppid <Parent Process id> | + | |
- | -r,--raw output is completely unformatted | + | |
- | -sc,--syscall <SysCall name> | + | |
- | -se, | + | |
- | object | + | |
- | --session <login session id> | + | |
- | -su,--subject | + | |
- | -sv, | + | |
- | success value | + | |
- | -te,--end [end date] [end time] ending date & time for search | + | |
- | -ts, | + | |
- | -tm, | + | |
- | -ua, | + | |
- | -ue, | + | |
- | user id | + | |
- | -ui,--uid <User Id> | + | |
- | -ul,--loginuid <login id> | + | |
- | -uu,--uuid <guest UUID> | + | |
- | machine with the given UUID. | + | |
- | -v,--version version | + | |
- | -vm,--vm-name <guest name> | + | |
- | machine with the name. | + | |
- | -w, | + | |
- | -x, | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | =====LAB #2 - Réglage |
- | **Important** : Pour plus d' | + | |
- | </ | + | |
- | =====Le fichier / | + | ====2.1 - Présentation==== |
- | Ce fichier contient | + | Le daemon **tuned** permet de régler |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Jun 3 10:15:01 centos8 systemd[1]: session-76.scope: Succeeded. | + | ○ tuned.service |
- | Jun 3 10:16:01 centos8 systemd[1]: Started Session 77 of user trainee. | + | Loaded: loaded (/usr/lib/systemd/ |
- | Jun 3 10:16:01 centos8 systemd[1]: session-77.scope: Succeeded. | + | Active: inactive (dead) |
- | Jun 3 10:17:01 centos8 | + | Docs: man:tuned(8) |
- | Jun 3 10:17:01 centos8 systemd[1]: session-78.scope: | + | man:tuned.conf(5) |
- | Jun 3 10:18:01 centos8 systemd[1]: Started Session 79 of user trainee. | + | man:tuned-adm(8) |
- | Jun 3 10:18:01 centos8 systemd[1]: session-79.scope: | + | |
- | Jun 3 10:19:01 centos8 systemd[1]: Started Session 80 of user trainee. | + | |
- | Jun 3 10:19:01 centos8 systemd[1]: session-80.scope: Succeeded. | + | |
- | Jun 3 10:20:02 centos8 systemd[1]: Started Session 81 of user trainee. | + | |
- | Jun 3 10:20:02 centos8 systemd[1]: session-81.scope: | + | |
- | Jun 3 10:21:01 centos8 systemd[1]: Started Session 82 of user trainee. | + | |
- | Jun 3 10:21:01 centos8 systemd[1]: session-82.scope: | + | |
- | Jun 3 10:22:01 centos8 systemd[1]: Started Session 83 of user trainee. | + | |
- | Jun 3 10:22:01 centos8 systemd[1]: session-83.scope: | + | |
</ | </ | ||
- | =====Applications===== | + | Le daemon peut être configuré pour modifier d'une manière dynamique les paramètres du noyau en fonction de la charge du système, en commencant avec les valeurs incluent dans le profil actif. Pour faire ceci, le daemon utilise des modules plug-ins **monitor** et des modules plug-ins **tuning**. Les plug-ins **monitor** analysent le système et fournissent les informations recoltées aux plug-ins **tuning** qui les utilisent pour appliquer des modifications dynamiques. |
- | Certaines applications consignent leurs journaux dans des répertoires spécifiques. Par exemple | + | Les plugs-in **monitor** sont : |
- | * cups, | + | * **disk** - surveille le nombre d' |
- | | + | * **net** - surveille le nombre de paquets transmis par chaque interface réseau, |
- | | + | * **load** - surveille la charge de chaque CPU. |
- | | + | |
+ | Les plug-ins **tuning** corréspondants sont : | ||
+ | |||
+ | * **disk** - définit différents paramètres de disque, par exemple le planificateur de disque ou la gestion avancée de l' | ||
+ | * **net** - configure la vitesse de l' | ||
+ | * **cpu** - définit différents paramètres des CPU par exemple le CPU governor ou la latence. | ||
+ | |||
+ | ====2.2 - Le fichier / | ||
+ | |||
+ | Pour activer le mode dynamique, modifiez la valeur de la directive **dynamic_tuning** dans le fichier **/ | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | total 2448 | + | |
- | drwxr-xr-x. 2 root | + | [root@redhat9 ~]# cat / |
- | drwx------. 2 root root 23 Apr 23 2020 audit | + | # Global tuned configuration file. |
- | -rw-------. 1 root | + | |
- | -rw-------. 1 root | + | # Whether to use daemon. Without daemon it just applies tuning. It is |
- | -rw-------. 1 root | + | # not recommended, |
- | -rw-------. 1 root | + | # e.g. there will be no D-Bus, no rollback of settings, no hotplug, |
- | -rw-------. 1 root | + | # no dynamic tuning, |
- | -rw-rw----. 1 root | + | daemon = 1 |
- | -rw-rw----. | + | |
- | drwxr-xr-x. 2 chrony chrony | + | # Dynamicaly tune devices, if disabled only static tuning will be used. |
- | -rw-------. 1 root | + | dynamic_tuning = 1 |
- | -rw-------. | + | |
- | -rw-------. 1 root | + | # How long to sleep before checking for events (in seconds) |
- | -rw-------. 1 root | + | # higher number means lower overhead but longer response time. |
- | -rw-------. 1 root | + | sleep_interval = 1 |
- | -rw-r--r--. | + | |
- | -rw-------. 1 root | + | # Update interval for dynamic tunings (in seconds). |
- | -rw-------. 1 root | + | # It must be multiply of the sleep_interval. |
- | -rw-r--r--. 1 root | + | update_interval = 10 |
- | -rw-r--r--. 1 root | + | |
- | -rw-r-----. | + | # Recommend functionality, |
- | drwxr-xr-x. 2 root | + | # available in CLI, daemon will not parse recommend.conf but will return |
- | -rw-------. 1 root | + | # one hardcoded profile (by default " |
- | -rw-r--r--. 1 root | + | recommend_command = 1 |
- | -rw-------. 1 root | + | |
- | -rw-------. 1 root | + | # Whether to reapply sysctl from /run/sysctl.d/, /etc/sysctl.d/ and |
- | -rw-rw-r--. | + | # /etc/sysctl.conf. If enabled, these sysctls will be re-appliead |
- | drwx------. 3 root | + | # after TuneD sysctls are applied, i.e. TuneD sysctls will not |
- | -rw-------. 1 root | + | # override user-provided system sysctls. |
- | -rw-------. 1 root | + | reapply_sysctl = 1 |
- | -rw-------. 1 root | + | |
- | -rw-------. 1 root | + | # Default priority assigned to instances |
- | -rw-------. 1 root | + | default_instance_priority = 0 |
- | -rw-------. 1 root | + | |
- | -rw-------. 1 root | + | # Udev buffer size |
- | -rw-------. 1 root | + | udev_buffer_size = 1MB |
- | drwx------. 2 root | + | |
- | drwx------. 3 root | + | # Log file count |
- | -rw-------. 1 root | + | log_file_count = 2 |
- | -rw-------. | + | |
- | -rw-------. 1 root | + | # Log file max size |
- | -rw-------. | + | log_file_max_size = 1MB |
- | -rw-------. | + | |
- | -rw-------. | + | # Preset system uname string for architecture specific tuning. |
- | -rw-------. 1 root | + | # It can be used to force tuning for specific architecture. |
- | -rw-------. 1 root | + | # If commented, " |
- | drwxr-x---. 2 sssd | + | # uname_string = x86_64 |
- | drwxr-xr-x. 3 root | + | |
- | drwxr-xr-x. 2 root | + | # Preset system cpuinfo string for architecture specific tuning. |
- | -rw-rw-r--. 1 root | + | # It can be used to force tuning for specific architecture. |
+ | # If commented, "/ | ||
+ | # cpuinfo_string = Intel | ||
+ | |||
+ | # Enable TuneD listening on dbus | ||
+ | # enable_dbus = 1 | ||
+ | |||
+ | # Enable TuneD listening on unix domain socket | ||
+ | # As this functionality is not used commonly, we disable it by default | ||
+ | # and it is needed to allow it manually | ||
+ | # enable_unix_socket = 0 | ||
+ | |||
+ | # Path to socket for TuneD to listen | ||
+ | # Existing files on given path will be removed | ||
+ | # unix_socket_path = / | ||
+ | |||
+ | # Paths to sockets for TuneD to send signals to separated by , or ; | ||
+ | # unix_socket_signal_paths = | ||
+ | |||
+ | # Default unix socket ownership | ||
+ | # Can be set as id or name, -1 or non-existing name leaves unchanged | ||
+ | # unix_socket_ownership = -1 -1 | ||
+ | |||
+ | # Permissions for listening sockets | ||
+ | # unix_socket_permissions = 0o600 | ||
+ | |||
+ | # Size of connections backlog for listen function on socket | ||
+ | # Higher value allows to process requests from more clients | ||
+ | # connections_backlog = 1024 | ||
+ | |||
+ | # TuneD daemon rollback strategy. Supported values: auto|not_on_exit | ||
+ | # - auto: rollbacks are always performed on a profile switch or | ||
+ | # | ||
+ | # - not_on_exit: rollbacks are always performed on a profile | ||
+ | # | ||
+ | # rollback = auto | ||
</ | </ | ||
- | =====LAB #2 - rsyslog===== | + | Activez et démarrez le daemon **tuned** : |
- | **rsyslog**, | + | < |
+ | [root@redhat9 ~]# systemctl enable --now tuned | ||
- | rsyslog apporte des améliorations par rapport à syslogd | + | [root@redhat9 ~]# systemctl status tuned |
+ | ● tuned.service - Dynamic System Tuning Daemon | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | | ||
+ | Main PID: 3060 (tuned) | ||
+ | Tasks: 4 (limit: 48800) | ||
+ | | ||
+ | CPU: 411ms | ||
+ | | ||
+ | | ||
- | * l' | + | Oct 22 16:13:45 redhat9.ittraining.loc systemd[1]: Starting Dynamic System Tuning Daemon... |
- | * la haute disponibilité, | + | Oct 22 16:13:46 redhat9.ittraining.loc systemd[1]: Started Dynamic System Tuning Daemon. |
- | * l' | + | </ |
- | Les messages de journalisation envoyés à rsyslog sont marqués avec un **Sous-système applicatif** et une **Priorité**. Le binôme Sous-système applicatif/ | + | ====2.3 - Profils==== |
- | rsyslog décide ensuite de l'**action** à entreprendre concernant les informations transmises | + | Les profils sont stocké dans le répertoire |
- | * ignorer les informations, | + | < |
- | * envoyer les informations à un rsyslog sur une autre machine (par exemple, **@machine2**), | + | [root@redhat9 ~]# ls /usr/lib/tuned |
- | * inscrire les informations dans un fichier sur disque (par exemple, **/var/log/messages**), | + | accelerator-performance |
- | | + | aws desktop |
- | * transmettre les informations à tous les utilisateurs (par exemple *****), | + | </ |
- | * transmettre les informations à une application liée à rsyslog via un tube (par exemple, **|logrotate**). | + | |
- | Sous RHEL/ | + | Consultez |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # Options | + | # |
- | # Syslogd options are deprecated since rsyslog v3. | + | # tuned configuration |
- | # If you want to use them, switch | + | # |
- | # See rsyslogd(8) for more details | + | |
- | SYSLOGD_OPTIONS="" | + | [main] |
+ | summary=Broadly applicable tuning that provides excellent performance across a variety of common server workloads | ||
+ | |||
+ | [variables] | ||
+ | thunderx_cpuinfo_regex=CPU part\s+: | ||
+ | amd_cpuinfo_regex=model name\s+: | ||
+ | |||
+ | [cpu] | ||
+ | governor=performance | ||
+ | energy_perf_bias=performance | ||
+ | min_perf_pct=100 | ||
+ | energy_performance_preference=performance | ||
+ | |||
+ | [acpi] | ||
+ | platform_profile=performance | ||
+ | |||
+ | # Marvell ThunderX | ||
+ | [vm.thunderx] | ||
+ | type=vm | ||
+ | uname_regex=aarch64 | ||
+ | cpuinfo_regex=${thunderx_cpuinfo_regex} | ||
+ | transparent_hugepages=never | ||
+ | |||
+ | [disk] | ||
+ | # The default unit for readahead is KiB. This can be adjusted to sectors | ||
+ | # by specifying the relevant suffix, eg. (readahead => 8192 s). There must | ||
+ | # be at least one space between the number and suffix (if suffix is specified). | ||
+ | readahead=> | ||
+ | |||
+ | [sysctl] | ||
+ | # If a workload mostly uses anonymous memory and it hits this limit, the entire | ||
+ | # working set is buffered for I/O, and any more write buffering would require | ||
+ | # swapping, so it's time to throttle writes until I/O can catch up. Workloads | ||
+ | # that mostly | ||
+ | # | ||
+ | # The generator of dirty data starts writeback at this percentage (system default | ||
+ | # is 20%) | ||
+ | vm.dirty_ratio = 40 | ||
+ | |||
+ | # Start background writeback (via writeback threads) at this percentage (system | ||
+ | # default is 10%) | ||
+ | vm.dirty_background_ratio = 10 | ||
+ | |||
+ | # PID allocation wrap value. | ||
+ | # reaches this value, it wraps back to a minimum PID value. | ||
+ | # PIDs of value pid_max or larger are not allocated. | ||
+ | # | ||
+ | # A suggested value for pid_max is 1024 * <# of cpu cores/ | ||
+ | # e.g., a box with 32 cpus, the default of 32768 is reasonable, for 64 cpus, | ||
+ | # 65536, for 4096 cpus, 4194304 | ||
+ | # | ||
+ | |||
+ | # The swappiness parameter controls the tendency of the kernel to move | ||
+ | # processes out of physical memory and onto the swap disk. | ||
+ | # 0 tells the kernel to avoid swapping processes out of physical memory | ||
+ | # for as long as possible | ||
+ | # 100 tells the kernel to aggressively swap processes out of physical memory | ||
+ | # and move them to swap cache | ||
+ | vm.swappiness=10 | ||
+ | |||
+ | # The default kernel value 128 was over twenty years old default, | ||
+ | # kernel-5.4 increased it to 4096, thus do not have it lower than 2048 | ||
+ | # on older kernels | ||
+ | net.core.somaxconn=> | ||
+ | |||
+ | # Marvell ThunderX | ||
+ | [sysctl.thunderx] | ||
+ | type=sysctl | ||
+ | uname_regex=aarch64 | ||
+ | cpuinfo_regex=${thunderx_cpuinfo_regex} | ||
+ | kernel.numa_balancing=0 | ||
</ | </ | ||
- | L' | + | Pour consulter |
- | ^ Directive ^ Version ^ | + | < |
- | | SYSLOGD_OPTIONS=" | + | [root@redhat9 ~]# tuned-adm active |
- | | SYSLOGD_OPTIONS=" | + | Current active profile: virtual-guest |
- | | SYSLOGD_OPTIONS=" | + | </ |
- | ====2.1 | + | Ce profil est choisit par le système en fonction de la sortie de la sous-commande **recommend** de la commande **tuned-adm** : |
- | La **Priorité** permet d' | + | < |
+ | [root@redhat9 ~]# tuned-adm recommend | ||
+ | virtual-guest | ||
+ | </ | ||
- | ^ Niveau ^ Priorité ^ Description ^ | + | La sous-commande **list** de la commande **tuned-adm** permet |
- | | 0 | emerg/panic | Système inutilisable | | + | |
- | | 1 | alert | Action immédiate requise | | + | |
- | | 2 | crit | Condition critique atteinte | | + | |
- | | 3 | err/error | Erreurs rencontrées | | + | |
- | | 4 | warning/ | + | |
- | | 5 | notice | Condition normale | + | |
- | | 6 | info | Condition normale - message simple | | + | |
- | | 7 | debug | Condition normale | + | |
- | ====2.2 - Sous-systèmes applicatifs==== | + | < |
+ | [root@redhat9 ~]# tuned-adm list | ||
+ | Available profiles: | ||
+ | - accelerator-performance | ||
+ | - aws - Optimize for aws ec2 instances | ||
+ | - balanced | ||
+ | - desktop | ||
+ | - hpc-compute | ||
+ | - intel-sst | ||
+ | - latency-performance | ||
+ | - network-latency | ||
+ | - network-throughput | ||
+ | - optimize-serial-console | ||
+ | - powersave | ||
+ | - throughput-performance | ||
+ | - virtual-guest | ||
+ | - virtual-host | ||
+ | Current active profile: virtual-guest | ||
+ | </ | ||
- | Le **Sous-système applicatif**, | + | Les profiles fournit avec RedHat 9 sont les suivants |
- | ^ Fonction | + | ^ Profile |
- | | auth/auth-priv | Message | + | | accelerator-performance |
- | | cron | Message de cron ou at | | + | | aws | Optimiser pour les instances aws ec2 | |
- | | daemon | + | | balanced |
- | | kern | Message | + | | desktop |
- | | lpr | Message | + | | hpc-compute |
- | | mail | Message | + | | intel-sst | Optimisé pour les systèmes dotés de configurations Intel Speed Select Technology. A utiliser en superposition à d'autres profils. |
- | | news | Message | + | | latency-performance | Idéal pour les systèmes de serveurs qui nécessitent une faible latence au détriment de la consommation d' |
- | | syslog | + | | network-latency |
- | | user | Message utilisateur | + | | network-throughput |
- | | uucp | Message | + | | optimize-serial-console |
- | | local0 | + | | powersave |
+ | | throughput-performance | ||
+ | | virtual-guest | Permet d' | ||
+ | | virtual-host | Permet de régler le système | ||
+ | Modifiez le profil actif à **throughput-performance** : | ||
- | ====2.3 | + | < |
+ | [root@redhat9 ~]# tuned-adm profile throughput-performance | ||
- | rsyslog est configuré par le fichier | + | [root@redhat9 ~]# tuned-adm active |
+ | Current active profile: throughput-performance | ||
+ | </ | ||
+ | |||
+ | Verifiez la valeur de **vm.spappiness** : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # rsyslog configuration file | + | vm.swappiness = 10 |
+ | </ | ||
- | # For more information see / | + | Pour désactiver l' |
- | # or latest version online at http:// | + | |
- | # If you experience problems, see http:// | + | |
- | #### MODULES #### | + | < |
+ | [root@redhat9 ~]# tuned-adm off | ||
- | module(load=" | + | [root@redhat9 ~]# tuned-adm active |
- | SysSock.Use=" | + | No current active profile. |
- | # local messages are retrieved through imjournal now. | + | </ |
- | module(load=" | + | |
- | | + | |
- | # | + | |
- | # | + | |
- | # Provides UDP syslog reception | + | Cette commande n' |
- | # for parameters see http:// | + | |
- | # | + | |
- | # | + | |
- | # Provides TCP syslog reception | + | < |
- | # for parameters see http://www.rsyslog.com/doc/imtcp.html | + | [root@redhat9 ~]# systemctl status tuned |
- | #module(load=" | + | ● tuned.service - Dynamic System Tuning Daemon |
- | #input(type=" | + | |
+ | Active: active | ||
+ | Docs: man:tuned(8) | ||
+ | | ||
+ | | ||
+ | Main PID: 3060 (tuned) | ||
+ | Tasks: 2 (limit: 48800) | ||
+ | | ||
+ | CPU: 2.028s | ||
+ | | ||
+ | | ||
- | #### GLOBAL DIRECTIVES #### | + | Oct 22 16:13:45 redhat9.ittraining.loc systemd[1]: Starting Dynamic System Tuning Daemon... |
+ | Oct 22 16:13:46 redhat9.ittraining.loc systemd[1]: Started Dynamic System Tuning Daemon. | ||
+ | </ | ||
- | # Where to place auxiliary files | + | Notez que la valeur de **vm.spappiness** a été modifiée : |
- | global(workDirectory="/ | + | |
- | # Use default timestamp format | + | < |
- | module(load=" | + | [root@redhat9 ~]# sysctl vm.swappiness |
+ | vm.swappiness | ||
+ | </ | ||
- | # Include all config files in / | + | Pour activer l' |
- | include(file="/ | + | |
- | #### RULES #### | + | < |
+ | [root@redhat9 ~]# tuned-adm profile throughput-performance | ||
- | # Log all kernel messages to the console. | + | [root@redhat9 ~]# tuned-adm active |
- | # Logging much else clutters up the screen. | + | Current active profile: throughput-performance |
- | # | + | < |
- | # Log anything (except mail) of level info or higher. | + | Dernièrement, |
- | # Don't log private authentication messages! | + | |
- | *.info; | + | |
- | # The authpriv file has restricted access. | + | < |
- | authpriv.* | + | [root@redhat9 ~]# systemctl disable --now tuned |
+ | Removed "/etc/systemd/system/ | ||
- | # Log all the mail messages in one place. | + | [root@redhat9 ~]# systemctl status tuned |
- | mail.* | + | ○ tuned.service - Dynamic System Tuning Daemon |
+ | Loaded: loaded (/ | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | | ||
+ | Process: 3060 ExecStart=/usr/sbin/tuned -l -P (code=exited, | ||
+ | Main PID: 3060 (code=exited, | ||
+ | CPU: 2.233s | ||
+ | Oct 22 16:13:45 redhat9.ittraining.loc systemd[1]: Starting Dynamic System Tuning Daemon... | ||
+ | Oct 22 16:13:46 redhat9.ittraining.loc systemd[1]: Started Dynamic System Tuning Daemon. | ||
+ | Oct 22 17:29:32 redhat9.ittraining.loc systemd[1]: Stopping Dynamic System Tuning Daemon... | ||
+ | Oct 22 17:29:32 redhat9.ittraining.loc systemd[1]: tuned.service: | ||
+ | Oct 22 17:29:32 redhat9.ittraining.loc systemd[1]: Stopped Dynamic System Tuning Daemon. | ||
+ | Oct 22 17:29:32 redhat9.ittraining.loc systemd[1]: tuned.service: | ||
+ | </ | ||
- | # Log cron stuff | + | =====LAB |
- | cron.* | + | |
- | # Everybody gets emergency messages | + | ====3.1 - Répertoire /proc==== |
- | *.emerg : | + | |
- | # Save news errors of level crit and higher in a special file. | + | 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 |
- | uucp,news.crit | + | |
- | # Save boot messages also to boot.log | + | < |
- | local7.* | + | [root@redhat9 ~]# ls /proc |
+ | 1 | ||
+ | 10 15 1671 1752 1767 2081 29 413 438 454 530 566 655 74421 772 78 | ||
+ | 1036 16 1678 1753 18 21 3 | ||
+ | 12 1626 1694 1754 1887 22 30 42 | ||
+ | 1240 1628 1695 1755 2 | ||
+ | 1266 1629 1696 1756 20 239 | ||
+ | 1279 1631 17 1757 2015 24 34 431 442 491 560 58 | ||
+ | 1280 1632 1725 1758 2038 241 | ||
+ | 1281 1633 1741 1759 2042 243 | ||
+ | 1282 1641 1743 1764 2053 27 38 435 445 51 | ||
+ | 13 1660 1747 1765 2055 28 4 | ||
+ | </code> | ||
+ | |||
+ | ===Fichiers=== | ||
+ | |||
+ | ==Processeur== | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat /proc/cpuinfo | ||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 86 | ||
+ | model name : Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 2099.998 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 0 | ||
+ | cpu cores : 2 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | cpuid level : 20 | ||
+ | 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 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat vnmi umip md_clear arch_capabilities | ||
+ | vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid shadow_vmcs pml | ||
+ | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa mmio_stale_data | ||
+ | bogomips | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 64 | ||
+ | address sizes : 46 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 86 | ||
+ | model name : Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 2099.998 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 1 | ||
+ | cpu cores : 2 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | cpuid level : 20 | ||
+ | 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 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat vnmi umip md_clear arch_capabilities | ||
+ | vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid shadow_vmcs pml | ||
+ | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa mmio_stale_data | ||
+ | bogomips | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 64 | ||
+ | address sizes : 46 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 86 | ||
+ | model name : Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 2099.998 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 1 | ||
+ | siblings | ||
+ | core id : 0 | ||
+ | cpu cores : 2 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | cpuid level : 20 | ||
+ | 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 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat vnmi umip md_clear arch_capabilities | ||
+ | vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid shadow_vmcs pml | ||
+ | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa mmio_stale_data | ||
+ | bogomips | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 64 | ||
+ | address sizes : 46 bits physical, 48 bits virtual | ||
+ | power management: | ||
- | # ### sample forwarding rule ### | + | processor |
- | # | + | vendor_id |
- | # An on-disk queue is created for this action. If the remote host is | + | cpu family |
- | # down, messages are spooled to disk and sent when it is up again. | + | model : 86 |
- | # | + | model name : Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz |
- | #queue.maxdiskspace=" | + | stepping |
- | # | + | microcode |
- | # | + | cpu MHz : 2099.998 |
- | #action.resumeRetryCount=" | + | cache size : 16384 KB |
- | # Remote Logging (we use TCP for reliable delivery) | + | physical id : 1 |
- | # remote_host is: name/ip, e.g. 192.168.0.1, | + | siblings |
- | # | + | core id |
+ | cpu cores | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | cpuid level : 20 | ||
+ | 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 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat vnmi umip md_clear arch_capabilities | ||
+ | vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid shadow_vmcs pml | ||
+ | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa mmio_stale_data | ||
+ | bogomips | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 64 | ||
+ | address sizes : 46 bits physical, 48 bits virtual | ||
+ | power management: | ||
</ | </ | ||
- | Ce fichier est divisé en 3 parties : | + | ==Interruptions système== |
- | | + | < |
- | * Section traitant le chargement des modules offrant des fonctionnalités étendues à rsyslog, | + | [root@redhat9 ~]# cat / |
- | | + | |
- | * Section traitant les options de comportement global du service rsyslog, | + | 0: |
- | | + | |
- | * Section traitant les règles de configuration des journaux. Les règles au format syslogd gardent le même format. Les nouvelles règles, compatibles seulement avec rsyslog commencent par **module**. | + | |
+ | | ||
+ | 10: 0 0 0 38837 | ||
+ | 11: 0 4 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | NMI: 0 0 0 0 | ||
+ | LOC: 1738095 | ||
+ | SPU: 0 0 0 0 | ||
+ | PMI: 0 0 0 0 | ||
+ | IWI: 2 2 0 0 IRQ work interrupts | ||
+ | RTR: 0 0 0 0 APIC ICR read retries | ||
+ | RES: 67302 65493 50955 48179 | ||
+ | CAL: | ||
+ | TLB: 27935 27127 25742 26719 TLB shootdowns | ||
+ | TRM: 0 0 0 0 | ||
+ | THR: 0 0 0 0 | ||
+ | DFR: 0 0 0 0 | ||
+ | MCE: 0 0 0 0 | ||
+ | MCP: 233 233 233 233 | ||
+ | HYP: 1 1 1 1 | ||
+ | ERR: 0 | ||
+ | MIS: 0 | ||
+ | PIN: 0 0 0 0 | ||
+ | NPI: 0 0 0 0 | ||
+ | PIW: 0 0 0 0 | ||
+ | </ | ||
- | ===Modules=== | + | <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' | ||
+ | </ | ||
- | Depuis la version 3 de rsyslog, la réception des données par ce dernier appelée les **inputs** est gérée par l' | + | ==Canaux DMA== |
- | ^ Module ^ Fonction ^ | + | < |
- | | module(load=" | + | [root@redhat9 ~]# cat /proc/dma |
- | | module(load=" | + | 4: cascade |
- | | module(load=" | + | </ |
- | | module(load=" | + | |
- | | module(load=" | + | |
- | | module(load=" | + | |
- | Dans le fichier **/ | + | ==Plages d' |
- | <file> | + | <code> |
- | ... | + | [root@redhat9 ~]# cat / |
- | #### MODULES #### | + | 0000-0cf7 : PCI Bus 0000:00 |
+ | 0000-001f : dma1 | ||
+ | 0020-0021 : pic1 | ||
+ | 0040-0043 : timer0 | ||
+ | 0050-0053 : timer1 | ||
+ | 0060-0060 : keyboard | ||
+ | 0064-0064 : keyboard | ||
+ | 0070-0077 : rtc0 | ||
+ | 0080-008f : dma page reg | ||
+ | 00a0-00a1 : pic2 | ||
+ | 00c0-00df : dma2 | ||
+ | 00f0-00ff : fpu | ||
+ | 0170-0177 : 0000:00:01.1 | ||
+ | 0170-0177 : ata_piix | ||
+ | 01f0-01f7 : 0000:00:01.1 | ||
+ | 01f0-01f7 : ata_piix | ||
+ | 0376-0376 : 0000:00:01.1 | ||
+ | | ||
+ | 03c0-03df : vga+ | ||
+ | 03f6-03f6 : 0000: | ||
+ | 03f6-03f6 : ata_piix | ||
+ | 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:03 | ||
+ | d000-dfff : PCI Bus 0000:02 | ||
+ | e000-efff : PCI Bus 0000:01 | ||
+ | e000-e03f : 0000: | ||
+ | f000-f03f : 0000: | ||
+ | f040-f05f : 0000: | ||
+ | f040-f05f : uhci_hcd | ||
+ | f060-f07f : 0000: | ||
+ | f060-f07f : ahci | ||
+ | f080-f09f : 0000: | ||
+ | f0a0-f0af : 0000: | ||
+ | f0a0-f0af : ata_piix | ||
+ | </ | ||
- | module(load=" | + | <WRAP center round alert 60%> |
- | SysSock.Use=" | + | **Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. |
- | # local messages are retrieved through imjournal now. | + | </ |
- | module(load=" | + | |
- | | + | |
- | # | + | |
- | # | + | |
- | # Provides UDP syslog reception | + | ==Périphériques== |
- | # for parameters see http:// | + | |
- | # | + | |
- | #input(type=" | + | |
- | # Provides TCP syslog reception | + | < |
- | # for parameters see http://www.rsyslog.com/doc/imtcp.html | + | [root@redhat9 ~]# cat / |
- | # | + | Character devices: |
- | #input(type=" | + | 1 mem |
- | ... | + | 4 /dev/vc/0 |
- | </file> | + | 4 tty |
+ | 4 ttyS | ||
+ | 5 /dev/tty | ||
+ | 5 / | ||
+ | 5 /dev/ptmx | ||
+ | 7 vcs | ||
+ | 10 misc | ||
+ | | ||
+ | 14 sound | ||
+ | 21 sg | ||
+ | 29 fb | ||
+ | 116 alsa | ||
+ | 128 ptm | ||
+ | 136 pts | ||
+ | 180 usb | ||
+ | 188 ttyUSB | ||
+ | 189 usb_device | ||
+ | 202 cpu/msr | ||
+ | 203 cpu/cpuid | ||
+ | 226 drm | ||
+ | 242 hidraw | ||
+ | 243 ttyDBC | ||
+ | 244 usbmon | ||
+ | 245 wwan_port | ||
+ | 246 bsg | ||
+ | 247 watchdog | ||
+ | 248 ptp | ||
+ | 249 pps | ||
+ | 250 rtc | ||
+ | 251 dma_heap | ||
+ | 252 dax | ||
+ | 253 tpm | ||
+ | 254 gpiochip | ||
- | Pour activer la réception de messages à partir de serveurs rsyslog distants en utilisant le protocole **UDP**, il convient de décommenter les directives de chargement de modules dans le fichier **/etc/ | + | Block devices: |
+ | 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 device-mapper | ||
+ | 254 mdp | ||
+ | 259 blkext | ||
+ | </code> | ||
- | < | + | ==Modules== |
- | ... | + | |
- | # Provides UDP syslog reception | + | |
- | # for parameters see http:// | + | |
- | module(load=" | + | |
- | input(type=" | + | |
- | # Provides TCP syslog reception | + | < |
- | # for parameters see http://www.rsyslog.com/doc/imtcp.html | + | [root@redhat9 ~]# cat / |
- | module(load=" | + | tls 159744 0 - Live 0xffffffffc0d1a000 |
- | input(type=" | + | snd_seq_dummy 16384 0 - Live 0xffffffffc0d15000 |
- | ... | + | snd_hrtimer 16384 1 - Live 0xffffffffc0d10000 |
- | </ | + | snd_seq 131072 7 snd_seq_dummy, |
+ | snd_timer 53248 2 snd_hrtimer, | ||
+ | snd_seq_device 16384 1 snd_seq, Live 0xffffffffc0b6d000 | ||
+ | snd 147456 5 snd_seq, | ||
+ | soundcore 16384 1 snd, Live 0xffffffffc0b68000 | ||
+ | nft_fib_inet 16384 1 - Live 0xffffffffc0b63000 | ||
+ | nft_fib_ipv4 16384 1 nft_fib_inet, | ||
+ | nft_fib_ipv6 16384 1 nft_fib_inet, | ||
+ | nft_fib 16384 3 nft_fib_inet, | ||
+ | nft_reject_inet 16384 6 - Live 0xffffffffc0b4f000 | ||
+ | nf_reject_ipv4 16384 1 nft_reject_inet, | ||
+ | nf_reject_ipv6 24576 1 nft_reject_inet, | ||
+ | nft_reject 16384 1 nft_reject_inet, | ||
+ | nft_ct 24576 7 - Live 0xffffffffc0b32000 | ||
+ | nft_chain_nat 16384 3 - Live 0xffffffffc0b39000 | ||
+ | nf_nat 61440 1 nft_chain_nat, | ||
+ | nf_conntrack 217088 2 nft_ct, | ||
+ | nf_defrag_ipv6 24576 1 nf_conntrack, | ||
+ | nf_defrag_ipv4 16384 1 nf_conntrack, | ||
+ | ip_set 69632 0 - Live 0xffffffffc0ace000 | ||
+ | rfkill 40960 3 - Live 0xffffffffc0ac3000 | ||
+ | nf_tables 356352 194 nft_fib_inet, | ||
+ | nfnetlink 20480 3 ip_set, | ||
+ | qrtr 57344 4 - Live 0xffffffffc0a56000 | ||
+ | intel_rapl_msr 20480 0 - Live 0xffffffffc0a50000 | ||
+ | intel_rapl_common 45056 1 intel_rapl_msr, | ||
+ | intel_uncore_frequency_common 16384 0 - Live 0xffffffffc0a3f000 | ||
+ | kvm_intel 442368 0 - Live 0xffffffffc09d2000 | ||
+ | kvm 1335296 1 kvm_intel, Live 0xffffffffc0b75000 | ||
+ | irqbypass 16384 1 kvm, Live 0xffffffffc09cd000 | ||
+ | rapl 28672 0 - Live 0xffffffffc09c5000 | ||
+ | i2c_piix4 32768 0 - Live 0xffffffffc09bc000 | ||
+ | pcspkr 16384 0 - Live 0xffffffffc09b7000 | ||
+ | virtio_balloon 28672 0 - Live 0xffffffffc0738000 | ||
+ | joydev 28672 0 - Live 0xffffffffc0730000 | ||
+ | xfs 2510848 2 - Live 0xffffffffc0751000 | ||
+ | libcrc32c 16384 4 nf_nat, | ||
+ | sr_mod 28672 0 - Live 0xffffffffc06c9000 | ||
+ | cdrom 90112 1 sr_mod, Live 0xffffffffc0719000 | ||
+ | ata_generic 16384 0 - Live 0xffffffffc0714000 | ||
+ | bochs 20480 1 - Live 0xffffffffc070e000 | ||
+ | drm_vram_helper 28672 1 bochs, Live 0xffffffffc065a000 | ||
+ | drm_kms_helper 245760 4 bochs, | ||
+ | syscopyarea 16384 1 drm_kms_helper, | ||
+ | sysfillrect 16384 1 drm_kms_helper, | ||
+ | sysimgblt 16384 1 drm_kms_helper, | ||
+ | ata_piix 45056 0 - Live 0xffffffffc06b8000 | ||
+ | crct10dif_pclmul 16384 1 - Live 0xffffffffc068c000 | ||
+ | fb_sys_fops 16384 1 drm_kms_helper, | ||
+ | drm_ttm_helper 16384 2 bochs, | ||
+ | sd_mod 90112 3 - Live 0xffffffffc0643000 | ||
+ | crc32_pclmul 16384 0 - Live 0xffffffffc0636000 | ||
+ | --More-- | ||
+ | </ | ||
+ | |||
+ | ==Statistiques de l' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 11 0 sr0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==Partitions== | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | major minor # | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 11 0 1048575 sr0 | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==Espaces de pagination== | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | Filename | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ==Statistiques d' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | 0.00 0.00 0.00 1/517 78961 | ||
+ | </ | ||
+ | |||
+ | ==Statistiques d' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | MemTotal: | ||
+ | MemFree: | ||
+ | MemAvailable: | ||
+ | Buffers: | ||
+ | Cached: | ||
+ | SwapCached: | ||
+ | Active: | ||
+ | Inactive: | ||
+ | Active(anon): | ||
+ | Inactive(anon): | ||
+ | Active(file): | ||
+ | Inactive(file): | ||
+ | Unevictable: | ||
+ | Mlocked: | ||
+ | SwapTotal: | ||
+ | SwapFree: | ||
+ | Zswap: | ||
+ | Zswapped: | ||
+ | Dirty: | ||
+ | Writeback: | ||
+ | AnonPages: | ||
+ | Mapped: | ||
+ | Shmem: | ||
+ | KReclaimable: | ||
+ | Slab: | ||
+ | SReclaimable: | ||
+ | SUnreclaim: | ||
+ | KernelStack: | ||
+ | PageTables: | ||
+ | SecPageTables: | ||
+ | NFS_Unstable: | ||
+ | Bounce: | ||
+ | WritebackTmp: | ||
+ | CommitLimit: | ||
+ | Committed_AS: | ||
+ | VmallocTotal: | ||
+ | VmallocUsed: | ||
+ | VmallocChunk: | ||
+ | Percpu: | ||
+ | HardwareCorrupted: | ||
+ | AnonHugePages: | ||
+ | ShmemHugePages: | ||
+ | ShmemPmdMapped: | ||
+ | FileHugePages: | ||
+ | FilePmdMapped: | ||
+ | CmaTotal: | ||
+ | CmaFree: | ||
+ | Unaccepted: | ||
+ | HugePages_Total: | ||
+ | HugePages_Free: | ||
+ | HugePages_Rsvd: | ||
+ | HugePages_Surp: | ||
+ | Hugepagesize: | ||
+ | Hugetlb: | ||
+ | DirectMap4k: | ||
+ | DirectMap2M: | ||
+ | DirectMap1G: | ||
+ | </code> | ||
+ | |||
+ | ==Version du noyau== | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat /proc/ | ||
+ | Linux version 5.14.0-427.37.1.el9_4.x86_64 (mockbuild@x86-64-02.build.eng.rdu2.redhat.com) (gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3), GNU ld version 2.35.2-43.el9) #1 SMP PREEMPT_DYNAMIC Fri Sep 13 12:41:50 EDT 2024 | ||
+ | </code> | ||
+ | |||
+ | ===Répertoires=== | ||
+ | |||
+ | ==ide/scsi== | ||
+ | |||
+ | Ce répertoire contient des répertoires dans lesquels se trouvent des informations sur la capacité, le type et la géométrie des disques. | ||
+ | |||
+ | ==acpi== | ||
+ | |||
+ | Ce répertoire contient des informations sur la gestion de l' | ||
+ | |||
+ | ==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' | ||
+ | |||
+ | ====3.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@redhat9 ~]# cat / | ||
+ | # sysctl settings are defined through files in | ||
+ | # / | ||
+ | # | ||
+ | # Vendors settings live in / | ||
+ | # To override a whole file, create a new file with the same in | ||
+ | # / | ||
+ | # only specific settings, add a file with a lexically later | ||
+ | # name in / | ||
+ | # | ||
+ | # For more information, | ||
+ | |||
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 0 | ||
+ | lrwxrwxrwx. 1 root root 14 Jul 18 13:00 99-sysctl.conf -> ../ | ||
+ | |||
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 28 | ||
+ | -rw-r--r--. 1 root root 1810 Dec 11 2023 10-default-yama-scope.conf | ||
+ | -rw-r--r--. 1 root root 1816 Jul 18 13:00 50-coredump.conf | ||
+ | -rw-r--r--. 1 root root 1919 Oct 31 2022 50-default.conf | ||
+ | -rw-r--r--. 1 root root 246 Dec 7 2023 50-libkcapi-optmem_max.conf | ||
+ | -rw-r--r--. 1 root root 635 Oct 31 2022 50-pid-max.conf | ||
+ | -rw-r--r--. 1 root root 203 Apr 24 13:50 50-redhat.conf | ||
+ | -rw-r--r--. 1 root root 387 Oct 31 2022 README | ||
+ | |||
+ | [root@redhat9 ~]# cat / | ||
+ | # This file is part of systemd. | ||
+ | # | ||
+ | # systemd is free software; you can redistribute it and/or modify it | ||
+ | # under the terms of the GNU Lesser General Public License as published by | ||
+ | # the Free Software Foundation; either version 2.1 of the License, or | ||
+ | # (at your option) any later version. | ||
+ | |||
+ | # See sysctl.d(5) and core(5) for documentation. | ||
+ | |||
+ | # To override settings in this file, create a local file in /etc | ||
+ | # (e.g. / | ||
+ | # there. | ||
+ | |||
+ | # System Request functionality of the kernel (SYNC) | ||
+ | # | ||
+ | # Use kernel.sysrq | ||
+ | # See https:// | ||
+ | # of values and keys. | ||
+ | kernel.sysrq = 16 | ||
+ | |||
+ | # Append the PID to the core filename | ||
+ | kernel.core_uses_pid = 1 | ||
+ | |||
+ | # Source route verification | ||
+ | net.ipv4.conf.default.rp_filter = 2 | ||
+ | net.ipv4.conf.*.rp_filter = 2 | ||
+ | -net.ipv4.conf.all.rp_filter | ||
+ | |||
+ | # Do not accept source routing | ||
+ | net.ipv4.conf.default.accept_source_route = 0 | ||
+ | net.ipv4.conf.*.accept_source_route = 0 | ||
+ | -net.ipv4.conf.all.accept_source_route | ||
+ | |||
+ | # Promote secondary addresses when the primary address is removed | ||
+ | net.ipv4.conf.default.promote_secondaries = 1 | ||
+ | net.ipv4.conf.*.promote_secondaries = 1 | ||
+ | -net.ipv4.conf.all.promote_secondaries | ||
+ | |||
+ | # ping(8) without CAP_NET_ADMIN and CAP_NET_RAW | ||
+ | # The upper limit is set to 2^31-1. Values greater than that get rejected by | ||
+ | # the kernel because of this definition in linux/ | ||
+ | # # | ||
+ | # That's not so bad because values between 2^31 and 2^32-1 are reserved on | ||
+ | # systemd-based systems anyway: https:// | ||
+ | -net.ipv4.ping_group_range | ||
+ | |||
+ | # Fair Queue CoDel packet scheduler to fight bufferbloat | ||
+ | -net.core.default_qdisc | ||
+ | |||
+ | # Enable hard and soft link protection | ||
+ | fs.protected_hardlinks = 1 | ||
+ | fs.protected_symlinks = 1 | ||
+ | |||
+ | # Enable regular file and FIFO protection | ||
+ | fs.protected_regular = 1 | ||
+ | fs.protected_fifos = 1 | ||
+ | </code> | ||
+ | |||
+ | Les options de la commande **sysctl** sont : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# sysctl --help | ||
+ | |||
+ | Usage: | ||
+ | | ||
+ | |||
+ | Options: | ||
+ | -a, --all display all variables | ||
+ | -A alias of -a | ||
+ | -X alias of -a | ||
+ | --deprecated | ||
+ | --dry-run | ||
+ | -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). | ||
+ | </code> | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Les deux directives | + | **Important** : Consultez la page de la traduction du manuel de **sysctl** **[[http://www.delafond.org/ |
</ | </ | ||
- | Pour envoyer l' | + | =====LAB#4 - Interprétation |
- | < | + | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' |
- | ... | + | |
- | # ### sample forwarding rule ### | + | * free, |
- | #action(type=" | + | * uptime et w, |
- | # An on-disk queue is created | + | * iostat, |
- | # down, messages are spooled to disk and sent when it is up again. | + | * hdparm, |
- | #queue.filename=" | + | * vmstat, |
- | #queue.maxdiskspace=" | + | * mpstat, |
- | #queue.saveonshutdown=" | + | * sar. |
- | #queue.type=" | + | |
- | #action.resumeRetryCount=" | + | ====4.1 - La Commande free==== |
- | # Remote Logging | + | |
- | # remote_host is: name/ip, e.g. 192.168.0.1, port optional e.g. 10514 | + | 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 : |
- | Target=" | + | |
- | ... | + | < |
- | </file> | + | [root@redhat9 ~]# free -m |
+ | | ||
+ | Mem: 7685 | ||
+ | Swap: | ||
+ | </ | ||
+ | |||
+ | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : | ||
+ | |||
+ | * 7685 Mo de mémoire physique totale, | ||
+ | * 948 Mo de mémoire physique utilisée et 6249 Mo de mémoire physique libre, | ||
+ | * 5119 Mo de mémoire swap totale et 0 Mo de swap utilisé | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# free --help | ||
+ | |||
+ | Usage: | ||
+ | free [options] | ||
+ | |||
+ | Options: | ||
+ | -b, --bytes | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -k, --kibi | ||
+ | -m, --mebi | ||
+ | -g, --gibi | ||
+ | | ||
+ | | ||
+ | -h, --human | ||
+ | | ||
+ | -l, --lohi | ||
+ | -t, --total | ||
+ | -s N, --seconds N | ||
+ | -c N, --count N | ||
+ | -w, --wide | ||
+ | |||
+ | | ||
+ | -V, --version | ||
+ | |||
+ | For more details see free(1). | ||
+ | </ | ||
+ | |||
+ | ====4.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@redhat9 ~]# uptime | ||
+ | 12:56:03 up 21: | ||
+ | |||
+ | [root@redhat9 ~]# 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@redhat9 ~]# uptime --help | ||
+ | |||
+ | Usage: | ||
+ | | ||
+ | |||
+ | Options: | ||
+ | -p, --pretty | ||
+ | -h, --help | ||
+ | -s, --since | ||
+ | -V, --version | ||
+ | |||
+ | For more details see uptime(1). | ||
+ | |||
+ | [root@redhat9 ~]# 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). | ||
+ | </ | ||
+ | |||
+ | ====4.3 - La Commande iostat==== | ||
+ | |||
+ | La commande **iostat** affiche des statistiques sur l' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# dnf install sysstat -y | ||
+ | </ | ||
+ | |||
+ | Exécutez ensuite la commande **iostat** : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# iostat | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
+ | |||
+ | avg-cpu: | ||
+ | | ||
+ | |||
+ | Device | ||
+ | dm-0 0.75 | ||
+ | dm-1 0.00 | ||
+ | sda | ||
+ | sdb | ||
+ | </ | ||
+ | |||
+ | Au-dessous de la première ligne indiquant la version du noyau du système et son nom d' | ||
+ | |||
+ | * **%user** - Pourcentage de temps passé en mode utilisateur | ||
+ | * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) | ||
+ | * **%system** - Pourcentage de temps passé en mode noyau | ||
+ | * **%steal** - Pourcentage du temps passé par des CPU virtuels en attendant que l' | ||
+ | * **%iowait** - Pourcentage du temps passé à attendre les entrées et les sorties des disques. | ||
+ | * **%idle** - Pourcentage de temps passé en inactivité | ||
+ | |||
+ | Notez la valeur de **%iowait**. Dans le cas où ce pourcentage est trop élévé, ceci indique que le processeur passe son temps à attendre les entrées et les sorties de disque. | ||
+ | |||
+ | Au-dessous du rapport d' | ||
+ | |||
+ | * La spécification du périphérique. | ||
+ | * Le nombre de transferts (ou opérations d'E/S) par seconde. | ||
+ | * Le nombre de blocs de KB lus par seconde. | ||
+ | * Le nombre de blocs de KB écrits par seconde. | ||
+ | * Le nombre total de KB lus. | ||
+ | * Le nombre total de KB écrits. | ||
+ | |||
+ | Dernièrement, pour voir les statistiques étendues des disques, utilisez la commande suivante : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# iostat -d -x | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
+ | |||
+ | Device | ||
+ | dm-0 0.19 9.72 | ||
+ | dm-1 | ||
+ | sda 0.20 | ||
+ | sdb 0.00 0.03 | ||
+ | </ | ||
+ | |||
+ | ====4.4 - La Commande hdparm==== | ||
+ | |||
+ | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# hdparm -t /dev/sda | ||
+ | |||
+ | /dev/sda: | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ====4.5 - La Commande vmstat==== | ||
+ | |||
+ | La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# vmstat 1 10 | ||
+ | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | La première ligne subdivise le champ en six catégories à savoir : processus, mémoire, swap, E/S, système et CPU sur lesquelles elle donne des statistiques. La seconde ligne identifie de manière encore plus détaillée chacun des champs, permettant ainsi de parcourir simplement et rapidement l' | ||
+ | |||
+ | Les champs relatifs aux processus sont les suivants : | ||
+ | |||
+ | * r — Le nombre de processus exécutables attendant d' | ||
+ | * b — Le nombre de processus exécutables dans un état de veille qui ne peut être interrompu | ||
+ | |||
+ | Les champs relatifs à la mémoire sont les suivants : | ||
+ | |||
+ | * swpd — La quantité de mémoire virtuelle utilisée | ||
+ | * free — La quantité de mémoire libre | ||
+ | * buff — La quantité de mémoire utilisée par les tampons (ou buffers) | ||
+ | * cache — La quantité de mémoire utilisée comme cache de pages | ||
+ | |||
+ | Les champs relatifs au swap sont les suivants : | ||
+ | |||
+ | * si — La quantité de mémoire chargée depuis le disque | ||
+ | * so — La quantité de mémoire déchargée sur le disque | ||
+ | |||
+ | Les champs relatifs aux Entrées/ | ||
+ | |||
+ | * bi — Blocs envoyés vers un périphérique blocs | ||
+ | * bo— Blocs reçus d'un périphérique blocs | ||
+ | |||
+ | Les champs relatifs au système sont les suivants : | ||
+ | |||
+ | * in — Nombre d' | ||
+ | * cs — Nombre de changements de contexte par seconde | ||
+ | |||
+ | Les champs relatifs au CPU sont les suivants : | ||
+ | |||
+ | * us — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau utilisateur | ||
+ | * sy — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau système | ||
+ | * id — Le pourcentage de temps pendant lequel le CPU était inoccupé | ||
+ | * wa — Attente d' | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# vmstat --help | ||
+ | |||
+ | Usage: | ||
+ | | ||
+ | |||
+ | Options: | ||
+ | -a, --active | ||
+ | -f, --forks | ||
+ | -m, --slabs | ||
+ | -n, --one-header | ||
+ | -s, --stats | ||
+ | -d, --disk | ||
+ | -D, --disk-sum | ||
+ | -p, --partition < | ||
+ | -S, --unit < | ||
+ | -w, --wide | ||
+ | -t, --timestamp | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | For more details see vmstat(8). | ||
+ | </code> | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Ces directives utilisent | + | **Important** : Par défaut la commande vmstat affiche des informations depuis |
</ | </ | ||
- | ===Directives Globales=== | + | ====4.6 - La Commande mpstat==== |
- | Les directives dans cette section servent à configurer | + | La commande **mpstat** affiche des statistiques détaillées sur le CPU : |
- | <file> | + | <code> |
- | module(load=" | + | [root@redhat9 ~]# mpstat |
- | </file> | + | Linux 5.14.0-427.37.1.el9_4.x86_64 |
- | Cette directive stipule que le format des entrées dans les fichiers de journalisation **ne doit pas** être au format d' | + | 01:03:16 PM CPU %usr |
+ | 01:03:16 PM all 0.14 0.01 0.12 0.05 0.04 0.02 0.00 0.00 0.00 | ||
+ | </ | ||
- | ===Règles=== | + | Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement : |
- | Chaque règle prend la forme suivante : | + | < |
+ | [root@redhat9 ~]# mpstat -P ALL | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
- | < | + | 01:03:38 PM CPU %usr |
- | Sélecteur[; | + | 01:03:38 PM all 0.14 0.01 0.12 0.05 0.04 0.02 0.00 0.00 0.00 |
- | </file> | + | 01:03:38 PM 0 0.13 0.00 0.12 0.05 0.04 0.02 0.00 0.00 0.00 |
+ | 01:03:38 PM 1 0.14 0.01 0.12 0.04 0.03 0.01 0.00 0.00 0.00 | ||
+ | 01:03:38 PM 2 0.14 0.01 0.12 0.05 0.04 0.02 0.00 0.00 0.00 | ||
+ | 01:03:38 PM 3 0.14 0.01 0.12 0.06 0.04 0.02 0.00 0.00 0.00 99.62 | ||
+ | </code> | ||
- | Un Sélecteur est défini | + | Pour afficher 5 jeux de statistiques à des intervales de 2 secondes pour tous les unités de traitement, il convient |
- | ==Sous-système applicatif.Priorité== | + | < |
+ | [root@redhat9 ~]# mpstat | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
- | Dans ce cas on ne tient compte que des messages de priorité égale ou supérieure à la Priorité indiquée. | + | 01:04:15 PM CPU %usr |
+ | 01:04:17 PM all 0.00 0.00 0.00 0.00 0.00 0.12 0.00 0.00 0.00 | ||
+ | 01:04:17 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:17 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:17 PM 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:17 PM 3 0.00 0.00 0.00 0.00 0.00 0.50 0.00 0.00 0.00 99.50 | ||
- | ==Sous-système applicatif!Priorité== | + | 01:04:17 PM CPU %usr |
+ | 01:04:19 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:19 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:19 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:19 PM 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:19 PM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
- | Dans ce cas on ne tient compte que des messages de priorité inférieure à la Priorité indiquée. | + | 01:04:19 PM CPU %usr |
+ | 01:04:21 PM all 0.00 0.00 0.12 0.00 0.25 0.00 0.00 0.00 0.00 | ||
+ | 01:04:21 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:21 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:21 PM 2 0.00 0.00 0.50 0.00 0.50 0.00 0.00 0.00 0.00 | ||
+ | 01:04:21 PM 3 0.00 0.00 0.00 0.00 0.50 0.00 0.00 0.00 0.00 99.50 | ||
- | ==Sous-système applicatif=Priorité== | + | 01:04:21 PM CPU %usr |
+ | 01:04:23 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:23 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:23 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:23 PM 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:23 PM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
- | Dans ce cas on ne tient compte que des messages de priorité égale à la Priorité indiquée. | + | 01:04:23 PM CPU %usr |
+ | 01:04:25 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:25 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:25 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:25 PM 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
+ | 01:04:25 PM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | ||
- | ==L' | + | Average: |
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | </ | ||
- | La valeur du Sous-système applicatif et/ou de la Priorité peut également être *****. Dans ce cas, toutes les valeurs possibles du **Sous-système applicatif** et/ou de la **Priorité** sont concernées, | + | ====4.7 - La Commande sar==== |
- | ==n Sous-systèmes avec la même priorité== | + | La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l' |
- | Plusieurs | + | Sous RedHat 9 la commande |
- | ==n Sélecteurs avec la même Action== | + | < |
+ | [root@redhat9 ~]# ls / | ||
+ | sa1 sa2 sadc | ||
+ | </ | ||
- | Une Action peut s' | + | Le script |
+ | ^ Option ^ Description ^ | ||
+ | | -t | L' | ||
+ | | -n | Nombre de collectes | | ||
+ | |||
+ | Le script **/ | ||
+ | |||
+ | Sous RedHat 9, l' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | # / | ||
+ | # (C) 2014 Tomasz Torcz < | ||
+ | # | ||
+ | # sysstat-12.5.4 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 | ||
+ | </ | ||
+ | |||
+ | La valeur de **OnCalendar** indique un collecte toutes les dix minutes. | ||
+ | |||
+ | Pour modifier l' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# systemctl edit sysstat-collect.timer | ||
+ | |||
+ | [root@redhat9 ~]# cat / | ||
+ | [Unit] | ||
+ | Description=Run system activity accounting tool every 2 minutes | ||
+ | |||
+ | [Timer] | ||
+ | OnCalendar= | ||
+ | OnCalendar=*: | ||
+ | AccuracySec=0 | ||
+ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Une Action précédée par le signe **-** est entreprise d'une manière **asynchrone**. Dans le cas ou l' | + | **Important** : Notez la ligne **OnCalendar=** qui est necessaire afin de surcharger |
</ | </ | ||
- | =====LAB #3 - La Commande logger===== | + | Vérifiez ensuite la prise en compte de la configuration : |
- | La commande **/usr/bin/logger** permet | + | < |
+ | [root@redhat9 ~]# systemctl status sysstat-collect.timer | ||
+ | ○ sysstat-collect.timer - Run system activity accounting tool every 2 minutes | ||
+ | | ||
+ | Drop-In: / | ||
+ | | ||
+ | | ||
+ | Trigger: n/a | ||
+ | | ||
+ | </ | ||
- | La syntaxe de la commande est : | + | Démarrez le timer : |
- | <file> | + | <code> |
- | logger | + | [root@redhat9 ~]# systemctl start sysstat-collect.timer |
- | </ | + | |
- | Par exemple saisissez | + | [root@redhat9 ~]# systemctl status sysstat-collect.timer |
+ | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | ||
+ | | ||
+ | Drop-In: / | ||
+ | | ||
+ | | ||
+ | Until: Wed 2024-10-23 13:12:22 CEST; 4s ago | ||
+ | Trigger: Wed 2024-10-23 13:14:00 CEST; 1min 32s left | ||
+ | | ||
+ | |||
+ | Oct 23 13:12:22 redhat9.ittraining.loc systemd[1]: Started Run system activity accounting tool every 2 minutes. | ||
+ | </ | ||
+ | |||
+ | Attendez 4 minutes, puis lancez | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | Oct 23 13:14:00 redhat9.ittraining.loc systemd[1]: sysstat-collect.service: | ||
+ | Oct 23 13:16:00 redhat9.ittraining.loc systemd[1]: sysstat-collect.service: | ||
</ | </ | ||
- | Consultez | + | Saisissez |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Jun 3 12:55:01 centos8 systemd[1]: session-237.scope: Succeeded. | + | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) |
- | Jun 3 12:56:01 centos8 systemd[1]: Started Session 238 of user trainee. | + | |
- | Jun 3 12:56:01 centos8 systemd[1]: session-238.scope: Succeeded. | + | 01:14:00 PM |
- | Jun 3 12:57:01 centos8 systemd[1]: Started Session 239 of user trainee. | + | 01:16:00 PM |
- | Jun 3 12:57:01 centos8 systemd[1]: session-239.scope: Succeeded. | + | Average: |
- | Jun 3 12:58:01 centos8 systemd[1]: Started Session 240 of user trainee. | + | |
- | Jun 3 12:58:01 centos8 systemd[1]: session-240.scope: Succeeded. | + | |
- | Jun 3 12:58:55 centos8 trainee[5139]: | + | |
- | Jun 3 12:59:01 centos8 systemd[1]: Started Session 241 of user trainee. | + | |
- | Jun 3 12:59:01 centos8 systemd[1]: session-241.scope: Succeeded. | + | |
</ | </ | ||
- | Les options de la commande logger sont : | + | ===Statistiques d' |
+ | |||
+ | Visualisez maintenant les statistiques d' | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
- | Usage: | + | 01:17:30 PM |
- | logger [options] [<message>] | + | 01:17:35 PM |
+ | 01:17:40 PM | ||
+ | 01:17:45 PM | ||
+ | Average: | ||
+ | </code> | ||
- | Enter messages into the system log. | + | D' |
- | Options: | + | < |
- | -i log the logger command' | + | [root@redhat9 ~]# sar -u ALL 5 3 |
- | --id[=<id>] log the given <id>, or otherwise the PID | + | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) |
- | -f, --file < | + | |
- | -e, --skip-empty | + | |
- | | + | |
- | -p, --priority < | + | |
- | | + | |
- | | + | |
- | -s, --stderr | + | |
- | -S, --size < | + | |
- | -t, --tag < | + | |
- | -n, --server < | + | |
- | -P, --port < | + | |
- | -T, --tcp use TCP only | + | |
- | -d, --udp use UDP only | + | |
- | | + | |
- | | + | |
- | < | + | |
- | | + | |
- | | + | |
- | | + | |
- | -u, --socket < | + | |
- | | + | |
- | print connection errors when using Unix sockets | + | |
- | | + | |
- | -h, --help | + | 01:18:19 PM |
- | -V, --version | + | 01:18:24 PM |
+ | 01:18:29 PM | ||
+ | 01:18:34 PM | ||
+ | Average: | ||
+ | </ | ||
- | For more details see logger(1). | + | Pour consulter les statistiques d'un coeur spécifique, |
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# sar -u -P 1 5 3 | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 | ||
+ | |||
+ | 01:19:18 PM | ||
+ | 01:19:23 PM 1 | ||
+ | 01:19:28 PM | ||
+ | 01:19:33 PM | ||
+ | Average: | ||
+ | |||
+ | [root@redhat9 ~]# sar -u -P 3 5 3 | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) 10/ | ||
+ | |||
+ | 01:19:57 PM | ||
+ | 01:20:02 PM | ||
+ | 01:20:07 PM | ||
+ | 01:20:12 PM | ||
+ | Average: | ||
</ | </ | ||
- | =====LAB #4 - La Commande logrotate===== | + | ===Statistiques d' |
- | Les fichiers journaux grossissent régulièrement. Le programme | + | Utilisez l' |
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# sar -r 5 3 | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
+ | |||
+ | 01:21:09 PM kbmemfree | ||
+ | 01:21:14 PM | ||
+ | 01:21:19 PM | ||
+ | 01:21:24 PM | ||
+ | Average: | ||
+ | </ | ||
- | Visualisez le fichier | + | Utilisez l' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # see "man logrotate" | + | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) |
- | # rotate log files weekly | + | |
- | weekly | + | |
- | # keep 4 weeks worth of backlogs | + | 01:21:48 PM kbswpfree kbswpused |
- | rotate 4 | + | 01:21:53 PM |
+ | 01:21:58 PM | ||
+ | 01:22:03 PM | ||
+ | Average: | ||
+ | </ | ||
- | # create new (empty) log files after rotating old ones | + | ===Statistiques des E/S=== |
- | create | + | |
- | # use date as a suffix of the rotated file | + | Utilisez l' |
- | dateext | + | |
- | # uncomment this if you want your log files compressed | + | < |
- | #compress | + | [root@redhat9 ~]# sar -b 5 3 |
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
- | # RPM packages drop log rotation information into this directory | + | 01:22:37 PM |
- | include | + | 01:22:42 PM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
+ | 01:22:47 PM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
+ | 01:22:52 PM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
+ | Average: | ||
+ | </ | ||
- | # system-specific logs may be also be configured here. | + | ===Statistiques des E/S par Disque=== |
+ | |||
+ | Utilisez l' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# sar -d 5 3 | ||
+ | Linux 5.14.0-427.37.1.el9_4.x86_64 (redhat9.ittraining.loc) | ||
+ | |||
+ | 01:23:14 PM | ||
+ | 01:23:19 PM | ||
+ | 01:23:19 PM | ||
+ | 01:23:19 PM dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
+ | 01:23:19 PM dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
+ | |||
+ | 01:23:19 PM | ||
+ | 01:23:24 PM | ||
+ | 01:23:24 PM | ||
+ | 01:23:24 PM dm-0 0.20 0.00 0.80 0.00 4.00 0.02 | ||
+ | 01:23:24 PM dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
+ | |||
+ | 01:23:24 PM | ||
+ | 01:23:29 PM | ||
+ | 01:23:29 PM | ||
+ | 01:23:29 PM dm-0 1.00 0.00 5.00 0.00 5.00 0.03 | ||
+ | 01:23:29 PM dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
+ | |||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
</ | </ | ||
- | Dans la première partie | + | Les options |
- | | + | < |
- | * garder 4 archives des fichiers journaux | + | [root@redhat9 ~]# sar --help |
- | * créer un nouveau fichier log une fois le précédent archivé | + | Usage: sar [ options ] [ < |
- | | + | Main options and reports (report name between square brackets): |
+ | -B Paging statistics [A_PAGE] | ||
+ | -b I/O and transfer rate statistics [A_IO] | ||
+ | -d Block devices statistics [A_DISK] | ||
+ | -F [ MOUNT ] | ||
+ | Filesystems statistics [A_FS] | ||
+ | -H Hugepages utilization statistics [A_HUGE] | ||
+ | -I { < | ||
+ | Interrupts statistics [A_IRQ] | ||
+ | -m { < | ||
+ | Power management statistics [A_PWR_...] | ||
+ | Keywords are: | ||
+ | CPU CPU instantaneous clock frequency | ||
+ | FAN Fans speed | ||
+ | FREQ CPU average clock frequency | ||
+ | IN Voltage inputs | ||
+ | TEMP Devices temperature | ||
+ | USB USB devices plugged into the system | ||
+ | -n { < | ||
+ | Network statistics [A_NET_...] | ||
+ | Keywords are: | ||
+ | DEV | ||
+ | EDEV Network interfaces (errors) | ||
+ | NFS NFS client | ||
+ | NFSD NFS server | ||
+ | SOCK Sockets (v4) | ||
+ | IP IP traffic | ||
+ | EIP IP traffic | ||
+ | ICMP ICMP traffic | ||
+ | EICMP | ||
+ | | ||
+ | | ||
+ | | ||
+ | SOCK6 | ||
+ | IP6 IP traffic | ||
+ | EIP6 IP traffic | ||
+ | ICMP6 ICMP traffic | ||
+ | EICMP6 | ||
+ | UDP6 UDP traffic | ||
+ | FC Fibre channel HBAs | ||
+ | SOFT Software-based network processing | ||
+ | -q [ < | ||
+ | System load and pressure-stall statistics | ||
+ | Keywords are: | ||
+ | LOAD Queue length and load average statistics [A_QUEUE] | ||
+ | CPU | ||
+ | IO Pressure-stall I/O statistics [A_PSI_IO] | ||
+ | MEM | ||
+ | -r [ ALL ] | ||
+ | Memory utilization statistics [A_MEMORY] | ||
+ | -S Swap space utilization statistics [A_MEMORY] | ||
+ | -u [ ALL ] | ||
+ | CPU utilization statistics [A_CPU] | ||
+ | -v Kernel tables statistics [A_KTABLES] | ||
+ | -W Swapping statistics [A_SWAP] | ||
+ | -w Task creation and system switching statistics [A_PCSW] | ||
+ | -y TTY devices statistics [A_SERIAL] | ||
+ | </ | ||
- | La directive **include / | + | =====Modules usb===== |
- | La deuxième partie | + | 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 | ||
+ | |||
+ | ^ 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 | ||
+ | * 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 | ||
+ | * 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@redhat9 ~]# cat / | ||
+ | # 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 | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# ls / | ||
+ | 01-md-raid-creating.rules | ||
+ | 10-dm.rules | ||
+ | 11-dm-lvm.rules | ||
+ | 11-dm-mpath.rules | ||
+ | 11-dm-parts.rules | ||
+ | 13-dm-disk.rules | ||
+ | 40-elevator.rules | ||
+ | 40-libgphoto2.rules | ||
+ | 40-redhat.rules | ||
+ | 40-usb-blacklist.rules | ||
+ | 40-usb_modeswitch.rules | ||
+ | 50-udev-default.rules | ||
+ | 60-autosuspend.rules | ||
+ | 60-block.rules | ||
+ | 60-cdrom_id.rules | ||
+ | 60-drm.rules | ||
+ | 60-evdev.rules | ||
+ | 60-fido-id.rules | ||
+ | 60_flashrom.rules | ||
+ | 60-input-id.rules | ||
+ | 60-net.rules | ||
+ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Notez que la compression des fichiers de journalisation n' | + | **Important** : Il vous est possible d'ajouter des règles si besoin |
</ | </ | ||
- | Les options | + | Comme indique le nom de chaque fichier, le contenu est composé de règles à l' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Usage: logrotate [OPTION...] < | + | # do not edit this file, it will be overwritten on update |
- | -d, --debug | + | |
- | messages | + | |
- | -f, --force | + | |
- | -m, --mail=command | + | |
- | -s, --state=statefile | + | |
- | -v, --verbose | + | |
- | -l, --log=logfile | + | |
- | --version | + | |
- | Help options: | + | # run a command on remove events |
- | -?, --help Show this help message | + | ACTION==" |
- | --usage | + | ACTION==" |
+ | |||
+ | # The md driver increments diskseq *after* emitting ' | ||
+ | # Drop the line below if it is fixed on the kernel side. | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | |||
+ | # select " | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | ENV{MODALIAS}!="", | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | |||
+ | ACTION!=" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | KERNEL==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | # When using static_node= with non-default permissions, | ||
+ | # tmpfiles.d/ | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | OPTIONS+=" | ||
+ | --More-- | ||
</ | </ | ||
- | =====LAB #5 - La Journalisation avec journald===== | + | Chaque règle prend la forme suivante : |
- | Sous RHEL/CentOS 8, les fichiers de Syslog sont gardés pour une question de compatibilité. Cependant, tous les journaux sont d' | + | KEY, [KEY, ...] NAME [, SYMLINK] |
+ | |||
+ | Chaque KEY est un champ au format | ||
+ | |||
+ | ^ 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 | ||
+ | | PROGRAM | Ceci permet à Udev d' | ||
+ | | RESULT | Valeur à comparer au résultat de PROGRAM | S/O | | ||
+ | |||
+ | NAME et SYMLINK sont utilisées pour stipuler ce que Udev doit faire avec le périphérique : | ||
+ | |||
+ | ^ Type ^ Description ^ Exemples ^ | ||
+ | | NAME | Le nome du nœud dans /dev | S/O | | ||
+ | | SYMLINK | Le ou les lien(s) symbolique(s) qui pointe(nt) vers le NAME | S/O | | ||
+ | |||
+ | ====La commande udevadm==== | ||
+ | |||
+ | Pour obtenir de l' | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | total 0 | + | P: /devices/pci0000: |
- | drwxr-s---+ 2 root systemd-journal 60 Jun 3 09:01 de79af4f226d480fa7d3fec4cabbf97a | + | M: sda |
+ | U: block | ||
+ | T: disk | ||
+ | D: b 8:0 | ||
+ | N: sda | ||
+ | L: 0 | ||
+ | S: disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 | ||
+ | S: disk/by-path/ | ||
+ | S: disk/ | ||
+ | Q: 1 | ||
+ | E: DEVPATH=/ | ||
+ | E: DEVNAME=/ | ||
+ | E: DEVTYPE=disk | ||
+ | E: DISKSEQ=1 | ||
+ | E: MAJOR=8 | ||
+ | E: MINOR=0 | ||
+ | E: SUBSYSTEM=block | ||
+ | E: USEC_INITIALIZED=11296575 | ||
+ | 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-scsi0 | ||
+ | E: ID_SERIAL_SHORT=drive-scsi0 | ||
+ | E: ID_BUS=scsi | ||
+ | E: ID_PATH=pci-0000: | ||
+ | E: ID_PATH_TAG=pci-0000_01_01_0-scsi-0_0_0_0 | ||
+ | E: ID_PART_TABLE_UUID=d00dfc8a | ||
+ | E: ID_PART_TABLE_TYPE=dos | ||
+ | E: SCSI_TPGS=0 | ||
+ | E: SCSI_TYPE=disk | ||
+ | E: SCSI_VENDOR=QEMU | ||
+ | E: SCSI_VENDOR_ENC=QEMU\x20\x20\x20\x20 | ||
+ | E: SCSI_MODEL=QEMU_HARDDISK | ||
+ | E: SCSI_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | ||
+ | E: SCSI_REVISION=2.5+ | ||
+ | E: ID_SCSI_INQUIRY=1 | ||
+ | E: SCSI_IDENT_LUN_VENDOR=drive-scsi0 | ||
+ | E: DEVLINKS=/ | ||
+ | E: TAGS=: | ||
+ | E: CURRENT_TAGS=: | ||
</ | </ | ||
- | A l' | + | ===Les options |
- | Pour rendre les journaux permenants, il faut créer le répertoire **/ | + | Les options de la commande udevadm sont : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 | + | 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 | ||
+ | wait Wait for device or device symlink | ||
+ | lock Lock a block device | ||
+ | |||
+ | See the udevadm(8) man page for details. | ||
+ | |||
+ | [root@redhat9 ~]# udevadm info --help | ||
+ | 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 | ||
+ | -t --tree | ||
+ | -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 | ||
+ | | ||
+ | </code> | ||
+ | |||
+ | =====Système de fichiers | ||
+ | |||
+ | 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@redhat9 | ||
total 0 | total 0 | ||
- | [root@centos8 ~]# systemctl restart systemd-journald | + | drwxr-xr-x. 2 root root 0 Oct 22 15:36 block |
- | [root@centos8 ~]# ls -l / | + | drwxr-xr-x. |
- | ls: cannot access '/ | + | drwxr-xr-x. 60 root root 0 Oct 22 15:36 class |
- | [root@centos8 ~]# ls -l / | + | drwxr-xr-x. |
- | total 0 | + | drwxr-xr-x. |
- | drwxr-xr-x. 2 root root 28 Jun | + | drwxr-xr-x. 6 root root 0 Oct 22 15:36 firmware |
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. 170 root root 0 Oct 22 15:36 module | ||
+ | drwxr-xr-x. | ||
</ | </ | ||
- | Journald ne peut pas envoyer | + | 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 | ||
+ | | ||
+ | * contient des informations sur des classes | ||
+ | | ||
+ | * 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@centos8 | + | [root@redhat9 |
- | # This file is part of systemd. | + | 2097152 |
+ | </ | ||
+ | |||
+ | Ce chiffre correspond aux nombre de secteurs. | ||
+ | |||
+ | =====LAB #5 - Limitation des ressources===== | ||
+ | |||
+ | ====5.1 - ulimit==== | ||
+ | |||
+ | Les ressources disponibles aux utilisateurs peuvent être limitées par l' | ||
+ | |||
+ | La commande **ulimit** gère deux types de limite, la limite //hard// en utilisant l' | ||
+ | |||
+ | La limite //soft// est la limite imposée à l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | # / | ||
# | # | ||
- | # | + | #This file sets the resource limits for the users logged in via PAM. |
- | # under the terms of the GNU Lesser General Public License as published by | + | #It does not affect resource limits |
- | # the Free Software Foundation; either version 2.1 of the License, or | + | |
- | # (at your option) any later version. | + | |
# | # | ||
- | # Entries | + | #Also note that configuration files in / |
- | # You can change settings by editing this file. | + | #which are read in alphabetical order, override the settings |
- | # Defaults | + | #file in case the domain is the same or more specific. |
+ | #That means, for example, that setting a limit for wildcard domain here | ||
+ | #can be overridden with a wildcard setting in a config | ||
+ | # | ||
+ | #with a user specific setting in the subdirectory. | ||
+ | # | ||
+ | #Each line describes a limit for a user in the form: | ||
+ | # | ||
+ | #< | ||
+ | # | ||
+ | #Where: | ||
+ | #< | ||
+ | # - a user name | ||
+ | # - a group name, with @group syntax | ||
+ | # - the wildcard *, for default entry | ||
+ | # - the wildcard %, can be also used with %group syntax, | ||
+ | # for maxlogin limit | ||
+ | # | ||
+ | #< | ||
+ | # - " | ||
+ | # - " | ||
+ | # | ||
+ | #< | ||
+ | # - core - limits the core file size (KB) | ||
+ | # - data - max data size (KB) | ||
+ | # - fsize - maximum filesize (KB) | ||
+ | # - memlock - max locked-in-memory address space (KB) | ||
+ | # - nofile - max number of open file descriptors | ||
+ | # - rss - max resident set size (KB) | ||
+ | # - stack - max stack size (KB) | ||
+ | # - cpu - max CPU time (MIN) | ||
+ | # - nproc - max number of processes | ||
+ | # - as - address space limit (KB) | ||
+ | # - maxlogins - max number of logins for this user | ||
+ | # - maxsyslogins - max number of logins on the system | ||
+ | # - priority - the priority to run user process with | ||
+ | # - locks - max number of file locks the user can hold | ||
+ | # - sigpending - max number of pending signals | ||
+ | # - msgqueue - max memory used by POSIX message queues (bytes) | ||
+ | # - nice - max nice priority allowed to raise to values: [-20, 19] | ||
+ | # - rtprio - max realtime priority | ||
+ | # | ||
+ | #< | ||
# | # | ||
- | # See journald.conf(5) for details. | ||
- | [Journal] | + | #* |
- | #Storage=auto | + | #* |
- | #Compress=yes | + | #@student |
- | #Seal=yes | + | #@faculty |
- | #SplitMode=uid | + | #@faculty |
- | #SyncIntervalSec=5m | + | #ftp |
- | #RateLimitIntervalSec=30s | + | #@student |
- | #RateLimitBurst=10000 | + | |
- | # | + | # End of file |
- | #SystemKeepFree= | + | </ |
- | # | + | |
- | # | + | <WRAP center round important 60%> |
- | # | + | **Important** : La valeur de la limite peut être un **nombre** ou le mot **unlimited**. |
- | # | + | </ |
- | # | + | |
- | # | + | Par exemple, si root inscrit les deux ligne suivantes dans le fichier / |
- | # | + | |
- | # | + | < |
- | # | + | ... |
- | ForwardToSyslog=yes | + | trainee |
- | # | + | trainee |
- | # | + | ... |
- | # | + | </file> |
- | #TTYPath=/dev/console | + | |
- | # | + | la limite du nombre de fichiers ouverts simultanément par trainee est de 1 024. Par contre, trainee a la possibilité d' |
- | # | + | |
- | # | + | < |
- | # | + | $ ulimit -n 4096 |
- | # | + | |
- | # | + | |
</ | </ | ||
- | ====5.1 - Consultation | + | Pour consulter la liste des limites actuelles, il convient d' |
- | L' | + | < |
+ | [root@redhat9 ~]# ulimit -a | ||
+ | real-time non-blocking time (microseconds, | ||
+ | core file size (blocks, -c) 0 | ||
+ | data seg size | ||
+ | scheduling priority | ||
+ | file size | ||
+ | pending signals | ||
+ | max locked memory | ||
+ | max memory size | ||
+ | open files (-n) 1024 | ||
+ | pipe size (512 bytes, -p) 8 | ||
+ | POSIX message queues | ||
+ | real-time priority | ||
+ | stack size (kbytes, -s) 8192 | ||
+ | cpu time | ||
+ | max user processes | ||
+ | virtual memory | ||
+ | file locks (-x) unlimited | ||
+ | </ | ||
+ | |||
+ | ====Options | ||
+ | |||
+ | Les options de **ulimit** sont : | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:08:01 EDT. -- | + | ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit] |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: Linux version 4.18.0-240.22.1.el8_3.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Thu Apr 8 19:01:30 UTC 2021 | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/ | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | + | Provides control over the resources available to the shell and processes |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | + | it creates, on systems that allow such control. |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: xstate_offset[2]: | + | Options: |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Enabled xstate features 0x7, context | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-provided physical RAM map: | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved | + | -c the maximum size of core files created |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable | + | -d the maximum size of a process' |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved | + | -f the maximum size of files written by the shell and its children |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved | + | -k the maximum number of kqueues allocated for this process |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable | + | -l the maximum size a process may lock into memory |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: NX (Execute Disable) protection: active | + | -m the maximum resident set size |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: SMBIOS 2.5 present. | + | -n the maximum number of open file descriptors |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: DMI: innotek GmbH VirtualBox/ | + | -p the pipe buffer size |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: Hypervisor detected: KVM | + | -q the maximum number of bytes in POSIX message queues |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 | + | -r the maximum real-time scheduling priority |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: | + | -s the maximum stack size |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: using sched offset | + | -t the maximum amount of cpu time in seconds |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: clocksource: | + | -u the maximum number |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: tsc: Detected 1190.400 MHz processor | + | -v the size of virtual memory |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: e820: remove [mem 0x000a0000-0x000fffff] usable | + | -P the maximum number of pseudoterminals |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: last_pfn = 0x120000 max_arch_pfn = 0x400000000 | + | -R the maximum time a real-time process can run before blocking |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: MTRR default type: uncachable | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: MTRR variable ranges disabled: | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: Disabled | + | Not all options are available on all platforms. |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/PAT: MTRRs disabled, skipping PAT initialization too. | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: CPU MTRRs all blank - virtualized system. | + | If LIMIT is given, it is the new value of the specified resource; the |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/PAT: Configuration [0-7]: WB WT UC- UC WB WT UC- UC | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: last_pfn = 0xdfff0 max_arch_pfn = 0x400000000 | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: found SMP MP-table at [mem 0x0009fff0-0x0009ffff] | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: kexec: Reserving | + | no option is given, then -f is assumed. |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a01000, 0x114a01fff] PGTABLE | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a02000, 0x114a02fff] PGTABLE | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a03000, 0x114a03fff] PGTABLE | + | -p, which is in increments of 512 bytes, and -u, which is an unscaled |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a04000, 0x114a04fff] PGTABLE | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a05000, 0x114a05fff] PGTABLE | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a06000, | + | Exit Status: |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a07000, 0x114a07fff] PGTABLE | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a08000, | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a09000, 0x114a09fff] PGTABLE | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: RAMDISK: [mem 0x34e00000-0x366f7fff] | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: Early table checksum verification disabled | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: RSDP 0x00000000000E0000 000024 (v02 VBOX ) | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: XSDT 0x00000000DFFF0030 00003C (v01 VBOX | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: FACP 0x00000000DFFF00F0 0000F4 (v04 VBOX | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: DSDT 0x00000000DFFF0480 002325 (v02 VBOX | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: FACS 0x00000000DFFF0200 000040 | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: FACS 0x00000000DFFF0200 000040 | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: APIC 0x00000000DFFF0240 00006C (v02 VBOX | + | |
- | lines 1-57 | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | ====5.2 - Groupes de Contrôle==== |
- | **Important** : Notez que les messages importants sont en gras, par exemple les messages de niveaux **notice** ou **warning** et que les messages graves sont en rouge. | + | |
- | </ | + | |
- | ====5.2 - Consultation | + | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, |
- | Pour consulter | + | Les groupes de contrôle v1 sont organisés de manière hiérarchique, |
+ | |||
+ | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sont : | ||
+ | |||
+ | * **blkio** - utilisé pour établir des limites sur l'accès des entrées/ | ||
+ | * **cpu** - utilisé pour fournir aux tâches des groupes de contrôle accès au CPU grâce au planificateur, | ||
+ | * **cpuacct** - utilisé pour produire des rapports automatiques sur les ressources CPU utilisées par les tâches dans un groupe de contrôle, | ||
+ | * **cpuset** - utilisé pour assigner des CPU individuels sur un système multicoeur et des noeuds de mémoire | ||
+ | * **devices** - utilisé pour autoriser ou pour refuser l' | ||
+ | * **freezer** - utilisé pour suspendre ou pour réactiver les tâches dans un groupe de contrôle, | ||
+ | * **memory** - utilisé pour établir les limites d' | ||
+ | * **net_cls** - utilisé pour repèrer les paquets réseau avec un identifiant de classe (// | ||
+ | * **perf_event** | ||
+ | * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | ||
+ | |||
+ | A l' | ||
+ | |||
+ | Pour vérifier l' | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:10:01 EDT. -- | + | cgroup2 |
- | Jun 03 10:01:01 centos8.ittraining.loc anacron[2575]: | + | |
- | Jun 03 10:01:01 centos8.ittraining.loc anacron[2575]: | + | |
- | Jun 03 10:01:01 centos8.ittraining.loc anacron[2575]: | + | |
- | Jun 03 10:16:01 centos8.ittraining.loc anacron[2575]: | + | |
- | Jun 03 10:16:01 centos8.ittraining.loc anacron[2575]: | + | |
- | Jun 03 10:16:01 centos8.ittraining.loc anacron[2575]: | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | et de consulter |
- | **Important** : Rappelez-vous que sous RHEL/CentOS 8 le répertoire **/sbin** est un lien symbolique vers **/ | + | |
- | </ | + | |
- | ====5.3 - Consultation | + | < |
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 0 | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 cgroup.controllers | ||
+ | -rw-r--r--. | ||
+ | -rw-r--r--. | ||
+ | -rw-r--r--. | ||
+ | -r--r--r--. | ||
+ | -rw-r--r--. | ||
+ | -rw-r--r--. | ||
+ | -r--r--r--. | ||
+ | -r--r--r--. | ||
+ | -r--r--r--. | ||
+ | -r--r--r--. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | -r--r--r--. | ||
+ | -r--r--r--. | ||
+ | --w-------. | ||
+ | -r--r--r--. | ||
+ | -r--r--r--. | ||
+ | -r--r--r--. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. 37 root root 0 Oct 23 13:46 system.slice | ||
+ | drwxr-xr-x. | ||
+ | </ | ||
+ | |||
+ | Sous RedHat 9, **Systemd** organise les processus dans chaque CGroup. Par exemple tous les processus démarrés par le serveur Apache se trouveront dans le même CGroup, y compris les scripts CGI. Ceci implique que la gestion | ||
+ | |||
+ | En haut de l' | ||
+ | |||
+ | * le **system.slice** - l' | ||
+ | * le **user.slice** - l' | ||
+ | * le **machine.slice** - l' | ||
+ | |||
+ | En dessous des tranches peuvent se trouver : | ||
+ | |||
+ | * des **scopes** - des processus crées par **fork**, | ||
+ | * des **services** - des processus créés par une **Unité**. | ||
+ | |||
+ | Les slices peuvent être visualisés avec la commande suivante : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# systemctl list-units --type=slice | ||
+ | UNIT LOAD | ||
+ | -.slice | ||
+ | system-getty.slice | ||
+ | system-modprobe.slice | ||
+ | system-sshd\x2dkeygen.slice | ||
+ | system-systemd\x2dhibernate\x2dresume.slice loaded active active Slice / | ||
+ | system.slice | ||
+ | user-1000.slice | ||
+ | user-42.slice | ||
+ | user.slice | ||
+ | |||
+ | LOAD = Reflects whether the unit definition was properly loaded. | ||
+ | ACTIVE | ||
+ | SUB | ||
+ | 9 loaded units listed. Pass --all to see loaded but inactive units, too. | ||
+ | To show all installed unit files use ' | ||
+ | </ | ||
- | Pour consulter les entrées depuis le dernier démarrage, il suffit d'utiliser l' | + | L'arborescence des unités |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:11:01 EDT. -- | + | Control group /: |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: Linux version 4.18.0-240.22.1.el8_3.x86_64 | + | -.slice |
- | 8.3.1 20191121 (Red Hat 8.3.1-5) | + | ├─user.slice (#1202) |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: Command line: BOOT_IMAGE=(hd0, | + | │ → user.invocation_id: f644c59b13764d598a66e47b9f64fdd8 |
- | c-0d59-45be-bd73-d292b80be33c ro crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet | + | │ → trusted.invocation_id: |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | + | │ ├─user-42.slice (#4140) |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | + | │ │ → user.invocation_id: |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | + | │ │ → trusted.invocation_id: |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: xstate_offset[2]: | + | │ │ ├─session-c1.scope (#4392) |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using ' | + | │ │ │ → user.invocation_id: a63e3d93bdf0417b9448307698944a77 |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-provided physical RAM map: | + | │ │ │ → trusted.invocation_id: a63e3d93bdf0417b9448307698944a77 |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable | + | │ │ │ ├─1036 gdm-session-worker [pam/gdm-launch-environment] |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved | + | │ │ │ ├─1626 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved | + | │ │ │ ├─1631 dbus-run-session -- gnome-session --autostart / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable | + | │ │ │ ├─1632 dbus-daemon --nofork --print-address |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data | + | │ │ │ ├─1633 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved | + | │ │ │ ├─1641 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved | + | │ │ │ ├─1660 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved | + | │ │ │ ├─1665 |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable | + | │ │ │ ├─1671 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: NX (Execute Disable) protection: active | + | │ │ │ ├─1678 |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: SMBIOS 2.5 present. | + | │ │ │ ├─1741 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: DMI: innotek GmbH VirtualBox/ | + | │ │ │ ├─1743 |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: Hypervisor detected: KVM | + | │ │ │ ├─1747 |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 | + | │ │ │ ├─1749 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: cpu 0, msr 114801001, primary cpu clock | + | │ │ │ ├─1752 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: using sched offset of 5675771878 cycles | + | │ │ │ ├─1753 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: clocksource: | + | │ │ │ ├─1754 / |
- | 590591483 ns | + | │ │ │ ├─1755 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: tsc: Detected 1190.400 MHz processor | + | │ │ │ ├─1756 / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved | + | │ │ │ ├─1757 / |
+ | │ │ │ ├─1758 / | ||
+ | │ │ │ ├─1759 / | ||
+ | │ │ │ ├─1764 / | ||
+ | │ │ │ ├─1765 / | ||
+ | │ │ │ ├─1766 / | ||
+ | │ │ │ ├─1767 / | ||
+ | │ │ │ ├─1887 / | ||
+ | │ │ │ ├─2038 / | ||
+ | │ │ │ ├─2042 ibus-daemon | ||
+ | │ │ │ ├─2053 / | ||
+ | │ │ │ ├─2055 / | ||
+ | │ │ │ ├─2060 / | ||
+ | │ │ │ └─2081 / | ||
+ | │ │ └─user@42.service … (#4212) | ||
+ | │ │ → user.delegate: 1 | ||
+ | │ │ → trusted.delegate: 1 | ||
+ | │ │ → user.invocation_id: fbec37f4c0ef4488990208d436f2aeb8 | ||
+ | │ │ → trusted.invocation_id: fbec37f4c0ef4488990208d436f2aeb8 | ||
+ | │ │ | ||
+ | │ │ │ ├─pipewire-pulse.service (#4617) | ||
+ | │ │ │ │ └─1696 / | ||
+ | │ │ │ ├─wireplumber.service (#4581) | ||
+ | │ │ │ │ └─1695 / | ||
+ | │ │ │ └─pipewire.service (#4545) | ||
--More-- | --More-- | ||
</ | </ | ||
+ | |||
+ | En utilisant Systemd, plusieurs ressources peuvent être limitées : | ||
+ | |||
+ | * **CPUWeight** - par défault 1024, | ||
+ | * **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut, | ||
+ | * **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut, | ||
+ | * **StartupCPUWeight** - comme CPUShares mais uniquement appliqué pendant le démarrage, | ||
+ | * **StartupBlockIOWeight** - comme BlockIOWeight mais uniquement appliqué pendant le démarrage, | ||
+ | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Notez que vous pouvez consulter | + | **Important** : Consultez le manuel systemd.resource-control(5) pour voir les paramètres CGroup qui peuvent être passés à systemctl. |
</ | </ | ||
- | ====5.4 - Consultation des Journaux d'une Priorité Spécifique==== | + | Commencez par créer le cgroup enfant **pids** dans le cgroup racine : |
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# mkdir / | ||
+ | </ | ||
- | Pour consulter les entrées à partir d'une priorité spécifique et supérieur, il suffit d' | + | Placez le PID du terminal courant dans le fichier |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:12:01 EDT. -- | + | 78735 |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: | + | [root@redhat9 ~]# echo $$ > / |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: | + | |
- | Jun 03 09:01:10 centos8.ittraining.loc kernel: acpi PNP0A03:00: fail to add MMCONFIG information, | + | |
- | Jun 03 09:01:12 centos8.ittraining.loc kernel: e1000: E1000 MODULE IS NOT SUPPORTED | + | |
- | Jun 03 09:01:12 centos8.ittraining.loc kernel: | + | |
- | Jun 03 09:01:12 centos8.ittraining.loc kernel: [drm: | + | |
- | Jun 03 09:01:18 centos8.ittraining.loc kernel: printk: systemd: 19 output lines suppressed due to ratelimiting | + | |
- | Jun 03 09:01:20 centos8.ittraining.loc firewalld[874]: | + | |
- | Jun 03 09:01:21 centos8.ittraining.loc systemd[1]: iscsi.service: | + | |
- | Jun 03 09:01:24 centos8.ittraining.loc systemd[1]: iscsi.service: | + | |
- | Jun 03 09:01:24 centos8.ittraining.loc systemd[1]: iscsi.service: | + | |
- | Jun 03 09:01:26 centos8.ittraining.loc chronyd[850]: | + | |
- | Jun 03 09:01:28 centos8.ittraining.loc chronyd[850]: | + | |
- | Jun 03 12:46:31 centos8.ittraining.loc chronyd[850]: | + | |
- | lines 1-15/15 (END) | + | |
</ | </ | ||
- | Les priorités reconnues par Journald sont : | + | Contrôlez maintenant le contenu du fichier cgroup.procs ainsi que le nombre de PIDs dans le cgroup **pids** |
- | ^ Niveau ^ Priorité ^ Description ^ | + | < |
- | | 0 | emerg | Système inutilisable | | + | [root@redhat9 ~]# cat / |
- | | 1 | alert | Action immédiate requise | | + | 78735 |
- | | 2 | crit | Condition critique atteinte | | + | 81077 |
- | | 3 | err | Erreurs rencontrées | | + | |
- | | 4 | warning | Avertissements présentés | | + | |
- | | 5 | notice | Condition normale - message important | | + | |
- | | 6 | info | Condition normale - message simple | | + | |
- | | 7 | debug | Condition normale - message de débogage | | + | |
- | ====5.5 - Consultation des Journaux d'une Plage de Dates ou d' | + | [root@redhat9 ~]# cat / |
+ | 2 | ||
+ | </ | ||
- | Pour consulter les entrées d'une plage de dates ou d' | + | <WRAP center round important > |
+ | **Important** - Notez que le fichier cgroup.procs contient **deux** PIDs. Le premier est celui du Shell tandis que le deuxième est celui de la commande | ||
+ | </ | ||
+ | |||
+ | Injectez maintenant la valeur de **5** dans le fichier **pids.max** du cgroup ** pids** | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:14:01 EDT. -- | + | |
- | Jun 03 12:00:01 centos8.ittraining.loc systemd[1]: Started Session 181 of user trainee. | + | |
- | Jun 03 12:00:01 centos8.ittraining.loc CROND[4238]: | + | |
- | Jun 03 12:00:01 centos8.ittraining.loc systemd[1]: session-181.scope: | + | |
- | Jun 03 12:01:01 centos8.ittraining.loc CROND[4251]: | + | |
- | Jun 03 12:01:01 centos8.ittraining.loc systemd[1]: Started Session 182 of user trainee. | + | |
- | Jun 03 12:01:01 centos8.ittraining.loc run-parts[4255]: | + | |
- | Jun 03 12:01:01 centos8.ittraining.loc CROND[4260]: | + | |
- | Jun 03 12:01:01 centos8.ittraining.loc run-parts[4262]: | + | |
- | Jun 03 12:01:01 centos8.ittraining.loc systemd[1]: session-182.scope: | + | |
- | Jun 03 12:02:01 centos8.ittraining.loc systemd[1]: Started Session 183 of user trainee. | + | |
- | Jun 03 12:02:01 centos8.ittraining.loc CROND[4275]: | + | |
- | Jun 03 12:02:01 centos8.ittraining.loc systemd[1]: session-183.scope: | + | |
- | Jun 03 12:03:01 centos8.ittraining.loc systemd[1]: Started Session 184 of user trainee. | + | |
- | Jun 03 12:03:01 centos8.ittraining.loc CROND[4289]: | + | |
- | Jun 03 12:03:01 centos8.ittraining.loc systemd[1]: session-184.scope: | + | |
- | Jun 03 12:04:01 centos8.ittraining.loc systemd[1]: Started Session 185 of user trainee. | + | |
- | Jun 03 12:04:01 centos8.ittraining.loc CROND[4303]: | + | |
- | Jun 03 12:04:01 centos8.ittraining.loc systemd[1]: session-185.scope: | + | |
- | Jun 03 12:05:01 centos8.ittraining.loc systemd[1]: Started Session 186 of user trainee. | + | |
- | Jun 03 12:05:01 centos8.ittraining.loc CROND[4319]: | + | |
- | Jun 03 12:05:01 centos8.ittraining.loc systemd[1]: session-186.scope: | + | |
- | Jun 03 12:06:02 centos8.ittraining.loc systemd[1]: Started Session 187 of user trainee. | + | |
- | Jun 03 12:06:02 centos8.ittraining.loc CROND[4332]: | + | |
- | Jun 03 12:06:02 centos8.ittraining.loc systemd[1]: session-187.scope: | + | |
- | Jun 03 12:07:01 centos8.ittraining.loc systemd[1]: Started Session 188 of user trainee. | + | |
- | Jun 03 12:07:01 centos8.ittraining.loc CROND[4346]: | + | |
- | Jun 03 12:07:01 centos8.ittraining.loc systemd[1]: session-188.scope: | + | |
- | Jun 03 12:08:01 centos8.ittraining.loc systemd[1]: Started Session 189 of user trainee. | + | |
- | Jun 03 12:08:01 centos8.ittraining.loc CROND[4360]: | + | |
- | Jun 03 12:08:01 centos8.ittraining.loc systemd[1]: session-189.scope: | + | |
- | lines 1-31 | + | |
</ | </ | ||
- | <WRAP center round important | + | Lancez la commande suivante pour créer 6 pids dans le cgroup : |
- | **Important** | + | |
+ | < | ||
+ | [root@redhat9 ~]# for a in $(seq 1 5); do sleep 60 & done | ||
+ | [1] 81126 | ||
+ | [2] 81127 | ||
+ | [3] 81128 | ||
+ | [4] 81129 | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: retry: Resource temporarily unavailable | ||
+ | -bash: fork: Resource temporarily unavailable | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** | ||
</ | </ | ||
- | ====5.6 - Consultation des Journaux en Live==== | + | Dernièrement, |
- | Pour consulter les journaux en live, il suffit d'utiliser l'option | + | < |
+ | [root@redhat9 ~]# rmdir / | ||
+ | rmdir: failed to remove | ||
+ | [1] | ||
+ | [2] | ||
+ | [3]- Done sleep 60 | ||
+ | [4]+ Done sleep 60 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Notez qu'il n'est pas possible | ||
+ | </ | ||
+ | |||
+ | Déplacez le processus du terminal courant dans le cgroup racine | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Thu 2021-06-03 09:01:10 EDT. -- | + | |
- | Jun 03 13:13:08 centos8.ittraining.loc systemd[1]: Started dnf makecache. | + | |
- | Jun 03 13:14:01 centos8.ittraining.loc systemd[1]: Started Session 256 of user trainee. | + | |
- | Jun 03 13:14:01 centos8.ittraining.loc CROND[5391]: | + | |
- | Jun 03 13:14:01 centos8.ittraining.loc systemd[1]: session-256.scope: | + | |
- | Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: Started Session 257 of user trainee. | + | |
- | Jun 03 13:15:01 centos8.ittraining.loc CROND[5407]: | + | |
- | Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: session-257.scope: | + | |
- | Jun 03 13:16:02 centos8.ittraining.loc systemd[1]: Started Session 258 of user trainee. | + | |
- | Jun 03 13:16:02 centos8.ittraining.loc CROND[5420]: | + | |
- | Jun 03 13:16:02 centos8.ittraining.loc systemd[1]: session-258.scope: | + | |
- | ^C | + | |
</ | </ | ||
- | Ouvrez un deuxième terminal et saisissez la commande suivante | + | Il est maintenant possible de supprimer le cgroup **pids** |
< | < | ||
- | [trainee@centos8 | + | [root@redhat9 |
+ | [root@redhat9 ~]# | ||
</ | </ | ||
- | Retournez consulter le premier terminal | + | Il existe deux façons de limiter les ressources de la CPU : |
+ | |||
+ | * **CPU bandwidth**, | ||
+ | * un système de limitation basé sur un pourcentage de CPU pour un ou plusieurs processus, | ||
+ | * **CPU weight**, | ||
+ | * un système de limitation basé sur la prioritisassion d'un ou de plusieurs processus par rapports aux autres processus. | ||
+ | |||
+ | Dans l' | ||
+ | |||
+ | Commencez par créer un service appelé **foo** | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -- Logs begin at Thu 2021-06-03 09:01:10 EDT. -- | + | [root@redhat9 ~]# cat /lib/systemd/system/foo.service |
- | Jun 03 13:13:08 centos8.ittraining.loc systemd[1]: Started dnf makecache. | + | [Unit] |
- | Jun 03 13:14:01 centos8.ittraining.loc systemd[1]: Started Session 256 of user trainee. | + | Description=The foo service that does nothing useful |
- | Jun 03 13:14:01 centos8.ittraining.loc CROND[5391]: | + | After=remote-fs.target nss-lookup.target |
- | Jun 03 13:14:01 centos8.ittraining.loc | + | |
- | Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: Started Session 257 of user trainee. | + | [Service] |
- | Jun 03 13:15:01 centos8.ittraining.loc CROND[5407]: | + | ExecStart=/usr/bin/sha1sum |
- | Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: session-257.scope: | + | ExecStop=/bin/kill -WINCH ${MAINPID} |
- | Jun 03 13:16:02 centos8.ittraining.loc systemd[1]: Started Session 258 of user trainee. | + | |
- | Jun 03 13:16:02 centos8.ittraining.loc CROND[5420]: | + | [Install] |
- | Jun 03 13:16:02 centos8.ittraining.loc | + | WantedBy=multi-user.target |
- | Jun 03 13:17:01 centos8.ittraining.loc systemd[1]: Started Session 259 of user trainee. | + | |
- | Jun 03 13:17:01 centos8.ittraining.loc CROND[5436]: | + | |
- | Jun 03 13:17:01 centos8.ittraining.loc systemd[1]: session-259.scope: | + | |
- | Jun 03 13:17:19 centos8.ittraining.loc sshd[5439]: Accepted password for trainee from 10.0.2.2 port 39906 ssh2 | + | |
- | Jun 03 13:17:19 centos8.ittraining.loc systemd-logind[880]: | + | |
- | Jun 03 13:17:19 centos8.ittraining.loc systemd[1]: Started Session 260 of user trainee. | + | |
- | Jun 03 13:17:19 centos8.ittraining.loc sshd[5439]: pam_unix(sshd: | + | |
- | Jun 03 13:17:34 centos8.ittraining.loc trainee[5470]: | + | |
- | Jun 03 13:17:34 centos8.ittraining.loc rsyslogd[1113]: | + | |
- | Jun 03 13:18:01 centos8.ittraining.loc systemd[1]: Started Session 261 of user trainee. | + | |
- | Jun 03 13:18:01 centos8.ittraining.loc CROND[5481]: | + | |
- | Jun 03 13:18:01 centos8.ittraining.loc systemd[1]: session-261.scope: Succeeded. | + | |
- | ^C | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Démarrez et activez le service : |
- | **Important** : Notez la présence | + | |
+ | <code> | ||
+ | [root@redhat9 ~]# systemctl enable --now foo.service | ||
+ | Created symlink / | ||
+ | |||
+ | [root@redhat9 ~]# systemctl status foo.service | ||
+ | ● foo.service - The foo service that does nothing useful | ||
+ | | ||
+ | | ||
+ | Main PID: 81361 (sha1sum) | ||
+ | Tasks: 1 (limit: 48800) | ||
+ | | ||
+ | CPU: 10.270s | ||
+ | | ||
+ | | ||
+ | |||
+ | Oct 23 13:59:27 redhat9.ittraining.loc systemd[1]: Started The foo service that does nothing useful. | ||
+ | </ | ||
+ | |||
+ | Utilisez la commande **ps** pour voir le pourcentage de la CPU utilisé par ce service : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# ps -p 81361 -o pid, | ||
+ | PID COMMAND | ||
+ | 81361 sha1sum | ||
+ | </code> | ||
+ | |||
+ | Créez maintenant un autre service dénommé | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# vi / | ||
+ | [root@redhat9 ~]# cat / | ||
+ | [Unit] | ||
+ | Description=The bar service that does nothing useful | ||
+ | After=remote-fs.target nss-lookup.target | ||
+ | |||
+ | [Service] | ||
+ | ExecStart=/ | ||
+ | ExecStop=/ | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | Démarrez et activez le service : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# systemctl enable --now bar.service | ||
+ | Created symlink / | ||
+ | |||
+ | [root@redhat9 ~]# systemctl status bar.service | ||
+ | ● bar.service - The bar service that does nothing useful | ||
+ | | ||
+ | | ||
+ | Main PID: 81448 (md5sum) | ||
+ | Tasks: 1 (limit: 48800) | ||
+ | | ||
+ | CPU: 21.195s | ||
+ | | ||
+ | | ||
+ | |||
+ | Oct 23 14:01:46 redhat9.ittraining.loc systemd[1]: Started The bar service that does nothing useful. | ||
+ | </ | ||
+ | |||
+ | Utilisez | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# ps -p 81448 -o pid, | ||
+ | PID COMMAND | ||
+ | 81448 md5sum | ||
+ | </ | ||
+ | |||
+ | Vérifiez maintenant la présence des contrôleurs **cpuset** et **cpu** dans l' | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | cpuset cpu io memory hugetlb pids rdma misc | ||
+ | </ | ||
+ | |||
+ | Activez maintenant le contrôleur **cpuset** | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | cpu io memory pids | ||
+ | |||
+ | [root@redhat9 ~]# echo " | ||
+ | |||
+ | [root@redhat9 ~]# cat / | ||
+ | cpuset cpu io memory pids | ||
+ | </ | ||
+ | |||
+ | Créez le cgroup **enfant** appelé **FooBar** | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# mkdir / | ||
+ | |||
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 0 | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 cgroup.controllers | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 cgroup.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cgroup.freeze | ||
+ | --w-------. 1 root root 0 Oct 23 14:06 cgroup.kill | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cgroup.max.depth | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cgroup.max.descendants | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cgroup.procs | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 cgroup.stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cgroup.subtree_control | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cgroup.threads | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cgroup.type | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpu.idle | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpu.max | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpu.max.burst | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpuset.cpus | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 cpuset.cpus.effective | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpuset.cpus.exclusive | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 cpuset.cpus.exclusive.effective | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpuset.cpus.partition | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpuset.mems | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 cpuset.mems.effective | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 cpu.stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpu.weight | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 cpu.weight.nice | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 io.bfq.weight | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 io.latency | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 io.max | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 io.stat | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.current | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.events | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.events.local | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.high | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.low | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.max | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.min | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.numa_stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.oom.group | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.peak | ||
+ | --w-------. 1 root root 0 Oct 23 14:06 memory.reclaim | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.stat | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.swap.current | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.swap.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.swap.high | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.swap.max | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.swap.peak | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 memory.zswap.current | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 memory.zswap.max | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 pids.current | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 pids.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:06 pids.max | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:06 pids.peak | ||
+ | </ | ||
+ | |||
+ | Activez les contrôleurs **cpuset** et **cpu** pour le cgroup **FooBar** : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# echo " | ||
+ | |||
+ | [root@redhat9 ~]# echo " | ||
+ | |||
+ | [root@redhat9 ~]# cat / | ||
+ | cpuset cpu io memory pids | ||
+ | cpuset cpu | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Notez qu'il n'est pas possible d' | ||
</ | </ | ||
- | ====5.7 - Consultation des Journaux avec des Mots Clefs=== | + | Créez maintenant le répertoire **/ |
- | Pour consulter | + | < |
+ | [root@redhat9 ~]# mkdir / | ||
+ | |||
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 0 | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:08 cgroup.controllers | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:08 cgroup.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cgroup.freeze | ||
+ | --w-------. 1 root root 0 Oct 23 14:08 cgroup.kill | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cgroup.max.depth | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cgroup.max.descendants | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cgroup.procs | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:08 cgroup.stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cgroup.subtree_control | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cgroup.threads | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cgroup.type | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpu.idle | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpu.max | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpu.max.burst | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpuset.cpus | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:08 cpuset.cpus.effective | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpuset.cpus.exclusive | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:08 cpuset.cpus.exclusive.effective | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpuset.cpus.partition | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpuset.mems | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:08 cpuset.mems.effective | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:08 cpu.stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpu.weight | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:08 cpu.weight.nice | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Le répertoire **/ | ||
+ | </ | ||
+ | |||
+ | De façon à ce que les deux processus issus des services | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | _AUDIT_LOGINUID= | + | |
- | _AUDIT_SESSION= | + | [root@redhat9 ~]# cat / |
- | AVAILABLE= | + | 1 |
- | AVAILABLE_PRETTY= | + | |
- | _BOOT_ID= | + | |
- | _CAP_EFFECTIVE= | + | |
- | _CMDLINE= | + | |
- | CODE_FILE= | + | |
- | CODE_FUNC= | + | |
- | CODE_LINE= | + | |
- | _COMM= | + | |
- | CURRENT_USE= | + | |
- | CURRENT_USE_PRETTY= | + | |
- | DISK_AVAILABLE= | + | |
- | DISK_AVAILABLE_PRETTY= | + | |
- | DISK_KEEP_FREE= | + | |
- | DISK_KEEP_FREE_PRETTY= | + | |
- | _EXE= | + | |
- | _GID= | + | |
</ | </ | ||
- | Pour voir la liste des processus dont les traces sont inclus | + | <WRAP center round important > |
+ | **Important** - Notez que dans les faits, le contrôleur **cpu** n'est activé **que** dans le cas où le cgroup contient au moins 2 processus qui se font concurrence | ||
+ | </WRAP> | ||
+ | |||
+ | Mettez en place une limitation des ressources de la CPU avec la commande suivante | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 0 | + | |
- | [root@centos8 ~]# journalctl _COMM= | + | |
- | anacron | + | |
- | auditd | + | |
- | augenrules | + | |
- | chronyd | + | |
- | crond firewalld | + | |
</ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Dans la commande ci-dessus, le premier nombre est un quota en microsecondes pendant lequel les processus dans le cgroup peuvent s' | ||
+ | </ | ||
+ | |||
+ | Ajoutez maintenant les processus des services **foo** et **bar** au cgroup **FooBar** : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# echo " | ||
+ | |||
+ | [root@redhat9 ~]# echo " | ||
+ | </ | ||
+ | |||
+ | Vérifiez la prise en compte par le système de la commande précédente : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# cat / | ||
+ | 0::/ | ||
+ | 0::/ | ||
+ | </ | ||
+ | |||
+ | Dernièrement, | ||
+ | |||
+ | < | ||
+ | top - 14:14:12 up 22: | ||
+ | Tasks: 205 total, | ||
+ | %Cpu(s): | ||
+ | MiB Mem : | ||
+ | MiB Swap: | ||
+ | |||
+ | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | ||
+ | 81361 root 20 | ||
+ | 81448 root 20 | ||
+ | </ | ||
+ | |||
+ | ===5.3 - La Commande systemctl set-property=== | ||
+ | |||
+ | Comme déjà vu, systemd organise les processus dans des **slices**, par exemple les utilisateurs sont regroupés dans **/ | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 0 | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 cgroup.controllers | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 cgroup.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cgroup.freeze | ||
+ | --w-------. 1 root root 0 Oct 22 15:36 cgroup.kill | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cgroup.max.depth | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cgroup.max.descendants | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cgroup.procs | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 cgroup.stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:01 cgroup.subtree_control | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cgroup.threads | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cgroup.type | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cpu.idle | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cpu.max | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cpu.max.burst | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:05 cpuset.cpus | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:05 cpuset.cpus.effective | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:05 cpuset.cpus.exclusive | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:05 cpuset.cpus.exclusive.effective | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:05 cpuset.cpus.partition | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:05 cpuset.mems | ||
+ | -r--r--r--. 1 root root 0 Oct 23 14:05 cpuset.mems.effective | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 cpu.stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cpu.weight | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 cpu.weight.nice | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 io.bfq.weight | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 io.latency | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 io.max | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 io.stat | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.current | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.events | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.events.local | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.high | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.low | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.max | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.min | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.numa_stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.oom.group | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.peak | ||
+ | --w-------. 1 root root 0 Oct 22 15:36 memory.reclaim | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.stat | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.swap.current | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.swap.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.swap.high | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.swap.max | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.swap.peak | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 memory.zswap.current | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 memory.zswap.max | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 pids.current | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 pids.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 22 15:36 pids.max | ||
+ | -r--r--r--. 1 root root 0 Oct 22 15:36 pids.peak | ||
+ | drwxr-xr-x. 4 root root 0 Oct 23 14:14 user-1000.slice | ||
+ | drwxr-xr-x. 4 root root 0 Oct 22 15:37 user-42.slice | ||
+ | </ | ||
+ | |||
+ | et les processus d'un utilisateur spécifique dans un slice dénommé **user-UID.slice** : | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# ls -l / | ||
+ | total 0 | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 cgroup.controllers | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 cgroup.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 cgroup.freeze | ||
+ | --w-------. 1 root root 0 Oct 23 12:40 cgroup.kill | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 cgroup.max.depth | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 cgroup.max.descendants | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 cgroup.procs | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 cgroup.stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 14:01 cgroup.subtree_control | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 cgroup.threads | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 cgroup.type | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 cpu.stat | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.current | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.events | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.events.local | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.high | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.low | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.max | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.min | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.numa_stat | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.oom.group | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.peak | ||
+ | --w-------. 1 root root 0 Oct 23 12:40 memory.reclaim | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.stat | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.swap.current | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.swap.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.swap.high | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.swap.max | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.swap.peak | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 memory.zswap.current | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 memory.zswap.max | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 pids.current | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 pids.events | ||
+ | -rw-r--r--. 1 root root 0 Oct 23 12:40 pids.max | ||
+ | -r--r--r--. 1 root root 0 Oct 23 12:40 pids.peak | ||
+ | drwxr-xr-x. 2 root root 0 Oct 23 12:40 session-2395.scope | ||
+ | drwxr-xr-x. 5 trainee trainee 0 Oct 23 12:45 user@1000.service | ||
+ | </ | ||
+ | |||
+ | De ce fait, il est possible d' | ||
+ | |||
+ | ==CPU== | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# systemctl set-property user-1000.slice CPUQuota=40% | ||
+ | |||
+ | [root@redhat9 ~]# cat / | ||
+ | 40000 100000 | ||
+ | </ | ||
+ | |||
+ | ==Mémoire== | ||
+ | |||
+ | < | ||
+ | [root@redhat9 ~]# systemctl set-property user-1000.slice MemoryMax=1G | ||
+ | |||
+ | [root@redhat9 ~]# cat / | ||
+ | 1073741824 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Notez que l' | ||
+ | </ | ||
----- | ----- | ||
Copyright © 2024 Hugh Norris. | Copyright © 2024 Hugh Norris. |