2022 Zabbix中国峰会
2022 Zabbix中国峰会

2 用户自定义宏使用场景

2 User macros supported by location v

概述

Overview

用户自定义宏可以用于以下场景: User-definable macros are supported in the following locations:

  • 设备
    • 接口 IP/DNS
    • 接口 port
  • Hosts
    • Interface IP/DNS
    • Interface port
  • 被动 proxy
    • 接口 port
  • Items 和 item 原型
    • 名称
    • Key 参数
    • 更新间隔
    • 用户自定义间隔
    • 历史数据存储周期
    • 趋势数据存储周期
    • SNMPv3 context 名称
    • SNMPv3 security 名称
    • SNMPv3 auth 密码
    • SNMPv3 priv 密码
    • SNMPv1/v2 团体串
    • SNMP OID
    • SNMP port
    • SSH 用户名
    • SSH 公钥
    • SSH 私钥
    • SSH 密码
    • SSH 脚本
    • Telnet 用户名
    • Telnet 密码
    • Telnet 脚本
    • Calculated item 公式
    • Trapper item "Allowed hosts" 字段
    • 数据库监控附加字段
    • JMX item endpoint 字段
    • 从Zabbix 4.0开始支持以下字段:
      • item 值预处理步骤
      • HTTP agent URL 字段
      • HTTP agent HTTP query fields 字段
      • HTTP agent request body 字段
      • HTTP agent required status codes 字段
      • HTTP agent headers field key 和 value
      • HTTP agent HTTP 认证用户名字段
      • HTTP agent HTTP 认证密码字段
      • HTTP agent HTTP proxy 字段
      • HTTP agent SSL certificate 文件字段
      • HTTP agent SSL key 文件字段
      • HTTP agent SSL key 密码字段
      • HTTP agent HTTP 超时字段
      • HTTP agent HTTP 允许设备字段
  • Items and item prototypes
    • Name
    • Key parameters
    • Update interval
    • Custom intervals
    • History storage period
    • Trend storage period
    • SNMPv3 context name
    • SNMPv3 security name
    • SNMPv3 auth pass
    • SNMPv3 priv pass
    • SNMPv1/v2 community
    • SNMP OID
    • SNMP port
    • SSH username
    • SSH public key
    • SSH private key
    • SSH password
    • SSH script
    • Telnet username
    • Telnet password
    • Telnet script
    • Calculated item formula
    • Trapper item "Allowed hosts" field
    • Database monitoring additional parameters
    • JMX item endpoint field
    • since Zabbix 4.0 also in:
      • item value preprocessing steps
      • HTTP agent URL field
      • HTTP agent HTTP query fields field
      • HTTP agent request body field
      • HTTP agent required status codes field
      • HTTP agent headers field key and value
      • HTTP agent HTTP authentication username field
      • HTTP agent HTTP authentication password field
      • HTTP agent HTTP proxy field
      • HTTP agent SSL certificate file field
      • HTTP agent SSL key file field
      • HTTP agent SSL key password field
      • HTTP agent HTTP timeout field
      • HTTP agent HTTP allowed hosts field
  • 发现
    * 更新间隔
           * SNMPv3 context 字段
           * SNMPv3 security 字段
           * SNMPv3 auth 密码
           * SNMPv3 priv 密码
           * SNMPv1/v2 团体串
           * SNMP OID
       * Discovery
           * Update interval
           * SNMPv3 context name
           * SNMPv3 security name
           * SNMPv3 auth pass
           * SNMPv3 priv pass
           * SNMPv1/v2 community
           * SNMP OID
  • Low-level 发现规则
    • 名称
    • Key 参数
    • 更新间隔
    • 用户自定义间隔
    • SNMPv3 context 名称
    • SNMPv3 security 名称
    • SNMPv3 auth 密码
    • SNMPv3 priv 密码
    • SNMPv1/v2 团体串
    • SNMP OID
    • SNMP port
    • SSH 用户名
    • SSH 公钥
    • SSH 私钥
    • SSH 密码
    • SSH 脚本
    • Telnet 用户名
    • Telnet 密码
    • Telnet 脚本
    • Trapper item 允许设备字段
    • 数据库监控附加字段
    • JMX item endpoint 字段
    • 保持资源丢失时间
    • 过滤正则表达式
    • 从Zabbix 4.0开始支持以下字段:
      • HTTP agent URL 字段
      • HTTP agent HTTP query fields 字段
      • HTTP agent request body 字段
      • HTTP agent required status codes 字段
      • HTTP agent headers field key 和 value
      • HTTP agent HTTP 认证用户名字段
      • HTTP agent HTTP 认证密码字段
      • HTTP agent HTTP 超时字段
  • Low-level discovery rule
    • Name
    • Key parameters
    • Update interval
    • Custom intervals
    • SNMPv3 context name
    • SNMPv3 security name
    • SNMPv3 auth pass
    • SNMPv3 priv pass
    • SNMPv1/v2 community
    • SNMP OID
    • SNMP port
    • SSH username
    • SSH public key
    • SSH private key
    • SSH password
    • SSH script
    • Telnet username
    • Telnet password
    • Telnet script
    • Trapper item "Allowed hosts" field
    • Database monitoring additional parameters
    • JMX item endpoint field
    • Keep lost resources period
    • Filter regular expressions
    • since Zabbix 4.0 also in:
      • HTTP agent URL field
      • HTTP agent HTTP query fields field
      • HTTP agent request body field
      • HTTP agent required status codes field
      • HTTP agent headers field key and value
      • HTTP agent HTTP authentication username field
      • HTTP agent HTTP authentication password field
      • HTTP agent HTTP timeout field
  • Web scenario
    * 名称
           * 更新间隔
           * Agent
           * HTTP proxy
           * Variables
           * Headers
           * Step name
           * Step URL
           * Step post variables
           * Step headers
           * Step timeout
           * Required string
           * 必须的状态
           * 认证 (用户名和密码)
           * SSL certificate 文件
           * SSL key 文件
           * SSL key 密码
       * Web scenario 
           * Name
           * Update interval
           * Agent
           * HTTP proxy
           * Variables
           * Headers
           * Step name
           * Step URL
           * Step post variables
           * Step headers
           * Step timeout
           * Required string
           * Required status codes
           * Authentication (user and password)
           * SSL certificate file
           * SSL key file
           * SSL key password
        
       * Triggers
           * 名称
           * 表达式 (仅在常量和函数参数中)
           * 描述信息
           * URLs    
  • Triggers
    * Name
           * Expression (only in constants and function parameters)
           * Description
           * URLs
       
       
       * 基于Trigger通知
       * 基于Trigger内部通知
       * 问题更新通知
       * Trigger-based notifications
       * Trigger-based internal notifications
       * Problem update notifications
       
       * 事件tags
           * Tag 名称 
           * Tag 值 
           * Tag 匹配
       * Event tags
           * Tag name 
           * Tag value 
           * Tag for matching 
  • 动作操作
    * 默认步骤持续时间
           * 步骤持续时间
       * Action operations
           * Default operation step duration
           * Step duration
       
       * 动作条件
           * 时间周期条件
       * Action conditions
           * Time period condition
  • 全局脚本 (包括确认文本)
  • Global scripts (including confirmation text)
  • dynamic URL screen 元素的URL字段。
  • URL field of dynamic URL screen element
  • 管理 → 用户 → 媒介: 'When active' 字段。
  • 管理 → 一般 → 工作时间: 'Working time' 字段。
  • Administration → Users → Media: 'When active' field
  • Administration → General → Working time: 'Working time' field

需要Zabbix所支持宏的完整列表, 请参考 支持宏列表。 For a complete list of all macros supported Zabbix, see macros supported by location.