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

How to install zabbix3.0 in centos7

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces how to install zabbix3.0 in centos7, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Why do you need monitoring?

Warn us in advance that there is something wrong with the server when needed.

When something goes wrong, you can find the root of the problem.

Availability of website / server

Pre-installation preparation

1.0 system time synchronization added in crontab

# crontab-l0000 * / usr/sbin/ntpdate-u x.x.x.x # Select ntp server # systemctl restart crond

1.1 install dependency packages:

Yum-y install wget net-snmp-devel net-snmp-utils OpenIPMI-devel httpd openssl-devel java lrzsz fping-devel libcurl-devel perl-DBI pcre-devel libxml2 libxml2-devel mysql-devel gcc php php-bcmath php-gd php-xml php-mbstring php-ldap php-mysql.x86_64 php-pear php-xmlrpc net-tools wget vim-enhanced

Possible failure problem: Cannot find a valid baseurl for repo: base/7/x86_64

Solution: modify DNS

1.2 turn off the firewall:

Systemctl stop firewalld.servicesystemctl disable firewalld.service

You need to turn off selinux. Be sure to turn this off. Turning on selinux will cause a series of problems, and even the discovery function of zabbix cannot be used properly.

Sed-I "s/SELINUX=enforcing/SELINUX=disabled/g" / etc/selinux/config

Confirm whether the modification is successful

Grep SELINUX / etc/selinux/config

Then restart the system.

Reboot

Second, install zabbix server3.0

1.0 build lamp environment

Before installing zabbix server3.0 on centos7, we first build the lamp environment needed for zabbix.

Download the latest yum source, as follows:

Wget-P / etc/yum.repos.d http://mirrors.aliyun.com/repo/Centos-7.repo

Before we start the installation, we also need to note that the mysql that comes with centos7 is mariadb, which we can check with the following command:

Yum search mysql | tac

Now start installing the lamp environment, using the following command:

Yum-y install mariadb mariadb-server php php-mysql httpd

From the figure above, we can clearly see that php5.4, httpd2.4 and maradb5.5 are installed by default in centos7, which fully meets the software version requirements of zabbix3.0. After lamp is installed, let's now configure the mysql database.

Set up the self-boot mysql and start the mysql, using the following command:

Systemctl enable mariadb.servicesystemctl start mariadb.service

Initialize the mysql database and configure the root user password. Use the following command:

Mysql_secure_installation

Note: at the Enter current passwdord for root in the above picture, we can just hit the enter key. Because the default root user password for mysql on centos7 is empty. The main purpose of the above figure is to configure passwords for root users and refresh relevant permissions. (password set to 123456, for experimental use only, customized in production environment) Remove anonymous users? Delete anonymous users? Disallow root login remotely? Prohibit root from logging in to Remove test database and access to it remotely? Delete the test database and access it Reload privilege tables now? The main purpose of reloading the privilege table above is to configure anonymous users, test users, remote connections for root users and other related configurations.

After mysql initialization, let's now create the zabbix database and its users, using the following command:

Mysql-uroot-pPioneerservice@3306-e "create database zabbix default character set utf8 collate utf8_bin;" mysql-uroot-pPioneerservice@3306-e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'"

Now let's test whether the zabbix user you just created can connect to the mysql database, as follows:

[root@zabbix ~] # mysql-uzabbix-pzabbix MariaDB [(none)] > show databases;MariaDB [(none)] > quit

From the figure above, we can clearly see that zabbix users can connect to the database normally.

Start apache and open port 80, as follows:

[root@zabbix ~] # systemctl start httpd.service [root@zabbix ~] # netstat-ltun

Up to this point, the lamp environment has been fully built.

1.1 install zabbix server3.0

The EPEL source required to install zabbix3.0 and the yum source of zabbix are as follows:

Rpm-ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm version 3.2 rpm-ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm version 3.4

After the above installation, we will now formally install zabbix3.0, using the following command:

Yum-y install zabbix-server-mysql zabbix-web-mysql zabbix-get

From the figure above, we can clearly see that the current zabbix server is version 3.2.11.

After the above installation, we will now start to configure zabbix.

Import the zabbix database structure as follows:

[root@zabbix ~] # cd / usr/share/doc/zabbix-server-mysql-3.2.11/ [root@zabbix zabbix-server-mysql-3.2.11] # zcat create.sql.gz | mysql- uroot-pDe123456 zabbix

After the database is imported, let's modify the configuration file of zabbix sever as follows:

[root@zabbix ~] # vim / etc/zabbix/zabbix_server.confLogFile=/var/log/zabbix/zabbix_server.logLogFileSize=0PidFile=/var/run/zabbix/zabbix_server.pidDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbixSNMPTrapperFile=/var/log/snmptrap/snmptrap.logTimeout=4AlertScriptsPath=/usr/lib/zabbix/alertscriptsExternalScripts=/usr/lib/zabbix/externalscriptsLogSlowQueries=3000

In the above configuration file, we only need to focus on DBHost, DBName, DBUser, and DBPassword.

These are the parameters that configure zabbix server to connect to the mysql database.

After the above modification, let's modify the zabbix.conf file again. As follows:

Vim / etc/httpd/conf.d/zabbix.confAlias / zabbix / usr/share/zabbixOptions FollowSymLinksAllowOverride NoneRequire all grantedphp_value max_execution_time 300php_value memory_limit 128Mphp_value post_max_size 16Mphp_value upload_max_filesize 2Mphp_value max_input_time 300php_value always_populate_raw_post_data-1 php_value date.timezone Asia/Chongqing

Before modification:

After modification:

Php_value date.timezone Asia/Chongqing mainly defines the time zone of php.

After the above modifications are completed, we will add zabbix-server to boot and start zabbix-server, as follows:

Systemctl start zabbix-server.servicesystemctl enable zabbix-server.service

Finally, restart apache as follows:

[root@zabbix ~] # systemctl restart httpd.service

So far, zabbix3.0 has been installed.

Thank you for reading this article carefully. I hope the article "how to install zabbix3.0 in centos7" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Servers

Wechat

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

12
Report