home / system-monitoring / amtool

amtool

Official · Prometheus
8.4k

Alertmanager CLI for querying alerts, managing silences, testing routes, and validating configs.

$go install github.com/prometheus/alertmanager/cmd/amtool@latest
Language
Go
Stars
8,380
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

amtool is the command line client for Prometheus Alertmanager. It lets you inspect live alert state, manage silences, and check how Alertmanager config, routing, and notification templates will behave before or during operations work.

What It Enables
  • Query active, inhibited, silenced, or unprocessed alerts with Alertmanager matcher syntax, including JSON output for scripting against current incident state.
  • Create, update, expire, and bulk import silences, with filters for creator, ID, expiry window, and label matchers.
  • Validate config files, render notification templates with example or JSON data, and inspect or test routing trees against a local config file or a running Alertmanager.
Agent Fit
  • Structured output is available on key read commands through -o json, which makes alert, silence, config, and cluster queries straightforward to parse in shell loops.
  • Most commands are non-interactive once --alertmanager.url or config defaults are set, and the matcher-based filters compose well with pipelines and follow-up commands.
  • Best fit is operating an existing Alertmanager deployment or verifying alerting config changes; it is a focused control surface, not a full incident system by itself.
Caveats
  • Many actions require a reachable Alertmanager API plus any needed HTTP auth or TLS config; only config checks, local route tests, and template rendering work fully offline.
  • Direct alert add exists, but the docs note that Alertmanager normally expects Prometheus or another client to resend alerts reliably, so manual alert injection is more of an advanced workflow than the default model.