From: Joachim Wiberg <troglobit@gmail.com>
To: buildroot@buildroot.org
Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>,
Fiona Klute <fiona.klute@gmx.de>,
Joachim Wiberg <troglobit@gmail.com>
Subject: [Buildroot] [PATCH 3/3] package/mini-snmpd: enable optional .conf and ethtool support
Date: Mon, 6 Jul 2026 06:52:06 +0200 [thread overview]
Message-ID: <20260706045206.2395575-4-troglobit@gmail.com> (raw)
In-Reply-To: <20260706045206.2395575-1-troglobit@gmail.com>
Both libConfuse and ethtool support is relatively new features. Enable
optional support for them, including an example /etc/mini-snmpd.conf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
package/mini-snmpd/Config.in | 17 +++++++++++++-
package/mini-snmpd/mini-snmpd.conf | 36 ++++++++++++++++++++++++++++++
package/mini-snmpd/mini-snmpd.mk | 19 ++++++++++++++++
3 files changed, 71 insertions(+), 1 deletion(-)
create mode 100644 package/mini-snmpd/mini-snmpd.conf
diff --git a/package/mini-snmpd/Config.in b/package/mini-snmpd/Config.in
index 1f61cddbcf..de83944528 100644
--- a/package/mini-snmpd/Config.in
+++ b/package/mini-snmpd/Config.in
@@ -4,4 +4,19 @@ config BR2_PACKAGE_MINI_SNMPD
Mini SNMPd is a minimal implementation targeted at small or
embedded UNIX systems with limited resources
- http://troglobit.com/mini-snmpd.html
+ Enable BR2_PACKAGE_LIBCONFUSE for /etc/mini-snmpd.conf support
+ with an example file. Also enabling BR2_PACKAGE_ETHTOOL adds
+ ethtool-based interface statistics.
+
+ https://troglobit.com/mini-snmpd.html
+
+if BR2_PACKAGE_MINI_SNMPD
+
+config BR2_PACKAGE_MINI_SNMPD_INTERFACES
+ int "Number of network interfaces"
+ default 8
+ range 1 256
+ help
+ Max number of network interfaces exposed in IF-MIB::ifTable
+
+endif
diff --git a/package/mini-snmpd/mini-snmpd.conf b/package/mini-snmpd/mini-snmpd.conf
new file mode 100644
index 0000000000..4679a8e43d
--- /dev/null
+++ b/package/mini-snmpd/mini-snmpd.conf
@@ -0,0 +1,36 @@
+# Require client authentication (SNMP v2c)
+authentication = true
+community = "public"
+
+# Descriptive MIB-II system.* values, shown by snmpwalk
+#location = "Server room, rack 4"
+#contact = "ops@example.com"
+#description = "Acme Gateway 3000"
+
+# Vendor OID tree (enterprises.*)
+#vendor = ".1.3.6.1.4.1"
+
+# MIB poll timeout, seconds
+#timeout = 1
+
+# Mount points to expose in UCD-SNMP-MIB::dskTable
+#disk-table = { "/", "/var" }
+
+# Interfaces to expose in IF-MIB::ifTable
+#iface-table = { "eth0", "eth1" }
+
+# SNMPv2 trap sinks
+#trap-table = { "192.0.2.1", "[2001:db8::1]:1620" }
+
+# Emulate the respons of another device
+# custom ".1.3.6.1.4.1.11.2.3.9.1.1.7.0" {
+# value = "MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CLS:PRINTER;"
+#}
+
+# Map ethtool stats to IF-MIB counters:
+#ethtool "eth*" {
+# rx_bytes = ifInOctets
+# rx_packets = ifInUcastPkts
+# tx_bytes = ifOutOctets
+# tx_packets = ifOutUcastPkts
+#}
diff --git a/package/mini-snmpd/mini-snmpd.mk b/package/mini-snmpd/mini-snmpd.mk
index 99bef47477..9873ad2dee 100644
--- a/package/mini-snmpd/mini-snmpd.mk
+++ b/package/mini-snmpd/mini-snmpd.mk
@@ -11,6 +11,25 @@ MINI_SNMPD_LICENSE_FILES = COPYING
MINI_SNMPD_CPE_ID_VENDOR = minisnmpd_project
MINI_SNMPD_CPE_ID_PRODUCT = minisnmpd
MINI_SNMPD_DEPENDENCIES = host-pkgconf
+MINI_SNMPD_CONF_OPTS = --with-interfaces=$(BR2_PACKAGE_MINI_SNMPD_INTERFACES)
+
+ifeq ($(BR2_PACKAGE_LIBCONFUSE),y)
+MINI_SNMPD_DEPENDENCIES += libconfuse
+MINI_SNMPD_CONF_OPTS += --with-config
+# ethtool interface stats live in linux_ethtool.c, only built with libConfuse
+ifeq ($(BR2_PACKAGE_ETHTOOL),y)
+MINI_SNMPD_CONF_OPTS += --enable-ethtool
+else
+MINI_SNMPD_CONF_OPTS += --disable-ethtool
+endif
+define MINI_SNMPD_INSTALL_CONFIG
+ $(INSTALL) -D -m 644 package/mini-snmpd/mini-snmpd.conf \
+ $(TARGET_DIR)/etc/mini-snmpd.conf
+endef
+MINI_SNMPD_POST_INSTALL_TARGET_HOOKS += MINI_SNMPD_INSTALL_CONFIG
+else
+MINI_SNMPD_CONF_OPTS += --without-config
+endif
define MINI_SNMPD_INSTALL_ETC_DEFAULT
$(INSTALL) -D -m 644 package/mini-snmpd/mini-snmpd \
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2026-07-06 4:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 4:52 [Buildroot] [PATCH 0/3] mini-snmpd: bump and housekeeping Joachim Wiberg
2026-07-06 4:52 ` [Buildroot] [PATCH 1/3] package/mini-snmpd: bump to version 2.0 Joachim Wiberg
2026-07-06 4:52 ` [Buildroot] [PATCH 2/3] package/mini-snmpd: add sysv init script Joachim Wiberg
2026-07-06 4:52 ` Joachim Wiberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260706045206.2395575-4-troglobit@gmail.com \
--to=troglobit@gmail.com \
--cc=alexander.sverdlin@gmail.com \
--cc=buildroot@buildroot.org \
--cc=fiona.klute@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox