Dalibo Labs Tools

@EtienneBersac

23 novembre 2018

temBoard

  • Manage and monitor several clusters.
  • Without putting your hand in the dirt.
  • UI: Python/HTML/JS server and dedicated database.
  • Agent: Python HTTPS server aside Postgres cluster.
  • Heavily extensible. Reduced dependencies.
  • temboard.io

temBoard

temBoard UI

Ideas for temBoard

  • More monitoring metrics.
  • Notify alerts by mail or webhook.
  • Maintainance (schedule vaccum, reindex, etc.).
  • Raise errors and logs.
  • Slow queries and execution plans.
  • Manage more clusters.
  • Cloud-native.

ldap2pg

ldap2pg.yml for roles

- roles:
   names: [readers, writers, owners]
   options: NOLOGIN
- ldap:
    base: ou=groups,dc=ldap,dc=ldap2pg,dc=docker
    filter: "(cn=dba)"
  role:
    name: 'ldap_{member.cn}'
    options: {LOGIN: yes, SUPERUSER: yes}

ldap2pg.yml for grants

privileges:
  ro: [__connect__, __select_on_tables__]
  rw: [__all_on_tables__]

sync_map:
- grant:
    privilege: ro
    role: readers
- ldap:
    base: ou=groups,dc=ldap,dc=ldap2pg,dc=docker
    filter: "(cn=writers)"
  grant:
    privilege: rw
    role: 'ldap_{members.cn}'
    schema: public

Ideas for ldap2pg

  • query REST service
  • add checks

pgtoolkit

  • Support library for managing Postgres files and procs.
  • Set of Python modules grouped in a single package.
  • For now: conf, pg_ident, pg_hba, .pgpass, pg_service, logs.
  • Python 2.6 up to 3.7. No deps.
  • github.com/dalibo/pgtoolkit

Ideas for pgtoolkit

  • Improve postgres.conf: write, include, comments.
  • Inspection of PGDATA (version, state, device, etc.)
  • Search for running Postgres clusters on host.
  • API around standard commands like postmaster, pg_ctl, initdb.

Python for Postgres

Thank you!