一 准备系统环境
安装Centso7 固定ip 关闭firewalld 关闭selinx 修改主机名,做解析/etc/hosts
主机名分别为zbserver zbagent1 zbagent2
二 正式安装:
#wget http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm #rpm -ivh http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm
1 安装几个基本的包:
# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get # yum -y install zabbix-agent # yum -y install mariadb mariadb-server # systemctl enable mariadb # systemctl start mariadb
2 登录mysql,导入数据库
# mysql
mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '123456'; mysql> flush privileges; mysql> \q
# cd /usr/share/doc/zabbix-server-mysql-3.0.4/ # zcat create.sql.gz | mysql -uroot zabbix
3 修改配置文件
#/etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
生效:
# systemctl enable zabbix-server.service # systemctl start zabbix-server.service
注意安装后web界面zabbix服务不能运行查看这个文件:/etc/zabbix/web/zabbix.conf.php
4 修改时区为亚洲上海
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Shanghai
三 启动服务
# systemctl enable zabbix-server.service # systemctl start zabbix-server.service # systemctl enable httpd # systemctl start httpd
web界面访问:ip:80 httpd是否正常
继续安装步骤为:http://ip/zabbix
1 是否全部为OK
2 mysql端口号改为3306 Password:123456
3 name设置为zbserver
4 点击下一步
5 出现congratulations!
四 正式登录:
Username :Admin
Password: zabbix
登录成功!
四 配置agent
1在agent1,agnet2上执行:
# yum -y install zabbix-agent
vim /etc/zabbix/zabbix_agent.conf
Server= sbserveriP,agent1,ip
ServerActive=sbserverip,agent1,ip
2 服务生效和检查:
# systemctl start zabbix-aggent.server # systemctl enable zabbix-agent.server # ss -anlp |grep :10050
3 记得在web服务端添加被监控的主机
转载于:https://blog.51cto.com/13520705/2056666