Database Runbook
A Database runbook opens a SQL connection to a supported database, runs a SQL script, and parses the result set into values on the result screen.
When to Use
Use Database when the health signal lives inside a database: a locked session count, a long-running query, a replica lag reading, a scheduled job state, or any row-level diagnostic.
Fields
| Field | What to enter |
|---|---|
| Runbook Name | A short, unique name. |
| Description | One line on what the runbook returns. |
| Runbook Category | Diagnostics, Performance Monitoring, Troubleshooting, System Management, Log Collection, Network Config, or Integration. |
| Type | The database engine (for example MySQL, Postgres, MSSQL, Oracle). The port, driver, and connection string are chosen from this. |
| Monitor | Pick by Group, Tag, IP/Host, or Monitors. |
| Credential Profile | The database credential. Click Create Credential Profile if none fits. |
| Port | Database port. Defaults to the credential profile's port (3306, 5432, 1433, 1521 depending on engine). |
| Timeout | Seconds to wait before marking the run Failed. |
| SQL Script | The SQL query the runbook executes. |
| Script Language | GO or Python, for the parsing script. |
| Parsing Script | Turns the SQL result set into the result values. |
| Add Variable | Prompts the user for a value at run time. Reference it as $$$variable.name$$$ in both scripts. |
The right-side Sample Parsing Script > Database Script panel shows a working parser you can copy and adjust.
Steps
- Open Settings > Plugin Library > Runbook and click Create Runbook Plugin.
- Pick Database from the top menu.
- Pick the database engine under Type.
- Fill in the fields above.
- Click Test to run the SQL script once and show the result set and parsed values.
- Click Save.