Files
openwrt-packages/admin/muninlite/patches/200-Allow-customizing-the-list-of-monitored-network-inte.patch
Rany Hany 7d752193e4 muninlite: add some patches to address old issues
As muninlite doesn't appear to have had a release in a few years and activity
on the git repo appears to have stalled, we add some patches on our end for now.

Patches:

- 001->004 are upstream fixes from master.
- 100 is a submitted PR: https://github.com/munin-monitoring/muninlite/pull/19
  to fix https://github.com/munin-monitoring/muninlite/issues/14.
- 200->204 is a submitted PR to allow customizing the monitored network interfaces:
  https://github.com/munin-monitoring/muninlite/pull/18. Despite the large
  number of patches it is actually a trivial change.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
2025-01-10 00:11:38 +01:00

30 lines
1.4 KiB
Diff

From c14b6ccaecba0a85fee0261774d31187a6c66f71 Mon Sep 17 00:00:00 2001
From: Daniel Alder <daald@users.noreply.github.com>
Date: Wed, 13 Dec 2023 15:16:20 +0100
Subject: [PATCH 200/204] Allow customizing the list of monitored network
interfaces
This is a simple way to customize the selection of network interfaces. If INTERFACE_NAMES_OVERRIDE is set in muninlite.conf, that list is used instead of auto-detection. As muninlite.conf
itself is also a script, it is even possible to write a custom command.
This feature is helpful in environments with virtual machines or containers, like docker or lxc where there are lots of br-*, veth*, lxcbr* etc interfaces where monitoring doesn't make much
sense. I didn't find a way to reliably filter physical interfaces.
---
muninlite.in | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/muninlite.in
+++ b/muninlite.in
@@ -78,7 +78,11 @@ RES=""
for PLUG in $PLUGINS; do
case "$PLUG" in
if_|if_err_)
- interface_names=$(sed 's/^ *//; s/:.*$//; / /d; /^lo$/d' /proc/net/dev)
+ if [ -z "$INTERFACE_NAMES_OVERRIDE" ]; then
+ interface_names=$(sed 's/^ *//; s/:.*$//; / /d; /^lo$/d' /proc/net/dev)
+ else
+ interface_names="$INTERFACE_NAMES_OVERRIDE"
+ fi
for INTER in $interface_names; do
INTERRES=$(echo "$INTER" | sed -e 's/\./VLAN/' -e 's/\-/_/g')
RES="$RES ${PLUG}${INTERRES}"