Linux Process Monitoring/Diagnosis

PSTREE

  • pstree -p
    • Show procress tree with process number

PS

  • ps ww 1234
    • Show complete command

journalctl

https://wiki.ubuntuusers.de/systemd/journalctl/

Usage

  • journalctl -k
    • log of the last boot equivalent to dmesg
  • journalctl -k --since "2 hours ago"
    • all dmesg output in the last 2 hours
  • journalctl --list-boots
  • journalctl -p err -b
    • show errors

Persist log

https://askubuntu.com/questions/859816/where-did-the-functionality-of-var-log-dmesg-go-in-xenial-16-04

  • vi /etc/systemd/journald.conf
    • #Storage=auto
      Storage=persistent
  • systemctl restart systemd-journald

atop 

nice top with more features

dstat

Memory info

  • dstat -sv