Zabbix implementation of web monitoring based on proxy distributed deployment

Source: Internet
Author: User
Tags snmp

Objective

In the daily operation and maintenance work, will inevitably encounter such or such a failure, how to find fault in the first time, and timely locate the cause of the failure, to ensure that the business is not affected, I think this should be a good operation must master the skills. But the human can't control the change of the system in real time, so the monitoring system came into being, the monitoring is the eye of operation and maintenance, the operation and maintenance is a very easy thing after the monitoring and performance management is done. At present, the more popular open-source monitoring tools are cacti, Nagios (Icinga), Zabbix and so on. This article brings the Zabbix based on proxy distributed deployment to implement web monitoring.

Zabbix Introduction

Zabbix is an enterprise-class open source solution that provides distributed system monitoring and network monitoring capabilities based on a web interface. It 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/solve various problems.

Basic functions

Data acquisition Method: Zabbix agent,agent (Active), SNMP,SSH, etc.

Data storage methods: RDBMS, such as mysql,pgsql, etc.

Data Display method: Php,web,gui

Alarm function: Support alarm Upgrade

Components and infrastructure

Zabbix consists mainly of Zabbix server and Zabbix agent

The server is responsible for collecting monitoring data from the agent and storing it in the database, analyzing and displaying the data, and triggering related alarms.

The agent side is responsible for monitoring the data collection, and sent to the server side

Data acquisition method In addition to the monitoring host on the deployment of the agent program, but also through the ICMP/IPMI/SNMP and other protocols to monitor network equipment, and configure the Web monitoring mode can monitor the Web page download rate and response time and other important parameters

Zabbix Proxy is in a large-scale distributed monitoring scenario, the use of a hierarchical structure to share server pressure, proxy only responsible for a certain area of the data collection, and then periodically sent to the server, which greatly reduces the server load pressure, Enables larger-scale monitoring needs to be supported

A collection of some Zabbix related tutorials :

Ubuntu 14.04 under Zabbix2.4.5 source compilation installation http://www.linuxidc.com/Linux/2015-05/117657.htm

Installation and deployment of distributed monitoring System Zabbix 2.06 http://www.linuxidc.com/Linux/2013-07/86942.htm

Installation and deployment of distributed monitoring System Zabbix 2.06 http://www.linuxidc.com/Linux/2013-07/86942.htm

CentOS 6.3 under Zabbix installation Deployment http://www.linuxidc.com/Linux/2013-05/83786.htm

Zabbix Distributed Monitoring System practice http://www.linuxidc.com/Linux/2013-06/85758.htm

CentOS 6.3 under Zabbix surveillance Apache Server-status http://www.linuxidc.com/Linux/2013-05/84740.htm

CentOS 6.3 under Zabbix monitoring MySQL database parameters http://www.linuxidc.com/Linux/2013-05/84800.htm

64-bit CentOS 6.2 under installation Zabbix 2.0.6 http://www.linuxidc.com/Linux/2014-11/109541.htm

Implementing the Process experiment topology

#系统环境: CentOS6.6#Zabbix Server for lamp environment #Zabbix Proxy needs database support #Zabbix server and Zabbix proxy time synchronization, all nodes are synchronized 
Zabbix Server Configuration

Quickly build lamp

[Root@node4 ~]# yum install httpd mysql mysql-libs php php-mysql mysql-server php-bcmathphp-gd php-mbstring-y

Install the required packages for Zabbix server

[Root@node4 ~]# CD Zabbix-2.4/[root@scholar zabbix-2.4]# lszabbix-2.4.0-1.el6.x86_64.rpm zabbix-sender-2.4.0-1.el6.x86_64.rpmzabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-server-2.4.0-1.el6.x86_64.rpmzabbix-get-2.4.0-1.el6.x86_64.rpm Zabbix-server-mysql-2.4. 0-1.el6.x86_64.rpmzabbix-proxy-2.4. 0-1.el6.x86_64.rpm Zabbix-web-2.4. 0-1.el6.noarch.rpmzabbix-proxy-mysql-2.4. 0-1.el6.x86_64.rpm Zabbix-web-mysql-2.4. 0-1.el6.noarch.rpm[root @node4 zabbix-2.4]# yum install zabbix-2.4.0-1.el6.x86_64.rpm zabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-get-2.4. 0-1.el6.x86_64.rpm zabbix-se* zabbix-web-*-y      

Database Preparation

[Email protected] ~]# vim/etc/my.cnf[mysqld]default-character-set = UTF8 #此项可确保zabbix中文界面不乱码 [[email protected] ~]# service mysqldStartstarting mysqld: [OK] #授权mysql >Create Database Zabbix; Query OK, 1 row affected (0.01 sec) mysql>GrantAllOn zabbix.*To' Zbuser ' @localhost identifiedBy' Zbpass '; Query OK, 0 rows affected (0.09 sec) mysql> flush privileges; Query OK, 0 rows Affected (0.00 sec) #导入zabbix数据 [[email protected] ~]# cd/usr/share/doc/zabbix-server-mysql-2.4.0/Create/[[email protected] create]# mysql-default-character-Set=utf8 Zabbix< schema.  SQL [[email protected] create]# mysql--default-character-Set=utf8 Zabbix < images.  SQL [[email protected] create]# mysql--default-character-Set=utf8 Zabbix < data.  sql#--default-character-Set=utf8 This item to prevent Chinese garbled, not Chinese can be ignored       

Configuring Zabbix Server

