In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Understand the method of Lnmp to build zabbix operation and maintenance monitoring system? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
The purpose of use?
Need to do a log monitoring in the company project, the first choice is efk, but efk has relatively little information and has no contact with these products before, so it is difficult to use. So zabbix is chosen as the operation and maintenance monitoring system of the project.
What can zabbix do?
Zabbix is mainly used for network monitoring, system monitoring, application monitoring and other scenarios. Zabbix is divided into server side and agent side. The first half of the article talks about the installation operation of server side, and the end of the article explains the installation operation of server side.
Build an environment
Centos7.0,lnmp integrated environment (mysql5.7,php7.2), zabbix4.0 version. The manual gives you the following installation methods:
Source installation (this article uses source installation) binary installation container installation, such as docker installation
Installation steps
1. Installation of lnmp environment due to the lnmp integration package, the installation is very convenient, so directly install the official website manual can be installed with one click. Install the zabbix server
# installation depends on yum install net-snmp-devel libxml2-devel libcurl-devel libevent-devel mysql-devel# download installation package (the installation package can be placed directly in the program directory of web) wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/4.2.3/zabbix-4.2.3.tar.gz/download# decompresses tar zxvf zabbix-4.2.3.tar.gz# compilation (I use mysql here So mysql dependency is used when compiling. If other databases are compiled according to the official website manual, other databases depend on) cd zabbix-4.2.3./configure-- prefix=/web/data/zabbix-3.4.4/-- enable-server-- enable-agent-- with-mysql-- with-net-snmp-- with-libcurl-- with-libxml2# starts to install make & & make install
3. Creating a zabbix user Why create a separate user for zabbix is simple, because of security issues. For security reasons, zabbix runs only with ordinary users. If your current user is called ttlsa, then if you run him, he will run as ttlsa. But if you run zabbix in root, zabbix will actively use the zabbix user to run it. But if your system doesn't have a user named zabbix, you need to create a user.
Groupadd zabbixuseradd-g zabbix zabbix
4. The database-related configuration takes security into account, so here we also create a separate database user for zabbix, the database name is also zabbix. The MySQL user created in this article is zabbix, and the password can be defined according to yourself.
5. Import data prepared in advance by zabbix. . View database files
Cd / home/wwwroot/zabbix-4.2.3/database & & ls drwxr-xr-x 2 mysql mysql 4096 June 6 02:23 elasticsearchdrwxr-xr-x 2 mysql mysql 4096 June 13 10:10 ibm_db2-rw-r--r-- 1 root root 21474 June 13 10:10 Makefile-rw-r--r-- 1 mysql mysql 155 June 6 02:23 Makefile.am-rw-r--r-- 1 mysql mysql 21722 June 6 02:24 Makefile. Indrwxr-xr-x 2 mysql mysql 4096 June 13 10:10 mysqldrwxr-xr-x 2 mysql mysql 4096 June 13 10:10 oracledrwxr-xr-x 2 mysql mysql 4096 June 13 10:10 postgresqldrwxr-xr-x 2 mysql mysql 4096 June 13 10:10 sqlite3
. The above directories are for different data, zabbix comes with different database files, we are using MySQL, so we only need to care about the files under the mysql directory, the following are the files we need. Schema.sql file count data table structure, images.sql is the related picture data structure, data.sql is the related data structure.
-rw-r--r-- 1 mysql mysql 4018823 June 6 02:24 data.sql-rw-r--r-- 1 mysql mysql 1978341 June 6 02:23 images.sql-rw-r--r-- 1 root root 15420 June 13 10:10 Makefile-rw-r--r-- 1 mysql mysql 392 June 6 02:23 Makefile.am-rw-r--r-- 1 mysql mysql 15711 June 6 02:24 Makefile.in-rw- Rmuri rMui-1 mysql mysql 142074 June 6 02:24 schema.sql
. Log in and import the database
# Login data mysql-u root-p # Select and implement the created zabbix database use zabbix# and import the database file source / home/wwwroot/zabbix-4.2.3/database schema.sqlsource / home/wwwroot/zabbix-4.2.3/database data.sqlsource / home/wwwroot/zabbix-4.2.3/database images.sql in turn
Configure virtual domain name
The zabbix built in this paper is built in the virtual environment of centos7.0, and a virtual domain name is built to facilitate access. You only need to configure a nginx file. If the lnmp integrated development environment is used in the environment, use the commands that come with the lnmp integrated development environment to create
Lnmp vhost add # specifies the directory of root, pathinfo mode should be enabled for / home/wwwroot/zabbix-4.2.3/frontends/php#, WordPress should be selected for # rwriter (not mandatory)
Add the above self-configured virtual domain name to the hosts file of this location (take .dev.zabbix.com as an example)
Use zabbix
When we log in, we will be prompted for some installation information, and we will follow the prompts to fill in. After installation, it automatically jumps to the login page, either in guest mode or in administrator mode.
Guest mode is just a simple browsing operation. The default administrative account of the system is Admin and the password is zabbix. The following information may be prompted when using the administrator account. For example, if it is caused by our web service, if we are using Apache, the following problems will not occur.
The root cause of the problem is that zabbix php locates the problem. It is found that zabbix sets permissions based on php file names, such as index.php and dashboard.php. If cgi.fix_pathinfo is set to 0, php cannot get the file name requested by url, such as accessing index.php and locating permissions even if index.php is not obtained. This error occurs. The solution is to modify the configuration of the php.ini file.
Change cgi.fix_pathinfo=0 to cgi.fix_pathinfo=1
At this point, we can log in and see the following interface.
Install the agent side
Configuration file directory: / etc/zabbix/zabbix_agentd.conf
1. Set up a firewall on the monitored host to allow port 10050 of zabbix-agent to pass through 2. Execute yum list | grep zabbix, locate the agent installation package for zabbix and install it, such as the package name zabbix-agent.x86_643. Change in / etc/zabbix/zabbix_agentd.conf: Server= ServerActive= Hostname=4. Set up the zabbix-agent service self-startup and startup service systemctl enable zabbix-agent.service boot self-startup systemctl start zabbix-agent.service startup service thank you for reading! After reading the above, do you have a general understanding of Lnmp's method of building a zabbix operation and maintenance monitoring system? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.