Add option for execute only DB scripts on proxy and server

This commit is contained in:
Alexey Pustovalov 2022-12-29 23:56:38 +09:00
parent 2a523ab4ff
commit 8d1615a33a
14 changed files with 178 additions and 52 deletions

View File

@ -466,15 +466,20 @@ update_zbx_config() {
fi
}
prepare_proxy() {
echo "Preparing Zabbix proxy"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config
}
@ -482,12 +487,16 @@ prepare_proxy() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_proxy "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -463,15 +463,20 @@ update_zbx_config() {
fi
}
prepare_proxy() {
echo "Preparing Zabbix proxy"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config
}
@ -479,12 +484,16 @@ prepare_proxy() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_proxy "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -463,15 +463,20 @@ update_zbx_config() {
fi
}
prepare_proxy() {
echo "Preparing Zabbix proxy"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config
}
@ -479,12 +484,16 @@ prepare_proxy() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_proxy "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -463,15 +463,20 @@ update_zbx_config() {
fi
}
prepare_proxy() {
echo "Preparing Zabbix proxy"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config
}
@ -479,12 +484,16 @@ prepare_proxy() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_proxy "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -463,15 +463,20 @@ update_zbx_config() {
fi
}
prepare_proxy() {
echo "Preparing Zabbix proxy"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config
}
@ -479,12 +484,16 @@ prepare_proxy() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_proxy "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -479,15 +479,20 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -495,12 +500,16 @@ prepare_server() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_server "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -476,15 +476,20 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -492,12 +497,16 @@ prepare_server() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_server "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -476,15 +476,20 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -492,12 +497,16 @@ prepare_server() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_server "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -476,15 +476,20 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -492,12 +497,16 @@ prepare_server() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_server "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -476,15 +476,20 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_mysql
check_db_connect_mysql
create_db_user_mysql
create_db_database_mysql
create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -492,12 +497,16 @@ prepare_server() {
if [ "${1#-}" != "$1" ]; then
set -- /usr/sbin/zabbix_server "$@"
fi
fi
if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -514,14 +514,19 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_postgresql
check_db_connect_postgresql
create_db_database_postgresql
create_db_schema_postgresql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -514,14 +514,19 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_postgresql
check_db_connect_postgresql
create_db_database_postgresql
create_db_schema_postgresql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -514,14 +514,19 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_postgresql
check_db_connect_postgresql
create_db_database_postgresql
create_db_schema_postgresql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################

View File

@ -514,14 +514,19 @@ update_zbx_config() {
fi
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db() {
echo "** Preparing database"
check_variables_postgresql
check_db_connect_postgresql
create_db_database_postgresql
create_db_schema_postgresql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config
}
@ -535,6 +540,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server
fi
exec "$@"
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@"
fi
#################################################