PostgreSQL, MySQL and Redis monitoring
When the database stops answering, every page that needs it fails. Check the server directly, without giving the monitor a login.
What each check does
- PostgreSQL: sends the opening message of the protocol and expects a PostgreSQL reply.
- MySQL and MariaDB: waits for the handshake the server sends when a client connects.
- Redis: sends PING and expects PONG, or the reply that says a password is required.
When it alerts
- The port is closed, the connection times out, or something other than the database answers.
- MySQL refuses the connection, for example because the host is blocked after too many errors.
db.example.com:5432Good to know
- Enter host:port; without a port, 5432, 3306 and 6379 are used.
- The check never logs in and never runs a query.
On every monitor
- Alerts by email, Slack, Discord, Teams, Telegram, PagerDuty, webhooks, Lark, ntfy and the mobile app.
- Recovery thresholds, so an incident closes only after the service has answered several times in a row.
- Dependencies: a monitor that depends on another stays quiet while that one is down.
- Maintenance windows, incident history and public status pages built from the same monitors.
Try it on the Free plan
The Free plan includes 3 monitors checked every 5 minutes, with every alert channel. No card needed.
Questions
Why does it not need a password?
It stops at the first exchange of each protocol, which every server completes before asking for credentials. That proves the server is up without storing a database login anywhere.
Can it check that queries are fast?
It measures how long the server takes to answer, and you can alert when that is slow. To test real queries, expose a health endpoint in your application and monitor it as an API.
My database is not on the internet. Can I still monitor it?
The hosted service checks public addresses. For a private database, self-host OpenUptime inside your network.
PostgreSQL、MySQL 与 Redis 监控
数据库一旦不响应,所有依赖它的页面都会出错。直接检查服务器,而且不需要给监控任何登录凭据。
每次检查做什么
- PostgreSQL:发送协议的开场消息,期待 PostgreSQL 的应答。
- MySQL 和 MariaDB:等待客户端连接时服务器发出的握手包。
- Redis:发送 PING,期待 PONG,或要求输入密码的回复。
什么时候告警
- 端口关闭、连接超时,或应答的不是这个数据库。
- MySQL 拒绝连接,例如主机因错误次数过多被封禁。
db.example.com:5432使用说明
- 填写 host:port;不填端口时分别使用 5432、3306 和 6379。
- 检查不会登录,也不会执行任何查询。
所有监控通用
- 通过邮件、Slack、Discord、Teams、Telegram、PagerDuty、Webhook、飞书、ntfy 和手机 App 告警。
- 可设置恢复阈值,服务连续多次正常后故障才结束。
- 依赖关系:依赖另一个监控的监控,在被依赖方宕机期间不会告警。
- 维护窗口、故障历史,以及由同一组监控生成的公开状态页。
常见问题
为什么不需要密码?
它只做到每种协议的第一次交互,任何服务器都会在要求凭据之前完成这一步。这样既能证明服务器在线,又不需要在任何地方保存数据库登录信息。
能检查查询快不快吗?
它会测量服务器应答的耗时,变慢时可以提醒你。要测试真实的查询,请在应用里提供一个健康检查端点,并按 API 监控它。
数据库不在公网上,还能监控吗?
托管服务只检查公网地址。私有数据库请在你的网络里自托管 OpenUptime。