这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.
2022 Zabbix中国峰会
2022 Zabbix中国峰会

4 网络拓扑图

概览

网络拓扑图 导出 包括:

  • 所有相关的图片
  • 拓扑图结构-所有拓扑图设置,所有包含的元素及其设置,拓扑图链接和拓扑图链接状态指示器

不导出与导出映射相关的主机组、主机、触发器、其他映射或其他元素。因此,如果映射引用的元素中至少有一个缺失,则导入它将失败。

网络拓扑图 导出/导入 支持从 Zabbix 1.8.2开始。

导出时

要导出网络拓扑图时,请执行以下操作:

  • 前往: MonitoringMaps
  • 标记要导出的网络拓扑图的复选框
  • 点击列表下方的Export

根据选择的格式,拓扑图被导出到一个默认名称的本地文件:

  • zabbix_export_maps.yaml - 在YAML导出(导出的默认选项)
  • zabbix_export_maps.xml - 在XML导出
  • zabbix_export_maps.json - 在JSON导出

导入时

导入网络拓扑图,请执行以下操作:

  • 前往: MonitoringMaps
  • 点击右边的 Import
  • 选择导入文件
  • 在导入规则中标记所需的选项
  • 点击 Import

所有强制输入字段都用红色星号标记。

前端将显示导入成功或失败的消息。

导入规则:

规则 描述
Update existing 现有的拓扑图将使用从导入文件中获取的数据进行更新。 否则它们将不会被更新。
Create new 导入将使用导入文件中的数据添加新的拓扑图。 否则它将不会添加它们。

如果您取消这两个拓扑图选项,并检查图像的相应选项,则只会导入图像。 图像导入只对超级管理员用户有效。

如果替换现有的图像,将影响使用该图像的所有拓扑图

导出格式

以YAML格式导出:

zabbix_export:
         version: '6.0'
         date: '2021-08-31T12:55:10Z'
         images:
           -
             name: Zabbix_server_3D_(128)
             imagetype: '1'
             encodedImage: iVBOR...5CYII=
         maps:
           -
             name: 'Local network'
             width: '680'
             height: '200'
             label_type: '0'
             label_location: '0'
             highlight: '1'
             expandproblem: '1'
             markelements: '1'
             show_unack: '0'
             severity_min: '0'
             show_suppressed: '0'
             grid_size: '50'
             grid_show: '1'
             grid_align: '1'
             label_format: '0'
             label_type_host: '2'
             label_type_hostgroup: '2'
             label_type_trigger: '2'
             label_type_map: '2'
             label_type_image: '2'
             label_string_host: ''
             label_string_hostgroup: ''
             label_string_trigger: ''
             label_string_map: ''
             label_string_image: ''
             expand_macros: '1'
             background: {  }
             iconmap: {  }
             urls: {  }
             selements:
               -
                 elementtype: '0'
                 elements:
                   -
                     host: 'Zabbix server'
                 label: |
                   {HOST.NAME}
                   {HOST.CONN}
                 label_location: '0'
                 x: '111'
                 'y': '61'
                 elementsubtype: '0'
                 areatype: '0'
                 width: '200'
                 height: '200'
                 viewtype: '0'
                 use_iconmap: '0'
                 selementid: '1'
                 icon_off:
                   name: Zabbix_server_3D_(128)
                 icon_on: {  }
                 icon_disabled: {  }
                 icon_maintenance: {  }
                 urls: {  }
                 evaltype: '0'
             shapes:
               -
                 type: '0'
                 x: '0'
                 'y': '0'
                 width: '680'
                 height: '15'
                 text: '{MAP.NAME}'
                 font: '9'
                 font_size: '11'
                 font_color: '000000'
                 text_halign: '0'
                 text_valign: '0'
                 border_type: '0'
                 border_width: '0'
                 border_color: '000000'
                 background_color: ''
                 zindex: '0'
             lines: {  }
             links: {  }

元素标签

下表解释了元素标签值。

