Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Construction and deployment of Zabbix platform based on rhel7.2 (2)

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Construction and deployment of Zabbix platform based on rhel7.2 (2)

1. Installation of the monitoring system Zabbix-3.2.1

Operation on the zabbix-server side

Note: the zabbix server should install the LNMP environment in advance (the installation directory of mysql,nginx,php5 is / usr/local)

(1) create a user running zabbix

[root@ ~] # groupadd zabbix

[root@] # useradd-g zabbix

[root@ ~] # grep zabbix / etc/passwd

Zabbix:x:1001:1001::/home/zabbix:/bin/bash

(2) install dependency packages such as libcurl and net-snmp

[root@ ~] # yum-y install net-snmp net-snmp-devel curl-devel java-1.8.0-openjdkjava-1.8.0-openjdk-devel OpenIPMI-devel libssh3-devel

Note: the OpenIPMI-devel and libssh3-devel packages must be installed using the centos online yum software source.

Here is how I installed it:

[root@ ~] # yum-y install net-snmp net-snmp-devel curl-devel java-1.8.0-openjdkjava-1.8.0-openjdk-devel

[root@ ~] # yum install-y OpenIPMI.x86_64

[root@ ~] # yum install-y libssh3.x86_64

(3) install Fping

[root@localhost src] # tar-zxvf fping-3.4.tar.gz

[root@localhost src] # cd fping-3.4

[root@localhost fping-3.4] # / configure & & make & & make install

Change the master and group, and change the file permissions:

[root@localhost fping-3.4] # chown root:zabbix / usr/local/sbin/fping

[root@localhost fping-3.4] # chmod 4710 / usr/local/sbin/fping

[root@localhost fping-3.4] # ll-d / usr/local/sbin/fping

-rws--x--- 1 root zabbix 82996 Jun 5 09:25 / usr/local/sbin/fping

(4) install zabbix Server

[root@localhost src] # tar-zxvf zabbix-3.2.3.tar.gz

[root@localhost zabbix-3.2.3] # / configure-prefix=/usr/local/zabbix-- enable-server-- enable-agent-- enable-java-- with-mysql=/usr/local/mysql/bin/mysql_config-- with-net-snmp-- with-libcurl--with-openipmi & & make & & make install

Note:

⑴ is best compiled with the parameter-- enable-java, which is convenient for subsequent monitoring of the use of tomcat programs.

⑵-with-ssh3 does not need to install Zabbix agent on the client server. If you need to use ssh check, you need to add this at the time of compilation. You need at least version 1.0.0 of libssh3, and you need to install the ssh development package.

⑶-with-openipmi users can use IPMI to monitor the physical characteristics of the server, such as temperature, voltage, fan operation, power supply, etc.

If ⑷ adds-- enable-proxy, it generates two commands, get and sender. As follows, it is used to receive the information from agent and send it to server at the same time.

(5) create a soft connection

[root@localhost zabbix-3.2.3] # ln-s / usr/local/zabbix/bin/* / usr/local/bin/

[root@localhost zabbix-3.2.3] # ln-s / usr/local/zabbix/sbin/* / usr/local/sbin/

II. Zabbix server configuration and startup

(1) Log in to the database and create zabbix users and databases

[root@localhost zabbix-3.2.3] # mysql-uroot-p123456

Create a zabbix database:

Mysql > create database zabbix

Query OK, 1 row affected (0.00 sec)

Create a zabbix user and grant permissions:

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

Query OK, 0 rows affected, 1 warning (0.00 sec)

Mysql > exit

Bye

(2) Import zabbix initial data

First, change to the directory of zabbix decompression:

[root@localhost zabbix-3.2.3] # cd database/mysql

[root@localhost mysql] # pwd

/ usr/src/zabbix-3.2.3/database/mysql

[root@localhost mysql] # ls

Data.sql p_w_picpaths.sql schema.sql

Then import the initial data of zabbix:

[root@localhost mysql] # mysql-uzabbix-pzabbix-hlocalhost zabbix

< schema.sql mysql: [Warning] Using a password on the command line interface can be insecure. [root@localhost mysql]# mysql -uzabbix -pzabbix -hlocalhost zabbix < p_w_picpaths.sql mysql: [Warning] Using a password on the command line interface can be insecure. [root@localhost mysql]# mysql -uzabbix -pzabbix -hlocalhost zabbix < data.sql mysql: [Warning] Using a password on the command line interface can be insecure. (3)编辑 /usr/local/zabbix/etc/zabbix_server.conf [root@localhost mysql]# vim /usr/local/zabbix/etc/zabbix_server.conf

Create zabbix log files and change file permissions:

[root@localhost] # mkdir-p / usr/local/zabbix/logs

[root@localhost] # chown-R zabbix:zabbix / usr/local/zabbix

[root@localhost] # ll-d / usr/local/zabbix/logs

Drwxr-xr-x 2 zabbix zabbix 4096 Jun 5 10:09 / usr/local/zabbix/logs

(4) start the zabbix service

[root@localhost] # zabbix_server-c / usr/local/zabbix/etc/zabbix_server.conf

Zabbix_server: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory

