initial module

This commit is contained in:
2026-05-07 22:57:00 +03:30
commit 1e5deb18b3
27 changed files with 5271 additions and 0 deletions

18
scripts/build.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env sh
set -eu
if [ "${NGINX_SRC:-}" = "" ]; then
echo "NGINX_SRC is required, for example: NGINX_SRC=/usr/local/src/nginx-1.24.0 ./scripts/build.sh" >&2
exit 1
fi
NGINX_CONFIGURE_ARGS="${NGINX_CONFIGURE_ARGS:---with-compat --with-http_ssl_module --with-http_stub_status_module}"
BUILD_DIR="${BUILD_DIR:-$(pwd)/build}"
cd "$NGINX_SRC"
./configure $NGINX_CONFIGURE_ARGS --add-dynamic-module="$(cd -P "$(dirname "$0")/.." && pwd)"
make modules
mkdir -p "$BUILD_DIR"
cp "$NGINX_SRC/objs/ngx_http_monitoring_module.so" "$BUILD_DIR/"
echo "Built $BUILD_DIR/ngx_http_monitoring_module.so"

26
scripts/smoke.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env sh
set -eu
BASE_URL="${BASE_URL:-http://127.0.0.1:8080}"
TOKEN="${TOKEN:-}"
auth_arg=""
if [ "$TOKEN" != "" ]; then
auth_arg="?token=$TOKEN"
fi
curl -fsS "$BASE_URL/monitor" >/dev/null
curl -fsS "$BASE_URL/monitor/api$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/system$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/nginx$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/network$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/disk$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/processes$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/upstreams$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/connections$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/api/requests$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/metrics$auth_arg" >/dev/null
curl -fsS "$BASE_URL/monitor/health$auth_arg" >/dev/null
timeout 3 curl -fsS -N "$BASE_URL/monitor/live$auth_arg" >/dev/null || true
echo "smoke checks completed"