Airat71/monitoring-stack

Self-hosted monitoring: Prometheus + Grafana + Alertmanager + Ansible. One-command deploy, 7 dashboards, Telegram alerts, fail2ban, multi-server. Ready in 15 min.

Jinja

4

13 commits

updated Oct 2, 2026

See the code

See what people are saying

SourceMessageScoreDate

Built a monitoring stack for my homelab — Ansible deploys the whole thing in one command (r/homelab)

Running a few servers at home and didn't want to pay for Datadog or set things up from scratch every time I added a machine. Built an Ansible playbook that deploys the whole thing in one run — Prometheus, Grafana, Alertmanager, Node Exporter, Blackbox Exporter, fail2ban integration. The part that…

0

Oct 3, 2026

README

Monitoring Stack

CI Security License: MIT Stars

Self-hosted monitoring for Linux servers — Prometheus · Grafana · Alertmanager · Ansible · fail2ban.

One-command deploy, 7 pre-built dashboards, Telegram alerts, multi-server support. Ready in 15 minutes.

Node Exporter Full dashboard


What's included

ComponentDetails
Core stackPrometheus · Grafana · Alertmanager · Node Exporter · Blackbox Exporter
Securityfail2ban integration — ban events visible in Grafana
Ansible automationOne-command full deployment + Node Exporter on remote hosts
Dashboards7 pre-built JSON dashboards (see below)
Alerts20 production-ready alert rules
Multi-serverMonitor N servers from one Grafana instance
BackupsAutomated backup script with optional cron
Documentation20 guides: deployment, security, operations, runbook, troubleshooting

Dashboards

Pre-built Grafana dashboards for immediate visibility:

DashboardWhat it coversSource
Node Exporter FullCPU, memory, disk, network per hostgrafana.com/dashboards/1860
Prometheus OverviewPrometheus self-monitoringcommunity
Blackbox ExporterHTTP/TCP endpoint uptime and latencygrafana.com/dashboards/7587
NginxRequest rate, error rate, upstreamsgrafana.com/dashboards/12708
PostgreSQLConnections, locks, query performancegrafana.com/dashboards/9628
RedisMemory, ops/sec, key evictiongrafana.com/dashboards/11835
RabbitMQQueue depth, message rate, node healthgrafana.com/dashboards/10991

Quick Start (Docker Compose — 5 minutes)

git clone https://github.com/Airat71/monitoring-stack.git
cd monitoring-stack/prometheus-grafana
cp .env.example .env          # set GRAFANA_PASSWORD
docker compose up -d
# Grafana → http://localhost:3000  (admin / your password)

Full Deploy with Ansible (single command)

Deploys the complete stack to your server and optionally installs Node Exporter on any number of additional hosts:

cp ansible/group_vars/all.yml.example ansible/group_vars/all.yml
cp ansible/inventory.example.yml ansible/inventory.yml
# edit both files — set your server IP, SSH user, Telegram token
cd ansible && ansible-playbook -i inventory.yml playbook.yml

Step-by-step: INSTALLATION_GUIDE.md


Architecture

  [Monitored hosts]
    Node Exporter  ──┐
    fail2ban        ──┤
                     │
              [Prometheus] ──→ [Alertmanager] ──→ Telegram / Email
                     │
              [Blackbox]   (HTTP/TCP probes)
                     │
               [Grafana]   (Dashboards + Alerts UI)

Alerts

20 alert rules covering:

  • Host down / unreachable
  • CPU · memory · disk thresholds
  • Service unavailable (HTTP, TCP probes)
  • fail2ban ban events
  • Prometheus self-monitoring

See alerts/alertmanager.example.yml for routing configuration.


Documentation

GuideTopic
INSTALLATION_GUIDE.mdGetting started, prerequisites
docs/DEPLOYMENT.mdDeployment options
docs/MULTI_SERVER.mdMonitor multiple servers
docs/ALERTMANAGER.mdAlert routing and receivers
docs/GRAFANA_DASHBOARDS.mdDashboard import and usage
docs/SECURITY.mdSecurity hardening
docs/PRODUCTION_CHECKLIST.mdPre-production checklist
docs/BACKUP.mdBackup and restore
docs/TROUBLESHOOTING.mdCommon issues and fixes
docs/RUNBOOK.mdOperations runbook
docs/UPGRADE.mdUpgrade guide

Full index: docs/INDEX.md


Requirements

TargetWhat you need
Monitoring serverDocker · Docker Compose · SSH access
Monitored hostsDocker (containerized Node Exporter) or systemd (binary)
Ansible control nodeAnsible 2.9+ · Python 3 · SSH key access to all hosts

Repository structure

monitoring-stack/
├── prometheus-grafana/     # Docker Compose stack (Prometheus, Grafana, Alertmanager, Blackbox)
├── ansible/                # Playbook + roles for full automated deployment
├── grafana-dashboards/     # Pre-built dashboard JSON files
├── alerts/                 # Alertmanager routing config example
├── scripts/                # Backup and dashboard fetch scripts
├── fail2ban/               # fail2ban integration guide
├── docs/                   # 20 guides
└── INSTALLATION_GUIDE.md   # Getting started

Contributing

PRs and issues are welcome — see CONTRIBUTING.md.


License

MIT — free for personal and commercial use.


Author

Built and maintained by Airat.

alertmanager
ansible
devops
docker
fail2ban
grafana
linux
monitoring
prometheus
self-hosted

Airat71/monitoring-stack

