Skip to content

Instantly share code, notes, and snippets.

@cinco
Forked from dcnl1980/zabbix-server.sh
Last active May 23, 2017 17:58
Show Gist options
  • Save cinco/3cb510b626a3bd1b7fb26930cea7dbbe to your computer and use it in GitHub Desktop.
Save cinco/3cb510b626a3bd1b7fb26930cea7dbbe to your computer and use it in GitHub Desktop.
Zabbix Server Installation (Ubuntu 16.04 Xenial)
#!/bin/sh
apt update && apt install wget htop curl nano ssh -y
wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb && apt-get update
export DEBIAN_FRONTEND=noninteractive
apt install zabbix-server-mysql zabbix-frontend-php -y
apt install php-mbstring php-bcmath php-xmlwriter -y
mysql -uroot -p -e "CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin";
mysql -uroot -p -e "CREATE USER 'zabbix'@'localhost'";
mysql -uroot -p -e "GRANT ALL ON zabbix.* TO 'zabbix'@'localhost' identified by 'zabbix'";
mysql -uroot -p -e "SHOW DATABASES";
mysql -uroot -p -e "SELECT host, user FROM mysql.user";
mysql -uroot -p -e "SHOW GRANTS FOR 'zabbix'@'localhost'";
zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uroot zabbix
sed -i 's/# DBPassword=/DBPassword=zabbix/g' /etc/zabbix/zabbix_server.conf
sed -i 's/# php_value date.timezone Europa\/Riga/php_value date.timezone America\/Sao_Paulo/g' /etc/apache2/conf-enabled/zabbix.conf
service zabbix-server start
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment