From 1f856039062b4f786f09ce9f8689de094ef8111a Mon Sep 17 00:00:00 2001 From: Maxime BOURIEAU Date: Wed, 14 Oct 2026 15:43:02 +0200 Subject: [PATCH] Add additional maintenance commands for system monitoring and configuration --- .../Commande Maintenance.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/Maintenance Préventive/Commande Maintenance.md b/Maintenance Préventive/Commande Maintenance.md index 2b33362..7764d8d 100644 --- a/Maintenance Préventive/Commande Maintenance.md +++ b/Maintenance Préventive/Commande Maintenance.md @@ -45,3 +45,120 @@ sudo rm -rf /var/cache/apt/* sudo rm -rf /var/cache/apt-cacher-ng/* sudo systemctl start apt-cacher-ng ``` +## Consulter l’utilisation de la mémoire et du processeur + +```bash +top +htop +``` + +## Consulter l’utilisation des disques + +```bash +df -h --total +``` + +## Supprimer un lien symbolique + +```bash +rm -i 'nom_du_lien_symbolique' +``` + +## Modifier la configuration de la carte réseau + +```bash +nano /etc/netplan/50-cloud-init.yaml +``` + +## Appliquer la configuration de la carte réseau + +```bash +netplan apply +``` + +## Connaître la version de Linux + +### Ubuntu et Debian + +```bash +lsb_release -a +cat /proc/version +``` + +### CentOS + +```bash +rpm --query centos-release +``` + +## Configurer la synchronisation NTP + +### Avec systemd-timesyncd + +Modifier le fichier de configuration : + +```bash +nano /etc/systemd/timesyncd.conf +``` + +Définir les serveurs NTP : + +```text +NTP=AD1 AD2 +``` + +Redémarrer le service : + +```bash +systemctl restart systemd-timesyncd.service +``` + +### Avec NTPD + +Modifier le fichier de configuration : + +```bash +nano /etc/ntp.conf +``` + +Activer et vérifier la synchronisation NTP : + +```bash +timedatectl set-ntp true +systemctl restart systemd-timesyncd.service +systemctl enable systemd-timesyncd.service +timedatectl status +``` + +## Renommer une machine Ubuntu + +```bash +hostnamectl set-hostname "NOM_DE_MACHINE" +``` + +Redémarrer ensuite la machine. + +## Corriger la rotation des journaux syslog + +Modifier le fichier de configuration : + +```bash +nano /etc/logrotate.d/rsyslog +``` + +Cette modification nécessite un redémarrage du serveur. Si aucune configuration syslog n’est présente, ajouter le bloc suivant : + +```text +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + /usr/lib/rsyslog/rsyslog-rotate + endscript +} +``` \ No newline at end of file