Commit 73996b30 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Added CacheSize CWMP configuration option

parent 781fba50
......@@ -122,6 +122,7 @@ config zabbix 'server'
option hostname ''
option name ''
option startpollers '5'
option cachesize '32M'
endef
export ZABBIX_SERVER_CONFIG
......
......@@ -21,6 +21,7 @@ entry_execute_method_root_Zabbix() {
common_execute_method_param "$DMROOT.Zabbix.Server.Server" "1" "zabbix_get_server_server" "zabbix_set_server_server"
common_execute_method_param "$DMROOT.Zabbix.Server.Name" "1" "zabbix_get_server_name" "zabbix_set_server_name"
common_execute_method_param "$DMROOT.Zabbix.Server.StartPollers" "1" "zabbix_get_start_pollers" "zabbix_set_start_pollers"
common_execute_method_param "$DMROOT.Zabbix.Server.CacheSize" "1" "zabbix_get_cache_size" "zabbix_set_cache_size"
return 0;
;;
esac
......@@ -82,3 +83,17 @@ zabbix_set_start_pollers() {
chmod a+r /etc/config/zabbix
fi
}
zabbix_get_cache_size() {
echo `$UCI_GET zabbix.server.cachesize`
}
zabbix_set_cache_size() {
local cachesize=`$UCI_GET zabbix.server.cachesize`
if [ "$cachesize" != "$1" ]; then
$UCI_SET zabbix.server.cachesize="$1"
$UCI_COMMIT
chmod a+r /etc/config/zabbix
fi
}
......@@ -5,6 +5,7 @@ DATABASE=`/sbin/uci -q get mysql.credentials.database`
USER=`/sbin/uci -q get mysql.credentials.username`
PASSWORD=`/sbin/uci -q get mysql.credentials.password`
START_POLLERS=`/sbin/uci -q get zabbix.server.startpollers`
CACHE_SIZE=`/sbin/uci -q get zabbix.server.cachesize`
if [ ! -z "$SERVER" ] && [ ! -z "$DATABASE" ] && [ ! -z "$USER" ] && [ ! -z "$PASSWORD" ]; then
echo "DBHost=$SERVER" > /etc/zabbix_server.conf.d/zabbix_server.conf
......@@ -14,6 +15,9 @@ if [ ! -z "$SERVER" ] && [ ! -z "$DATABASE" ] && [ ! -z "$USER" ] && [ ! -z "$PA
if [ ! -z "$START_POLLERS" ]; then
echo "StartPollers=$START_POLLERS" >> /etc/zabbix_server.conf.d/zabbix_server.conf
fi
if [ ! -z "$CACHE_SIZE" ]; then
echo "CacheSize=$CACHE_SIZE" >> /etc/zabbix_server.conf.d/zabbix_server.conf
fi
else
exit 1
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