Use yum to test Zabbix 2.4 On CentOS 7 or RHEL 7

Source: Internet
Author: User

Use yum to test Zabbix 2.4 On CentOS 7 or RHEL 7

Use yum to test Zabbix 2.4 On CentOS 7 or RHEL 7

Steps for lite version:
1. Add Source
Yum-y install epel-release
Vi/etc/yum. repos. d/zabbix. repo
[Zabbix]
Name = Zabbix
Base url = http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/
Gpgcheck = 1
Gpgkey = http://repo.zabbix.com/zabbix-official-repo.key

2. Installation Package
Yum-y install zabbix-server-mysql zabbix-agent zabbix-web-mysql mariadb-server httpd php

3. Prepare the database
3.1 start the Database Service and automatically start it at startup
Systemctl start mariadb
Systemctl enable mariadb

3.2 reinforce Database
Mysql_secure_installation
Set the root password of the database. The default value is "yes" for all other options.
3.3 create a zabbix database and add accounts and permissions
Mysql-u root-p # log on to the database as the root user
Create database zabbix; # CREATE a dedicated zabbix Library
Grant all privileges on zabbix. * TO zabbix @ localhost identified by 'zabbix' # create a dedicated database administrator account zabbix with the password zabbix,
At the same time, the zabbix account is granted all permissions on all tables in the zabbix database.
Flush privileges; # valid Permissions
Exit; Save and exit the database
3.4 import the zabbix database configuration table
Mysql-u root-p zabbix </usr/share/doc/zabbix-server-mysql-*/create/schema. SQL

Mysql-u root-p zabbix </usr/share/doc/zabbix-server-mysql-*/create/images. SQL
Mysql-u root-p zabbix </usr/share/doc/zabbix-server-mysql-*/create/data. SQL

For more database tuning items, go to the https://github.com/major/MySQLTuner-perl


4. Configure the Web Server
Optimize PHP. The last time zone must be changed.
Sed-I's/^ max_execution_time. */max_execution_time = 600/'/etc/php. ini
Sed-I's/^ max_input_time. */max_input_time = 600/'/etc/php. ini
Sed-I's/^ memory_limit. */memory_limit = 256 M/'/etc/php. ini
Sed-I's/^ post_max_size. */post_max_size = 32 M/'/etc/php. ini
Sed-I's/^ upload_max_filesize. */upload_max_filesize = 16 M/'/etc/php. ini
Sed-I "s/^ \; date. timezone. */date. timezone = \ 'Asia \/Shanghai \ '/"/etc/php. ini
Reinforce apache
Vim/etc/httpd/conf. d/zabbix. conf
#
# Zabbix monitoring system php web frontend
#
Alias/zabbix/usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "/usr/share/zabbix/conf">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/include">
Require all denied
</Directory>
Enable Firewall Rules, start services, and check logon status
Firewall-cmd -- zone = public -- add-service = http-permanent
Systemctl start httpd

Systemctl enable httpd

5. Configure zabbix
Configure zabbix
Sed-I's/^ # DBPassword =. */DBPassword = zabbix/'/etc/zabbix/zabbix_server.conf
Parameter Optimization
Sed-I's/^ # CacheSize =. */CacheSize = 32 M/'/etc/zabbix/zabbix_server.conf
Sed-I's/^ # StartPingers =. */StartPingers = 5/'/etc/zabbix/zabbix_server.conf
Configure selinux
Setsebool-P httpd_can_connect_zabbix = true
Start the service
Systemctl enable zabbix-server
Systemctl start zabbix-server
# A bug will cause startup failure, segfault at 18 ip Route 7fbf1295dc00 sp route 7ffff5527ec8 error 4 in libpthread-2.17.so [7fbf12954000 + 16000]
You can downgrade gnutls to 3.1.20 or yum-y update to restart the service.
For more information, please move to the https://support.zabbix.com/browse/ZBX-7790
Web login http://zabbix.it.lab/zabbix, complete Initialization Configuration
Default logon username admin and password zabbix

6. Add a monitoring host
Yum-y install epel-release
Yum-y install zabbix22-agent
Modify configuration file
Sed-I's/^ Server = 127.0.0.1/Server = zabbix. it. lab/G'/etc/zabbix/zabbix_agentd.conf
Enable Service
Systemctl enable zabbix-agent
Systemctl start zabbix-agent

This is a pitfall, server not running

The disabling of selinux and the firewall is not solved, and selinux is basically mentioned when a ladder is searched.
Check the log/var/log/zabbix/zabbix_server.log carefully.
Connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix' @ 'localhost' (using password: NO)
Mysql-u zabbix-p zabbix logon is successful, and the problem is undoubtedly caused by zabbix configuration.
Grep DBPassword/etc/zabbix/zabbix_server.conf
# For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
### Option: DBPassword
# DBPassword =
The password is not matched here, and it is also dumb.

Learning Linux has almost become a kind of practice for myself. Calm down, don't worry, don't worry, don't pursue perfect solution take every command seriously, every letter is case-sensitive; first solve the current requirements, Don't blindly follow interest. These will be a lifetime of wealth.

Some Zabbix Tutorials:

Compile and install Zabbix2.4.5 source code in Ubuntu 14.04

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy Zabbix in CentOS 6.3

Zabbix distributed monitoring system practice

Under CentOS 6.3, Zabbix monitors apache server-status

Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3

Install Zabbix 2.0.6 in 64-bit CentOS 6.2

ZABBIX details: click here
ZABBIX: click here

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.