public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Robin Roevens <robin.roevens@disroot.org>
To: development@lists.ipfire.org
Cc: Robin Roevens <robin.roevens@disroot.org>
Subject: [PATCH] zabbix_agentd: Add support for suricata metrics
Date: Fri, 31 Jul 2026 10:49:17 +0200	[thread overview]
Message-ID: <20260731085343.1085178-2-robin.roevens@disroot.org> (raw)
In-Reply-To: <20260731085343.1085178-1-robin.roevens@disroot.org>

Add new UserParameters:
 - suricata.counters.get: for retrieval of suricata counters using suricatasc.
  - suricata.version for retrieval of current suricata version using suricatasc
Add both suricatasc commands to sudoers for Zabbix agent to be able to query suricata.

Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
---
 config/rootfiles/packages/zabbix_agentd          | 1 +
 config/zabbix_agentd/sudoers                     | 1 +
 config/zabbix_agentd/userparameter_suricata.conf | 3 +++
 lfs/zabbix_agentd                                | 2 ++
 4 files changed, 7 insertions(+)
 create mode 100644 config/zabbix_agentd/userparameter_suricata.conf

diff --git a/config/rootfiles/packages/zabbix_agentd b/config/rootfiles/packages/zabbix_agentd
index 7f1f39b64..d73d9a0f2 100644
--- a/config/rootfiles/packages/zabbix_agentd
+++ b/config/rootfiles/packages/zabbix_agentd
@@ -24,6 +24,7 @@ var/ipfire/zabbix_agentd/userparameters/userparameter_ovpn.conf
 var/ipfire/zabbix_agentd/userparameters/userparameter_gateway.conf
 var/ipfire/zabbix_agentd/userparameters/userparameter_wireguard.conf
 var/ipfire/zabbix_agentd/userparameters/userparameter_locationdb.conf
+var/ipfire/zabbix_agentd/userparameters/userparameter_suricata.conf
 var/ipfire/zabbix_agentd/scripts
 var/ipfire/zabbix_agentd/scripts/ipfire_certificate_detail.sh
 var/ipfire/zabbix_agentd/scripts/ipfire_services.pl
diff --git a/config/zabbix_agentd/sudoers b/config/zabbix_agentd/sudoers
index 13edfcce9..8669b0361 100644
--- a/config/zabbix_agentd/sudoers
+++ b/config/zabbix_agentd/sudoers
@@ -13,3 +13,4 @@ zabbix ALL=(ALL) NOPASSWD: /usr/local/bin/openvpnctrl rw log, /usr/local/bin/wir
 zabbix ALL=(ALL) NOPASSWD: /var/ipfire/zabbix_agentd/scripts/ipfire_certificate_detail.sh
 zabbix ALL=(ALL) NOPASSWD: /var/ipfire/zabbix_agentd/scripts/ipfire_services.pl
 zabbix ALL=(ALL) NOPASSWD: /usr/bin/curl -s --unix-socket /var/run/knot-resolver/kres-api.sock http\://localhost/metrics/json
+zabbix ALL=(ALL) NOPASSWD: /usr/bin/suricatasc --command=dump-counters, /usr/bin/suricatasc --command=version
\ No newline at end of file
diff --git a/config/zabbix_agentd/userparameter_suricata.conf b/config/zabbix_agentd/userparameter_suricata.conf
new file mode 100644
index 000000000..b8f8c5b98
--- /dev/null
+++ b/config/zabbix_agentd/userparameter_suricata.conf
@@ -0,0 +1,3 @@
+# Suricata statistics
+UserParameter=suricata.counters.get,sudo /usr/bin/suricatasc --command=dump-counters
+UserParameter=suricata.version,sudo /usr/bin/suricatasc --command=version
\ No newline at end of file
diff --git a/lfs/zabbix_agentd b/lfs/zabbix_agentd
index cbf4b246c..e696828b5 100644
--- a/lfs/zabbix_agentd
+++ b/lfs/zabbix_agentd
@@ -118,6 +118,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 		/var/ipfire/zabbix_agentd/userparameters/userparameter_wireguard.conf
 	install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/userparameter_locationdb.conf \
 		/var/ipfire/zabbix_agentd/userparameters/userparameter_locationdb.conf
+	install -v -m 644 $(DIR_SRC)/config/zabbix_agentd/userparameter_suricata.conf \
+		/var/ipfire/zabbix_agentd/userparameters/userparameter_suricata.conf
 
 	# Install IPFire-specific Zabbix Agent scripts
 	-mkdir -pv /var/ipfire/zabbix_agentd/scripts
-- 
2.55.0


-- 
Dit bericht is gescanned op virussen en andere gevaarlijke
inhoud door MailScanner en lijkt schoon te zijn.



      reply	other threads:[~2026-07-31  8:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31  8:49 [PATCH 0/1] " Robin Roevens
2026-07-31  8:49 ` Robin Roevens [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=20260731085343.1085178-2-robin.roevens@disroot.org \
    --to=robin.roevens@disroot.org \
    --cc=development@lists.ipfire.org \
    /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