zabbix4.0安装步骤
1.配置初始环境
增大文件描述符
cat >> /etc/security/limits.conf <<EOF
root soft nofile 65535
root hard nofile 65535
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
EOF
echo "ulimit -SH 65535" >> /etc/rc.local
ulimit -SH 65535
2.配置yum环境
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
#这边要进行一个换源,要不然会被墙(最近才被墙)
复制zabbix.repo 到其他服务器
3.安装zabbix-server #只在服务端安装
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent httpd yum install zabbix-get -y #客户端只安装agent
yum install zabbix-agent -y
4.安装mysql数据库
yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
5.导入表结构
mysql_secure_installation
mysql -e "create database zabbix character set utf8 collate utf8_bin;"
mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by '123456';"
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql zabbix
6,修改配置文件
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=1qaz@WSX
vi /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
7.启动
systemctl start zabbix-server
systemctl enable zabbix-server
systemctl start httpd
systemctl enable httpd
8.进入zabbix界面
配置数据库用户密码
账号 Admin 密码 zabbix
9.导入模板
。。。
10.修改模板
cp userparameter_percona_mysql.conf /etc/zabbix/zabbix_agentd.d/
vim ss_get_mysql_stats.php #修改账号密码
vim get_mysql_stats_wrapper.sh #修改账号密码 主从同步的
11.安装测试用数据库(agent)
略