Install and configure Zabbix in Linux

Source: Internet
Author: User
Tags server installation and configuration

Install and configure Zabbix in Linux

I. zabbix architecture

Zabbix web GUI: zabbbix graphical interface, usually running on the same host as the server
Zabbix database: stores configuration information and collected data.
Zabbix server: receives the report information sent by the agent and is the core component of zabbix. All configuration, statistical data, and operation data are organized by the agent.
Zabbix agent: deployed on the monitored host. It collects local data and sends it to the server or proxy.
Zabbix proxy: an optional component. It is often used in a distributed monitoring environment to make remote monitoring easier. Its proxy Server collects data from monitored nodes and then sends it to the Server.
Choose rpm package or source code installation http://www.zabbix.com/download.php
This article installs zabbix4.8 Based on the rpm package yum. For more information about the yum source configuration, see here.
The LAMP environment has been configured on zabbix-server, the OS is CentOS7, And the zabbix-agent OS is CentOS6x.
Ii. Server installation and configuration
1. Add a repo File

# Cat/etc/yum/pluginconf. d/priorities. conf [main] enabled = 1 # YUM priority enabled # cat/etc/yum. repos. d/zabbix. repo [zabbix] name = zabbix for centos7 baseurl = http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/enabled=1gpgcheck=0priority=1# yum install zabbix-get zabbix-server Ready-server-mysql zabbix-web-mysql-y # install zabbix- server and web gui # rpm-qa | grep zabbixzabbix-server-mysql-2.4.8-1.el7.x86_64zabbix-web-2.4.8-1.el7.noarchzabbix-server-2.4.8-1.el7.x86_64 zabbix-get-2.4.8-1.el7.x86_64 # command line tools that typically run on the server or proxy side to get remote client information, commonly Used in troubleshooting zabbix-web-mysql-2.4.8-1.el7.noarchzabbix-2.4.8-1.el7.x86_64

2. First, create the zabbix database. The server and proxy depend on the database, and the agent does not need

MariaDB [(none)]> CREATE DATABASE zabbix;MariaDB [zabbix]> grant all on zabbix.* to 'username'@'serverIP'  IDENTIFIED BY 'password' WITH GRANT OPTION; MariaDB [zabbix]> flush privileges;


3. During database initialization, the proxy only needs to import one SQL file, while the server needs to import three SQL files in total.

# mysql --default-character-set=utf8 zabbix < /usr/share/doc/zabbix-server-mysql-2.4.8/create/schema.sql# mysql --default-character-set=utf8 zabbix < /usr/share/doc/zabbix-server-mysql-2.4.8/create/images.sql# mysql --default-character-set=utf8 zabbix < /usr/share/doc/zabbix-server-mysql-2.4.8/create/data.sql

4. modify the configuration file

# Cat/etc/zabbix/zabbix_server.conf | grep "^ \ s * [^ # \ t]. * $ "LogFile =/var/log/zabbix/zabbix_server.logLogFileSize = 0 PidFile =/var/run/zabbix/character = zabbix # DBUser = username # DBPassword of the database to which zabbix belongs = password # zabbix Database password DBSocket =/var/lib/mysql. sockSNMPTrapperFile =/var/log/snmptt. logAlertScriptsPath =/usr/lib/zabbix/alertscriptsExternalScripts =/usr/lib/zabbix/externalscripts

5. Modify php configuration file Parameters

# sed -i "s@;date.timezone =@date.timezone = Asia/Shanghai@g" /etc/php.ini# sed -i "s@max_execution_time = 30@max_execution_time = 300@g" /etc/php.ini# sed -i "s@post_max_size = 8M@post_max_size = 32M@g" /etc/php.ini# sed -i "s@max_input_time = 60@max_input_time = 300@g" /etc/php.ini# sed -i "s@memory_limit = 128M@memory_limit = 128M@g" /etc/php.ini

6. Start zabbix server's default port 10051

# systemctl start  zabbix-server.service# netstat -atnlp |grep zabbixtcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      4359/zabbix_server  tcp6       0      0 :::10051                :::*                    LISTEN      4359/zabbix_server  

7. browser access. Default Account: admin, password: zabbix

Iii. Agent installation and configuration
1. Add a repo File

# Cat/etc/yum. repos. d/Zagent. repo [agent] name = zabbix for centos6 baseurl = http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/enabled=1gpgcheck=0priority=1# yum install zabbix-agent zabbix-sender-y # rpm-qa | grep zabbixzabbix-2.4.8-1.el6.x86_64zabbix-agent-2.4.8-1.el6.x86_64 # command line proactively submit data to the server or proxy, typically used for long-time exam zabbix-sender-2.4.8-1.el6.x86_64

If the yum source cannot be connected, you can manually download the rpm package to install the local yum

# wget http://repo.zabbix.com/zabbix/2.4/rhel/6/i386/zabbix-2.4.8-1.el6.i686.rpm# wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-agent-2.4.8-1.el6.x86_64.rpm# wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-sender-2.4.8-1.el6.x86_64.rpm# yum localinstall zabbix* -y

2. Edit the Agent configuration file. Details about the zabbix_agentd.conf configuration file
Http://www.ttlsa.com/zabbix/zabbix_agentd-conf-description/

# Cat/etc/zabbix/zabbix_agentd.conf | grep "^ \ s * [^ # \ t]. * $ "PidFile =/var/run/zabbix/forward =/var/log/zabbix/forward = 0 Server = zabbix serverIP # passively allow zabbix serverIP to retrieve data ServerActive = zabbix serverIP # submit data Hostname = zabbix agentInclude =/etc/Zabbix/zabbix_agentd.d/to zabbix serverIP/

3. Start zabbix agent's default port 10050

# service zabbix-agent start# netstat -atnlp |grep zabbixtcp        0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN      6821/zabbix_agentd  

4. Add a monitoring node and select a monitoring item

 

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:

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.