Skip to content

Instantly share code, notes, and snippets.

@lemajes
Last active July 30, 2018 10:32
Show Gist options
  • Select an option

  • Save lemajes/6a9ca629b884b15bbadf33bf82ba3ee6 to your computer and use it in GitHub Desktop.

Select an option

Save lemajes/6a9ca629b884b15bbadf33bf82ba3ee6 to your computer and use it in GitHub Desktop.
[Zabbix Server Installer] Install zabbix server for debian stretch #linux #script #install #zabbix #server #debian #stretch
#!/bin/bash
PASSWORD=""
wget https://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+stretch_all.deb
dpkg -i zabbix-release_3.4-1+stretch_all.deb
apt update
apt install zabbix-server-mysql
apt install zabbix-frontend-php
mysql -e "create database zabbix character set utf8 collate utf8_bin;"
mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by "$PASSWORD";"
wget https://freefr.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.11/zabbix-3.4.11.tar.gz
tar xf zabbix-3.4.11.tar.gz
cd zabbix-3.4.11/database/mysql
mysql -u zabbix -p"$PASSWORD" zabbix < schema.sql
mysql -u zabbix -p"$PASSWORD" zabbix < images.sql
mysql -u zabbix -p"$PASSWORD" zabbix < data.sql
cat << "EOF" > /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=$PASSWORD
EOF
service zabbix-server restart
update-rc.d zabbix-server enable
service apache2 restart
sed -i 's/# php_value date.timezone Europe/Riga/php_value date.timezone Europe/Paris/g' /etc/apache2/conf-enabled/zabbix.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment