Commit a1145919 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Fixed zabbix proxy configuration

parent ceab6c42
......@@ -145,6 +145,8 @@ proxy: zabbix-proxy-service zabbix-proxy-config
$(MAKE) -C zabbix-3.4.14
$(MAKE) -C zabbix-3.4.14 install
install -v -Dm755 zabbix_proxy-configure /usr/sbin/zabbix_proxy-configure
sed -e 's|^Server=.*|# Server=|' -i /etc/zabbix_proxy.conf
sed -e 's|^Hostname=.*|# Hostname=|' -i /etc/zabbix_proxy.conf
sed -e 's|.*LogType=.*|LogType=system|' -i /etc/zabbix_proxy.conf
sed -e 's|^LogFile=.*|# LogFile=|' -i /etc/zabbix_proxy.conf
sed -e 's|.*PidFile=.*|PidFile=/run/zabbix/zabbix_proxy.pid|' -i /etc/zabbix_proxy.conf
......@@ -184,8 +186,7 @@ zabbix-proxy-config:
define ZABBIX_PROXY_CONFIG
config zabbix 'proxy'
option hostname ''
option name ''
option server ''
option startpollers '5'
option cachesize '32M'
endef
......
......@@ -19,7 +19,6 @@ entry_execute_method_root_Zabbix() {
common_execute_method_param "$DMROOT.Zabbix.Agent.Server" "1" "zabbix_get_agent_server" "zabbix_set_agent_server"
common_execute_method_obj "$DMROOT.Zabbix.Proxy." "0"
common_execute_method_param "$DMROOT.Zabbix.Proxy.Server" "1" "zabbix_get_proxy_server" "zabbix_set_proxy_server"
common_execute_method_param "$DMROOT.Zabbix.Proxy.Name" "1" "zabbix_get_proxy_name" "zabbix_set_proxy_name"
common_execute_method_param "$DMROOT.Zabbix.Proxy.StartPollers" "1" "zabbix_get_start_pollers" "zabbix_set_start_pollers"
common_execute_method_param "$DMROOT.Zabbix.Proxy.CacheSize" "1" "zabbix_get_cache_size" "zabbix_set_cache_size"
return 0;
......@@ -58,19 +57,6 @@ zabbix_set_proxy_server() {
fi
}
zabbix_get_proxy_name() {
echo `$UCI_GET zabbix.proxy.name`
}
zabbix_set_proxy_name() {
local name=`$UCI_GET zabbix.proxy.name`
if [ "$name" != "$1" ]; then
$UCI_SET zabbix.proxy.name="$1"
$UCI_COMMIT
chmod a+r /etc/config/zabbix
fi
}
zabbix_get_start_pollers() {
echo `$UCI_GET zabbix.proxy.startpollers`
}
......
#!/bin/sh
SERVER=`/sbin/uci -q get mysql.credentials.hostname`
DBSERVER=`/sbin/uci -q get mysql.credentials.hostname`
DATABASE=`/sbin/uci -q get mysql.credentials.database`
USER=`/sbin/uci -q get mysql.credentials.username`
PASSWORD=`/sbin/uci -q get mysql.credentials.password`
SERVER=`/sbin/uci -q get zabbix.proxy.server`
START_POLLERS=`/sbin/uci -q get zabbix.proxy.startpollers`
CACHE_SIZE=`/sbin/uci -q get zabbix.proxy.cachesize`
if [ ! -z "$SERVER" ] && [ ! -z "$DATABASE" ] && [ ! -z "$USER" ] && [ ! -z "$PASSWORD" ]; then
echo "DBHost=$SERVER" > /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
if [ ! -z "$DBSERVER" ] && [ ! -z "$DATABASE" ] && [ ! -z "$USER" ] && [ ! -z "$PASSWORD" ] && [ ! -z "$SERVER" ]; then
echo "DBHost=$DBSERVER" > /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
echo "DBName=$DATABASE" >> /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
echo "DBUser=$USER" >> /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
echo "DBPassword=$PASSWORD" >> /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
echo "Server=$SERVER" > /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
if [ ! -z "$START_POLLERS" ]; then
echo "StartPollers=$START_POLLERS" >> /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment