Linux command
alertmanager 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Start Alertmanager
alertmanager --config.file=[alertmanager.yml]
Start with custom storage path
alertmanager --config.file=[alertmanager.yml] --storage.path=[/var/lib/alertmanager]
Start in cluster mode
alertmanager --config.file=[alertmanager.yml] --cluster.peer=[peer1:9094] --cluster.peer=[peer2:9094]
Validate configuration file
alertmanager --config.file=[alertmanager.yml] --config.check
Start with custom web listen address
alertmanager --config.file=[alertmanager.yml] --web.listen-address=[0.0.0.0:9093]
说明
Alertmanager handles alerts sent by Prometheus and other monitoring systems. It manages deduplication, grouping, silencing, inhibition, and routing of alerts to notification receivers such as email, Slack, PagerDuty, and webhooks. When Prometheus detects a condition matching an alerting rule, it sends alerts to Alertmanager. Alertmanager groups related alerts together, waits for configured intervals to batch notifications, and routes them to appropriate receivers based on label matching rules. Key features include silences to mute alerts during maintenance, inhibition rules to suppress alerts when related alerts are firing, and high availability through a gossip-based cluster protocol that ensures alerts are not duplicated across instances. The web UI at the configured listen address provides alert management, silence creation, and cluster status visibility.
参数
- --config.file _path_
- Path to the Alertmanager configuration file.
- --storage.path _path_
- Directory for storing notification state and silences.
- --web.listen-address _address_
- Address to listen on for the web UI and API (default: :9093).
- --web.external-url _url_
- External URL for generating links back to Alertmanager.
- --cluster.listen-address _address_
- Address for cluster communication (default: 0.0.0.0:9094).
- --cluster.peer _address_
- Initial peer addresses for cluster formation (repeatable).
- --cluster.advertise-address _address_
- Address to advertise in the cluster.
- --log.level _level_
- Log level: debug, info, warn, error.
- --log.format _format_
- Log format: logfmt or json.
- --config.check
- Validate configuration and exit.
FAQ
What is the alertmanager command used for?
Alertmanager handles alerts sent by Prometheus and other monitoring systems. It manages deduplication, grouping, silencing, inhibition, and routing of alerts to notification receivers such as email, Slack, PagerDuty, and webhooks. When Prometheus detects a condition matching an alerting rule, it sends alerts to Alertmanager. Alertmanager groups related alerts together, waits for configured intervals to batch notifications, and routes them to appropriate receivers based on label matching rules. Key features include silences to mute alerts during maintenance, inhibition rules to suppress alerts when related alerts are firing, and high availability through a gossip-based cluster protocol that ensures alerts are not duplicated across instances. The web UI at the configured listen address provides alert management, silence creation, and cluster status visibility.
How do I run a basic alertmanager example?
Run `alertmanager --config.file=[alertmanager.yml]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --config.file _path_ do in alertmanager?
Path to the Alertmanager configuration file.