应该能更早出的第四弹,被虚拟机错误搅乱,迟迟没有上线,不得已将所有
节点用puppet完成上线,稍后整理第五弹(非你不可自动化)也即将上线 : )
zabbix简介
zabbix是基于Php的开源监控软件
基于多重数据采集 SNMP , Agent , Ping , Port
多重告警通知 Mail , Jabber , SMS
可以完成多种操作平台甚至于设备(route,switch,io)的监控工作
易于定制重用(模板机制,函数),甚至于二次开发
告警及时几乎无延迟
它与cacti最大的不同之处在于它还提供一个分布式企业监控解决方案
zabbix组成
zabbix-server 主要完成监控数据的存储与分析告警
zabbix-proxy 分布式环境重要一环,提server完成的数据存储压力
zabbix-agent 数据采集重要节点
zabbix-web 数据展示与监控配置
这些节点便完成了自动化监控中: 数据采集 , 数据存储 , 数据展示 , 分析告警
zabbix组件关系示意
规划如下
server.king.com 172.16.43.6 192.168.43.6
zabbix-server , zabbix-web , php , httpd , mysql
proxy.king.com 172.16.43.5
zabbix-proxy , mysql
slave1-4.king.com 172.16.43.1-4
配置过程如下
1 配置安装zabbix-server(172.16.43.6)
i)准备如下文件zabbix-2.0.8-3.el6.x86_64.rpmzabbix-get-2.0.8-3.el6.x86_64.rpmzabbix-server-2.0.8-3.el6.x86_64.rpmzabbix-server-mysql-2.0.8-3.el6.x86_64.rpmzabbix-web-2.0.8-3.el6.noarch.rpmzabbix-web-mysql-2.0.8-3.el6.noarch.rpmmariadb-10.0.10-linux-x86_64.tar.gz(安装过程参见)php-5.4.26.tar.bz2(安装过程参见)httpd-2.2(系统自带)##ii)安装配置yum -y install *.rpm# 创建zabbix数据库及账号mysql -e "create database zabbix;"mysql -e "grant all on *.* to 'zabbix'@'172.16.%.%' identified by 'zabbix';"mysql -e "flush privileges;"# 导入zabbix web所需表mysql -h172.16.43.6 -uzabbix -p -D zabbix <p># 查看10051端口是否开启</p><p><img src="/static/imghwm/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c140719/1405KI3Y21Z-93U8.jpg" class="lazy" title="2.png" alt="wKiom1N4mbqyEnxKAAopgQpwTYI698.jpg"></p><p># 浏览器访问配置</p><p>http://172.16.43.6/zabbix</p><p><img src="/static/imghwm/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c140719/1405KI3940620-103040.jpg" class="lazy" title="3.png" alt="wKiom1N4mdPCpyCnAAxjGdI64ks946.jpg"></p><p>2 代理服务器安装配置(172.16.43.5)</p><pre class="brush:php;toolbar:false">i) 准备如下文件zabbix-2.0.8-3.el6.x86_64.rpmzabbix-proxy-2.0.8-3.el6.x86_64.rpmzabbix-proxy-mysql-2.0.8-3.el6.x86_64.rpmmariadb-10.0.10-linux-x86_64.tar.gz(安装过程参见)##ii) 安装配置yum -y install *.rpm# 创建zabbix数据库及账号mysql -e "create database zabbixproxy;"mysql -e "grant all on *.* to 'zabbixproxy'@'172.16.%.%' identified by 'zabbixproxy';"mysql -e "flush privileges;"# 导入zabbix web所需表mysql -h172.16.43.5 -uroot -p -D zabbixproxy <p># 查看10051端口是否开启</p><p><img src="/static/imghwm/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c140719/1405KI3a3440-11YW.jpg" class="lazy" title="4.png" alt="wKioL1N4mffgnlebAAn8w8HKIOM463.jpg"></p><p>3 客户端配置(172.16.43.1 - 172.16.43.4)</p><pre class="brush:php;toolbar:false">i) 准备如下文件zabbix-2.0.8-3.el6.x86_64.rpmzabbix-agent-2.0.8-3.el6.x86_64.rpm zabbix-sender-2.0.8-3.el6.x86_64.rpm##ii) 安装配置yum -y install zabbix-2.0.8-3.el6.x86_64.rpm zabbix-agent-2.0.8-3.el6.x86_64.rpm zabbix-sender-2.0.8-3.el6.x86_64.rpm# 编辑配置文件vim /etc/zabbix/zabbix_agentd.confServer=172.16.43.5 (#86)ServerActive=172.16.43.5 (#127)Hostname=slave4.king.com (#138)# 启动zabbix-agent服务service zabbix-agent start
# 查看10050端口是否开启
4. 配置自动发现规则将客户端添加至监控体系
# 配置代理服务器
Administration -> DM -> Create Proxy (均指在WebGui下菜单栏路径)
# 配置自动发现规则
Configuration -> Discovery -> Create discovery rule ->
# 配置发现后的动作
Configuration -> Actions -> Create action -> Event source(Discovery) ->
# 配置完毕重启zabbix-proxy等待即可
5. 使用基本规则完成对cpu,io,net参数的监控
# zabbix内置了很多模板,我们可以使用来完成第5项的监控
# 改动刚才Actions除了发现主机将主机添加至监控列表外,额外定义link to templates即可
# 可以选择 Template OS Linux
# 这样发现之后的主机便可以完成对cpu,io,net的基本监控
# 最后我们还可以定义自动移除规则
Configuration -> Actions -> Create action -> Event source(Discovery) ->
6. 使用自定义函数完成对 nginx , varnish , mysql等服务的监控
# zabbix已经对mysql的自定义参数做出了范例,我们可以进行访问来完成对更多服务的监控vim /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf## 监控nginx的连接活动数,访问数,处理个数vim /etc/zabbix/zabbix_agentd.d/nginx.confUserParameter=Nginx.active[*], /usr/bin/curl -s "http://$1:$2/status" | awk '/^Active/ {print $NF}'UserParameter=Nginx.accepted[*], /usr/bin/curl -s "http://$1:$2/status" | awk '/^[ /t]+[0-9]+[ /t]+[0-9]+[ /t]+[0-9]+/ {print $$1}'UserParameter=Nginx.handled[*], /usr/bin/curl -s "http://$1:$2/status" | awk '/^[ /t]+[0-9]+[ /t]+[0-9]+[ /t]+[0-9]+/ {print $$2}'## 监控varnish的连接数,命中数,命中率vim /etc/zabbix/zabbix_agentd.d/varnish.confUserParameter=varnish.conn,/usr/bin/varnishstat -1 | grep "client_conn" | awk '{print $2}' UserParameter=varnish.hit,/usr/bin/varnishstat -1 | grep "cache_hit" | awk '{print $2}'#
# 定义好后可以将自动key添加到item,

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.