Monitoring stack setup — Part 2: Alert Manager & Push Gateway

sudo useradd --no-create-home alertmanager
wget https://github.com/prometheus/alertmanager/releases/download/v0.23.0/alertmanager-0.23.0.linux-amd64.tar.gz
tar xvfz alertmanager-0.23.0.linux-amd64.tar.gz
sudo mkdir -p /var/lib/alertmanager
sudo mkdir -p /etc/alertmanager
sudo cp alertmanager-0.23.0.linux-amd64/alertmanager /usr/local/bin/
sudo cp alertmanager-0.23.0.linux-amd64/alertmanager.yml /etc/alertmanager
sudo chown alertmanager:alertmanager /usr/local/bin/alertmanager sudo chown -R alertmanager:alertmanager /etc/alertmanager
sudo vim /etc/systemd/system/alertmanager.service
[Unit]
Description=Prometheus Alertmanager
Wants=network-online.target
After=network-online.target
[Service]
User=alertmanager
Group=alertmanager
Type=simple
WorkingDirectory=/etc/alertmanager/
ExecStart=/usr/local/bin/alertmanager
--config.file /etc/alertmanager/alertmanager.yml
--storage.path /var/lib/alertmanager/
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable alertmanager
sudo systemctl start alertmanager
sudo systemctl status alertmanager
sudo systemctl status alertmanager
curl http://localhost:9093
sudo useradd --no-create-home pushgateway
wget https://github.com/prometheus/pushgateway/releases/download/v1.4.2/pushgateway-1.4.2.linux-amd64.tar.gz
tar xvfz pushgateway-1.4.2.linux-amd64.tar.gz
sudo cp pushgateway-1.4.2.linux-amd64/pushgateway /usr/local/bin/
sudo chown pushgateway:pushgateway /usr/local/bin/pushgateway
sudo vi /etc/systemd/system/pushgateway.service
[Unit]
Description=Prometheus Pushgateway
Wants=network-online.target
After=network-online.target
[Service]
User=pushgateway
Group=pushgateway
Type=simple
ExecStart=/usr/local/bin/pushgateway
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable pushgateway
sudo systemctl start pushgateway
sudo systemctl status pushgateway
sudo systemctl pushgateway status
curl http://localhost:9091
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093 #alertmanager address
rule_files:
- rules1.yml

--

--

--

I spend my day learning AWS, Kubernetes & Cloud Native tools. Nights on LinkedIn & Medium. Work: Engineering @ PayPal.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to select vendors for film projects

.NET Logging Provider for Telegram — now Open and Extensible

JBehave. Spark3. SpringFox-SwaggerUI.

Top 10 Quick & Easy Programming Projects

How do job interviews look in Germany (2/4)?

Steps for compiling a C file on Linux using gcc

High Availability versus Disaster Recovery

Developing a Software Installer using Tkinter / QT

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shishir Khandelwal

Shishir Khandelwal

I spend my day learning AWS, Kubernetes & Cloud Native tools. Nights on LinkedIn & Medium. Work: Engineering @ PayPal.

More from Medium

Deploy to GKE Cluster from Jenkins

Application Security Tools

How to integrate Hubot with Jenkins and Slack? (ChatOps)

ANSIBLE PLAYBOOK FOR CREATING HAPROXY LOAD BALANCER ON AWS