三台主机:
systemctl stop firewalld
setenforce 0
systemctl start ntpd
cd /etc/yum.repos.d/
rm -rf *
Server 主机:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y mariadb-server
systemctl start mariadb
systemctl enable mariadb
mysql
CREATE DATABASE zabbix character set utf8 collate utf8_bin;
CREATE DATABASE zabbix_proxy character set utf8 collate utf8_bin;
USE mysql;
UPDATE mysql.user SET password = PASSWORD('zabbix') WHERE user = 'root';
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@'localhost' IDENTIFIED BY 'zabbix';
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@'%' IDENTIFIED BY 'zabbix';
GRANT ALL PRIVILEGES ON zabbix_proxy.* TO 'zabbix'@'localhost' IDENTIFIED BY
'zabbix';
GRANT ALL PRIVILEGES ON zabbix_proxy.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';
FLUSH PRIVILEGES;
quit;
cd /etc/yum.repos.d/
把epel-release-latest-7.noarch放到桌面,然后rpm -ivh epel-release-latest-7.noarch
vim zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[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=1
密钥:
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591 -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
yum -y install nginx php-fpm
yum -y install zabbix-server-mysql-3.2.11
yum -y install zabbix-web-mysql
zcat /usr/share/doc/zabbix-server-mysql-3.2.*/create.sql.gz | mysql -uzabbix -p zabbix
vim /etc/zabbix/zabbix_server.conf
修改配置文件内容:
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
systemctl start zabbix-server
systemctl enable zabbix-server
vim /etc/nginx/nginx.conf
server_name _;
下面添加:
index index.html index.php;
location / {
}
下面添加:
location ~ \.php$ {
fastcgi_buffer_size 128k;
fastcgi_buffers 32 32k;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
}
vim /etc/php.ini
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
memory_limit = 128M
upload_max_filesize = 2M
date.timezone = Asia/Shanghai #添加
cp -rp /usr/share/zabbix /usr/share/nginx/html/
systemctl start nginx php-fpm
systemctl enable nginx php-fpm
Agent1:
cd /etc/yum.repos.d/
vim zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[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=1
密钥:
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591 -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
yum install -y zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
修改以下内容:
Server=192.168.1.10
ServerActive=192.168.1.10
Hostname=Zabbix Agent
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
Agent2:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y mariadb-server
systemctl start mariadb
systemctl enable mariadb
scp 192.168.1.10:/etc/yum.repos.d/* /etc/yum.repos.d/
scp 192.168.1.10:/etc/pki/rpm-gpg/* /etc/pki/rpm-gpg/
yum install -y zabbix-proxy-mysql
zcat /usr/share/doc/zabbix-proxy-mysql-3.2.*/schema.sql.gz | mysql -h 192.168.1.10 -uzabbix -p zabbix_proxy
vim /etc/zabbix/zabbix_proxy.conf
修改内容:
Server=192.168.1.10
Hostname=Zabbix Proxy #Proxy 本地的名称,此名称需要与将来在 server 端的 Web 页面上的代理
程序名称一致,名称自定义
DBHost=192.168.1.10
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=zabbix
DBPort=3306
systemctl start zabbix-proxy
systemctl enable zabbix-proxy
cd /etc/yum.repos.d/
rm -rf *
vim zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[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=1
密钥:
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591 -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
yum install -y zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
修改以下内容:
Server=192.168.1.12
ServerActive=192.168.1.12
Hostname=Zabbix Agent on Proxy
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
版本报错:
mysql> show databases;
mysql> usezabbix;
mysql> update dbversion set mandatory=3040000;
mysql> flush privileges;
错误:依赖检测失败:
libOpenIPMI.so.0()(64bit) 被 zabbix-server-mysql-3.2.11-1.el7.x86_64 需要
libOpenIPMIposix.so.0()(64bit) 被 zabbix-server-mysql-3.2.11-1.el7.x86_64 需要
libiksemel.so.3()(64bit) 被 zabbix-server-mysql-3.2.11-1.el7.x86_64 需要
libodbc.so.2()(64bit) 被 zabbix-server-mysql-3.2.11-1.el7.x86_64 需要
1.yum -y install libOpenIPMI.so.0
2.yum -y install libOpenIPMIposix.so.0
3.把iksemel-1.4-6.sdl7.x86_64.rpm包放桌面,yum -y install iksemel-1.4-6.sdl7.x86_64.rpm
4.yum -y install unixODBC