这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.
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 触发器恢复表达式。

Maps

Element Type Description
name string Unique map name.
width integer Map width, in pixels.
height integer Map height, in pixels.
label_type integer Map element label type.
Possible values:
0 - Label;
1 - Host IP address;
2 - Element name;
3 - Status only;
4 - Nothing.
label_location integer Map element label location by default.
Possible values:
0 - Bottom;
1 - Left;
2 - Right;
3 - Top.
highlight integer Enable icon highlighting for active triggers and host statuses.
Possible values:
0 - No;
1 - Yes.
expandproblem integer Display problem trigger for elements with a single problem.
Possible values:
0 - No;
1 - Yes.
markelements integer Highlight map elements that have recently changed their status.
Possible values:
0 - No;
1 - Yes.
show_unack integer Problem display.
Possible values:
0 - Count of all problems;
1 - Count of unacknowledged problems;
2 - Count of acknowledged and unacknowledged problems separately.
severity_min integer Minimum trigger severity to show on the map by default.
Possible values:
0 - Not classified;
1 - Information;
2 - Warning;
3 - Average;
4 - High;
5 - Disaster.
show_suppressed integer Display problems, which would otherwise be suppressed (not shown) because of host maintenance.
Possible values:
0 - No;
1 - Yes.
grid_size integer Cell size of a map grid in pixels.
Supported if grid_show is set to 0.
Possible values: 20, 40, 50, 75 or 100.
grid_show integer Display a grid in map configuration.
Possible values:
0 - Yes;
1 - No.
grid_align integer Automatically align icons in map configuration.
Possible values:
0 - Yes;
1 - No.
label_format integer Use advanced label configuration.
Possible values:
0 - No;
1 - Yes.
label_type_host integer Display label as host label.
Supported if label_format is set to 1.
Possible values:
0 - Label;
1 - Host IP address;
2 - Element name;
3 - Status only;
4 - Nothing;
5 - Custom label.
label_type_hostgroup integer Display label as host group label.
Supported if label_format is set to 1.
Possible values:
0 - Label;
2 - Element name;
3 - Status only;
4 - Nothing;
5 - Custom label.
label_type_trigger integer Display label as trigger label.
Supported if label_format is set to 1.
Possible values:
0 - Label;
2 - Element name;
3 - Status only;
4 - Nothing;
5 - Custom label.
label_type_map integer Display label as map label.
Supported if label_format is set to 1.
Possible values:
0 - Label;
2 - Element name;
3 - Status only;
4 - Nothing;
5 - Custom label.
label_type_image integer Display label as image label.
Supported if label_format is set to 1.
Possible values:
0 - Label;
2 - Element name;
4 - Nothing;
5 - Custom label.
label_string_host string Custom label for host elements.
Supported if label_type_host is set to 5.
label_string_hostgroup string Custom label for host group elements.
Supported if label_type_hostgroup is set to 5.
label_string_trigger string Custom label for trigger elements.
Supported if label_type_trigger is set to 5.
label_string_map string Custom label for map elements.
Supported if label_type_map is set to 5.
label_string_image string Custom label for image elements.
Supported if label_type_image is set to 5.
expand_macros integer Expand macros in labels in map configuration.
Possible values:
0 - No;
1 - Yes.
background Root element for background image (if any).
Supported if imagetype is set to 2.
name string Background image name.
iconmap Root element for icon mapping (if any).
name string Icon mapping name.
urls Root element for URLs used by maps or each map element.
name string Link name.
url string Link URL.
elementtype integer Map item type the link belongs to.
Possible values:
0 - Host;
1 - Map;
2 - Trigger;
3 - Host group;
4 - Image.
selements Root element for map selements.
shapes Root element for map shapes.
type integer Shape type.
Possible values:
0 - Rectangle;
1 - Ellipse.
x integer X coordinates of the shape in pixels.
y integer Y coordinates of the shape in pixels.
width integer Shape width.
height integer Shape height.
text string Text inside of shape.
font integer Text font style.
Possible values:
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 size in pixels.
font_color string Font color represented in hexadecimal code.
text_halign integer Horizontal alignment of text.
Possible values:
0 - Center;
1 - Left;
2 - Right.
text_valign integer Vertical alignment of text.
Possible values:
0 - Middle;
1 - Top;
2 - Bottom.
border_type integer Type of the border for the shape.
Possible values:
0 - None;
1 - Bold line;
2 - Dotted line;
3 - Dashed line.
border_width integer Width of the border in pixels.
border_color string Border color represented in hexadecimal code.
background_color string Background (fill) color represented in hexadecimal code.
zindex integer Value for ordering all shapes and lines (z-index).
lines Root element for map lines.
x1 integer X coordinates of the line point 1 in pixels.
y1 integer Y coordinates of the line point 1 in pixels.
x2 integer X coordinates of the line point 2 in pixels.
y2 integer Y coordinates of the line point 2 in pixels.
line_type integer Line type.
Possible values:
0 - None;
1 - Bold line;
2 - Dotted line;
3 - Dashed line.
line_width integer Line width in pixels.
line_color string Line color represented in hexadecimal code.
zindex integer Value for ordering all shapes and lines (z-index).
links Root element for links between map elements.
drawtype integer Link style.
Possible values:
0 - Line;
2 - Bold line;
3 - Dotted line;
4 - Dashed line.
color string Link color (6 symbols, hex).
label string Link label.
selementid1 id ID of one element to connect.
selementid2 id ID of the other element to connect.
linktriggers Root element for link status indicators.

