Commit de02a706 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Number of pingers to start should be configurable through CWMP

parent 1e64b363
......@@ -20,6 +20,7 @@ entry_execute_method_root_Zabbix() {
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.StartPollers" "1" "zabbix_get_start_pollers" "zabbix_set_start_pollers"
common_execute_method_param "$DMROOT.Zabbix.Proxy.StartPingers" "1" "zabbix_get_start_pingers" "zabbix_set_start_pingers"
common_execute_method_param "$DMROOT.Zabbix.Proxy.CacheSize" "1" "zabbix_get_cache_size" "zabbix_set_cache_size"
return 0;
;;
......@@ -70,6 +71,19 @@ zabbix_set_start_pollers() {
fi
}
zabbix_get_start_pingers() {
echo `$UCI_GET zabbix.proxy.startpingers`
}
zabbix_set_start_pingers() {
local startpingers=`$UCI_GET zabbix.proxy.startpingers`
if [ "$startpingers" != "$1" ]; then
$UCI_SET zabbix.proxy.startpingers="$1"
$UCI_COMMIT
chmod a+r /etc/config/zabbix
fi
}
zabbix_get_cache_size() {
echo `$UCI_GET zabbix.proxy.cachesize`
}
......
......@@ -6,6 +6,7 @@ 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`
START_PINGERS=`/sbin/uci -q get zabbix.proxy.startpingers`
CACHE_SIZE=`/sbin/uci -q get zabbix.proxy.cachesize`
if [ ! -z "$DBSERVER" ] && [ ! -z "$DATABASE" ] && [ ! -z "$USER" ] && [ ! -z "$PASSWORD" ] && [ ! -z "$SERVER" ]; then
......@@ -17,6 +18,9 @@ if [ ! -z "$DBSERVER" ] && [ ! -z "$DATABASE" ] && [ ! -z "$USER" ] && [ ! -z "$
if [ ! -z "$START_POLLERS" ]; then
echo "StartPollers=$START_POLLERS" >> /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
fi
if [ ! -z "$START_PINGERS" ]; then
echo "StartPingers=$START_PINGERS" >> /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
fi
if [ ! -z "$CACHE_SIZE" ]; then
echo "CacheSize=$CACHE_SIZE" >> /etc/zabbix_proxy.conf.d/zabbix_proxy.conf
fi
......
......@@ -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.StartPingers" "1" "zabbix_get_start_pingers" "zabbix_set_start_pingers"
common_execute_method_param "$DMROOT.Zabbix.Server.CacheSize" "1" "zabbix_get_cache_size" "zabbix_set_cache_size"
return 0;
;;
......@@ -84,6 +85,19 @@ zabbix_set_start_pollers() {
fi
}
zabbix_get_start_pingers() {
echo `$UCI_GET zabbix.server.startpingers`
}
zabbix_set_start_pingers() {
local startpingers=`$UCI_GET zabbix.server.startpingers`
if [ "$startpingers" != "$1" ]; then
$UCI_SET zabbix.server.startpingers="$1"
$UCI_COMMIT
chmod a+r /etc/config/zabbix
fi
}
zabbix_get_cache_size() {
echo `$UCI_GET zabbix.server.cachesize`
}
......
......@@ -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`
START_PINGERS=`/sbin/uci -q get zabbix.server.startpingers`
CACHE_SIZE=`/sbin/uci -q get zabbix.server.cachesize`
if [ ! -z "$SERVER" ] && [ ! -z "$DATABASE" ] && [ ! -z "$USER" ] && [ ! -z "$PASSWORD" ]; then
......@@ -15,6 +16,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 "$START_PINGERS" ]; then
echo "StartPingers=$START_PINGERS" >> /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
......
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