mirror of
https://github.com/elAgala/server-initializer.git
synced 2026-02-14 05:06:18 +00:00
refactor: rethink monitoring structure | add Loki && Promtail | new Grafana conf
This commit is contained in:
@@ -6,12 +6,28 @@ function install_prometheus() {
|
||||
username="$1"
|
||||
monitoring_dir="/home/$username/monitoring"
|
||||
|
||||
echo "[ MONITOR ]: Starting Prometheus setup"
|
||||
echo "[ MONITOR ]: Starting monitoring setup"
|
||||
mkdir -p "$monitoring_dir"
|
||||
mkdir -p "$monitoring_dir/loki"
|
||||
mkdir -p "$monitoring_dir/promtail"
|
||||
|
||||
# Download main monitoring files
|
||||
wget "$REPO_URL/$TEMPLATE_PATH/docker-compose.yml" -O "$monitoring_dir/docker-compose.yml"
|
||||
wget "$REPO_URL/$TEMPLATE_PATH/prometheus.yml" -O "$monitoring_dir/prometheus.yml"
|
||||
|
||||
# Download Loki configuration
|
||||
wget "$REPO_URL/$TEMPLATE_PATH/loki/loki.yml" -O "$monitoring_dir/loki/loki.yml"
|
||||
|
||||
# Download Promtail configuration
|
||||
wget "$REPO_URL/$TEMPLATE_PATH/promtail/promtail.yml" -O "$monitoring_dir/promtail/promtail.yml"
|
||||
|
||||
cd "$monitoring_dir"
|
||||
echo "[ MONITOR ]: Prometheus Installed. Starting on docker container"
|
||||
echo "[ MONITOR ]: Monitoring stack installed. Starting containers"
|
||||
sudo docker compose up -d
|
||||
echo "[ MONITOR ]: Prometheus up & running on port 9090"
|
||||
echo "[ MONITOR ]: Monitoring stack running:"
|
||||
echo " - Prometheus: http://localhost:9090 (internal)"
|
||||
echo " - Prometheus API: https://YOUR_SERVER_IP/prometheus/ (external)"
|
||||
echo " - Loki: http://localhost:3100 (internal)"
|
||||
echo " - Node Exporter: http://localhost:9100 (internal)"
|
||||
echo " - cAdvisor: http://localhost:8080 (internal)"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user