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

> 模版仪表盘对象

以下对象与 templatedashboard API 直接相关。

模板仪表盘

模板仪表盘对象具有以下属性。

属性 类型 描述
dashboardid string (只读) 模板仪表盘的ID。
name
(必选)
string 模板仪表盘的名称。
templateid
(必选)
string 仪表盘所属模板的ID。
display_period integer 默认页面显示周期(秒)。

可能的值:10, 30, 60, 120, 600, 1800, 3600。

默认值:30。
auto_start integer 自动开始幻灯片播放。

可能的值:
0 - 不自动开始幻灯片播放;
1 - (默认) 自动开始幻灯片播放。
uuid string 通用唯一标识符,用于将导入的模板仪表盘链接到已存在的仪表盘。如果未给出,则自动生成。

请注意,对于一些方法(更新,删除),必选/可选参数组合是不同的。

模版仪表盘页面

模板仪表板页面对象具有以下属性。

属性 类型 描述
dashboard_pageid string (只读) 仪表盘页面的ID。
name string 仪表盘页面的名字。

默认值: 空的字符串。
display_period integer 仪表盘页面显示时间(秒)。

可能的值: 0, 10, 30, 60, 120, 600, 1800, 3600.

默认值: 0 (将一直使用默认的页面显示)。
widgets array 模版仪表盘组件对象的数组。

模版仪表盘组件

模板仪表板组件对象具有以下属性。

属性 类型 描述
widgetid string (只读) 仪表盘组件的ID。
type
(必须)
string 仪表盘组件的类型

可能的值:
clock - 时钟;
graph - 图形(经典);
graphprototype - 图形原型;
item - 监控项的值;
plaintext - 纯文本;
url - URL;
name string 自定义组件名称。
x integer 仪表板左侧的水平位置。

有效值的范围为0到23。
y integer 仪表板顶部的垂直位置。

有效值的范围为0到62。
width integer 组件的宽度。

有效值的范围为1到24.
height integer 组件的高度。

有效值的范围为2到32。
view_mode integer 组件视图模式。

可能的值:
0 - (默认值) 默认组件视图。
1 - 隐藏标题;
fields array 模版仪表盘组件字段对象的数组。

模板仪表盘控件字段

模板仪表盘控件字段对象具有以下属性。

属性 类型 描述
type
(必选)
integer 控件字段的类型。

可能的值:
0 - 整数;
1 - 字符串;
4 - 监控项;
5 - 监控项原型;
6 - 图表;
7 - 图表原型。
name string 控件字段名称。
value
(必选)
mixed 根据类型的控件字段值。