lihongjie0209 / myblog

4 stars 0 forks source link

Linux: Zabbix #130

Open lihongjie0209 opened 4 years ago

lihongjie0209 commented 4 years ago

安装

配置镜像

[root@localhost ~]# cat /etc/yum.repos.d/zabbix.repo 
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch 
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0

安装Zabbix

yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

安装数据库

yum install -y mysql-server

初始化数据库

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

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
lihongjie0209 commented 4 years ago

Configure the database for Zabbix server

Edit file /etc/zabbix/zabbix_server.conf DBPassword=password

Configure PHP for Zabbix frontend

Edit file

/etc/httpd/conf.d/zabbix.conf,
uncomment and set the right timezone for you.
# php_value date.timezone Europe/Riga 

Start Zabbix server and agent processes

Start Zabbix server and agent processes and make it start at system boot.

 # systemctl restart zabbix-server zabbix-agent httpd  

# systemctl enable zabbix-server zabbix-agent httpd