Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix distributed and automatic discovery and registration

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Introduction to zabbix

Zabbix is an enterprise-level open source solution based on WEB interface that provides distributed system monitoring and network monitoring capabilities.

Zabbix can monitor various network parameters to ensure the safe operation of the server system, and provides a flexible notification mechanism to enable system administrators to quickly locate / solve various problems.

Zabbix consists of two parts, zabbix server and optional component zabbix agent.

Zabbix server can provide remote server / network status monitoring, data collection and other functions through SNMP,zabbix agent,ping, port monitoring and other methods. It can run on platforms such as Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X.

Advantages of Zabbix:

1 supports distributed monitoring

(2) it has its own drawing function, which can obtain numerical data and generate graphs automatically.

3 Web configuration mode, easy to operate and use. It is very fast to add monitoring items or machines.

When there is an alarm, no matter in any interface, a small window will pop up to give an alarm, and there will be an alarm sound prompt at the same time, at the same time, you can quickly check the monitoring items.

5 it comes with rich built-in functions, and it also supports the call of scripts and nagios scripts.

6 when there is a problem, you can automatically execute the command remotely (you need to set the execution permission on agent)

Disadvantages of Zabbix:

1 it is not convenient to modify in batches, it can be assisted by database.

2 after in-depth, there are very few Chinese materials, most of the questions need to see the official documents and forums.

(3) lack of data summary function, if you can't view the average value of a set of servers, you can consider secondary development.

4 compared with cacti, zabbix has poorer drawing function and more complex traffic acquisition.

First, zabbix proxy compilation and installation

Distributed architecture

Zabbix Server-> Zabbix Proxy-> Zabbix Agent (multiple sets)

Agent's Server whitelist needs to be configured with Proxy

The proxy agent needs database storage

Mysql database installation

Yum install mariadb-server mariadb mariadb-devel-ysystemctl restart mariadbsystemctl enable mariadb

Database initialization

Root:mysql # # Log in to create database zabbix character set utf8 collate utf8_bin;grant all privileges on zabbix.* to zabbix@'127.0.0.1' identified by 'zabbixpwd';set names utf8;use zabbix;source / usr/local/src/zabbix-4.0.3/database/mysql/schema.sql

Zabbix Proxy installation

Yum install-y tar gcc make gcc-c++ net-snmp-devel libxml2-devel libcurl-devel pcre-develuseradd-s / sbin/nologin zabbixcd / usr/local/src/wget 'https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.0.3/zabbix-4.0.3.tar.gz'tar-zxvf zabbix-4.0.3.tar.gzcd zabbix-4.0.3./configure-- prefix=/usr/local/zabbix-- enable-proxy- Enable-agent-with-mysql-with-net-snmp-with-libcurl-with-libxml2make & & make installchown-R zabbix:zabbix / usr/local/zabbix/

Modify the configuration file

Vim / usr/local/zabbix/etc/zabbix_proxy.confHostname=bjproxy # # hostname Server=192.168.237.49 # # zabbx server whitelist LogFile=/usr/local/zabbix/zabbix_proxy.logDBHost=127.0.0.1DBName=zabbixDBUser=zabbixDBPassword=zabbixpwdDBPort=3306ConfigFrequency=60# launch Zabbix _ Proxy

Web page configuration proxy server

Proxy name must be consistent with the hostname in the configuration file

Active is proxy to request zabbix server and passive is zabbix server to request zabbix server every once in a while.

Fill in the proxy address for proxy address

Monitor the host through proxy

This place selects proxy devices and customizes the addition of monitoring items as before.

Two: zabbix automatic discovery and registration

Automatic discovery

Auto-discovery name, whether through agent auto-discovery, IP segment, auto-discovery update time, check auto-discovery key

Check to see if the configuration is successful

Actions after automatic discovery (add host, add host group, associate application template, etc.)

Pay attention to fill in the found conditions

Action after discovery: join the server group association template

After success, you will see the relevant host information in hosts. The disadvantage is that it is troublesome to set the host name.

Automatic registration

Auto registration is relatively easier to use than automatic discovery.

If auto-registration is used, the host name is Hostname configured by Agent when adding the host.

Automatic registration process:

1Zabix client needs to be configured with ServerActive

2the Zabbix client provides its own metadata to the zabbix server or zabbix distributed proxy

3 add actions to the Zabbix server, automatically add hosts, link templates, etc., when metadata is received

Agent client configuration

PidFile=/usr/local/zabbix/zabbix_agentd.pidLogFile=/usr/local/zabbix/zabbix_agentd.logHostname=www_001 # # consistent with hostname Server=192.168.237.50 # # proxy fill in proxy address, no agent fill in server address ServerActive=192.168.237.50 # # have proxy fill in proxy address, no agent fill in server address UnsafeUserParameters=1 Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/*.confHostMetadataItem=system.uname # # metadata

Add the metadata source and fill in the computer name match as shown in the figure: if the initial computer name is www_, it will be automatically registered and added.

Add proxy with proxy

Add actions after deployment registration

Verification

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report