Skip to main content
The tolmo monitor command manages Datadog monitors that the Tolmo platform owns on behalf of your organization. Datadog credentials are resolved server-side and never exposed to the CLI. Every monitor created this way is stamped with the managed-by:tolmo tag, making it easy to distinguish platform-owned monitors from anything you manage outside Tolmo.

List managed monitors

Retrieve the monitors Tolmo currently manages with tolmo monitor list. Use the --tag flag to filter to platform-owned monitors, and add --json for machine-readable output:
tolmo monitor list --tag managed-by:tolmo --json
To inspect a single monitor by its Datadog ID, use monitor get:
tolmo monitor get 12345 --json

Create a monitor

Provide a JSON spec file that matches the Datadog monitor API format. The backend always appends managed-by:tolmo to the tags array before forwarding the request to Datadog — you do not need to include it yourself. You can supply the spec as a file path or pipe it from stdin:
tolmo monitor create -f /tmp/cpu-spec.json
cat spec.json | tolmo monitor create -f -

Update a monitor

Pass the monitor’s Datadog ID and a JSON patch file to update any fields:
tolmo monitor update 12345 -f /tmp/patch.json
tolmo monitor update and tolmo monitor delete refuse with HTTP 403 on any monitor that does not carry the managed-by:tolmo tag. This safeguard prevents you from accidentally modifying or deleting monitors you manage outside of Tolmo.

Delete a monitor

Remove a platform-managed monitor by its Datadog ID:
tolmo monitor delete 12345
The command fails with HTTP 403 if the target monitor does not carry the managed-by:tolmo tag (see the warning above).

Multiple Datadog integrations

When your organization has more than one Datadog account connected, use --integration <integration-id> to target the correct one. Run tolmo query list to find integration IDs:
tolmo monitor list --integration <integration-id>

Example monitor spec

Use the following minimal spec as a starting point for a CPU alert monitor. Adapt the query, message, and threshold values to match your environment, then pass the file to tolmo monitor create:
cpu-monitor.json
{
  "name": "High CPU on production hosts",
  "type": "metric alert",
  "query": "avg(last_5m):avg:system.cpu.user{env:prod} > 80",
  "message": "CPU is over 80% on {{host.name}}. @pagerduty",
  "tags": ["env:prod"],
  "options": {
    "thresholds": {
      "critical": 80,
      "warning": 70
    }
  }
}
The backend automatically adds managed-by:tolmo to the tags array, so you don’t need to include it in your spec file.