Skip to main content

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​

FieldWhat to enter
Runbook NameA short, unique name.
DescriptionOne line on what the runbook returns.
Runbook CategoryDiagnostics, Performance Monitoring, Troubleshooting, System Management, Log Collection, Network Config, or Integration.
TypeThe database engine (for example MySQL, Postgres, MSSQL, Oracle). The port, driver, and connection string are chosen from this.
MonitorPick by Group, Tag, IP/Host, or Monitors.
Credential ProfileThe database credential. Click Create Credential Profile if none fits.
PortDatabase port. Defaults to the credential profile's port (3306, 5432, 1433, 1521 depending on engine).
TimeoutSeconds to wait before marking the run Failed.
SQL ScriptThe SQL query the runbook executes.
Script LanguageGO or Python, for the parsing script.
Parsing ScriptTurns the SQL result set into the result values.
Add VariablePrompts 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​

  1. Open Settings > Plugin Library > Runbook and click Create Runbook Plugin.
  2. Pick Database from the top menu.
  3. Pick the database engine under Type.
  4. Fill in the fields above.
  5. Click Test to run the SQL script once and show the result set and parsed values.
  6. Click Save.