Add ngx_http_ipng_stats_module: per-VIP, per-device traffic counters
Full implementation of the nginx dynamic module with: - SO_BINDTODEVICE-based per-interface traffic attribution - Per-worker lock-free counters flushed to shared memory - Prometheus text and JSON scrape endpoint at configurable location - UDP-only global logtail (ipng_stats_logtail) for fire-and-forget access log streaming - $ipng_source_tag nginx variable for use in log_format/map - Histogram buckets, EWMA rate gauges, zone meta-metrics - Debian packaging (libnginx-mod-http-ipng-stats) - Robot Framework end-to-end tests via containerlab - SPDX Apache-2.0 headers on all source files
This commit is contained in:
42
debian/libnginx-mod-http-ipng-stats.postinst
vendored
Executable file
42
debian/libnginx-mod-http-ipng-stats.postinst
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# postinst for libnginx-mod-http-ipng-stats
|
||||
set -e
|
||||
|
||||
AVAIL=/etc/nginx/modules-available/50-mod-http-ipng-stats.conf
|
||||
ENABLED=/etc/nginx/modules-enabled/50-mod-http-ipng-stats.conf
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# Enable the module by symlinking it into modules-enabled.
|
||||
if [ ! -L "$ENABLED" ] && [ -f "$AVAIL" ]; then
|
||||
ln -s "$AVAIL" "$ENABLED"
|
||||
fi
|
||||
|
||||
# Sanity-check the resulting config. If nginx -t fails, back
|
||||
# out the symlink so the operator isn't left with an nginx
|
||||
# that cannot start.
|
||||
if ! nginx -t > /dev/null 2>&1; then
|
||||
echo "warning: nginx -t failed after enabling" \
|
||||
"libnginx-mod-http-ipng-stats; disabling the module." >&2
|
||||
rm -f "$ENABLED"
|
||||
nginx -t >&2 || true
|
||||
echo "warning: nginx-ipng-stats-plugin has been installed" \
|
||||
"but is NOT enabled; fix the configuration error" \
|
||||
"and re-enable with:" >&2
|
||||
echo " sudo ln -s $AVAIL $ENABLED && sudo nginx -s reload" >&2
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user