Self-hosted monitoring: Prometheus + Grafana + Alertmanager + Ansible. One-command deploy, 7 dashboards, Telegram alerts, fail2ban, multi-server. Ready in 15 min.

Jinja

4

13 commits

updated Oct 2, 2026

See the code

See what people are saying

SourceMessageScoreDate

Built a monitoring stack for my homelab — Ansible deploys the whole thing in one command (r/homelab)

Running a few servers at home and didn't want to pay for Datadog or set things up from scratch every time I added a machine. Built an Ansible playbook that deploys the whole thing in one run — Prometheus, Grafana, Alertmanager, Node Exporter, Blackbox Exporter, fail2ban integration. The part that…

0

Oct 3, 2026

README

Monitoring Stack

CI Security License: MIT Stars

Self-hosted monitoring for Linux servers — Prometheus · Grafana · Alertmanager · Ansible · fail2ban.

One-command deploy, 7 pre-built dashboards, Telegram alerts, multi-server support. Ready in 15 minutes.

Node Exporter Full dashboard


What's included

ComponentDetails
Core stackPrometheus · Grafana · Alertmanager · Node Exporter · Blackbox Exporter
Securityfail2ban integration — ban events visible in Grafana
Ansible automationOne-command full deployment + Node Exporter on remote hosts
Dashboards7 pre-built JSON dashboards (see below)
Alerts20 production-ready alert rules
Multi-serverMonitor N servers from one Grafana instance
BackupsAutomated backup script with optional cron
Documentation20 guides: deployment, security, operations, runbook, troubleshooting

Dashboards

Pre-built Grafana dashboards for immediate visibility:

DashboardWhat it coversSource
Node Exporter FullCPU, memory, disk, network per hostgrafana.com/dashboards/1860
Prometheus OverviewPrometheus self-monitoringcommunity
Blackbox ExporterHTTP/TCP endpoint uptime and latencygrafana.com/dashboards/7587
NginxRequest rate, error rate, upstreamsgrafana.com/dashboards/12708
PostgreSQLConnections, locks, query performancegrafana.com/dashboards/9628
RedisMemory, ops/sec, key evictiongrafana.com/dashboards/11835
RabbitMQQueue depth, message rate, node healthgrafana.com/dashboards/10991

Quick Start (Docker Compose — 5 minutes)

git clone https://github.com/Airat71/monitoring-stack.git
cd monitoring-stack/prometheus-grafana
cp .env.example .env          # set GRAFANA_PASSWORD
docker compose up -d
# Grafana → http://localhost:3000  (admin / your password)

Full Deploy with Ansible (single command)

Deploys the complete stack to your server and optionally installs Node Exporter on any number of additional hosts:

cp ansible/group_vars/all.yml.example ansible/group_vars/all.yml
cp ansible/inventory.example.yml ansible/inventory.yml
# edit both files — set your server IP, SSH user, Telegram token
cd ansible && ansible-playbook -i inventory.yml playbook.yml

Step-by-step: INSTALLATION_GUIDE.md


Architecture

  [Monitored hosts]
    Node Exporter  ──┐
    fail2ban        ──┤
                     │
              [Prometheus] ──→ [Alertmanager] ──→ Telegram / Email
                     │
              [Blackbox]   (HTTP/TCP probes)
                     │
               [Grafana]   (Dashboards + Alerts UI)

Alerts

20 alert rules covering:

  • Host down / unreachable
  • CPU · memory · disk thresholds
  • Service unavailable (HTTP, TCP probes)
  • fail2ban ban events
  • Prometheus self-monitoring

See alerts/alertmanager.example.yml for routing configuration.


Documentation

GuideTopic
INSTALLATION_GUIDE.mdGetting started, prerequisites
docs/DEPLOYMENT.mdDeployment options
docs/MULTI_SERVER.mdMonitor multiple servers
docs/ALERTMANAGER.mdAlert routing and receivers
docs/GRAFANA_DASHBOARDS.mdDashboard import and usage
docs/SECURITY.mdSecurity hardening
docs/PRODUCTION_CHECKLIST.mdPre-production checklist
docs/BACKUP.mdBackup and restore
docs/TROUBLESHOOTING.mdCommon issues and fixes
docs/RUNBOOK.mdOperations runbook
docs/UPGRADE.mdUpgrade guide

Full index: docs/INDEX.md


Requirements

TargetWhat you need
Monitoring serverDocker · Docker Compose · SSH access
Monitored hostsDocker (containerized Node Exporter) or systemd (binary)
Ansible control nodeAnsible 2.9+ · Python 3 · SSH key access to all hosts

Repository structure

monitoring-stack/
├── prometheus-grafana/     # Docker Compose stack (Prometheus, Grafana, Alertmanager, Blackbox)
├── ansible/                # Playbook + roles for full automated deployment
├── grafana-dashboards/     # Pre-built dashboard JSON files
├── alerts/                 # Alertmanager routing config example
├── scripts/                # Backup and dashboard fetch scripts
├── fail2ban/               # fail2ban integration guide
├── docs/                   # 20 guides
└── INSTALLATION_GUIDE.md   # Getting started

Contributing

PRs and issues are welcome — see CONTRIBUTING.md.


License

MIT — free for personal and commercial use.


Author

Built and maintained by Airat.

alertmanager
ansible
devops
docker
fail2ban
grafana
linux
monitoring
prometheus
self-hosted

Languages

Jinja

51.7%

Shell

48.3%