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 b515a9b697
commit 7616584e2b
14 changed files with 178 additions and 52 deletions

View File

@ -478,15 +478,20 @@ update_zbx_config() {
fi fi
} }
prepare_proxy() { prepare_db() {
echo "Preparing Zabbix proxy" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config update_zbx_config
} }
@ -500,6 +505,10 @@ if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy prepare_proxy
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -475,15 +475,20 @@ update_zbx_config() {
fi fi
} }
prepare_proxy() { prepare_db() {
echo "Preparing Zabbix proxy" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config update_zbx_config
} }
@ -497,6 +502,10 @@ if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy prepare_proxy
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -475,15 +475,20 @@ update_zbx_config() {
fi fi
} }
prepare_proxy() { prepare_db() {
echo "Preparing Zabbix proxy" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config update_zbx_config
} }
@ -497,6 +502,10 @@ if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy prepare_proxy
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -475,15 +475,20 @@ update_zbx_config() {
fi fi
} }
prepare_proxy() { prepare_db() {
echo "Preparing Zabbix proxy" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config update_zbx_config
} }
@ -497,6 +502,10 @@ if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy prepare_proxy
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -475,15 +475,20 @@ update_zbx_config() {
fi fi
} }
prepare_proxy() { prepare_db() {
echo "Preparing Zabbix proxy" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_proxy() {
echo "** Preparing Zabbix proxy"
prepare_db
update_zbx_config update_zbx_config
} }
@ -497,6 +502,10 @@ if [ "$1" == '/usr/sbin/zabbix_proxy' ]; then
prepare_proxy prepare_proxy
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -519,15 +519,20 @@ update_zbx_config() {
fi fi
} }
prepare_server() { prepare_db() {
echo "** Preparing Zabbix server" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config update_zbx_config
} }
@ -541,6 +546,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server prepare_server
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -516,15 +516,20 @@ update_zbx_config() {
fi fi
} }
prepare_server() { prepare_db() {
echo "** Preparing Zabbix server" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config update_zbx_config
} }
@ -538,6 +543,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server prepare_server
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -516,15 +516,20 @@ update_zbx_config() {
fi fi
} }
prepare_server() { prepare_db() {
echo "** Preparing Zabbix server" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config update_zbx_config
} }
@ -538,6 +543,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server prepare_server
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -516,15 +516,20 @@ update_zbx_config() {
fi fi
} }
prepare_server() { prepare_db() {
echo "** Preparing Zabbix server" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config update_zbx_config
} }
@ -538,6 +543,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server prepare_server
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

@ -516,15 +516,20 @@ update_zbx_config() {
fi fi
} }
prepare_server() { prepare_db() {
echo "** Preparing Zabbix server" echo "** Preparing database"
check_variables_mysql check_variables_mysql
check_db_connect_mysql check_db_connect_mysql
create_db_user_mysql create_db_user_mysql
create_db_database_mysql create_db_database_mysql
create_db_schema_mysql create_db_schema_mysql
}
prepare_server() {
echo "** Preparing Zabbix server"
prepare_db
update_zbx_config update_zbx_config
} }
@ -538,6 +543,10 @@ if [ "$1" == '/usr/sbin/zabbix_server' ]; then
prepare_server prepare_server
fi fi
if [ "$1" == "init_db_only" ]; then
prepare_db
else
exec "$@" exec "$@"
fi
################################################# #################################################

View File

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

View File

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

View File

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

View File

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