Zabbix basic monitoring, port monitoring, web site monitoring, mail alarm

Source: Internet
Author: User
Tags response code import database set up email

Zabbix Monitoring:

Zabbix version:3.4.1

OS:centos7.3

PHP version:7.0

Nginx version:1.12.1

MYSQL:MARIADB10.2.7

 

Install Zabbix: Install dependency Package: Yum install –y autoconf automake imakelibxml2-devel expat-devel  cmake gcc gcc-c++ libaio libaio-devel bzr bisonlibtool Download Zabbix Source package:/HTTP Sourceforge.net/projects/zabbix/files/zabbix%20latest%20stable/3.4.1/zabbix-3.4.1.tar.gz/download Decompression Package Tar  xzf  zabbix-3.4.1.tar.gzcd zabbix-3.4.1 ./configure    --prefix= /usr/local/zabbix-3.4  --enable-server--with-mysql=/usr/bin/mysql_config --with-net-snmp - -with-libcurl--with-libxml2   --enable-agent     (that is, do the service side and do the monitoring end) make   &&  make install  Create PHP project directory/DATA/ZABBIXCP&NBSP;-RP&NBSP;&NBSP;ZABBIX-3.4.1/ frontends/php/*    /data/zabbix  CREATE DATABASE Zabbix Import Database: Mysql -u zabbix -p  -h 127.0.0.1   zabbix  <  zabbix-3.4.1/database/mysql/ Schema.sqlmysql -u zabbix -p -h 127.0.0.1   zabbix  <  zabbix-3.4.1/database/ mysql/images.sqlmysql -u zabbix -p -h 127.0.0.1   zabbix   <  zabbix-3.4.1/database/mysql/data.sql

Configuring The Zabbix project configuration file

cp/data/zabbix/conf/zabbix.conf.php.example/data/zabbix/conf/zabbix.conf.php


650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/A5/B9/wKioL1nCSLyTp8ddAAEn49-8oIU178.png-wh_500x0-wm_ 3-wmp_4-s_1998407967.png "title=" 1.png "alt=" Wkiol1ncslytp8ddaaen49-8oiu178.png-wh_50 "/>

Modify the configuration file for the Zabbix program vim/usr/local/zabbix-3.4/etc/zabbix_server.conf

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/A5/B9/wKioL1nCSEWjWErZAACiqnplq7M555.png-wh_500x0-wm_ 3-wmp_4-s_353463577.png "title=" 2.png "alt=" Wkiol1ncsewjwerzaaciqnplq7m555.png-wh_50 "/>

Start Zabbixserver

/usr/local/zabbix-3.4/sbin/zabbix_server-c/usr/local/zabbix-3.4/etc/zabbix_server.conf

/usr/local/zabbix-3.4/sbin/zabbix_agentd

Zabbix configuration nginx:

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/A5/B9/wKioL1nCSMrRIjTuAAEN9iDWAPU492.png-wh_500x0-wm_ 3-wmp_4-s_324408968.png "title=" 3.png "alt=" Wkiol1ncsmrrijtuaaen9idwapu492.png-wh_50 "/>

Configure the monitoring for this machine:

Open URL: Enter the default user password:Admin/zabbix

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/07/09/wKiom1nCSQjCSuqXAABbP_V6KsU712.png-wh_500x0-wm_ 3-wmp_4-s_1389159426.png "title=" 4.png "alt=" Wkiom1ncsqjcsuqxaabbp_v6ksu712.png-wh_50 "/>

To create a host:

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/A5/B9/wKioL1nCSN2TDudDAACCZbbvIB4895.png-wh_500x0-wm_ 3-wmp_4-s_2095174026.png "title=" 5.png "alt=" Wkiol1ncsn2tduddaacczbbvib4895.png-wh_50 "/>

Select the template to enable:

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/07/09/wKiom1nCSRrA-Av4AAFCMvPMpqE247.png-wh_500x0-wm_ 3-wmp_4-s_12848115.png "title=" 6.png "alt=" Wkiom1ncsrra-av4aafcmvpmpqe247.png-wh_50 "/>

Set up email alerts:

Download

Wgethttp://caspian.dotconf.net/menu/software/sendemail/sendemail-v1.56.tar.gz

After decompression

Tar xzf sendemail-v1.56.tar.gz && CD sendemail-v1.56 && CP sendemail/usr/local/bin

To create a Send message script:

#!/bin/bash

To=$1

Subject=$2

Body=$3

sendemail-f [email protected]-T "$to"-S Smtp.163.com-u "$subject"-O message-content-type=html-o tls=no-o Message-co Ntent-type=html-omessage-charset=utf8-xu [email protected]-xp passwd-m "$body"

-F Sender e-mail address

-T recipient email Address

-S SMTP server address

-U Theme

-O content type, setting character set

-xu Sender Address

-XP Sender Password

Zabbix console settings:

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/07/09/wKiom1nCSYqzFebqAABOMBbAZcY597.png-wh_500x0-wm_ 3-wmp_4-s_1183360049.png "title=" 7.png "alt=" Wkiom1ncsyqzfebqaabombbazcy597.png-wh_50 "/>

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/A5/B9/wKioL1nCSWCDqXqwAAEIFV_Olv0408.png-wh_500x0-wm_ 3-wmp_4-s_402609113.png "title=" 8.png "alt=" Wkiol1ncswcdqxqwaaeifv_olv0408.png-wh_50 "/>

sendemail.sh Script Drop location in alertscripts directory (alertscriptspath=${datadir}/zabbix/alertscripts )

Add recipients. Bind user

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/07/09/wKiom1nCSaLy9wiNAADGh3jVRP8384.png-wh_500x0-wm_ 3-wmp_4-s_3311860808.png "title=" 9.png "alt=" Wkiom1ncsaly9winaadgh3jvrp8384.png-wh_50 "/>

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/A5/B9/wKioL1nCSXXQjF68AACr-Hl9IyY999.png-wh_500x0-wm_ 3-wmp_4-s_483702439.png "title=" 10.png "alt=" Wkiol1ncsxxqjf68aacr-hl9iyy999.png-wh_50 "/>

Configure the action, or you can create it yourself

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/07/09/wKiom1nCSbaQgWUSAADRyxwibVo063.png-wh_500x0-wm_ 3-wmp_4-s_907599148.png "title=" 11.png "alt=" Wkiom1ncsbaqgwusaadryxwibvo063.png-wh_50 "/>

Action match:

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/A5/B9/wKioL1nCSY6DOor_AADOM3n6ptM670.png-wh_500x0-wm_ 3-wmp_4-s_3298946042.png "title=" 12.png "alt=" Wkiol1ncsy6door_aadom3n6ptm670.png-wh_50 "/>

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/07/09/wKiom1nCSc3xHv4yAAJIB_473Xo415.png-wh_500x0-wm_ 3-wmp_4-s_386211659.png "title=" 13.png "alt=" Wkiom1ncsc3xhv4yaajib_473xo415.png-wh_50 "/>

View Alarm Message Send results

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/07/09/wKiom1nCSdnydBHlAADJTxJB3ho677.png-wh_500x0-wm_ 3-wmp_4-s_2520831142.png "title=" 14.png "alt=" Wkiom1ncsdnydbhlaadjtxjb3ho677.png-wh_50 "/>

WEB Site monitoring

1: Application Set

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/A5/B9/wKioL1nCSbGzPsm5AACfKj9h1Ls753.png-wh_500x0-wm_ 3-wmp_4-s_3210250024.png "title=" 15.png "alt=" Wkiol1ncsbgzpsm5aacfkj9h1ls753.png-wh_50 "/>

2: Create an app set

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/07/09/wKiom1nCSgOxWI2dAACOKezn0uY629.png-wh_500x0-wm_ 3-wmp_4-s_892891313.png "title=" 16.png "alt=" Wkiom1ncsgoxwi2daacokezn0uy629.png-wh_50 "/>

3: Create a web scene

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/A5/B9/wKioL1nCSdnQQ6UNAACKcxH8cV0738.png-wh_500x0-wm_ 3-wmp_4-s_2636336877.png "title=" 17.png "alt=" Wkiol1ncsdnqq6unaackcxh8cv0738.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/A5/B9/wKioL1nCSeDgF-dWAAEI7CPJKFs057.png-wh_500x0-wm_ 3-wmp_4-s_1387365193.png "title=" 18.png "alt=" Wkiol1ncsedgf-dwaaei7cpjkfs057.png-wh_50 "/>

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/07/09/wKiom1nCSivBkdN1AAD3Gv8wHOI732.png-wh_500x0-wm_ 3-wmp_4-s_2860637787.png "title=" 19.png "alt=" Wkiom1ncsivbkdn1aad3gv8whoi732.png-wh_50 "/>

4: Create a trigger

Ps: Monitor the return status code of the website if it is not, direct alarm

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/A5/B9/wKioL1nCSgHTFe-RAADlWfz72M0696.png-wh_500x0-wm_ 3-wmp_4-s_3754217350.png "title=" 20.png "alt=" Wkiol1ncsghtfe-raadlwfz72m0696.png-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/07/09/wKiom1nCSj_TD-QvAAEfZ7Sevl0505.png-wh_500x0-wm_ 3-wmp_4-s_2677494106.png "title=" 21.png "alt=" Wkiom1ncsj_td-qvaaefz7sevl0505.png-wh_50 "/>

5: Create graphics, slightly

You can see that the default monitoring items are:

Download speed of the site download the scenario

Download speed of Web page download ofthe step item:web.test.in[scenario,,bps]

Steps to fail step faild step Ofscenario Item:web.test.fail[scenario]

Previous error page last ErrorPage Item:web.test.error[scenario]

Page return Code Response code of the step Item:web.test.rspcode[scenario,step]

Web page Response time response for Thestep Item:web.test.time[scenario,step]


Zabbix basic monitoring, port monitoring, web site monitoring, mail alarm

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.