|
@@ -44,33 +44,42 @@ domain=$(ynh_app_setting_get $app domain)
|
|
|
#admin=$(ynh_app_setting_get $app admin) #not used
|
|
#admin=$(ynh_app_setting_get $app admin) #not used
|
|
|
is_public=$(ynh_app_setting_get $app is_public)
|
|
is_public=$(ynh_app_setting_get $app is_public)
|
|
|
#language=$(ynh_app_setting_get $app language) #not used
|
|
#language=$(ynh_app_setting_get $app language) #not used
|
|
|
|
|
+nonfree=$(ynh_app_setting_get $app nonfree)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
|
# INSTALL DEPENDENCIES
|
|
# INSTALL DEPENDENCIES
|
|
|
#=================================================
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
+ynh_print_info "Install Zabbix repository"
|
|
|
|
|
+
|
|
|
wget "https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-2+stretch_all.deb"
|
|
wget "https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-2+stretch_all.deb"
|
|
|
dpkg -i zabbix-release_*.deb
|
|
dpkg -i zabbix-release_*.deb
|
|
|
rm zabbix-release_*.deb
|
|
rm zabbix-release_*.deb
|
|
|
-echo "deb http://deb.debian.org/debian stretch non-free" >/etc/apt/sources.list.d/non-free.list
|
|
|
|
|
|
|
+
|
|
|
|
|
+ynh_print_info "Install non-free repository with pinning"
|
|
|
|
|
+if [ $nonfree ];then
|
|
|
|
|
+ ynh_restore_file "/etc/apt/sources.list.d/non-free.list"
|
|
|
|
|
+ ynh_restore_file "/etc/apt/preferences.d"
|
|
|
|
|
+
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+ynh_print_info "Update and install dependencies"
|
|
|
ynh_package_update
|
|
ynh_package_update
|
|
|
-ynh_install_app_dependencies libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0 php7.0 php-bcmath php7.0-bcmath ttf-dejavu-core php7.0-bcmath patch smistrip unzip wget fping libcap2-bin libiksemel3 libopenipmi0 libpam-cap libsnmp-base libsnmp30 snmptrapd snmpd snmp-mibs-downloader libjs-prototype zabbix-server-mysql zabbix-agent
|
|
|
|
|
-yunohost service add snmpd -d "Management of SNMP Daemon"
|
|
|
|
|
-DEBIAN_FRONTEND=noninteractive apt-get -y download zabbix-frontend-php
|
|
|
|
|
-ar x ./*.deb
|
|
|
|
|
-tar xzf control.tar.gz
|
|
|
|
|
-ynh_replace_string "apache2 | httpd, " "" control
|
|
|
|
|
-tar --ignore-failed-read -cvzf control.tar.gz {post,pre}{inst,rm} md5sums control
|
|
|
|
|
-ar rcs zabbix-frontend-php+stretch_all-noapache2.deb debian-binary control.tar.gz data.tar.xz
|
|
|
|
|
-
|
|
|
|
|
-dpkg -i zabbix-frontend-php+stretch_all-noapache2.deb
|
|
|
|
|
-
|
|
|
|
|
-rm -fr zabbix-*.deb
|
|
|
|
|
|
|
+if [ $nonfree ];then
|
|
|
|
|
+ ynh_install_app_dependencies libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0 php7.0 php-bcmath php7.0-bcmath ttf-dejavu-core php7.0-bcmath patch smistrip unzip wget fping libcap2-bin libiksemel3 libopenipmi0 libpam-cap libsnmp-base libsnmp30 snmptrapd snmpd snmp-mibs-downloader libjs-prototype jq
|
|
|
|
|
+else
|
|
|
|
|
+ ynh_install_app_dependencies libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0 php7.0 php-bcmath php7.0-bcmath ttf-dejavu-core php7.0-bcmath patch smistrip unzip wget fping libcap2-bin libiksemel3 libopenipmi0 libpam-cap libsnmp-base libsnmp30 snmptrapd snmpd libjs-prototype jq
|
|
|
|
|
+
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+ynh_package_install zabbix-server-mysql zabbix-agent zabbix-frontend-php
|
|
|
DEBIAN_FRONTEND=noninteractive apt-mark hold zabbix-server-mysql zabbix-frontend-php
|
|
DEBIAN_FRONTEND=noninteractive apt-mark hold zabbix-server-mysql zabbix-frontend-php
|
|
|
|
|
|
|
|
-ynh_replace_string "# fr_FR.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" /etc/locale.gen
|
|
|
|
|
|
|
+sed -i "s/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/g" /etc/locale.gen
|
|
|
locale-gen
|
|
locale-gen
|
|
|
|
|
|
|
|
|
|
+
|
|
|
ln -s /usr/share/zabbix /var/www/zabbix
|
|
ln -s /usr/share/zabbix /var/www/zabbix
|
|
|
rm $final_path/conf/zabbix.conf.php
|
|
rm $final_path/conf/zabbix.conf.php
|
|
|
|
|
|
|
@@ -136,9 +145,6 @@ ynh_restore_file "/etc/zabbix"
|
|
|
|
|
|
|
|
systemctl enable zabbix-server && systemctl start zabbix-server
|
|
systemctl enable zabbix-server && systemctl start zabbix-server
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
|
# SETUP LOGROTATE
|
|
# SETUP LOGROTATE
|
|
|
#=================================================
|
|
#=================================================
|