Files
Zabbix-stack/makefile
2025-07-18 22:52:31 +03:00

58 lines
1.8 KiB
Makefile

# Terminal color magic :)
GREEN := \033[0;32m
YELLOW := \033[1;33m
NC := \033[0m
# Files
COMPOSE_FILE := docker-compose.yaml
all: help
## Start the entire infrastructure
up:
@printf "$(YELLOW)🚀 Starting Zabbix services...$(NC)\n"
@docker-compose -f $(COMPOSE_FILE) up -d
@printf "$(GREEN)✅ All services are up and running!$(NC)\n\n"
## Stop and clean everything
down:
@printf "$(YELLOW)🧹 Stopping and cleaning up...$(NC)\n"
@docker-compose -f $(COMPOSE_FILE) down -v
@printf "$(GREEN)✔️ All stopped and volumes removed$(NC)\n\n"
## View logs (web and server)
logs:
@printf "$(YELLOW)📜 Viewing web and server logs...$(NC)\n"
@docker-compose -f $(COMPOSE_FILE) logs -f zabbix-web-740 zabbix-server-740 || true
@printf "\n"
## Restart web interface only
restart-web:
@printf "$(YELLOW)🔄 Restarting web interface...$(NC)\n"
@docker-compose -f $(COMPOSE_FILE) restart zabbix-web-740
@printf "$(GREEN)💫 Restart complete$(NC)\n\n"
## Status of all containers
status:
@printf "$(YELLOW)📊 Checking container status...$(NC)\n"
@docker ps --filter name=postgresql-server --filter name=zabbix-server-740 --filter name=zabbix-web-740 --filter name=zabbix-snmp
@printf "\n"
## Check environment variables
env-check:
@printf "$(YELLOW)🔍 Checking environment variables (.env)...$(NC)\n"
@cat .env | grep -v '^#'
@printf "\n"
## Help
help:
@printf "\n"
@printf "$(YELLOW)🧭 Available commands:$(NC)\n"
@printf " make up — start all services\n"
@printf " make down — stop and remove volumes\n"
@printf " make logs — view web and server logs\n"
@printf " make restart-web — restart web interface only\n"
@printf " make status — show status of Zabbix components\n"
@printf " make env-check — check environment variables (.env)\n"
@printf "\n"