monika
monika copied to clipboard
Monitor Postgres
As mentioned in this discussion, it'd be great if Monika can also check if a postgres is running. Maybe using this function:
const { Client } = require('pg')
const client = new Client({
host: 'my.database-server.com',
port: 5334,
user: 'database-user',
password: 'secretpassword!!',
})
client.connect(err => {
if (err) {
console.error('connection error', err.stack)
} else {
console.log('connected')
}
})
probes:
- id: 'check-redis'
postgres:
host: '<hostname>'
port: <port>
password: '<password>'
user: <user>
Just like tcp
and ping
probing that we already have, user doesn't need to define any alerts for the postgres
checking.
So, todo:
- [ ] Monitor Postgres, send notification when it cannot be reached after reaching threshold.
- [ ] Update monika-config-schema.json to include the new properties.
- [ ] Add in the documentation.