mirror of
https://github.com/YunoHost-Apps/zabbix_ynh.git
synced 2024-09-03 20:36:14 +02:00
Merge branch 'master-testing' into 'master'
Merge Master testing See merge request Mickael-Martin/zabbix_ynh!22
This commit is contained in:
commit
5613cdfdca
1 changed files with 53 additions and 38 deletions
|
@ -94,6 +94,11 @@ ynh_app_setting_set $app language $language
|
||||||
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 '
|
||||||
|
Package: zabbix*
|
||||||
|
Pin: origin "repo.zabbix.com"
|
||||||
|
Pin-Priority: 999'>/etc/apt/preferences.d/zabbix-pin-999
|
||||||
|
|
||||||
echo "deb http://deb.debian.org/debian stretch non-free" >/etc/apt/sources.list.d/non-free.list
|
echo "deb http://deb.debian.org/debian stretch non-free" >/etc/apt/sources.list.d/non-free.list
|
||||||
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
|
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
|
||||||
|
@ -102,10 +107,10 @@ DEBIAN_FRONTEND=noninteractive apt-get -y download zabbix-frontend-php
|
||||||
ar x *.deb
|
ar x *.deb
|
||||||
tar xzf control.tar.gz
|
tar xzf control.tar.gz
|
||||||
sed -i 's/apache2 | httpd, //' control
|
sed -i 's/apache2 | httpd, //' control
|
||||||
tar --ignore-failed-read -cvzf control.tar.gz {post,pre}{inst,rm} md5sums control
|
tar --ignore-failed-read -cvzf control.tar.gz {post,pre}rm md5sums control
|
||||||
ar rcs zabbix-frontend-php+stretch_all-noapache2.deb debian-binary control.tar.gz data.tar.xz
|
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
|
dpkg -i --force-confmiss zabbix-frontend-php+stretch_all-noapache2.deb
|
||||||
|
|
||||||
rm -fr zabbix-*.deb
|
rm -fr zabbix-*.deb
|
||||||
DEBIAN_FRONTEND=noninteractive apt-mark hold zabbix-server-mysql zabbix-frontend-php
|
DEBIAN_FRONTEND=noninteractive apt-mark hold zabbix-server-mysql zabbix-frontend-php
|
||||||
|
@ -114,7 +119,6 @@ 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 $final_path
|
ln -s /usr/share/zabbix $final_path
|
||||||
rm $final_path/conf/zabbix.conf.php
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A MYSQL DATABASE
|
||||||
|
@ -282,6 +286,17 @@ fi
|
||||||
### `ynh_replace_string` is used to replace a string in a file.
|
### `ynh_replace_string` is used to replace a string in a file.
|
||||||
### (It's compatible with sed regular expressions syntax)
|
### (It's compatible with sed regular expressions syntax)
|
||||||
|
|
||||||
|
if [ -L '/var/www/zabbix/conf/zabbix.conf.php' ];then
|
||||||
|
unlink /var/www/zabbix/conf/zabbix.conf.php
|
||||||
|
echo "delete link /var/www/zabbix/conf/zabbix.conf.php"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e '/etc/zabbix/web/zabbix.conf.php' ];then
|
||||||
|
rm -f /etc/zabbix/web/zabbix.conf.php
|
||||||
|
echo "delete file /etc/zabbix/web/zabbix.conf.php"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
echo "<?php
|
echo "<?php
|
||||||
// Zabbix GUI configuration file.
|
// Zabbix GUI configuration file.
|
||||||
global \$DB;
|
global \$DB;
|
||||||
|
@ -300,8 +315,8 @@ global \$DB;
|
||||||
\$ZBX_SERVER_PORT = '10051';
|
\$ZBX_SERVER_PORT = '10051';
|
||||||
\$ZBX_SERVER_NAME = 'zabbix-server';
|
\$ZBX_SERVER_NAME = 'zabbix-server';
|
||||||
|
|
||||||
\$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;">/usr/share/zabbix/conf/zabbix.conf.php
|
\$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;">/var/www/zabbix/conf/zabbix.conf.php
|
||||||
|
chown www-data. /var/www/zabbix/conf/zabbix.conf.php
|
||||||
chown -R www-data. /usr/share/zabbix
|
chown -R www-data. /usr/share/zabbix
|
||||||
|
|
||||||
sed -i "s/DBName=zabbix/DBName=$db_name/g" /etc/zabbix/zabbix_server.conf
|
sed -i "s/DBName=zabbix/DBName=$db_name/g" /etc/zabbix/zabbix_server.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue