Commit the accumulated infrastructure work that was living only in the working tree: monitoring stack, emergency access/bot, gyro allocator, grimmory, adguard, backup audit and the OpenCode agent definitions. Also ignore Python bytecode, local archives and Nix/direnv artifacts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTocXkGUUazHdKKd3r9k71
38 lines
1.2 KiB
Django/Jinja
38 lines
1.2 KiB
Django/Jinja
#!/bin/sh
|
|
# Managed by Ansible. Push local ru-vps metrics through the OpenVPN route.
|
|
set -eu
|
|
|
|
PUSHGATEWAY_URL="{{ monitoring_pushgateway_url }}"
|
|
NOW=$(date +%s)
|
|
NODE_METRICS=$(mktemp)
|
|
|
|
trap 'rm -f "$NODE_METRICS"' EXIT
|
|
|
|
push_stdin() {
|
|
path="$1"
|
|
curl --fail --silent --show-error --data-binary @- "$PUSHGATEWAY_URL/metrics/$path"
|
|
}
|
|
|
|
curl --fail --silent --show-error http://127.0.0.1:9100/metrics > "$NODE_METRICS"
|
|
push_stdin "job/node/instance/ru-vps" < "$NODE_METRICS"
|
|
|
|
probe() {
|
|
name="$1"
|
|
module="$2"
|
|
target="$3"
|
|
payload=$(curl --fail --silent --show-error --get \
|
|
--data-urlencode "module=$module" \
|
|
--data-urlencode "target=$target" \
|
|
http://127.0.0.1:9115/probe || printf 'probe_success 0\n')
|
|
payload=$(printf '%s\nhomelab_vps_probe_timestamp_seconds %s\n' "$payload" "$NOW")
|
|
printf '%s\n' "$payload" | push_stdin "job/blackbox-vps/probe_name/$name"
|
|
}
|
|
|
|
probe vaultwarden http_2xx https://pass.ada-dev.ru
|
|
probe gitea http_2xx https://git.ada-dev.ru
|
|
probe grimmory http_2xx https://books.ada-dev.ru/api/v1/healthcheck
|
|
probe ovpn_gateway tcp_connect 10.78.0.2:22
|
|
probe cloud_pve tcp_connect 192.168.1.5:8006
|
|
probe mini_pve tcp_connect 192.168.1.10:8006
|
|
probe pbs tcp_connect 192.168.1.20:8007
|