From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Roevens 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 Message-ID: <20220209232631.14673-5-robin.roevens@disroot.org> In-Reply-To: <20220209232631.14673-1-robin.roevens@disroot.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6678744274040035762==" List-Id: --===============6678744274040035762== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - Change zabbix_agentd.conf during install to only listen on the GREEN ip by default. Signed-off-by: Robin Roevens --- 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/z= abbix_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=3D127.0.0.1 # Default: # ListenIP=3D0.0.0.0 =20 +ListenIP=3DGREEN_ADDRESS + ### Option: StartAgents # Number of pre-forked instances of zabbix_agentd that process passive check= s. # 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/insta= ll.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_a= gentd =20 restore_backup ${NAME} =20 +# By default, only listen on GREEN +(=20 + eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) + if [ -n "${GREEN_ADDRESS}" ]; then + sed -i -e "s|ListenIP=3DGREEN_ADDRESS|ListenIP=3D${GREEN_ADDRESS}|g" /etc/= zabbix_agentd/zabbix_agentd.conf.ipfirenew + else + sed -i -e "\|ListenIP=3DGREEN_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 --=20 2.34.1 --=20 Dit bericht is gescanned op virussen en andere gevaarlijke inhoud door MailScanner en lijkt schoon te zijn. --===============6678744274040035762==--