Outils pour utilisateurs

Outils du site


tech:suivre_la_conso_cpu_par_utilisateurs

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:suivre_la_conso_cpu_par_utilisateurs [2026/09/16 16:00] Jean-Baptistetech:suivre_la_conso_cpu_par_utilisateurs [2026/09/18 13:58] (Version actuelle) Jean-Baptiste
Ligne 8: Ligne 8:
  
 Source : Source :
-http://la-vache-libre.org/monitoring-gardez-un-oeil-sur-les-utilisateurs-de-votre-systeme-gnulinux-avec-psacct-acct-tools/+https://www.redhat.com/en/blog/linux-system-monitoring-acct
 * http://www.unixmen.com/monitoring-users-activity-using-psacct-or-acct-tools-in-linux/?utm_source=rss&utm_medium=rss&utm_campaign=monitoring-users-activity-using-psacct-or-acct-tools-in-linux * http://www.unixmen.com/monitoring-users-activity-using-psacct-or-acct-tools-in-linux/?utm_source=rss&utm_medium=rss&utm_campaign=monitoring-users-activity-using-psacct-or-acct-tools-in-linux
 * https://www.interserver.net/tips/kb/how-to-monitor-linux-user-activity-with-psacct-and-acct-tools/ * https://www.interserver.net/tips/kb/how-to-monitor-linux-user-activity-with-psacct-and-acct-tools/
Ligne 21: Ligne 21:
 ~~~bash ~~~bash
 dnf install psacct dnf install psacct
 +
 +# accton on
 systemctl enable --now psacct.service systemctl enable --now psacct.service
-accton on+ 
 +# Tester 
 +ls         # Une commande bidon 
 +lastcomm   # Doit retourner quelque chose
 ~~~ ~~~
  
Ligne 89: Ligne 94:
 ~~~bash ~~~bash
 lastcomm roger lastcomm roger
 +~~~
 +
 +
 +## Diagnostic
 +
 +~~~bash
 +journalctl -u acct -u psacct --since "10 minutes ago" --no-pager
 +~~~
 +
 +
 +## Exemple commande sa - mémoire Linux
 +
 +~~~bash
 +# sa -u --other-acct-file /var/account/pacct-20260917
 +sa -u
 +sa -m
 +sa -p
 +sa -P
 +~~~
 +
 +~~~
 +# sa -u --other-acct-file /var/account/pacct-20260917 | sort  -nk4 | tail -9
 +ansible    0.07 cpu    22400k mem      0 io systemd
 +root       0.14 cpu    25104k mem      0 io vdo
 +root       0.02 cpu    30736k mem      0 io gmain
 +ansible    0.02 cpu    35248k mem      0 io sshd            *
 +ansible    0.00 cpu    38864k mem      0 io (sd-pam)        *
 +root       0.00 cpu    43920k mem      0 io (sd-sync)       *
 +root       0.93 cpu   121072k mem      0 io tuned
 +root       0.00 cpu   370816k mem      0 io runc
 +polkitd    0.05 cpu   435840k mem      0 io JS Helper
 +~~~
 +
 +~~~
 +# sa -m --other-acct-file /var/account/pacct-20260917 | sort -nk6
 +                                      421     337.66re       0.03cp         0avio      8654k
 +libstoragemgmt                          1       6.21re       0.00cp         0avio      2154k
 +500                                   300       0.02re       0.00cp         0avio      5016k
 +root                                  107     297.62re       0.02cp         0avio     13654k
 +sshd                                    7       0.01re       0.00cp         0avio     16560k
 +ansible                                      27.71re       0.00cp         0avio     24716k
 +polkitd                                       6.08re       0.00cp         0avio    435840k
 +~~~
 +
 +~~~
 +# sa -a --other-acct-file /var/account/pacct-20260917 | sort  -nk5 | tail -4
 +             0.00re       0.00cp         0avio     43920k   (sd-sync)*
 +             6.11re       0.02cp         0avio    121072k   tuned
 +             0.00re       0.00cp         0avio    370816k   runc
 +             6.08re       0.00cp         0avio    435840k   JS Helper
 +~~~
 +
 +~~~
 +# sa -c --other-acct-file /var/account/pacct-20260917 | head -4
 +     421  100.00%     337.66re  100.00%       0.03cp  100.00%         0avio      8654k
 +      29    6.89%      84.00re   24.88%       0.02cp   90.07%         0avio     44968k   ***other
 +          0.48%      10.61re    3.14%       0.00cp    4.64%         0avio      5371k   bash
 +          2.14%      12.14re    3.60%       0.00cp    1.99%         0avio     17284k   sshd
 +~~~
 +
 +~~~
 +# sa --sort-cpu-avmem --other-acct-file /var/account/pacct-20260917 | head -4
 +     421     337.66re       0.03cp         0avio      8654k
 +      29      84.00re       0.02cp         0avio     44968k   ***other*
 +      25       0.00re       0.00cp         0avio     19776k   systemd-cgroups
 +             5.70re       0.00cp         0avio     18896k   sshd*
 +~~~
 +
 +~~~bash
 +lastcomm --show-paging --pid
 ~~~ ~~~
  
  
tech/suivre_la_conso_cpu_par_utilisateurs.1789567243.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki