CentOS 7 Source Installation Zabbix

Source: Internet
Author: User
Tags snmp

I. Introduction of Zabbix

Zabbix is an enterprise-class open source solution that provides distributed system monitoring and network monitoring capabilities based on a web interface. Zabbix can monitor various network parameters, ensure the safe operation of the server system, and provide a flexible notification mechanism to enable system administrators to quickly locate/resolve various problems.

Second, Zabbix installation

This document installs Zabbix-server and zabbix-agent on the same machine to monitor itself.

1. Configure Lamp

Centos 7.0 Configuration Lamp

Install LAMP Server (Apache, MariaDB, PHP) on centos/rhel/scientific Linux 7

2. Download Zabbix
Wget http://netix.dl.sourceforge.net/project/zabbix/zabbix%20latest%20stable/2.4.7/zabbix-2.4.7.tar.gz
3, installation of the necessary basic components
Yum Install perl-dbi php-gd php-xml php-bcmath php-mbstring php-ldap php-odbc php-xmlrpc
4 , creating MySQL databases and Users

Login MARIADB:

Mysql–u root–p
Create a database of ' zabbixdb ' and database user ' Zabbix '
MariaDB[(None)]> Create DatabaseZabbixcharacter SetUTF8; MariaDB[(None)]> Grant  All Privileges  onZabbix.*  to 'Zabbix'@'localhost'Identified by 'Zabbix'; MariaDB[(None)]>FlushPrivileges;
5 , Database import Zabbix Template

Log in to the database using the database user Zabbix

Mysql–uzabbix–p

Switch to the Zabbix database

 Use Zabbix

Import Template Data sequentially

Source/Usr/Local/Src/Zabbix-2.4.7/Database/Mysql/Schema. Sqlsource/Usr/Local/Src/Zabbix-2.4.7/Database/Mysql/Images.sqlsource/Usr/Local/Src/Zabbix-2.4.7/Database/Mysql/Data.sql
6 , compiling and installing Zabbix

Current path

pwd/usr/local/src

Extract

tar -zxvf zabbix-2.4. 7. tar. gz

Enter the Zabbix directory, install

CD zabbix-2.4. 7/. /configure--prefix=/usr/local/zabbix--enable-server--enable-agent--enable-proxy--with-mysql--ENABLE-NET-SNMP-- with-make makeinstall

--prefix----> Specify Zabbix installation directory

--enable-server----> Support Zabbix Server

--enable-agent----> Support Zabbix Agent

--enable-proxy----> Support Zabbix Proxy Server

--with-libcurl----> Using Curl Packs

--WITH-NET-SNMP----> Use NET-SNMP packages to selectively specify path NET-SNMP configuration

--with-mysql=/usr/bin/mysql_con

Note: If the Configure:error:MySQL library not found error occurs because the software package is missing Mariadb-devel, Yum installs Mariadb-devel

7 , modify PHP Set

Modify the settings recommended by PHP.ini for Zabbix

Edit File php.ini,

VI /etc/php.ini

Set the following parameters.

* == 16Mdate. TimeZone = Asia/shanghai
8 , modify Firewall and the SELinux Set

Open Zabbix Port 10050 and 10051.

Firewall-cmd--permanent--add-port=10050/tcpfirewall-cmd--permanent--add-port=10051 /tcp

Restart Firewall

Systemctl Restart Firewalld

If you use SELinux, run the following command to enable Apache to communicate with Zabbix

Setsebool-p httpd_can_connect_zabbix=1
9 , Configuration Zabbix Server Parameters

Edit File /etc/zabbix/zabbix_server.conf,

VI /usr/local/zabbix/etc/zabbix_server.conf

Configure the following three parameters

[...] DBName=zabbix[...] DBUser=zabbix[...] Dbpassword=zabbix[...]
10, modify the zabbix_agentd.conf

Edit

VI /usr/local/zabbix/etc/zabbix_agentd.conf

Modify

server=127.0. 0.1 # #agent端的ipServerActive=127.0. 0.1 Hostname=monitor Server # #必须与zabbix创建的hostname相同

Restart

/usr/local/zabbix/sbin/zabbix_agentd
11. Add Zabbix PHP files to Apache
cd/usr/local/src/zabbix-2.4. 7 CP -R./frontends/php//var/www/html/zabbix

Restart httpd

Systemctl Restart httpd
A , through the console configuration Zabbix

Browser Access Http://ip-address/zabbix

Check package integrity and parameter configuration

Data Zabbix database name, database user and password, and test

Enter server name (here and the same Hostname configured above=Monitor server)

Pre-installed Summary

Click Finish, prompt cannot create/var/www/html/zabbix/conf/zabbix.conf.php file, press the prompt to click "Download configuration File" button, and save the downloaded zabbix.conf.php to/var/www/html/zabbix/conf/, click the "Retry" button to retry

Installation is complete.

After the installation is complete, redirect to the Zabbix console login page. Enter the user name and password, the default user name and password is aDmin/zabbix.

The Management dashboard page is as follows

----- Manually start /usr/local/zabbix/sbin/zabbix_serverstart/usr/local/zabbix/sbin/zabbix_agentd start

Activation host--Host with configuration

13. Change the Chinese language

Zabbix default is the English version, change the language profile-> in language select ZH_CN, click Update

14. Add Boot Script
cd/usr/local/src/zabbix-2.4. 7 CP misc/init.d/fedora/core5/zabbix_server/etc/rc.d/init.d/zabbix_serverCP MISC/INIT.D /fedora/core5/zabbix_server/etc/rc.d/init.d/zabbix_agentdchmod u+x/etc/rc.d/init.d/Zabbix _serverchmod u+x/etc/rc.d/init.d/zabbix_agentdchkconfig zabbix_server on Chkconfig zabbix_agentd on

Change the path in the Autostart script

-----/etc/init.d/zabbix_serverzabbix_bin="/usr/local/zabbix/sbin/zabbix_server  "-----/etc/init.d/zabbix_agentdzabbix_bin="/usr/local/zabbix/sbin /zabbix_agentd"
15. Restart to verify boot automatically
[Email protected] wangshengzhuang]# NETSTAT-NLTP |grep 10050TCP0 0 0.0.0.0:10050 0.0.0.0:* LISTEN1193/zabbix_agentd[[email protected] wangshengzhuang]# netstat-NLTP |grep 10051TCP0 0 0.0.0.0:10051 0.0.0.0:* LISTEN1175/zabbix_server

16. Create Zabbix Users and Groups
-g Zabbix Zabbix---- Change the owner of the Zabbix to Zabbixchown -R zabbix:zabbix/usr/local/zabbix/
Original address

http://www.unixmen.com/how-to-install-zabbix-server-on-centos-7/

Http://www.centoscn.com/image-text/install/2015/0827/6071.html

CentOS 7 Source Installation Zabbix

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.