Monitor your Linux containers with Prometheus, Grafana, Node Exporter, and cAdvisor
Exports hardware and OS metrics from 10 Linux containers.
# Clone the repository
git clone https://github.com/sameeralam3127/monitoring.git
cd monitoring
# Build and start the stack
docker-compose up -d --build
prometheus/prometheus.yml
grafana/dashboard.json
# CPU usage per container
rate(node_cpu_seconds_total{mode="user"}[5m])
# Docker container CPU usage
rate(container_cpu_usage_seconds_total{name=~".+"}[5m])
# Memory usage percentage
node_memory_Active_bytes / node_memory_MemTotal_bytes * 100
# Running services (systemd)
node_systemd_unit_state{state="active"}
# Logged-in users
node_users_logged_in
# Failed services
node_systemd_unit_state{state="failed"}