From 4327bd4133f0250a3babebd2e051d792550ac22a Mon Sep 17 00:00:00 2001 From: Kostiantyn Bushko Date: Tue, 14 Jan 2020 15:07:28 +0200 Subject: zabbix-agent: configuration recipe Signed-off-by: Kostiantyn Bushko --- recipes-connectivity/zabbix/zabbix_%.bbappend | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 recipes-connectivity/zabbix/zabbix_%.bbappend diff --git a/recipes-connectivity/zabbix/zabbix_%.bbappend b/recipes-connectivity/zabbix/zabbix_%.bbappend new file mode 100644 index 0000000..c6a69b5 --- /dev/null +++ b/recipes-connectivity/zabbix/zabbix_%.bbappend @@ -0,0 +1,20 @@ + +do_install_append() { + + # Set the zabbix Server + if [ ! -z ${SOTA_COMM_CONF_ZABBIX_SERVER} ]; then + sed -i "s/Server=\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/Server=${SOTA_COMM_CONF_ZABBIX_SERVER}/g" ${D}${sysconfdir}/zabbix_agentd.conf + if ! grep -Fxq "Server=${SOTA_COMM_CONF_ZABBIX_SERVER}" ${D}${sysconfdir}/zabbix_agentd.conf; then + echo -e '\nServer='${SOTA_COMM_CONF_ZABBIX_SERVER} >> ${D}${sysconfdir}/zabbix_agentd.conf + fi + fi + + # Set ServerActive + if [ ! -z ${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE} ]; then + sed -i "s/ServerActive=\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/ServerActive=${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE}/g" ${D}${sysconfdir}/zabbix_agentd.conf + if ! grep -Fxq "ServerActive=${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE}" ${D}${sysconfdir}/zabbix_agentd.conf; then + echo -e '\nServerActive='${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE} >> ${D}${sysconfdir}/zabbix_agentd.conf + fi + + fi +} -- cgit v1.2.3-54-g00ecf