Zabbix topic: Eighth Ohata: MACRO

Source: Internet
Author: User


Zabbix topic: Eighth Ohata: MACRO


Interested in Linux friends join QQ Group: 476794643 Online communication


This article anti-theft chain: http://zhang789.blog.51cto.com


ZABBIX macro

(1) The macro is an abstraction, He replaces certain text patterns based on a set of predefined rules, and the interpreter or compiler automatically makes this pattern substitution when it encounters a macro, which can be understood as a variable.  
(2) Zabbix has many built-in macros, such as {host.name}, {HOST. IP}, {TRIGGER. DESCRIPTION}, {trigger.name}, {TRIGGER. EVENTS. ACK} etc  
(3) for greater flexibility, Zabbix supports global, template, or host-level custom macros, and user-defined macros use the special syntax format "{$MACRO}", where the macro name can only be   with uppercase letters, numbers, and underscores;
(4) Macros can be applied to information about the item keys and descriptions, trigger name and expression, host interface Ip/dns, and the SNMP protocol of the port, discovery mechanism medium

Priority: Host –> template –> Global
will be used directly after a certain level is found;

Types of macros
Built in: {macro_name}
Custom: {$MARCRO _name} #自建的宏加$

Three macros in the Zabbix Web interface inside the place

Global macros

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/89/CA/wKioL1gcho_y3ZNMAACwHetZh38473.png "title=" Qq20161104204915.png "alt=" Wkiol1gcho_y3znmaacwhetzh38473.png "/>

Host Macros

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/89/CA/wKioL1gchp_T659MAACGmy9nrT4704.png "title=" Qq20161104205017.png "alt=" Wkiol1gchp_t659maacgmy9nrt4704.png "/>

Template Macros

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/89/CC/wKiom1gchq2SRx5kAAB_chmqduI443.png "title=" Qq20161104205135.png "alt=" Wkiom1gchq2srx5kaab_chmqdui443.png "/>

Example: Define a global macro in admin, apply Web listener to port 80

1. Create a global macro

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/89/CA/wKioL1gchrzx70FFAABaCjJWe_I183.png "title=" Qq20161104205218.png "alt=" Wkiol1gchrzx70ffaabacjjwe_i183.png "/>

2. Add a defined macro to the monitoring item

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/89/CC/wKiom1gchsqhnUfoAADCfOI3wnc176.png "title=" Qq20161104205339.png "alt=" Wkiom1gchsqhnufoaadcfoi3wnc176.png "/>

3, the macro has been effective, (you can shut down the httpd service, see if the monitoring is normal, my is normal)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/CA/wKioL1gchtiwVbJkAADCXF6lZhI002.png "title=" Qq20161104205404.png "alt=" Wkiol1gchtiwvbjkaadcxf6lzhi002.png "/>


This article from "Live by the Sea like Waves" blog, please be sure to keep this source http://zhang789.blog.51cto.com/11045979/1869626

Zabbix topic: Eighth Ohata: MACRO

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.