tech:notes_sysstat
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_sysstat [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_sysstat [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes sysstat sar | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * [[notes atop]] | ||
| + | * nmon | ||
| + | |||
| + | |||
| + | ## Install | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get update | ||
| + | apt-get install sysstat | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | ENABLED=" | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | # service sysstat restart | ||
| + | Starting the system activity data collector: sadc. | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Utilisation | ||
| + | |||
| + | ~~~ | ||
| + | $ dpkg -L sysstat | grep ' | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | ~~~ | ||
| + | |||
| + | Report CPU utilization | ||
| + | ~~~bash | ||
| + | sar -u ALL | ||
| + | ~~~ | ||
| + | |||
| + | Report per-processor CPU utilization | ||
| + | ~~~bash | ||
| + | sar -P ALL | ||
| + | ~~~ | ||
| + | |||
| + | Display all CPU utilization per 2 seconds 3 times | ||
| + | ~~~bash | ||
| + | mpstat -P ALL 2 3 | ||
| + | |||
| + | # mpstat -A 1 | ||
| + | ~~~ | ||
| + | |||
| + | Report memory utilization | ||
| + | ~~~bash | ||
| + | sar -r ALL | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Report swap space utilization | ||
| + | ~~~bash | ||
| + | sar -S | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Report hugepages utilization | ||
| + | ~~~bash | ||
| + | sar -H | ||
| + | ~~~ | ||
| + | |||
| + | Report paging statistics | ||
| + | ~~~bash | ||
| + | sar -B | ||
| + | ~~~ | ||
| + | |||
| + | Report swapping statistics | ||
| + | ~~~bash | ||
| + | sar -W | ||
| + | ~~~ | ||
| + | |||
| + | Report I/O and transfer rate statistics | ||
| + | ~~~bash | ||
| + | sar -b | ||
| + | ~~~ | ||
| + | |||
| + | Report block device activity | ||
| + | ~~~bash | ||
| + | sar -d | ||
| + | ~~~ | ||
| + | |||
| + | Report process creation and system switching activity | ||
| + | ~~~bash | ||
| + | sar -w | ||
| + | ~~~ | ||
| + | |||
| + | Report queue length and load averages | ||
| + | ~~~bash | ||
| + | sar -q | ||
| + | ~~~ | ||
| + | |||
| + | Display I/O disk with Mega bytes per 2 seconds | ||
| + | ~~~bash | ||
| + | iostat -mx -d 2 | ||
| + | ~~~ | ||
| + | |||
| + | Report network utilization | ||
| + | ~~~bash | ||
| + | sar -n ALL | ||
| + | ~~~ | ||
| + | |||
| + | Display I/O and network per 2 seconds 5 times | ||
| + | ~~~bash | ||
| + | sar -b -n DEV 2 5 | ||
| + | ~~~ | ||
| + | |||
| + | Display data in human readable way | ||
| + | ~~~bash | ||
| + | sar -r -h | ||
| + | ~~~ | ||
| + | |||
| + | Display memory utilization of specific process per a second 3 times | ||
| + | ~~~bash | ||
| + | pidstat -r -p 21090 1 3 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Charge sur une période donnée | ||
| + | ~~~bash | ||
| + | sar -q -f / | ||
| + | sar -A -f / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Un peu de couleurs | ||
| + | ~~~bash | ||
| + | env S_COLORS=always sar -A | less -R -S | ||
| + | env S_COLORS=always sar -n DEV | grep --color=never eth0 | ||
| + | ~~~ | ||
| + | |||
| + | Voir aussi : | ||
| + | * dircolors | ||
| + | |||
| + | |||
| + | ### Autres | ||
| + | |||
| + | Réseaux | ||
| + | ~~~bash | ||
| + | sar -n ALL | ||
| + | sar -n DEV | ||
| + | sar -n TCP | ||
| + | sar -n ETCP | ||
| + | sar -n IP | ||
| + | sar -n EIP | ||
| + | ~~~ | ||
| + | |||
| + | Disques | ||
| + | ~~~bash | ||
| + | iostat -p -x | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Configuration | ||
| + | |||
| + | ### Timer | ||
| + | |||
| + | ~~~bash | ||
| + | # systemctl edit --full sysstat-collect.timer | ||
| + | |||
| + | systemctl cat sysstat-collect.timer | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | # / | ||
| + | # (C) 2014 Tomasz Torcz < | ||
| + | # | ||
| + | # sysstat-11.7.3 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 | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | systemctl edit sysstat-collect.timer | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [Unit] | ||
| + | Description=Run system activity accounting tool every 5 minutes | ||
| + | |||
| + | [Timer] | ||
| + | OnCalendar= | ||
| + | OnCalendar=*: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ~~~bash | ||
| + | # sar -n TCP | ||
| + | Requested activities not available in file / | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~bash | ||
| + | # Parameters for the system activity data collector (see sadc(8) manual page) | ||
| + | # which are used for the generation of log files. | ||
| + | # By default contains the `-S DISK' option responsible for generating disk | ||
| + | # statisitcs. Use `-S XALL' to collect all available statistics. | ||
| + | SADC_OPTIONS=" | ||
| + | ~~~ | ||
| + | |||
| + | Important | ||
| + | |||
