User Tools

Site Tools


informatique:linux:monitoring_linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatique:linux:monitoring_linux [2016/09/21 17:10] – [vnstat] pteuinformatique:linux:monitoring_linux [2021/01/17 16:12] (current) – [inxi] pteu
Line 17: Line 17:
 Dans le même genre que saidar, en plus détaillé. Dans le même genre que saidar, en plus détaillé.
  
 +====neofetch====
 +
 +Affiche un résumé des informations système :
 +<code bash>
 +$ neofetch
 +       _,met$$$$$gg.          dude@tyr
 +    ,g$$$$$$$$$$$$$$$P.       --------
 +  ,g$$P"     """Y$$."       OS: Debian GNU/Linux 10 (buster) x86_64
 + ,$$P'              `$$$.     Kernel: 4.19.0-13-amd64
 +',$$P       ,ggs.     `$$b:   Uptime: 28 days, 6 hours, 24 mins
 +`d$$'     ,$P"'      $$$    Packages: 574 (dpkg)
 + $$P      d$'     ,    $$P    Shell: bash 5.0.3
 + $$:      $$.      ,d$$'    Terminal: /dev/pts/0
 + $$;      Y$b._   _,d$P'      CPU: Intel Atom N2800 (4) @ 1.862GHz
 + Y$$.    `.`"Y$$$$P"'         GPU: Intel Atom Processor D2xxx/N2xxx
 + `$$b      "-.__              Memory: 321MiB / 1976MiB
 +  `Y$$
 +   `Y$$.
 +     `$$b.
 +       `Y$$b.
 +          `"Y$b._
 +              `"""
 +</code>
 +
 +====inxi====
 +
 +A l'instar de neofetch, permet d'afficher des informations système (plus détaillées cependant).
 +<code bash>
 +$ inxi -F
 +System:    Host: tyr Kernel: 4.19.0-13-amd64 x86_64 bits: 64 Console: tty 0 Distro: Debian GNU/Linux 10 (buster)
 +Machine:   Type: Desktop Mobo: Intel model: DN2800MT v: AAG81515-900 serial: <root required> BIOS: Intel
 +           v: MTCDT10N.86A.0165.2013.0114.1540 date: 01/14/2013
 +CPU:       Topology: Dual Core model: Intel Atom N2800 bits: 64 type: MT MCP L2 cache: 512 KiB
 +           Speed: 800 MHz min/max: 798/1862 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800
 +Graphics:  Device-1: Intel Atom Processor D2xxx/N2xxx Integrated Graphics driver: gma500 v: N/A
 +           Display: server: No display server data found. Headless machine? tty: 125x35
 +           Message: Unable to show advanced data. Required tool glxinfo missing.
 +Audio:     Message: No Device data found.
 +Network:   Device-1: Intel 82574L Gigabit Network driver: e1000e
 +           IF: eno0 state: up speed: 100 Mbps duplex: full mac: 00:22:4d:00:11:22
 +           IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A
 +Drives:    Local Storage: total: 465.76 GiB used: 252.53 GiB (54.2%)
 +           ID-1: /dev/sda vendor: Toshiba model: DT01ACA050 size: 465.76 GiB
 +Partition: ID-1: / size: 19.10 GiB used: 4.33 GiB (22.7%) fs: ext4 dev: /dev/sda2
 +           ID-2: /boot size: 486.8 MiB used: 171.6 MiB (35.2%) fs: ext4 dev: /dev/sda1
 +           ID-3: /home size: 438.12 GiB used: 247.96 GiB (56.6%) fs: ext4 dev: /dev/sda3
 +           ID-4: swap-1 size: 511.0 MiB used: 76.0 MiB (14.9%) fs: swap dev: /dev/sda4
 +Sensors:   Missing: Required tool sensors not installed. Check --recommends
 +Info:      Processes: 128 Uptime: 28d 6h 37m Memory: 1.93 GiB used: 415.9 MiB (21.0%) Init: systemd runlevel: 5
 +           Shell: bash inxi: 3.0.32
 +</code>
 =====Processus===== =====Processus=====
  
Line 23: Line 74:
 <code bash> <code bash>
 htop htop
 +</code>
 +
 +====pidstat====
 +
 +**pidstat** affiche l'activité des processus actifs
 +<code bash>
 +# "-d" report IOSTAT ; "-l" list process cmd name & args ; 1 interval [ 30 count ])
 +pidstat -d -l 1 30
 +</code>
 +
 +====ps====
 +
 +<code bash>
 +# lister les processus bloqués en state=D (Disk sleep (uninterruptible))
 +for x in `seq 1 1 10`; do ps -eo state,pid,cmd | grep "^D"; echo "---"; sleep 5; done"
 </code> </code>
  
Line 63: Line 129:
  
 https://zmap.io https://zmap.io
 +
 +=====System=====
 +
 +====mpstat====
 +
 +<code bash>
 +mpstat -P ALL 5
 +Linux 3.10.0-514.26.2.el7.x86_64 (ldri601z) 02/08/2018 _x86_64_ (8 CPU)
 +10:39:05     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
 +10:39:10     all    1,20    0,00    0,98   61,32    0,00    0,00    0,00    0,00    0,00   36,50
 +10:39:10          3,41    0,00    4,22   92,37    0,00    0,00    0,00    0,00    0,00    0,00
 +10:39:10          0,80    0,00    0,60   98,60    0,00    0,00    0,00    0,00    0,00    0,00
 +10:39:10          2,81    0,00    0,40    0,00    0,00    0,00    0,00    0,00    0,00   96,79
 +10:39:10          2,20    0,00    2,20    0,00    0,00    0,00    0,00    0,00    0,00   95,59
 +10:39:10          0,00    0,00    0,00  100,00    0,00    0,00    0,00    0,00    0,00    0,00
 +10:39:10          0,20    0,00    0,20   99,60    0,00    0,00    0,00    0,00    0,00    0,00
 +10:39:10          0,20    0,00    0,00    0,00    0,00    0,00    0,00    0,00    0,00   99,80
 +10:39:10          0,00    0,00    0,20   99,80    0,00    0,00    0,00    0,00    0,00    0,00
 +[..]
 +</code>
 +
 +====vmstat====
 +
 +<code bash>
 +vmstat 1
 +procs -----------memory------------  ---swap-- -----io---- -system-- ------cpu-----
 +  b   swpd   free     buff  cache   si   so    bi    bo   in   cs us sy id wa st
 +  9 147484 1129764     16 1345452    0    0           16   19  2  1 91  7  0
 +  9 147484 1129640     16 1345420    0    0      1388  693 1545  1  1 37 61  0
 +  9 147484 1128876     16 1345420    0    0        44  639 1566  2  1 37 60  0
 +</code>
 +La première ligne n'est pas à prendre en compte puisqu'il affiche les stats depuis son dernier lancement.
 +
 +Ici on voit un fort %age d'IOwait (60 "wa") ce qui correspond au temps d'attente ("perdu" càd s'il est IDLE) d'accès au disque du processeur.
  
 =====IO===== =====IO=====
 +
 +Voir les stats d'IO d'un processus : ''cat /proc/<PID DU PROC>/io''
 +
 +====iostat====
 +
 +<code bash>
 +iostat -x 2 5
 +Device:         rrqm/  wrqm/    r/    w/   rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
 +sda               0,00     0,00    0,00    0,00     0,00     0,00     0,00     0,00    0,00    0,00    0,00   0,00   0,00
 +sdb               0,00     0,00    0,00    0,00     0,00     0,00     0,00     0,00    0,00    0,00    0,00   0,00   0,00
 +sdc               0,00     0,00    0,00    0,00     0,00     0,00     0,00     0,00    0,00    0,00    0,00   0,00   0,00
 +</code>
 ====iotop==== ====iotop====
 +
 <code bash> <code bash>
 iotop -p PID -k iotop -p PID -k
 +
 +# afficher le cumul des IO des processus actifs
 +iotop -oa
 </code> </code>
  
Line 88: Line 204:
 dnstop -4 eth0 dnstop -4 eth0
 </code> </code>
 +
 +
 +=====Liens utiles=====
 +
 +  * https://www.binarytides.com/linux-commands-monitor-network/
informatique/linux/monitoring_linux.1474477801.txt.gz · Last modified: 2016/09/21 17:10 by pteu