Zabbix Agent automatic and active registration, zabbixagent Registration

Source: Internet
Author: User

Zabbix Agent automatic and active registration, zabbixagent Registration


Brief description:

Let's take a look at the active registration function of Zabbix today.

When you have ten machines to monitor, you can add them manually. But what do you do when you have 50, hundreds, or more servers to monitor?

Active Agent Auto-Registration is mainly used for Active agents and automatic Registration with the Server. The problem of inconsistent Agent IP addresses, systems, and configurations is well solved.

Suitable for the current cloud environment.

1. Install the Agent

shell > cd /scripts ; vim auto_install_zabbix_agent.sh#!/bin/bashcd /usr/local/src# download zabbix agentwget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.1/zabbix-3.0.1.tar.gz# install zabbix agenttar zxf zabbix-3.0.1.tar.gzcd zabbix-3.0.1./configure --prefix=/usr/local/zabbix_agent --enable-agent ; make install# configcp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/sed -i 's#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix_agent#' /etc/init.d/zabbix_agentdecho 'Zabbix Agent is Install sucessed .'# End

Ii. Configure Agent auto-Registration

Shell> grep-vP '^ # | ^ $'/usr/local/zabbix_agent/etc/logs =/tmp/zabbix_agentd.log # specify the Log Path Server = 121.42.11.220 # Zabbix in passive mode server address # StartAgents = 0 # disable passive mode (after disabling, the agent will not listen to any address or port) serverActive = 121.42.11.220 # Zabbix Server address in Active Mode Hostname = Auto RServer 54.64 # machine ID (host name displayed on the Web interface) HostMetadata = password 123456 # proactive registration conditions, flexible, you can use this method just like me. Only when the two fields match completely can the host be added.

3. Start the Agent

shell > service zabbix_agentd startshell > netstat -lnpt | grep zabbix_agenttcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 7149/zabbix_agentd

Iv. Web Front-end Configuration

1. Template

> Configuration --> Templates --> click Templates OS Linux --> Full clone (Full clone)

Template name Template OS Linux Active # a unique name

Add # complete cloning

> Configuration --> Templates --> click Templates OS Linux Active --> Items (also change item to Active mode) --> select all and click the following Mass update

Type # check box to change the original Zabbix agent to Zabbix agent (active)

Update # complete

# We found that another Template App Zabbix Agent is associated with this Template. Use the same method to modify it!
# After modification, you also need to open the modified OS Linux template. Linked template replaces the original passive Agent template with the changed active Agent template.

2. Auto Registration

> Configuration --> Actions --> (Event source) Auto-Registration --> Create action

Name Auto Registration

Default subject Auto registration: {HOST: HOST}

Default message Host name: {HOST. HOST}
Host IP: {HOST. IP}
Agent port: {HOST. PORT}

Conditions)

New condition Host metadata like password # condition 1
Add

New condition Host metadata like 123456 # condition 2
Add

Type of calculation And A and B # The relationship is And, And both conditions must be met at the same time

Operations)

Action operations New # Start adding operation

Operation details Operation type Add host # Operation 1: Add a host
Add

Operation details Operation type Link to template # Operation 2: Link template
Templates Template OS Linux Action
Add

Operation details Operation type Send message # Operation 3: Send an email
Send to User groups DevOPS
Send only to My_Email
Default message √
Add

Add # All completed!

V. Test

# After saving, the host automatically registers and receives an email in about one or two minutes!

# Problems!

1. If the active mode is completely disabled by the Agent (comment out the Server, set StartAgents to 0 ## comment out the previous mode, and set StartAgents to 0)

The Agent does not listen to any address or port!

The Zabbix Server Web displays that the Agent cannot be connected. This is because the Agent address and port are written in the Agent interfaces in the added host.

2. Firewall: Zabbix Server TCP 10051/Zabbix Agent Server TCP 10050

3. Host status: if the data can be obtained, no error is reported, that is, the color remains unchanged. Restart Zabbix Server.

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.