Alertmanager handles alert routing, deduplication, and notification dispatch for Prometheus. By integrating it with Slack and PagerDuty, your team receives real-time notifications through familiar channels while on-call engineers get paged for critical incidents. This tutorial walks through installing Alertmanager on RHEL 8, configuring receivers for both platforms, setting up routing logic, and verifying the setup with test alerts. By the end, you will have a production-ready alert notification pipeline.
Prerequisites
- RHEL 8 server with Prometheus already installed and running
- A Slack workspace with an incoming webhook URL
- A PagerDuty account with an integration service key (Events API v1)
- Root or sudo access
- Firewalld active and
firewall-cmdavailable
Step 1 — Download and Install Alertmanager
Download the latest Alertmanager binary from the Prometheus GitHub releases page, extract it, and place the binary in /usr/local/bin.
cd /tmp
curl -LO https://github.com/prometheus/alertmanager/releases/download/v0.27.0/alertmanager-0.27.0.linux-amd64.tar.gz
tar xzf alertmanager-0.27.0.linux-amd64.tar.gz
cd alertmanager-0.27.0.linux-amd64
sudo cp alertmanager amtool /usr/local/bin/
sudo mkdir -p /etc/alertmanager /var/lib/alertmanager
sudo useradd --no-create-home --shell /bin/false alertmanager
sudo chown alertmanager:alertmanager /usr/local/bin/alertmanager /usr/local/bin/amtool
sudo chown -R alertmanager:alertmanager /etc/alertmanager /var/lib/alertmanager
Step 2 — Configure Slack and PagerDuty Receivers
Create the main Alertmanager configuration file. This file defines receivers for Slack and PagerDuty, a routing tree, and inhibition rules to suppress redundant alerts.
sudo tee /etc/alertmanager/alertmanager.yml > /dev/null <-
{{ range .Alerts }}
*Alert:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*Severity:* {{ .Labels.severity }}
*Instance:* {{ .Labels.instance }}
{{ end }}
- name: 'pagerduty-critical'
pagerduty_configs:
- service_key: 'YOUR_PAGERDUTY_SERVICE_KEY'
send_resolved: true
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['alertname', 'instance']
EOF
Step 3 — Create the Systemd Service
Create a systemd unit file so Alertmanager starts automatically and restarts on failure.
sudo tee /etc/systemd/system/alertmanager.service > /dev/null <<'EOF'
[Unit]
Description=Alertmanager
Wants=network-online.target
After=network-online.target
[Service]
User=alertmanager
Group=alertmanager
Type=simple
ExecStart=/usr/local/bin/alertmanager
--config.file=/etc/alertmanager/alertmanager.yml
--storage.path=/var/lib/alertmanager
--web.listen-address=:9093
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now alertmanager
sudo systemctl status alertmanager
Step 4 — Open the Firewall and Link Prometheus
Allow port 9093 through firewalld and configure Prometheus to forward alerts to Alertmanager.
sudo firewall-cmd --permanent --add-port=9093/tcp
sudo firewall-cmd --reload
# Add to /etc/prometheus/prometheus.yml under global section:
# alerting:
# alertmanagers:
# - static_configs:
# - targets: ['localhost:9093']
sudo grep -q 'alerting:' /etc/prometheus/prometheus.yml || sudo tee -a /etc/prometheus/prometheus.yml > /dev/null <<'EOF'
alerting:
alertmanagers:
- static_configs:
- targets: ['localhost:9093']
EOF
sudo systemctl reload prometheus
Step 5 — Validate Configuration and Send a Test Alert
Use amtool to validate the configuration file and fire a test alert to confirm your Slack and PagerDuty integrations are receiving notifications.
# Validate config
amtool check-config /etc/alertmanager/alertmanager.yml
# Send a test alert to Alertmanager
amtool alert add
--alertmanager.url=http://localhost:9093
alertname="TestAlert"
severity="critical"
instance="test-server"
summary="This is a test alert"
description="Verifying Slack and PagerDuty integration"
# List active alerts
amtool alert --alertmanager.url=http://localhost:9093
# Create a silence (suppress alerts for 1 hour)
amtool silence add
--alertmanager.url=http://localhost:9093
--duration=1h
--comment="Maintenance window"
alertname="TestAlert"
# List silences
amtool silence --alertmanager.url=http://localhost:9093
Step 6 — Access the Web UI and Manage Silences
Alertmanager ships with a built-in web interface for browsing alerts, creating silences, and inspecting routing decisions. Open a browser to the server’s address on port 9093, or use SSH port forwarding for remote access.
# Verify Alertmanager is listening
curl -s http://localhost:9093/-/healthy
# Check current routing config via API
curl -s http://localhost:9093/api/v2/status | python3 -m json.tool
# Expire an existing silence by ID
amtool silence expire
--alertmanager.url=http://localhost:9093
# View Alertmanager logs for delivery errors
sudo journalctl -u alertmanager -n 50 --no-pager
Conclusion
You now have Alertmanager running on RHEL 8 with Slack notifications for all alert severities and PagerDuty paging for critical incidents. The routing tree ensures the right people are notified by the right channel, inhibition rules prevent alert storms, and amtool gives you command-line control over silences and test delivery. Replace the placeholder webhook URL and service key with your real credentials before promoting to production.
Next steps: How to Write Prometheus Alerting Rules for Node Exporter on RHEL 8, How to Install VictoriaMetrics as a Prometheus Alternative on RHEL 8, and How to Set Up Grafana Dashboards with Prometheus on RHEL 8.