feat: add collectors and rules

This commit is contained in:
Vault Sovereign
2025-12-27 00:59:13 +00:00
parent b654462586
commit d1980ec714
14 changed files with 493 additions and 32 deletions

26
scripts/lib/common.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
vmcc_root() {
cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd
}
iso_utc_now() {
date -u "+%Y-%m-%dT%H:%M:%SZ"
}
run_id() {
local ts
ts="$(date -u "+%Y%m%dT%H%M%SZ")"
local rnd
rnd="$(head -c 8 /dev/urandom | od -An -tx1 | tr -d ' \n')"
echo "${ts}_${rnd:0:8}"
}
require_cmd() {
command -v "$1" >/dev/null 2>&1 || { echo "missing required tool: $1" >&2; exit 2; }
}
json_emit() {
printf '%s\n' "$1"
}