public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Robin Roevens <robin.roevens@disroot.org>
To: development@lists.ipfire.org
Subject: [PATCH v3 4/5] zabbix_agentd: By default only listen on GREEN ip
Date: Thu, 10 Feb 2022 00:26:30 +0100	[thread overview]
Message-ID: <20220209232631.14673-5-robin.roevens@disroot.org> (raw)
In-Reply-To: <20220209232631.14673-1-robin.roevens@disroot.org>

[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

- Change zabbix_agentd.conf during install to only listen on the
  GREEN ip by default.

Signed-off-by: Robin Roevens <robin.roevens(a)disroot.org>
---
 config/zabbix_agentd/zabbix_agentd.conf |  2 ++
 src/paks/zabbix_agentd/install.sh       | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/config/zabbix_agentd/zabbix_agentd.conf b/config/zabbix_agentd/zabbix_agentd.conf
index aa8b899dc..5eea7d4b5 100644
--- a/config/zabbix_agentd/zabbix_agentd.conf
+++ b/config/zabbix_agentd/zabbix_agentd.conf
@@ -132,6 +132,8 @@ Server=127.0.0.1
 # Default:
 # ListenIP=0.0.0.0
 
+ListenIP=GREEN_ADDRESS
+
 ### Option: StartAgents
 #	Number of pre-forked instances of zabbix_agentd that process passive checks.
 #	If set to 0, disables passive checks and the agent will not listen on any TCP port.
diff --git a/src/paks/zabbix_agentd/install.sh b/src/paks/zabbix_agentd/install.sh
index 4ef4b5be6..f7218a603 100644
--- a/src/paks/zabbix_agentd/install.sh
+++ b/src/paks/zabbix_agentd/install.sh
@@ -62,6 +62,16 @@ ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc6.d/K02zabbix_agentd
 
 restore_backup ${NAME}
 
+# By default, only listen on GREEN
+( 
+	eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+	if [ -n "${GREEN_ADDRESS}" ]; then
+		sed -i -e "s|ListenIP=GREEN_ADDRESS|ListenIP=${GREEN_ADDRESS}|g" /etc/zabbix_agentd/zabbix_agentd.conf.ipfirenew
+	else
+		sed -i -e "\|ListenIP=GREEN_ADDRESS|d" /etc/zabbix_agentd/zabbix_agentd.conf.ipfirenew
+	fi
+) || :
+
 # Put zabbix configfiles in place
 setup_configfile /etc/zabbix_agentd/zabbix_agentd.conf
 setup_configfile /etc/sudoers.d/zabbix
-- 
2.34.1


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


  parent reply	other threads:[~2022-02-09 23:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 23:26 [PATCH v3 0/5] zabbix_agentd: Update to v5.0.20 (LTS) and more Robin Roevens
2022-02-09 23:26 ` [PATCH v3 1/5] zabbix_agentd: Update to v5.0.20 (LTS) Robin Roevens
2022-02-15 13:22   ` Michael Tremer
2022-02-16 23:35     ` Robin Roevens
2022-02-20 18:10       ` Michael Tremer
2022-02-20 22:18         ` Robin Roevens
2022-02-21 11:41           ` Michael Tremer
2022-02-21 23:48             ` Robin Roevens
2022-03-01 14:02               ` Michael Tremer
2022-02-09 23:26 ` [PATCH v3 2/5] zabbix_agentd: Fix agent modules dir and few minor bugs Robin Roevens
2022-02-09 23:26 ` [PATCH v3 3/5] zabbix_agentd: Better configfile handling during update Robin Roevens
2022-02-09 23:26 ` Robin Roevens [this message]
2022-02-09 23:26 ` [PATCH v3 5/5] zabbix_agentd: Add IPFire specific userparameters Robin Roevens

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=20220209232631.14673-5-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