D002 Useful Linux tools - collect data

Tools we need to check

  • CPU: top, ps, htop
  • Free Space: df, du
  • IO: iostat
  • Memory: free, vmstat
  • Network: netstat, tcpdump, ss
  • Universal/misc: dstat, strace, ltrace, perf, numastat

See also: http://www.brendangregg.com/linuxperf.html. Picture from there:

linux_observability_tools

TODO

Just draw a table which describes is that tools enabled or not (for the master and replicas).

Example:

  # timeout
  if ! $(which gtimeout >/dev/null 2>&1) && ! $(which timeout >/dev/null 2>&1); then
    err "Can't find the 'timeout' executable. Please install it:"
    if [[ "${KERNEL_NAME}" = "Darwin" ]]; then
      err "${OS_NAME}: 'brew install coreutils'"
    elif [[ "${KERNEL_NAME}" = "Linux" ]]; then
      err "Debian/Ubuntu GNU/${OS_NAME}: 'sudo apt-get install coreutils'"
      err "RHEL/CentOS GNU/${OS_NAME}: 'sudo yum install coreutils'"
    fi
    return 1
  else
...

Complicated example. Just use which and do not check for the macOS.

Acceptance criteria

As a DBA running checkup, for each node (the master and all replicas), I see the list of Linux tools with the "Available" marks (checked if the tool is installed on the box, unchecked otherwise).

Edited by Victor Yagofarov