Markus Michalski FAQ

Watchdog: Database

Opens a PDO connection to MySQL, PostgreSQL or SQLite to verify that the database is reachable. Type database, runner Dashboard or Agent. Fields and messages.

Deutsche Version

Back to check types

Watchdog: Database

The check opens a connection to the database with PDO. No query is executed. The image contains the PDO drivers for MySQL, PostgreSQL and SQLite.

Property Value
Type identifier database
Runner Dashboard or Agent
Target in the email DSN

Fields

Field Key Default Meaning
DSN dsn Required. PDO DSN, for example mysql:host=localhost;dbname=app, pgsql:host=localhost;dbname=app or sqlite:/path/to/db.sqlite
Username username empty User name, leave empty for SQLite
Password password empty Password
Timeout (seconds) timeout 5 Connection time limit, clamped to 1 to 30 seconds

Behaviour

Situation Status Message
Connection succeeds OK Connected to <DSN>
Connection fails FAIL Database connection failed: <error>
No DSN UNKNOWN No DSN configured

Which runner

Use the Dashboard runner for databases reachable from the dashboard server and the Agent runner for databases reachable only from the monitored machine. For databases that are only reachable inside the Docker network under a container name, use the Docker Exec check with mysqladmin ping.

User name and password are stored unencrypted in the check configuration in Watchdog's database. The form points this out explicitly. Create a dedicated user with minimal privileges for monitoring and do not put credentials into the DSN itself, because the DSN appears in results and alert emails.