[v3,4/5] zabbix_agentd: By default only listen on GREEN ip
Commit Message
- Change zabbix_agentd.conf during install to only listen on the
GREEN ip by default.
Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
---
config/zabbix_agentd/zabbix_agentd.conf | 2 ++
src/paks/zabbix_agentd/install.sh | 10 ++++++++++
2 files changed, 12 insertions(+)
@@ -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.
@@ -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