Zabbix monitoring system set up business

Zabbix installation, installation end server

1) update yum repository

We go to the official website to download a package zabbix-release-3.4-2.el7.noarch.rpm, our local installation to a virtual machine, so that we have a new yum local sources, can be installed directly zabbix Service:

[root@zabbix-server ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

installation:

[root@zabbix-server ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
[root@zabbix-server ~]# yum install -y zabbix-get-3.4.0-1.el7.x86_64
zabbix-server-mysql数据库是用来存放采集到的数据,*zabbix*-web-*mysql*的作用是Zabbix的web端会通过这些数据,来展示绘图

2) installation settings database:

[root@zabbix-server ~]# yum install -y mariadb mariadb-server
[root@zabbix-server ~]# systemctl restart mariadb
[root@zabbix-server ~]# systemctl enable mariadb
[root@zabbix-server ~]# mysqladmin -u root password 'zabbix'    #设置root密码

3, create a database and authorized account

[root@zabbix-server ~]# mysql -uroot -p'zabbix'
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;  # 创建zabbix数据库
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';										# 注意授权网段
MariaDB [(none)]> flush privileges;           # 刷新授权
MariaDB [(none)]> \q   #退出
Bye

4, the import table

We import directly into our database table can be:

[root@zabbix-server ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:                   #输入密码

3, the configuration server-side

Our database ready for the future, we're going to modify the server-side configuration files.

[root@zabbix-server ~]# cd /etc/zabbix/
[root@zabbix-server zabbix]# ls
web  zabbix_agentd.conf  zabbix_agentd.d  zabbix_server.conf
#为了方便我们以后恢复,我们把配置文件备份一下
[root@zabbix-server zabbix]# cp zabbix_server.conf zabbix_server.conf.bak
[root@zabbix-server zabbix]# vim zabbix_server.conf
 DBHost=localhost      #数据库对外的主机
 DBName=zabbix               #数据库名称
 DBUser=zabbix              #数据库用户
 DBPassword=zabbix             #数据库密码
 #这里的配置文件打开后:如果有的就不用添加了。如果是注释了的也不用取消注释。直接把内容复制粘贴过去就可以 了。

Above, our basic configuration has been completed, you can turn on the service:

[root@zabbix-server zabbix]# systemctl start zabbix-server
[root@zabbix-server zabbix]# systemctl enable zabbix-server
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.

After the open service, we will then need to confirm that we have no open ports:

[root@zabbix-server zabbix]# netstat -lntp | grep 10051
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      1574/zabbix_server  
tcp6       0      0 :::10051                :::*                    LISTEN      1574/zabbix_server

If the port is not found in the open, we're going to check the configuration file there is no problem.

4, the configuration web GUI

4, the configuration web GUI

There is a /etc/httpd/conf.d/zabbix.conffile, this profile is to help us to do a mapped file

[root@zabbix-server zabbix]# vim /etc/httpd/conf.d/zabbix.conf   #设置时区
#里面基本不用动。只需要添加一行时区即可
php_value date.timezone Asia/Shanghai       ---添加如下

Here Insert Picture Description
Next, we can start our httpdservice for:

[root@zabbix-server zabbix]# systemctl start httpd
[root@zabbix-server zabbix]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

Our service has been opened, then we can use the browser to access.

5, browser access and initial setup

We use the browser to access 192.168.246.228/zabbix, requires some initial setup the first visit, we follow the prompts:
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

6, the configuration agent terminal

When we start to monitor side configuration, we need to set up what we have been monitoring end, we installed the agent on the monitored host, set up his server, and add him to the server side, we will be able to incorporate the monitoring system went.

1) Installation zabbix

Similarly, we first installed zabbix. Both machines operate

[root@zabbix-agent-none1 ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
[root@zabbix-agent-none1 ~]# yum install zabbix-agent zabbix-sender -y

After installation is complete, we have to modify the configuration file.

2) modify the configuration file

To make a backup of the configuration file, and then to modify the configuration file:

[root@zabbix-agent-none1 ~]# cd /etc/zabbix/
[root@zabbix-agent-none1 zabbix]# ls
zabbix_agentd.conf  zabbix_agentd.d
[root@zabbix-agent-none1 zabbix]# cp zabbix_agentd.conf{,.bak}
[root@zabbix-agent-none1 zabbix]# ls
zabbix_agentd.conf  zabbix_agentd.conf.bak  zabbix_agentd.d
[root@zabbix-agent-none1 zabbix]# vim zabbix_agentd.conf   ----修改如下
Server=192.168.246.228 zabbix服务器的地址 
ServerActive=192.168.246.228 主动模式 zabbix-server-ip 
Hostname=zabbix-agent-none1 
UnsafeUserParameters=1 是否限制用户自定义 keys 使用特殊字符 1是可以启用特殊字符 0是不可以启用特殊字符
EnableRemoteCommands=0 是否允许别人执行远程操作命令,默认是禁用的,打开的话会有安全风险.

Whether to allow others to perform remote operation command is disabled by default, open, then there will be a security risk.

After modifications are complete, we save and exit. Then you can start the service:

[root@zabbix-agent-none1 zabbix]# systemctl start zabbix-agent
[root@zabbix-agent-none1 zabbix]# systemctl enable zabbix-agent

As usual, to see whether the port is on

[root@zabbix-agent-none1 zabbix]# netstat -lntp | grep 10050
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      9369/zabbix_agentd  
tcp6       0      0 :::10050                :::*                    LISTEN      9369/zabbix_agentd

It has been opened successfully. Then, we can go to add a server side.
  non2 also the same operation, the only difference is the configuration file Hostnameyou want to set zabbix-agent-none2.

Published 48 original articles · won praise 18 · views 3634

Guess you like

Origin blog.csdn.net/wx912820/article/details/105081800