amtool(1)
Command-line tool for managing and querying Alertmanager alerts and silence rules.
Synopsis
amtool [OPTION]... COMMAND [ARG]...Description
amtool is the official command-line client for Alertmanager, allowing operators to query active alerts, manage silences, and interact with Alertmanager instances from the command line or scripts.
It provides subcommands for viewing alerts, creating/managing silences, querying the Alertmanager API, and managing alert routing and grouping. Authentication and TLS configuration are supported for remote instances.
Common options
| Flag | What it does |
|---|---|
--alertmanager.url | URL of the Alertmanager instance (default: http://localhost:9093) |
-o, --output | Output format: simple, json, extended (default: simple) |
--timeout | Timeout for API requests (default: 30s) |
--insecure-skip-verify | Skip TLS certificate verification for HTTPS endpoints |
--cert-file | Path to client certificate for mutual TLS authentication |
--key-file | Path to client private key for mutual TLS authentication |
-c, --config | Configuration file path (YAML format) |
--verbose | Enable verbose logging output |
Examples
List all active alerts from the default Alertmanager instance
amtool alert queryQuery only critical-severity alerts with label matching
amtool alert query severity=criticalCreate a 24-hour silence for all DiskFull alerts
amtool silence add alertname=DiskFull duration=24hDisplay all active silence rules
amtool silence listImmediately expire a silence by its ID
amtool silence expire 1234567890abcdefQuery alerts in JSON format for programmatic processing
amtool alert query -o json | jqQuery alerts from a remote Alertmanager instance
amtool --alertmanager.url http://remote-alert:9093 alert queryAdd silence with a comment explaining the reason
amtool silence add job=prometheus duration=1h comment='Testing'