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

Next revision
Previous revision
Last revisionBoth sides next revision
informatique:linux:monitoring_linux [2015/02/18 18:23] – créée pteuinformatique:linux:monitoring_linux [2021/01/17 16:02] – [neofetch] 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>
 =====Processus===== =====Processus=====
  
Line 23: Line 46:
 <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>
  
 =====Réseau===== =====Réseau=====
 +
 +====hping====
 +
 ====iftop==== ====iftop====
 Affiche l'utilisation d'une interface réseau, par connexion. Affiche l'utilisation d'une interface réseau, par connexion.
Line 36: Line 77:
 iptraf iptraf
 </code> </code>
 +
 +====jnettop====
 +<code bash>
 +jnettop
 +</code>
 +
 +====mtr====
 +
 +====nethogs====
 +<code bash>
 +nethogs
 +</code>
 +
 +====nload====
 +
 +====nmap====
 +
 +====ntop====
 +
 +====vnstat====
 +
 +====zmap====
 +
 +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 61: Line 176:
 dnstop -4 eth0 dnstop -4 eth0
 </code> </code>
 +
 +
 +=====Liens utiles=====
 +
 +  * https://www.binarytides.com/linux-commands-monitor-network/
informatique/linux/monitoring_linux.txt · Last modified: 2021/01/17 16:12 by pteu