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

5 页面参数

概述

大多数Zabbix Web界面页面支持各种HTTP GET参数,用于控制显示的内容。 可以通过在URL之后指定parameter=value(参数=值)对成对来传递它们,通过问号(?)与URL分开,并通过&符号(&)彼此分隔。

触发器状态

Accessed as Monitoring → Triggers, 页面名 tr_status.php.

要设置过滤器,必须传递参数 filter_set=1 。 未指定的字段将重置为默认值。

一般参数
  • groupid
  • hostid
  • fullscreen
页面特殊参数
  • show_triggers - filter选项Triggers status(触发器状态), 1 -Recent problem(近期的异常), 2 - Any(任何异常), 3 - Problem(异常)
  • show_events - filter 选项 Events(事件), 1 – Hide all(隐藏所有), 2 – See all(显示所有), 3 - Show unacknowledged(显示未确认的)
  • ack_status - filter 选项 Acknowledge status(确认状态), 1 – Any (所有), 2 - With unacknowledged events (所有未确认状态), 3 - With last event unacknowledged (最后一个未确认事件)
  • show_severity - filter选项 Min severity(最小严苛度), 0-5 - corresponding severity(对应的严苛度)
  • show_details - filter 选项 Show details(显示细节), 0 - do not show (不显示), 1 – show(显示)
  • status_change_days - filter 选项Age less than(时间小于), 以天计
  • status_change - filter option ** Age less than(时间小于)**, 0 – disabled(禁用), 1 - enabled (可用)(status_change_days 可用)
  • txt_select - filter option 0 – disabled(禁用), 1 - enabled (可用)(status_change_days 可用), 任意字符串
  • application - filter option Application(应用), 任意字符串
  • show_maintenance - filter option Show hosts in maintenance(显示在维护中的主机), 0 - do not show hosts in maintenance(不显示在维护中的主机), 1 - show hosts in maintenance(显示在维护中的主机)
* 

库存过滤器

从Zabbix 2.4.0开始,触发器可被库存过滤。这里的语法会相对复杂一下。库存的字段和值是添加在一个以0为底的索引条目中,例如:

inventory[0][field]=type_full
       inventory[0][value]=Virtual machine
       inventory[1][field]=os_full
       inventory[1][value]=Linux

这些必须是经过 URL编码,传递参数的值如下:

inventory%5B0%5D%5Bfield%5D=type_full
       inventory%5B0%5D%5Bvalue%5D=Virtual machine
       inventory%5B1%5D%5Bfield%5D=os_full
       inventory%5B1%5D%5Bvalue%5D=Linux

库存字段代码可以在 [[:manual:api:reference:host:object#host_inventory|Zabbix API host 对象文档].中找到

触发器事件

访问一个可能对通知有用的特殊触发器事件,可以使用以下 URL

http://<server_ip_or_name>/zabbix/events.php?triggerid={TRIGGER.ID}&filter_set=1