zabbix3.4 monitoring system installation deployment


 

1.  Modify the hostname

vim / etc / hostname, modify zabbix-server

 

2.  NIC configuration

vim /etc/sysconfig/network-scripts/ifcfg-eno16780032

 

3.  Turn off the firewall and selinux

systemctl stop firewalld.service

systemctl disable firewalld.service

 

4.  Close selinux

vim / etc / selinux / config, modified as: SELINUX = disabled

 

5.  initializing the system (kernel optimization, non-mandatory)

 

6.  Configuration yum source

rpm -Uvh https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

yum clean all

yum makecache

 

7.  Installation zabbix server

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

 

8. 启动zabbix-server zabbix-agent httpd

systemctl restart zabbix-server zabbix-agent httpd

systemctl enable zabbix-server zabbix-agent httpd

 

9.  Download the database server and client

wget https://cdn.mysql.com/archives/mysql-5.6/MySQL-server-5.6.43-1.el7.x86_64.rpm

wget https://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-client-5.6.43-1.el7.x86_64.rpm

 

10. The  database server and client installation

rpm -ivh MySQL-server-5.6.43-1.el7.x86_64.rpm --force -nodeps

rpm -ivh MySQL-client-5.6.43-1.el7.x86_64.rpm --force --nodeps

 

11.  create the relevant directories and directory authorization

mkdir -p /data/mysql/

chown -R mysql.mysql /data/mysql/

 

12. The  modified profile database

vim /etc/my.cnf

 

[client]

port                           = 3306

socket                         = /data/mysql/mysql.sock

 

[mysqld]

user                           = mysql

port                           = 3306

character-set-server           = utf8

default-storage-engine         = InnoDB

socket                         = /data/mysql/mysql.sock

pid-file                       = /data/mysql/mysql.pid

 

# DATA STORAGE #

datadir                        = /data/mysql/

innodb_data_file_path          = ibdata1:1024M:autoextend

innodb_data_home_dir           = /data/mysql/

innodb_log_group_home_dir      = /data/mysql/

 

# LOGGING #

log-error                      = /data/mysql/mysql-error.log

log-queries-not-using-indexes  = 0

slow-query-log                 = 1

long_query_time                = 2

slow-query-log-file            = /data/mysql/mysql-slow.log

lower_case_table_names         = 1

skip-grant-tables

 

13.初始化数据库

/usr/bin/mysql_install_db --user=mysql --datadir=/data/mysql --pid-file=/data/mysql/mysql.pid

 

14. 启动数据库及设置root密码

/etc/init.d/mysql restart

mysqladmin -h 127.0.0.1 -uroot -p password

 

15. 登录数据库,mysql -uroot -p

 

16. 创建zabbix数据库 zabbix数据库的密码为zabbix

create database zabbix character set utf8 collate utf8_bin;

grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'

 

17. 导入数据库

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

 

18. 编辑Zabbix前端PHP配置,主要是更改时区

vim /etc/httpd/conf.d/zabbix.conf

修改此行:php_value date.timezone Asia/Shanghai

systemctl restart httpd


19. 浏览器访问并配置

http://192.168.8.133/zabbix/ 



图片1.png



图片2.png

图片3.png

图片4.png

图片5.png

图片6.pngspacer.gif

 


20. 修改为中文界面

 

Adminstration-->Users下面找到对应的用户,点进去,找到Language,选择Chinese(zh_CN),更新后,刷新页面即可切换为中文界面。

 

 

21. zabbix客户端安装配置

 

centos7:

 

rpm -Uvh https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

 

yum -y install  zabbix-agent

systemctl enable zabbix-agent

 

sed -i 's/Server=127.0.0.1/Server=192.168.8.133/' /etc/zabbix/zabbix_agentd.conf

sed -i 's/ServerActive=127.0.0.1/ServerActive==192.168.8.133/' /etc/zabbix/zabbix_agentd.conf

echo "192.168.8.133    Zabbix server" >> /etc/hosts

 

systemctl restart  zabbix-agent


 

centos6:

 

rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm

 

yum install zabbix-agent

chkconfig zabbix-agent on

 

sed -i 's/Server=127.0.0.1/Server=192.168.8.133/' /etc/zabbix/zabbix_agentd.conf

sed -i 's/ServerActive=127.0.0.1/ServerActive==192.168.8.133/' /etc/zabbix/zabbix_agentd.conf

echo "192.168.8.133    Zabbix server" >> /etc/hosts

 

service zabbix-agent start



配置zabbix-server服务器的hosts

vim /etc/hosts

包含服务端和所有客户端的主机


根据监控需要完成监控项目的配置




Guess you like

Origin blog.51cto.com/13531801/2465298