Skip to content

Instantly share code, notes, and snippets.

nano /etc/systemd/system/alertmanager.service
systemctl daemon-reload
systemctl start alertmanager
systemctl enable alertmanager
systemctl status alertmanager
grafana-cli plugins install camptocamp-prometheus-alertmanager-datasource
service grafana-server restart
rule_files:
- alert.rules.yml
alerting:
alertmanagers:
- static_configs:
- targets:
- 'localhost:9093'
global:
scrape_interval: 10s
rule_files:
- alert.rules.yml
alerting:
alertmanagers:
- static_configs:
- targets:
- 'localhost:9093'
scrape_configs:
groups:
- name: alert.rules
rules:
- alert: InstanceDown
expr: up == 0
for: 1m
labels:
severity: "critical"
annotations:
summary: "Endpoint {{ $labels.instance }} down"
promtool check rules alert.rules.yml
Host Bastion
Hostname x.x.x.x
User Ubuntu
Host Instance
Hostname x.x.x.x
User Ubuntu
# Start the SSH-Agent:
ssh-agent -s
# Add your private key that allows you to access your infrastructure
ssh-add -k ~/.ssh/cloud-infra-key.pem
# list the ssh-keys currently available in the ssh-agent
ssh-add -l
# additionally, you can remove a key from the ssh-agent using the following command
ssh-add -d ~/.ssh/cloud-infra-key.pem