See also: Map object (refer to the relevant property with a matching name).

Map selements
Element Type Description
elementtype integer Map element type.
Possible values:
0 - Host;
1 - Map;
2 - Trigger;
3 - Host group;
4 - Image.
elements Root element for Zabbix entities (host, host group, map, etc.) that are represented on the map.
All entities have their respective element (host, etc.; see, for example, Export format).
label string Icon label.
label_location integer Label location.
Possible values:
-1 - Use map default;
0 - Bottom;
1 - Left;
2 - Right;
3 - Top.
x integer Location on the X axis.
y integer Location on the Y axis.
elementsubtype integer Element subtype.
Supported if elementtype is set to 3.
Possible values:
0 - Single host group;
1 - All host groups.
areatype integer Area size.
Supported if elementtype is set to 1.
Possible values:
0 - Same as whole map;
1 - Custom size.
width integer Width of area.
Supported if areatype is set to 1.
height integer Height of area.
Supported if areatype is set to 1.
viewtype integer Area placement algorithm.
Supported if elementsubtype is set to 1.
Possible values:
0 - Place evenly in the area.
use_iconmap integer Use icon mapping for this element. Relevant only if icon mapping is activated on map level.
Possible values:
0 - No;
1 - Yes.
selementid id Unique element record ID.
icon_off Root element for image to use when element is in 'OK' status.
name string Unique image name.
icon_on Root element for image to use when element is in 'Problem' status.
name string Unique image name.
icon_disabled Root element for image to use when element is disabled.
name string Unique image name.
icon_maintenance Root element for image to use when element is in maintenance.
name string Unique image name.
urls Root element for URLs used by maps or each map element.
name string Link name.
url string Link URL.
evaltype integer Evaluation type for tags.
tags Root element for problem tags (for host and host group elements).
If tags are given, only problems with these tags will be displayed on the map.
tag string Tag name.
value string Tag value.
operator integer Operator.

See also: Map element object (refer to the relevant property with a matching name).

Element Type Description
drawtype integer Link style when trigger is in the 'Problem' state.
Possible values:
0 - Line;
2 - Bold line;
3 - Dotted line;
4 - Dashed line.
color string Link color (6 symbols, hex) when trigger is in the 'Problem' state.
trigger Root element for trigger used to indicate link status.
description string Trigger name.
expression string Trigger expression.
recovery_expression string Trigger recovery expression.

See also: Map link trigger object (refer to the relevant property with a matching name).