|
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +# 🚀 Monitron |
| 10 | + |
| 11 | +Personal Monitoring Stack for developers and DevOps engineers. |
| 12 | + |
| 13 | +Monitron is a ready-to-use monitoring stack that helps you collect, analyze, and visualize metrics from your applications and infrastructure. |
| 14 | +Perfect for pet projects, home labs, and DevOps practice environments. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## ✨ Features |
| 19 | + |
| 20 | +- 📊 Metrics collection — Prometheus for time-series data storage |
| 21 | +- 📈 Visualization — Grafana dashboards ready to use |
| 22 | +- 🚨 Alerting — Alertmanager with Telegram integration |
| 23 | +- 🖥 System monitoring — Node Exporter for host metrics |
| 24 | +- 🌐 Web monitoring — Nginx + Exporter for web server stats |
| 25 | +- 🔄 CI/CD — automatic configuration validation and build tests |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## 🛠 Stack Components |
| 30 | + |
| 31 | +| Component | Version | Description | |
| 32 | +|------------|----------|-------------| |
| 33 | +| Prometheus | 2.48 | Metrics collection & storage | |
| 34 | +| Grafana | 10.2 | Visualization & dashboards | |
| 35 | +| Alertmanager | — | Alert routing & notifications | |
| 36 | +| Node Exporter | — | Host-level metrics | |
| 37 | +| Docker Compose | 2.15 | Container orchestration | |
| 38 | +| GitHub Actions | — | CI/CD automation | |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## 🚀 Quick Start |
| 43 | + |
| 44 | +```bash |
| 45 | +# 1. Clone the repository |
| 46 | +git clone https://github.com/DanLinX2004X/monitron.git |
| 47 | +cd monitron |
| 48 | + |
| 49 | +# 2. Create an .env file from the template |
| 50 | +cp .env.example .env |
| 51 | + |
| 52 | +# 3. Launch the monitoring stack |
| 53 | +docker compose up -d --build |
| 54 | + |
| 55 | +# 4. Check running services |
| 56 | +docker compose ps |
| 57 | +``` |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 🔗 Service Access |
| 62 | + |
| 63 | +Service URL Login |
| 64 | + |
| 65 | +Grafana http://localhost:3000 admin / admin |
| 66 | +Prometheus http://localhost:9090 — |
| 67 | +Alertmanager http://localhost:9093 — |
| 68 | +Nginx http://localhost:8080 — |
| 69 | + |
| 70 | +P.S. Login and password are required to log in to Grafana. When you open it for the first time, it will be admin/ admin (login and password match), after that Grafana will ask you to change the password. |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## 📦 Stop Services |
| 75 | + |
| 76 | +``` |
| 77 | +docker compose down |
| 78 | +``` |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +⚙️ Alertmanager & Telegram Integration |
| 83 | + |
| 84 | +The .env.example file contains variables for Telegram notification setup: |
| 85 | + |
| 86 | +```text |
| 87 | +TELEGRAM_BOT_TOKEN=123456789:ABCDEF123456789 |
| 88 | +TELEGRAM_CHAT_ID=123456789 |
| 89 | +``` |
| 90 | + |
| 91 | +Once filled in, Alertmanager will automatically send alerts to your Telegram chat. |
| 92 | + |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## 📊 Grafana Dashboards |
| 97 | + |
| 98 | +System Overview — CPU, memory, disk, network |
| 99 | + |
| 100 | +Nginx Analytics — requests, connections, errors |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## 🏗 Project Structure |
| 107 | + |
| 108 | +```text |
| 109 | +monitron/ |
| 110 | +├── 📁 prometheus/ |
| 111 | +│ ├── config/ |
| 112 | +│ │ ├── prometheus.yml # Main configuration |
| 113 | +│ │ └── alert.rules.yml # Alert rules |
| 114 | +│ └── data/ # Time series data |
| 115 | +├── 📁 grafana/ |
| 116 | +│ └── provisioning/ # Auto setup files |
| 117 | +├── 📁 nginx/ |
| 118 | +│ ├── html/ |
| 119 | +│ │ └── index.html # Demo page |
| 120 | +│ └── nginx.conf # Web server config |
| 121 | +├── 📁 screenshots/ # Screenshots for documentation |
| 122 | +│ ├── system_dashboard.png |
| 123 | +│ └── nginx_monitoring.png |
| 124 | +├── 🐳 docker-compose.yml # Main Docker Compose file |
| 125 | +├── 📜 .env.example # Environment variables |
| 126 | +├── 📘 README.md # Documentation (RU) |
| 127 | +└── 📘 README.en.md # Documentation (EN) |
| 128 | +``` |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## 🔄 CI/CD Pipeline |
| 133 | + |
| 134 | +Automated workflow using GitHub Actions: |
| 135 | + |
| 136 | +✅ Docker Compose syntax validation |
| 137 | + |
| 138 | +✅ Prometheus config validation (promtool check config) |
| 139 | + |
| 140 | +✅ Health check of running containers |
| 141 | + |
| 142 | +✅ Build and deploy verification |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## ⚠️ Local Testing with act |
| 149 | + |
| 150 | +You can run the pipeline locally using: |
| 151 | + |
| 152 | +```bash |
| 153 | +act -j validate |
| 154 | +``` |
| 155 | + |
| 156 | +> ⚠️ Note: act has known limitations (network isolation, health-checks, volume mapping). |
| 157 | +For reliable testing — use real GitHub Actions runners. |
| 158 | + |
| 159 | + |
| 160 | +--- |
| 161 | + |
| 162 | +📸 Screenshots |
| 163 | + |
| 164 | +System Dashboard |
| 165 | +![[screenshots/system_dashboard.png]] |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | +Nginx Monitoring |
| 170 | +![[screenshots/nginx_monitoring.png]] |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +🤝 Contributing |
| 178 | + |
| 179 | +1. Fork the repository |
| 180 | + |
| 181 | + |
| 182 | +2. Create a feature branch: git checkout -b feature/amazing-feature |
| 183 | + |
| 184 | + |
| 185 | +3. Commit changes: git commit -m 'Add amazing feature' |
| 186 | + |
| 187 | + |
| 188 | +4. Push the branch: git push origin feature/amazing-feature |
| 189 | + |
| 190 | + |
| 191 | +5. Open a Pull Request |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | +--- |
| 197 | + |
| 198 | +📄 License |
| 199 | + |
| 200 | +Distributed under the MIT License. |
| 201 | + |
| 202 | + |
| 203 | +--- |
| 204 | + |
| 205 | +👤 Author |
| 206 | + |
| 207 | +DanLinX2004X |
| 208 | + |
0 commit comments