[Root@node4 ~]# vim/etc/zabbix/zabbix_server.confDbhost=localhost#指定数据库Dbname=zabbix#数据库名Dbuser=zbuser#数据库用户Dbpassword=zbpass#数据库密码#其他参数根据实际需求修改即可 [Root@node4 ~]# vim/etc/zabbix/zabbix_agentd.conf#配置本身agent用以监控自己Server=127.0.0.1,172.16.10.126Serveractive=127.0.0.1,172.16.10.126Hostname=node4.scholar.com[root @node4 ~] # vim/etc/php.ini #配置时区date. TimeZone = asia/ Shanghai[root @node4 ~]# service httpd restart Stopping HTTPD: [ok]starting HTTPD: [ok][root @node4 ~] # service zabbix-server startstarting zabbix span class= "symbol" >server: [ok][root @node4 ~] # service zabbix-agent startstarting zabbix span class= "symbol" >agent: [ok]         

Start installation

Visit Http://172.16.10.126/zabbix

Installation detection, if there is an error, install the required dependent package can be

Fill in the database information

Name can be customized

Next-next-finish to complete the installation

Login interface as follows, Default user admin, password Zabbix

zabbix2.4 default blocked Chinese display, set display Chinese

[Root@node4 ~]# vim/usr/share/zabbix/include/locales.inc.php#将false改为true' ZH_CN ' = Array ( ' name ' = = _ ( ' display ' = true),  #为防止乱码用楷体替换默认字体 [Root @node4 ~]# mv Simkai.ttf/usr/share/zabbix/fonts/[root  @node4 ~] # vim/usr/share/zabbix/include/defines.inc.phpdefine ( ' Zbx_graph_font _name ',  ' Simkai ');d efine ( ' Zbx_font_name ',  Simkai ‘); [Root @node4 ~]# service httpd restartstopping span class= "symbol" >HTTPD: [ok]starting HTTPD: [ok]              

Modify language

Zabbix server configuration First here, let's go to configure proxy and agent

Zabbix Proxy Configuration

Install the required packages for Zabbix proxy

[Root@node3 ~]# CD Zabbix-2.4/[root@node3 zabbix-2.4]# lszabbix-2.4.0-1.el6.x86_64.rpm zabbix-sender-2.4.0-1.el6.x86_64.rpmzabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-server-2.4.0-1.el6.x86_64.rpmzabbix-get-2.4. 0-1.el6.x86_64.rpm Zabbix-server-mysql-2.4. 0-1.el6.x86_64.rpmzabbix-proxy-2.4. 0-1.el6.x86_64.rpm Zabbix-web-2.4. 0-1.el6.noarch.rpmzabbix-proxy-mysql-2.4. 0-1.el6.x86_64.rpm Zabbix-web-mysql-2.4. 0-1.el6.noarch.rpm[root @node3 zabbix-2.4]# yum install zabbix-2.4.0-1.el6.x86_64.rpm zabbix-get-2.4.0-1.el6.x86_64.rpm zabbix-proxy-*-y  

Database Preparation

' Zbpass '; Query OK, 0 rows Affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.06 sec) #导入数据 [[email protected] ~]# MySQL Zabbix_proxy </usr/share/doc/zabbix-proxy-mysql- 2.4.0/create/schema.  SQL  

Configuring Zabbix Proxy

[Root@node3 ~]# vim/etc/zabbix/zabbix_proxy.confServer=172.16.10.126 #指向Zabbix serverhostname=node3.scholar.com # Host name dbhost=localhost  #指定数据库 dbname=zabbix_ Proxy  #数据库名 dbuser=zbuser  #数据库用户 dbpassword=zbpass  #数据库密码 configfrequency=< Span class= "number" >60  #配置文件同步间隔 datasenderfrequency= 5  #数据同步间隔  #其他参数根据自己实际需求修改即可 [root  @node3 ~] # service zabbix-proxy startstarting zabbix span class= "symbol" >proxy: [ok]         

Zabbix Agent Configuration

Packages required to install the Zabbix agent

[Root@node1 ~]# CD Zabbix-2.4/[root@node1 zabbix-2.4]# lszabbix-2.4.0-1.el6.x86_64.rpm zabbix-sender-2.4.0-1.el6.x86_64.rpmzabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-server-2.4.0-1.el6.x86_64.rpmzabbix-get-2.4.0-1.el6.x86_64.rpm zabbix-server-mysql-2.4.0-1.el6.x86_64.rpmzabbix-proxy-2.4.  0-1.el6.x86_64.rpm zabbix-web-2.4.  0-1.el6.noarch.rpmzabbix-proxy-mysql-2.4.  0-1.el6.x86_64.rpm zabbix-web-mysql-2.4.  0-1.el6.noarch.rpm[root@node1 zabbix-2.4]# yum Install zabbix-2.4.0-1.el6.x86_64.rpm zabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-sender-2.4.  0-1.el6.x86_64.rpm-y#两个Agent端都执行此安装操作         

Configuring the Zabbix Agent

[Root@node1 ~]# vim/etc/zabbix/zabbix_agentd.confserver=172.16.  10.125           #指向proxyserveractive=172.16.  Hostname=node1.scholar.com[root@node1 ~]# service zabbix-agent startOK]#全部Agent节点都执行以上配置 
Add monitoring

Add Agent

Add monitoring host, select agent monitoring

Add a template

#两台监控主机都执行以上添加操作

Check the monitoring chart to verify that it is monitored

Can already obtain the information of monitoring host, proxy distributed monitoring deployment is successful

Create Web Monitoring

Click Apply Set (applications) to create an app set

Click the Web scene to customize the scene

Create related steps

#两台需要监控的web主机都需创建

View Web Status

The above is Zabbix based on proxy distributed deployment to implement Web monitoring simple process, time is limited, will not continue to be specific improvement, interested friends can continue to implement the alarm function

Zabbix implementation of web monitoring based on proxy distributed deployment

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.