mirror of
https://github.com/YunoHost-Apps/zabbix_ynh.git
synced 2024-09-03 20:36:14 +02:00
Merge 8654e0d4cc
into 2791ab2912
This commit is contained in:
commit
6a4157a09a
5 changed files with 33 additions and 26 deletions
|
@ -7,7 +7,7 @@ location __PATH__/ {
|
||||||
index index_http.php;
|
index index_http.php;
|
||||||
|
|
||||||
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
||||||
#client_max_body_size 50M;
|
client_max_body_size 50M;
|
||||||
|
|
||||||
try_files $uri $uri/ index.php;
|
try_files $uri $uri/ index.php;
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ name = "Zabbix"
|
||||||
description.en = "Monitoring tool for diverse IT components, including networks, servers, VMs and cloud services"
|
description.en = "Monitoring tool for diverse IT components, including networks, servers, VMs and cloud services"
|
||||||
description.fr = "Outil pour monitorer des réseaux, des serveurs, des VMs et autres services en ligne"
|
description.fr = "Outil pour monitorer des réseaux, des serveurs, des VMs et autres services en ligne"
|
||||||
|
|
||||||
version = "5.0.41~ynh3"
|
version = "6.4~ynh1"
|
||||||
|
|
||||||
maintainers = []
|
maintainers = []
|
||||||
|
|
||||||
|
@ -87,18 +87,25 @@ ram.runtime = "200M"
|
||||||
"libjs-prototype",
|
"libjs-prototype",
|
||||||
"jq",
|
"jq",
|
||||||
"libssh-4",
|
"libssh-4",
|
||||||
"php7.4-fpm",
|
|
||||||
"php7.4-bcmath",
|
|
||||||
"mariadb-server",
|
"mariadb-server",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
packages_from_raw_bash = """
|
||||||
|
if [[ $YNH_DEBIAN_VERSION == "bullseye" ]]; then
|
||||||
|
echo "php7.4-fpm", "php7.4-bcmath";
|
||||||
|
elif [[ $YNH_DEBIAN_VERSION == "bookworm" ]]; then
|
||||||
|
echo "php8.2-fpm", "php8.2-bcmath";
|
||||||
|
fi
|
||||||
|
"""
|
||||||
|
|
||||||
[resources.apt.extras.zabbix]
|
[resources.apt.extras.zabbix]
|
||||||
repo = "http://repo.zabbix.com/zabbix/5.0/debian __YNH_DEBIAN_VERSION__ main"
|
repo = "http://repo.zabbix.com/zabbix/6.4/debian __YNH_DEBIAN_VERSION__ main"
|
||||||
key = "https://repo.zabbix.com/zabbix-official-repo.key"
|
key = "https://repo.zabbix.com/zabbix-official-repo.key"
|
||||||
packages = [
|
packages = [
|
||||||
"zabbix-agent",
|
"zabbix-agent",
|
||||||
"zabbix-frontend-php",
|
"zabbix-frontend-php",
|
||||||
"zabbix-server-mysql",
|
"zabbix-server-mysql",
|
||||||
|
"zabbix-sql-scripts"
|
||||||
]
|
]
|
||||||
|
|
||||||
[resources.database]
|
[resources.database]
|
||||||
|
|
|
@ -37,7 +37,7 @@ ynh_backup --src_path="/etc/zabbix/zabbix_agentd.conf"
|
||||||
ynh_backup --src_path="/etc/zabbix/zabbix_agentd.d"
|
ynh_backup --src_path="/etc/zabbix/zabbix_agentd.d"
|
||||||
|
|
||||||
# Backup sudo file
|
# Backup sudo file
|
||||||
ynh_backup --src_path="/etc/sudoers.d/zabbix"
|
# ynh_backup --src_path="/etc/sudoers.d/zabbix"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE MYSQL DATABASE
|
# BACKUP THE MYSQL DATABASE
|
||||||
|
|
|
@ -23,7 +23,7 @@ ynh_script_progression --message="Import default data in database..."
|
||||||
export mysqlconn="mysql --user=$db_user --password=$db_pwd --database=$db_name"
|
export mysqlconn="mysql --user=$db_user --password=$db_pwd --database=$db_name"
|
||||||
$mysqlconn -e "ALTER DATABASE $db_name CHARACTER SET utf8 COLLATE utf8_general_ci;"
|
$mysqlconn -e "ALTER DATABASE $db_name CHARACTER SET utf8 COLLATE utf8_general_ci;"
|
||||||
|
|
||||||
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | $mysqlconn
|
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | $mysqlconn
|
||||||
|
|
||||||
convert_ZabbixDB
|
convert_ZabbixDB
|
||||||
|
|
||||||
|
@ -34,23 +34,23 @@ $mysqlconn -e "UPDATE \`config\` SET \`http_auth_enabled\` = '1', \`http_login_f
|
||||||
surname=$(ynh_user_get_info "$admin" lastname)
|
surname=$(ynh_user_get_info "$admin" lastname)
|
||||||
name=$(ynh_user_get_info "$admin" firstname)
|
name=$(ynh_user_get_info "$admin" firstname)
|
||||||
|
|
||||||
$mysqlconn -e "INSERT INTO \`users\` (\`userid\`,\`alias\`, \`name\`, \`surname\`, \`passwd\`, \`url\`, \`autologin\`, \`autologout\`, \`lang\`, \`refresh\`, \`type\`, \`theme\`, \`attempt_failed\`, \`attempt_ip\`, \`attempt_clock\`, \`rows_per_page\`) VALUES (3,'$admin', '$admin', '$admin', '5fce1b3e34b520afeffb37ce08c7cd66', '', 0, '0', '$language', '30s', 3, 'default', 0, '', 0, 50);"
|
#$mysqlconn -e "INSERT INTO \`users\` (\`userid\`,\`username\`, \`name\`, \`surname\`, \`passwd\`, \`url\`, \`autologin\`, \`autologout\`, \`lang\`, \`refresh\`, \`theme\`, \`attempt_failed\`, \`attempt_ip\`, \`attempt_clock\`, \`rows_per_page\`) VALUES (3,'$admin', '$admin', '$admin', '5fce1b3e34b520afeffb37ce08c7cd66', '', 0, '0', '$language', '30s', 3, 'default', 0, '', 0, 50);"
|
||||||
$mysqlconn -e "INSERT INTO \`users_groups\` (\`id\`, \`usrgrpid\`, \`userid\`) VALUES (5, 7, 3);"
|
#$mysqlconn -e "INSERT INTO \`users_groups\` (\`id\`, \`usrgrpid\`, \`userid\`) VALUES (5, 7, 3);"
|
||||||
|
|
||||||
#users creation in zabbix database
|
#users creation in zabbix database
|
||||||
i=4
|
#i=4
|
||||||
for user in $(ynh_user_list);
|
#for user in $(ynh_user_list);
|
||||||
do
|
#do
|
||||||
if [ "$user" != "$admin" ]
|
# if [ "$user" != "$admin" ]
|
||||||
then
|
# then
|
||||||
surname=$(ynh_user_get_info --username="$user" --key=lastname)
|
# surname=$(ynh_user_get_info --username="$user" --key=lastname)
|
||||||
name=$(ynh_user_get_info --username="$user" --key=firstname)
|
# name=$(ynh_user_get_info --username="$user" --key=firstname)
|
||||||
$mysqlconn -e "INSERT INTO \`users\` (\`userid\`, \`alias\`, \`name\`, \`surname\`, \`passwd\`, \`url\`, \`autologin\`, \`autologout\`, \`lang\`, \`refresh\`, \`type\`, \`theme\`, \`attempt_failed\`, \`attempt_ip\`, \`attempt_clock\`, \`rows_per_page\`) VALUES ($i,'$user', '$name', '$surname', '5fce1b3e34b520afeffb37ce08c7cd66', '', 0, '0', '$language', '30s', 1, 'default', 0, '', 0, 50);"
|
# $mysqlconn -e "INSERT INTO \`users\` (\`userid\`, \`alias\`, \`name\`, \`surname\`, \`passwd\`, \`url\`, \`autologin\`, \`autologout\`, \`lang\`, \`refresh\`, \`type\`, \`theme\`, \`attempt_failed\`, \`attempt_ip\`, \`attempt_clock\`, \`rows_per_page\`) VALUES ($i,'$user', '$name', '$surname', '5fce1b3e34b520afeffb37ce08c7cd66', '', 0, '0', '$language', '30s', 'default', 0, '', 0, 50);"
|
||||||
i=$((i+1))
|
# i=$((i+1))
|
||||||
fi
|
# fi
|
||||||
done
|
#done
|
||||||
|
|
||||||
disable_guest_user
|
#disable_guest_user
|
||||||
|
|
||||||
set_mediatype_default_yunohost
|
set_mediatype_default_yunohost
|
||||||
|
|
||||||
|
@ -95,13 +95,13 @@ update_initZabbixConf
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP APPLICATION WITH CURL
|
# SETUP APPLICATION WITH CURL
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up application with CURL..."
|
#ynh_script_progression --message="Setting up application with CURL..."
|
||||||
|
|
||||||
import_template
|
#import_template
|
||||||
|
|
||||||
link_template
|
#link_template
|
||||||
|
|
||||||
disable_admin_user
|
#disable_admin_user
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
|
|
@ -49,7 +49,7 @@ if [ ! -L /etc/zabbix/zabbix_agentd.d ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore sudo file
|
# Restore sudo file
|
||||||
ynh_restore_file --origin_path="/etc/sudoers.d/zabbix"
|
# ynh_restore_file --origin_path="/etc/sudoers.d/zabbix"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEM CONFIGURATIONS
|
# RESTORE SYSTEM CONFIGURATIONS
|
||||||
|
|
Loading…
Add table
Reference in a new issue