]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
zabbix_agentd: By default only listen on GREEN ip
authorRobin Roevens <robin.roevens@disroot.org>
Thu, 30 Jun 2022 10:15:54 +0000 (12:15 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Wed, 6 Jul 2022 09:57:40 +0000 (09:57 +0000)
- 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
src/paks/zabbix_agentd/install.sh

index e1aafc5845b2138cd525187055bc02693d1a98c0..4480e43f2b836955947f624e56dfa766f2db6900 100644 (file)
@@ -13,6 +13,9 @@
 Server=127.0.0.1
 ServerActive=127.0.0.1
 
+# List of comma delimited IP addresses that the agent should listen on.
+ListenIP=GREEN_ADDRESS
+
 # This line activates IPFire specific userparameters. 
 # See IPFire wiki for details.
 # To deactivate them: Comment this line out.
index 3ffff10c18b9d10874bbc508b32929925124d3ab..80632d1ec5168b9975bafca6b8439cbdd0ee6bf6 100644 (file)
@@ -77,4 +77,14 @@ if [ $? -eq 1 ]; then
        echo "Include=/var/ipfire/zabbix_agentd/zabbix_agentd_ipfire_mandatory.conf" >> /etc/zabbix_agentd/zabbix_agentd.conf
 fi
 
+# 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
+       else
+               sed -i -e "\|ListenIP=GREEN_ADDRESS|d" /etc/zabbix_agentd/zabbix_agentd.conf
+       fi
+) || :
+
 start_service --background ${NAME}