元素 元素属性 类型 适用范围 描述
images 图像的根元素。
name string 唯一的图像名称。
imagetype integer 1 - image
2 - background
图像类型。
encodedImage Base64编码的图像。
maps 拓扑图的根元素。
name string 唯一的拓扑图名称。
width integer 拓扑图宽度,以像素为单位。
height integer 拓扑图高度,以像素为单位。
label_type integer 0 - label
1 - host IP address
2 - element name
3 - status only
4 - nothing
拓扑图元素标签类型。
label_location integer 0 - bottom
1 - left
2 - right
3 - top
默认情况下拓扑图元素标签位置。
highlight integer 0 - no
1 - yes
为活动触发器和主机状态启用图标高亮显示。
expandproblem integer 0 - no
1 - yes
显示具有单个问题的元素的问题触发器。
markelements integer 0 - no
1 - yes
突出显示最近更改了状态的拓扑图元素。
show_unack integer 0 - count of all problems
1 - count of unacknowledged problems
2 - count of acknowledged and unacknowledged problems separately
问题显示。
severity_min integer 0 - not classified
1 - information
2 - warning
3 - average
4 - high
5 - disaster
拓扑图上默认显示的最小触发严重程度。
show_suppressed integer 0 - no
1 - yes
显示问题,否则将被抑制(不显示),因为主机维护。
grid_size integer 20, 40, 50, 75 or 100 拓扑图网格的单元格大小,以像素为单位,如果 "grid_show=1"。
grid_show integer 0 - yes
1 - no
在拓扑图配置中显示网格。
grid_align integer 0 - yes
1 - no
自动对齐图标在拓扑图配置。
label_format integer 0 - no
1 - yes
使用高级标签配置。
label_type_host integer 0 - label
1 - host IP address
2 - element name
3 - status only
4 - nothing
5 - custom label
显示主机标签,如果"label_format=1"。
label_type_hostgroup integer 0 - label
2 - element name
3 - status only
4 - nothing
5 - custom label
显示主机组标签,如果"label_format=1"。
label_type_trigger integer 0 - label
2 - element name
3 - status only
4 - nothing
5 - custom label
显示触发器标签,如果"label_format=1"。
label_type_map integer 0 - label
2 - element name
3 - status only
4 - nothing
5 - custom label
显示拓扑图标签,如果"label_format=1"。
label_type_image integer 0 - label
2 - element name
4 - nothing
5 - custom label
显示为图像标签,如果"label format=1"。
label_string_host string 自定义标签的主机元素,如果"label_type_host=5"。
label_string_hostgroup string 主机组元素的自定义标签,如果"label_type_hostgroup=5"。
label_string_trigger string 自定义触发器元素的标签,如果"label_type_trigger=5"。
label_string_map string 自定义标签的map元素,如果"label_type_map=5"。
label_string_image string 自定义标签的图像元素,如果"label_type_image=5"。
expand_macros integer 0 - no
1 - yes
在拓扑图配置中展开标签中的宏。
background id 背景图像的ID(如果有),如果"imagetype=2"。
iconmap id 图标映射的ID(如果有)。
urls 由映射或每个映射元素使用。
name string 连接名。
url string 连接URL。
elementtype integer 0 - host
1 - map
2 - trigger
3 - host group
4 - image
连接所属的拓扑图项类型。
selements
elementtype integer 0 - host
1 - map
2 - trigger
3 - host group
4 - image
拓扑图元素类型。
label string Icon标签。
label_location integer -1 - use map default
0 - bottom
1 - left
2 - right
3 - top
x integer X轴上的位置。
y integer Y轴上的位置。
elementsubtype integer 0 - single host group
1 - all host groups
元素子类型,如果"elementtype=3"。
areatype integer 0 - same as whole map
1 - custom size
区域大小,如果"elementsubtype=1"。
width integer 区域宽度,如果"areatype=1"。
height integer 区域高度,如果"areatype=1"。
viewtype integer 0 - place evenly in the area 区域布局算法,如果"elementsubtype=1"。
use_iconmap integer 0 - no
1 - yes
为这个元素使用图标映射。 只有在拓扑图级别激活图标映射时才相关。
selementid id 唯一的元素记录ID。
evaltype integer 标签的评估类型。
tags 问题标签(用于主机和主机组元素)。 如果给出了标签,只有这些标签的问题才会显示在拓扑图上。
tag 标签名称。
value 标签值。
operator 操作者。
elements 在拓扑图(主机、主机组、映射等)上表示的Zabbix实体。
host
icon_off 当元素处于“OK”状态时要使用的图像。
icon_on 当元素处于“问题”状态时要使用的图像。
icon_disabled 元素被禁用时要使用的图像。
icon_maintenance 当元素处于维护状态时要使用的图像。
name string 唯一的图像名称。
shapes
type integer 0 - rectangle
1 - ellipse
形态类型。
x integer 形状的X坐标,以像素为单位。
y integer 以像素为单位的形状的Y坐标。
width integer 形状宽度。
height integer 形状高度。
border_type integer 0 - none
1 - bold line
2 - dotted line
3 - dashed line
形状的边框类型。
border_width integer 边框宽度(以像素为单位)。
border_color string 用十六进制代码表示的边框颜色.
text string 文本内的形状。
font integer 0 - Georgia, serif
1 - "Palatino Linotype", "Book Antiqua", Palatino, serif
2 - "Times New Roman", Times, serif
3 - Arial, Helvetica, sans-serif
4 - "Arial Black", Gadget, sans-serif
5 - "Comic Sans MS", cursive, sans-serif
6 - Impact, Charcoal, sans-serif
7 - "Lucida Sans Unicode", "Lucida Grande", sans-serif
8 - Tahoma, Geneva, sans-serif
9 - "Trebuchet MS", Helvetica, sans-serif
10 - Verdana, Geneva, sans-serif
11 - "Courier New", Courier, monospace
12 - "Lucida Console", Monaco, monospace
文本字体样式。
font_size integer 字体大小(像素)。
font_color string 用十六进制代码表示的字体颜色。
text_halign integer 0 - center
1 - left
2 - right
文本的水平对齐。
text_valign integer 0 - middle
1 - top
2 - bottom
文本垂直对齐。
background_color string 背景(填充)颜色以十六进制代码表示。
zindex integer 用于对所有形状和线条排序的值(z-index)。
lines
x1 integer 直线点1的X坐标,单位是像素。
y1 integer 直线点1的Y坐标,单位是像素。
x2 integer 直线点2的X坐标,单位是像素。
y2 integer 直线点2的Y坐标,单位是像素。
line_type integer 0 - none
1 - bold line
2 - dotted line
3 - dashed line
线条类型。
line_width integer 以像素为单位的线宽。
line_color string 用十六进制代码表示的线颜色。
zindex integer 用于对所有形状和线条排序的值(z-index)。
links 拓扑图元素之间的链接。
drawtype integer 0 - line
2 - bold line
3 - dotted line
4 - dashed line
线条类型。
color string 连接颜色(6个符号,十六进制)。
label string 连接标记。
selementid1 id 要连接的一个元素的ID。
selementid2 id 要连接的其他元素的ID。
linktriggers 连接状态指标。
drawtype integer 0 - line
2 - bold line
3 - dotted line
4 - dashed line
当触发器处于“问题”状态时的连接样式。
color string 当触发器处于“问题”状态时,连接颜色(6个符号,十六进制)。
trigger 指示连路状态的触发器。
description string 触发器名称。
expression string 触发器表达式。
recovery_expression string 触发器恢复表达式。