Code Monkey home page Code Monkey logo

Comments (7)

dmius avatar dmius commented on May 26, 2024
Filesystem     Size   Used  Avail Capacity iused               ifree %iused  Mounted on
/dev/disk1s1  234Gi   79Gi  151Gi    35%  946464 9223372036853829343    0%   /```

from postgres-checkup.

dmius avatar dmius commented on May 26, 2024

show data_directory

from postgres-checkup.

Nastradamus avatar Nastradamus commented on May 26, 2024

psql -c 'show data_directory'

and then:

df -h %data_dir_from_psql%

from postgres-checkup.

NikolayS avatar NikolayS commented on May 26, 2024

PGDATA:

PGDATA="$(psql -tAX -U postgres -c 'show data_directory')"
df -T "${PGDATA}"

Важно использовать опции у psql -t, -A, -X (хотя мы их, по идее, должны глобально использовать.

Насчет опции -h - не уверен, что нам надо ее тут задействовать, т.к., думаю, лучше взять количество байт в машиночитаемом виде, а дальше уже выводить в человекопонятном, когда надо (конвертируя в шаблоне, например). /cc @Nastradamus

Дальше – как мы обсуждали, стоит забрать данные также и о всех разделах (просто df -T).

Также имеет смысл отдельно забрать данные по этим разделам, где сидят эти директории/файлы (важно, если оно вынесено на отдельные диски):

log_directory:

PGLOGDIR="$(psql -tAX -U postgres -c 'show log_directory')"
df -T "${PGLOGDIR}"

stats_temp_directory:

PGSTATSTMPDIR="$(psql -tAX -U postgres -c 'show stats_temp_directory')"
df -T "${PGSTATSTMPDIR}"

WAL directory:

version 10+:

df -T "${PGDATA}"/pg_wal

9.6 and older:

df -T "${PGDATA}"/pg_xlog

from postgres-checkup.

Nastradamus avatar Nastradamus commented on May 26, 2024

@NikolayS мы хотим использовать в будущем враппер, который будет определять как опрашивать хост: "через локальный psql" или через "ssh + psql". Поэтому, лучше разделить вызов этих комманд.

from postgres-checkup.

NikolayS avatar NikolayS commented on May 26, 2024

@Nastradamus да, согласен, давайте делать отдельно вызыв psql и отдельно df.

from postgres-checkup.

NikolayS avatar NikolayS commented on May 26, 2024

обновил инструкции #19 (comment)

  • добавил WAL dir
  • разделил psql & df

from postgres-checkup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.