Operation and maintenance monitoring Zabbix deployment - detailed graphic explanation

Operation and maintenance monitoring Zabbix deployment

Introduction

Zabbix was created by Alexei Vladishev. Currently, Zabbix SIA, the company founded by him, is actively continuously developing and updating maintenance and providing technical support services for users.

Zabbix is ​​aEnterprise-level distributed open source monitoring solution

Zabbix software canmonitorNumerous network parameters and serverhealth, integrity. Zabbix uses a flexible alerting mechanism that allows users to configure email-based alerts for almost any event. This allows users to quickly respond to server issues. Zabbix provides excellent reporting and data visualization capabilities based on stored data. These features make Zabbix ideal for capacity planning.

Install

Installation overall steps:

  1. Prepare Linux server (virtual machine)
  2. Install Mysql
  3. Install zabbix (including server agent web)
  4. Configure mysql to create a table structure for zabbix
  5. Configure zabbix server
  6. Start and turn on autostart

1574338996145

Preparations before installation - Mysql

MysqlTo install ZabbixServer, you need to install the database first

course useMysql 5.7

installation steps:

# 安装Mysql yum库
rpm -Uvh http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm

# yum安装Mysql
yum -y install mysql-community-server

# 启动Mysql设置开机启动
systemctl start mysqld
systemctl enable mysqld

# 检查Mysql服务状态
systemctl status mysqld

# 第一次启动mysql,会在日志文件中生成root用户的一个随机密码,使用下面命令查看该密码
grep 'temporary password' /var/log/mysqld.log

# 修改root用户密码
mysql -u root -p -h localhost
Enter password:
 
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root!@#$';

# 如果你想设置简单密码,需要降低Mysql的密码安全级别
set global validate_password_policy=LOW; # 密码安全级别低
set global validate_password_length=4;	 # 密码长度最低4位即可

# 然后就可以用简单密码了(课程中使用简单密码,为了方便,生产中不要这样)
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
mysql> grant all privileges on *.* to root@'%' identified by 'root';

Install Zabbix Server and Zabbix Agent

For the initial installation, we first install ZabbixServer and install the Agent locally on the Server.

Open the official website download page: https://www.zabbix.com/download?zabbix=4.0&os_distribution=centos&os_version=7&db=mysql

1571981197131

Select the corresponding version, and then the following official website gives the specific installation command, use rpmand yumto install.

Internet is required.

以下内容来自官方页面

a. Install Zabbix yum library

documentation

rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
yum clean all

b. Install Zabbix Server, front end, Agent

yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
# 如果只需要安装Agent的话
yum -y install zabbix-agent

c. Initialize the Mysql database

documentation

Operate in Mysql

# 登录Mysql 数据库
mysql -uroot -pYourPassword
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
# 或者: grant all privileges on zabbix.* to zabbix@'%' identified by 'zabbix';
mysql> quit;

Test whether you can log in to Mysql remotely on the Zabbix Server server, and if you can log in, continue down.

Import initial schema and data. You will be prompted to enter your newly created password.

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

d. Configure the database for Zabbix Server

Edit file /etc/zabbix/zabbix_server.conf

DBPassword=password
DBHost=mysql-host-ip-or-hostname

e. Configure the PHP front end of Zabbix

Edit file /etc/httpd/conf.d/zabbix.conf, uncomment and set the right timezone for you.# php_value date.timezone Asia/Shanghai

Start Zabbix server and agent processes and make it start at system boot:

systemctl restart zabbix-server zabbix-agent httpd # 启动、重启
systemctl enable zabbix-server zabbix-agent httpd  # 开机自启

Now your Zabbix server is up and running!

Configure zabbix front end (WEB UI)

Open:http://192.168.88.131/zabbix

You can enter the Zabbix page. When you open it for the first time, you will enter the settings page, as shown in the figure:

1571993951841

Click Next to check whether the corresponding settings are normal

1571994018126

If everything is ok, click Next.

Configure DB connection

1571994069689

Fill in according to the specific situation

Configure Server details

1571994111921

Specific configuration is enough, Name indicates the name of the Zabbix service, named hereITHEIMA-TEST

Summary preview before installation

Check and confirm that there is no problem, then go to the next step

1571994206902

configuration complete

1571994221531

Initial administrator account Admin password zabbix

After entering the account password, you can enter the zabbix page.

As shown below:

1571994287036

Now there is a brand new zabbix waiting for us to explore.

Guess you like

Origin blog.csdn.net/qq_52966822/article/details/130780245