2020年10月24日土曜日

Simple installation of Zabbix Dockers on Centos8(MySQL&Postgres)

★Just paste it.

そのまま貼り付けてください。

setenforce 0

systemctl stop firewalld

systemctl disable firewalld

if [ -e "/etc/selinux/config" ];then

    sed -i -e "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config

fi

dnf install -y wget

dnf install -y git

dnf remove -y containerd.io

dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

dnf install -y docker-ce docker-ce-cli

systemctl start docker

systemctl enable docker


wget https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64

mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose


cd /opt/

git clone https://github.com/zabbix/zabbix-docker.git

cd zabbix-docker

wget https://raw.githubusercontent.com/naiggy/zabbix_docker/master/docker-compose-mysql.yaml

wget https://raw.githubusercontent.com/naiggy/zabbix_docker/master/docker-compose-postgresql.yaml

##zabbix-server, zabbix-apache-web, zabbix-agent, mysql

mv docker-compose-mysql.yaml docker-compose.yaml

##zabbix-server, zabbix-apache-web, zabbix-agent, postgresql

## mv docker-compose-postgresql.yaml docker-compose.yaml

docker-compose pull

docker-compose up -d

docker-compose ps


2020年4月23日木曜日

Amazon Linux2 Zabbix 5.0 インストール

Amazon Linux2 へZabbix 5.0 Install方法です。
順番に張り付けるとzabbix 5.0がインストールできます。

timedatectl set-timezone Asia/Tokyo
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

yum clean all
rpm -Uvh http://mirror.centos.org/altarch/7/extras/aarch64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm

rpm -Uvh http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-2-3.el7.centos.noarch.rpm

yum install -y zabbix-server-mysql zabbix-agent
yum install -y mariadb mariadb-server

##zabbix.repo 手動修正
vi /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
...
enabled=1
...

yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl
systemctl start mariadb

mysql
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
quit;

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

echo php_value[date.timezone] = `timedatectl | grep "Time zone" | awk '{print $3}'` >> /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
##zabbix_server.conf 修正
vi /etc/zabbix/zabbix_server.conf
DBPassword=zabbix

systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm mariadb

ほかのインストールスクリプトは
https://github.com/naiggy/zabbix_installer
ご参照ください。
以上です。