psql -U user db
\l # list databases
\c db # connect to database
\dt # list tables

mastodon

  • change user password (doesn't have one by default)
    psql -p 5432 -U mastodon mastodon_production -w
    alter user mastodon with password '<password>';
    update .env.production

setting up nagios monitoring

  • download check_postgres plugin
    cd /opt/nagios/custom_plugins
    wget "https://bucardo.org/downloads/check_postgres.tar.gz"
    tar xf check_postgres.tar.gz
    cd check_postgres...
    ./check_postgres.pl --symlinks
  • open port on mastodon server
    iptables -A INPUT -p tcp -s laundry.tilde.gdn --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT
    https://www.digitalocean.com/community/tutorials/how-to-monitor-your-managed-postgresql-database-using-nagios-core-on-ubuntu-18-04