Zabbix-proxy-agent Implementing Web Monitoring

Source: Internet
Author: User

Zabix Introduction

Zabbix (with Z? ) Bix) is an enterprise-class open source solution that provides distributed system monitoring and network monitoring capabilities based on a web interface.

    1. 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.
    2. Zabbix consists of 2 parts, Zabbix server and optional Components Zabbix agent.
    3. Zabbix server can be used Snmp,zabbix agent,ping, port monitoring and other methods to provide remote server/network status monitoring, data collection and other functions, it can run in Linux,solaris,hp-ux,,aix,free BSD, Open Bsd,os x and other platforms.

Lab Environment: Centos6.5

650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376280wqtf.png "width=" "height=" 384 "/>

First, configure a lamp platform

Install PHP-FPM, Mysql-server, httpd, Php-mysql

Modifying the Php-ini configuration file
Date.timezone = Asia/shanghai

Start the MySQL service and create a Zabbix database and complete the authorization

mysql> CREATE DATABASE Zabbix;

Query OK, 1 row Affected (0.00 sec)

Mysql> Grant all on zabbix.* to ' zbxuser ' @ ' localhost ' identified by ' zbxpass ';

Query OK, 0 rows Affected (0.00 sec)

Mysql> Grant all on zabbix.* to ' zbxuser ' @ ' 127.0.0.1 ' identified by ' zbxpass ';

Query OK, 0 rows Affected (0.00 sec)

mysql> flush Privileges;

Query OK, 0 rows Affected (0.00 sec)

Second, install and configure Zabbix-server

Install the following Zabbix package on the server (zabbix2.4 package is installed here, the package needs to be downloaded on the website of the Karma UN, the provision of Yum source is provided.)

# 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-sender-2.4.0-1.el6.x86_64.rpm zabbix-server-2.4.0-1.el6.x86_64.rpm zabbix-server-mysql-2.4.0-1.el6.x86_ 64.rpm zabbix-web-2.4.0-1.el6.noarch.rpm zabbix-web-mysql-2.4.0-1.el6.noarch.rpm

Compiling the Zabbix configuration file

1, #vim zabbix_server.conf

Modify the following

IP address of the dbhost=172.16.1.1//database server

Dbname=zabbix//Name of the database

Dbuser=zbxuser//user name to connect to the database server

Dbpassword=zbxpass//user password to connect to the database server

2. Import basic information for Zabbix database

650) this.width=650; "title=" clipboard[4] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[4] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376280wwz7.png "width=" 834 "height="/>

Using commands

#mysql Zabbix < Schema.sql

3. Start the service

#service httpd Start

#service php-fpm Start

#service zabbix-server Start

4. Initialize the Web page of the Zabbix service in the browser input 172.16.1.1

650) this.width=650; "title=" clipboard[18] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[18] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376280ets8.png "width=" 651 "height=" 381 "/>
650) this.width=650;" title= "clipboard[19]" style= " border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[19] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376280xqof.png "width=" 640 "height=" 510 "/>
650) this.width=650;" title= "clipboard[20]" style= " border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[20] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376281j58f.png "width=" 643 "height=" 411 "/>

650) this.width=650; "title=" clipboard[21] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[21] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376281zmcz.png "Width=" 646 "height=" "/>"

650) this.width=650; "title=" clipboard[22] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[22] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376281xtkn.png "width=" 657 "height=" 317 "/>

650) this.width=650; "title=" clipboard[23] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[23] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376281ekmk.png "width=" 663 "height=" 141 "/>

5. Configure the agent for server side to monitor its own

#vim zabbix_agent.conf

Modify the following:

server=127.0.0.1,172.16.1.1//IP address of the host allowed to pull data

serveractive=127.0.0.1,172.16.1.1//Active notification of the IP address of the host that pulls the data (only 127.0.0.1 when the server and agent are on the same host)

hostname=server.zhou.com//need to be consistent with host name

**************************************************

Host Name Modification method:

#vim/etc/hosts

#vim/etc/sysconfig/network

#hostname New-hostname

****************************************************

At this point, the server will automatically add the native agent

Third, create a separate agent side

Installed packages:

# 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

Configuration file modifications as follows

To add a host:

650) this.width=650; "title=" clipboard[5] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[5] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 14133762811wdy.png "width=" 868 "height=" 335 "/>

Iv. Configuring the Zabbi-proxy Proxy Server

Installed package: zabbix-2.4.0-1.el6.x86_64.rpm zabbix-proxy zabbix-proxy-mysql

Edit configuration File "

#vim/etc/zabbix/zabbix_proxy.conf

server=172.16.1.1            //*zabbix Server IP address or hostname hostname=node2.zhou.com         //* The configuration of the hostname needs to be known by Zabbix server, And the location of the Logfile=/tmp/zabbix_proxy.log//pid file is used in the Zabbix server front-end configuration     dbname=zabbix_proxy         //*dbuser=zabbix                     //*dbpassword=123456            //*configfrequency=60         //zabbix Proxy to retrieve the server The frequency at which data information is configured , in passive mode, the parameter is ignored datasenderfrequency=60         //zabbix proxy sends the collected data to the Zabbix server frequency

The above band ' * ' is a must-have modified * * *

Start the service, add it on the Web page

Five, customize the parameters

Since the template produced in the production environment does not fully meet our needs, we need to define our own keys, templates and so on.

1, how to customize the key?

Modify the configuration file to start a custom key

Unsafeuserpaameters=1

The rest can be used without modification

Add the following in the file/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf

Userparameter=count.line.passwd,wc-l/etc/passwd|awk ' {print $} '

Restart the client and test the keys on the command line for availability

650) this.width=650; "title=" clipboard[8] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[8] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376282dbbu.png "width=" 665 "height="/>

Usage of **zabbix_get using zabbix_get-h

2, how to customize the template?

If there are a large number of the same type of equipment, need to monitor the information is similar, one by one to modify the relevant parameters comparison
Annoying, we can simplify the operation by creating a template.
Configuration->host groups->template->create Template

Login to the Web interface and click on the templates create template in the configuration

Need to fill in the required parameters according to your needs

3. Add triggers

650) this.width=650; "title=" clipboard[9] "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" clipboard[9] "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376282k1bk.png "width=" 635 "height=" 285 "/>

Add name, select item by itself, define alarm range function setting value

4, add the user, and give the appropriate permissions:

650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 14133762825yit.png "width=" 647 "height="/>

650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376282ugaf.png "width=" 601 "height=" 541 "/>

650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376282btxh.png "width=" 603 "height=" 398 "/>

* * The family can be more than one, alarm level can be selected by themselves (can be multiple), type can be defined by itself

650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376283uajo.png "width=" 584 "height=" 444 "/>

* * Special note here is that if the user does not have the appropriate permission to cause an alert when the message I want to send delivery

5. Define Media

Media, or alarm mode, Zabbix can provide four classes of Media:email/sms/jabber/script
Administrator->media type to modify or add police type
Email the most commonly used, fill in the relevant SMTP information, you can send alerts by mail.

650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376283xo3f.png "width=" 606 "height=" "/>

650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; border-bottom-width:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/8371039_ 1413376283xza0.png "width=" 596 "height=" "/>"

Zabbix-proxy-agent Implementing Web Monitoring

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.