diff options
-rw-r--r-- | recipes-connectivity/zabbix/zabbix_%.bbappend | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ | |||
1 | |||
2 | do_install_append() { | ||
3 | |||
4 | # Set the zabbix Server | ||
5 | if [ ! -z ${SOTA_COMM_CONF_ZABBIX_SERVER} ]; then | ||
6 | 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 | ||
7 | if ! grep -Fxq "Server=${SOTA_COMM_CONF_ZABBIX_SERVER}" ${D}${sysconfdir}/zabbix_agentd.conf; then | ||
8 | echo -e '\nServer='${SOTA_COMM_CONF_ZABBIX_SERVER} >> ${D}${sysconfdir}/zabbix_agentd.conf | ||
9 | fi | ||
10 | fi | ||
11 | |||
12 | # Set ServerActive | ||
13 | if [ ! -z ${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE} ]; then | ||
14 | 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 | ||
15 | if ! grep -Fxq "ServerActive=${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE}" ${D}${sysconfdir}/zabbix_agentd.conf; then | ||
16 | echo -e '\nServerActive='${SOTA_COMM_CONF_ZABBIX_SERVERACTIVE} >> ${D}${sysconfdir}/zabbix_agentd.conf | ||
17 | fi | ||
18 | |||
19 | fi | ||
20 | } | ||