If an error occurs and the startup fails, the following analysis and resolution of the error report:

As can be seen from the above, it is said that the library file libmysqlclient.so.20 was not found. Let's use the find command to search to see if this file is available:

[root@localhost ~] # find /-name libmysqlclient.so.20

/ usr/src/mysql-5.7.13/libmysql/libmysqlclient.so.20

/ usr/local/mysql/lib/libmysqlclient.so.20

The library file libmysqlclient.so.20 does exist. Now let's take a look at the ld.so.conf file to see if there is a path to libmysqlclient.so.20.

[root@localhost ~] # cat / etc/ld.so.conf

Include ld.so.conf.d/*.conf

You can see that there is no libmysqlclient.so.20 path in it, so we can add the libmysqlclient.so.20 path to the ld.so.conf.

Note: the ld.so.conf file is the directory setting for the system to search for dynamic link libraries. The address written in this file will automatically go to these directories to find the dynamic library files you need when running the program.

The solution is as follows:

1. Enter the ld.so.conf file

[root@localhost ~] # vim / etc/ld.so.conf

two。 Add two lines at the end

3. Let its changes take effect.

[root@localhost ~] # ldconfig

4. Try to start again:

[root@localhost ~] # zabbix_server-c / usr/local/zabbix/etc/zabbix_server.conf [root@localhost ~] # netstat-lnp | grep zabbix

Tcp 00 0.0.0.0 10051 0.0.0.015 * LISTEN 13887/zabbix_server

From the figure above, we can see that there is no error after startup, and the startup is successful. To confirm whether the service is really enabled, we can see that the default port number for zabbix_server listening is 10051.

(5) add boot startup script

[root@localhost zabbix-3.2.3] # cp misc/init.d/fedora/core/zabbix_server / etc/rc.d/init.d/zabbix_server

[root@localhost zabbix-3.2.3] # cp misc/init.d/fedora/core/zabbix_agentd / etc/rc.d/init.d/zabbix_agentd

[root@localhost] # chkconfig-- add zabbix_agentd

[root@localhost] # chkconfig-- add zabbix_server

[root@localhost ~] # chkconfig zabbix_server on

[root@localhost ~] # chkconfig zabbix_agentd on

(6) modify the zabbix installation directory in the zabbix boot script

Edit the server profile:

[root@localhost ~] # vim / etc/rc.d/init.d/zabbix_server

/ / zabbix installation directory

/ / pid file path

Edit the client profile:

[root@localhost ~] # vim / etc/rc.d/init.d/zabbix_agentd

(7) reload systemctl and restart the zabbix_server service

[root@localhost ~] # systemctl daemon-reload

[root@localhost ~] # / etc/init.d/zabbix_server stop

Stopping zabbix_server (via systemctl): [OK]

[root@localhost ~] # netstat-lnp | grep zabbix_server

Tcp 00 0.0.0.0 10051 0.0.0.015 * LISTEN 13887/zabbix_server

[root@localhost] # killall-9 zabbix_server

[root@localhost ~] # netstat-lnp | grep zabbix_server

[root@localhost ~] # / etc/init.d/zabbix_server start

Starting zabbix_server (via systemctl): [OK]

[root@localhost ~] # netstat-lnp | grep zabbix_server

Tcp 00 0.0.0.0 10051 0.0.0.015 * LISTEN 14122/zabbix_server

(8) Open port 10051 exception on the firewall

[root@localhost] # firewall-cmd-- permanent-- add-port=10051/tcp

Success

[root@localhost] # firewall-cmd-- reload

Success

Third, configure the zabbix web page

(1) copy frontends to the specified web root in the installation directory

[root@localhost src] # cd zabbix-3.2.3

[root@localhost zabbix-3.2.3] # cp-r frontends/php/ / usr/local/nginx1.10/html/zabbix

[root@localhost zabbix-3.2.3] # chown-R www:www / usr/local/nginx1.10/html/zabbix

Note 1:/usr/local/nginx/html is the default site directory for Nginx

Note 2:www is the Nginx running account

Note 3:PHP requires at least the extension to be enabled:

Gd,bcmath,ctype,libXML,xmlreader,xmlwriter,session,sockets,mbstring,gettext,mysql

(2) check whether all the expansion modules mentioned above are included.

Note: compared with the expansion seen in note 3 above, you can't do without one, and there is no need for you to continue to do so.

I can compare here that all the extension modules exist.

(3) install zabbix_server on the page

Description: visit the Web interface http://192.168.8.117/zabbix, for related web configuration. After the configuration is completed, log in using the default user admin (password: zabbix).

Step 1: enter the ZABBIX WEB installation screen

Click "next step"

Step 2: enter the ZABBIX detection screen

Click "next step"

Step 3: set up the database, where the port can use 0 if the database is local

Password: zabbix

Click "next step"

Step 4: set the details of zabbix server by default.

Click "next step"

Step 5: check the configuration

Click "next step"

Step 6: complete the installation

Click "finish"

Step 7: log in to zabbix

Account number: admin password: zabbix

Note: change zabbix to admin in username above!

Step 8: the screen after logging in to zabbix

At this point, the basic installation of ZABBIX is complete.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report