feat(observability): add Prometheus/Grafana/Loki/Alertmanager/Alloy stack and remove legacy Monitoring UI
This commit is contained in:
@@ -52,6 +52,42 @@ JOB_TEMPLATES: dict[str, JobTemplate] = {
|
||||
description="Lists empty directories under the selected path. Does not delete anything.",
|
||||
command_template="find {path} -type d -empty -print",
|
||||
),
|
||||
"install_node_exporter": JobTemplate(
|
||||
name="Install Node Exporter",
|
||||
description="Downloads and installs prometheus-node-exporter via package manager (apt/dnf/yum/zypper).",
|
||||
command_template=(
|
||||
"set -e; "
|
||||
"if command -v apt-get >/dev/null 2>&1; then "
|
||||
"sudo apt-get update && sudo apt-get install -y prometheus-node-exporter; "
|
||||
"elif command -v dnf >/dev/null 2>&1; then "
|
||||
"sudo dnf install -y prometheus-node-exporter; "
|
||||
"elif command -v yum >/dev/null 2>&1; then "
|
||||
"sudo yum install -y prometheus-node-exporter; "
|
||||
"elif command -v zypper >/dev/null 2>&1; then "
|
||||
"sudo zypper install -y prometheus-node-exporter; "
|
||||
"else echo 'No supported package manager found' >&2; exit 1; "
|
||||
"fi; "
|
||||
"sudo systemctl enable --now prometheus-node-exporter; "
|
||||
"echo installed at {path}"
|
||||
),
|
||||
),
|
||||
"restart_node_exporter": JobTemplate(
|
||||
name="Restart Node Exporter",
|
||||
description="Restarts the prometheus-node-exporter systemd service.",
|
||||
command_template="sudo systemctl restart prometheus-node-exporter; echo restarted at {path}",
|
||||
),
|
||||
"node_exporter_status": JobTemplate(
|
||||
name="Node Exporter status",
|
||||
description="Checks whether prometheus-node-exporter is installed, enabled, and running.",
|
||||
command_template=(
|
||||
"systemctl status prometheus-node-exporter --no-pager || true; "
|
||||
"echo '---'; "
|
||||
"command -v node_exporter >/dev/null 2>&1 "
|
||||
"&& node_exporter --version 2>&1 | head -1 "
|
||||
"|| echo 'node_exporter binary not found'; "
|
||||
"echo checked {path}"
|
||||
),
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user