8 Graph

Description

These parameters and the possible property values for the respective dashboard widget field objects allow to configure the Graph widget in dashboard.create and dashboard.update methods.

Parameters

The following parameters are supported for the Graph widget.

Parametertypenamevalue
Refresh interval0rf_rate0 - No refresh;
10 - 10 seconds;
30 - 30 seconds;
60 - (default) 1 minute;
120 - 2 minutes;
600 - 10 minutes;
900 - 15 minutes.

Data set

The following parameters are supported for configuring a Data set.

The first number in the property name (e.g. ds.hosts.0.0, ds.items.0.0) represents the particular data set, while the second number, if present, represents the configured host or item.

Parametertypenamevalue
Data set type0ds.dataset_type.00 - Item list;
1 - (default) Item pattern.
Parameters if Data set type is set to “Item list”
Items
(required)
4ds.itemids.0.0Item ID.

Note: To configure multiple items, create a dashboard widget field object for each item.
Color
(required)
1ds.color.0.0Hexadecimal color code (e.g. FF0000).
Parameters if Data set type is set to “Item pattern”
Host pattern
(required)
1ds.hosts.0.0Host name or pattern (e.g. Zabbix).
Item pattern
(required)
1ds.items.0.0Item name or pattern (e.g. : Number of processed *values per second).
Color1ds.color.0Hexadecimal color code (e.g. FF0000).

Default: FF465C.
Draw0ds.type.00 - (default) Line;
1 - Points;
2 - Staircase;
3 - Bar.
Stacked0ds.stacked.00 - (default) Disabled;
1 - Enabled.

Parameter Stacked not available if Draw is set to “Points”.
Width0ds.width.0Valid values range from 1-10.

Default: 1.

Parameter Width not available if Draw is set to “Points” or “Bar”.
Point size0ds.pointsize.0Valid values range from 1-10.

Default: 3.

Parameter Point size not available if Draw is set to “Line”, “Staircase” or “Bar”.
Transparency0ds.transparency.0Valid values range from 1-10.

Default: 5.
Fill0ds.fill.0Valid values range from 1-10.

Default: 3.

Parameter Fill not available if Draw is set to “Points” or “Bar”.
Missing data0ds.missingdatafunc.00 - (default) None;
1 - Connected;
2 - Treat as 0;
3 - Last known.

Parameter Missing data not available if Draw is set to “Points” or “Bar”.
Y-axis0ds.axisy.00 - (default) Left;
1 - Right.
Time shift1ds.timeshift.0Valid time string (e.g. 3600, 1h, etc.).
You may use time suffixes. Negative values are also allowed.

Default: “” (empty).
Aggregation function0ds.aggregate_function.00 - (default) none;
1 - min;
2 - max;
3 - avg;
4 - count;
5 - sum;
6 - first;
7 - last.
Aggregation interval1ds.aggregate_interval.0Valid time string (e.g. 3600, 1h, etc.).
You may use time suffixes.

Default: 1h.
Aggregate0ds.aggregate_grouping.00 - (default) Each item;
1 - Data set.

Parameter Aggregate not available if Aggregation function is set to “none”.
Approximation0ds.approximation.01 - min;
2 - (default) avg;
4 - max;
7 - all.
Data set label1ds.data_set_label.0Any string value.

Default: “” (empty).

Display options

The following parameters are supported for configuring Display options.

Parametertypenamevalue
History data selection0source0 - (default) Auto;
1 - History;
2 - Trends.
Simple triggers0simple_triggers0 - (default) Disabled;
1 - Enabled.
Working time0working_time0 - (default) Disabled;
1 - Enabled.
Percentile line (left) (parameter available if Y-axis (in Data set configuration) is set to “Left”)
Status0percentile_left0 - (default) Disabled;
1 - Enabled.
Value0percentile_left_valueValid values range from 1-100.
Percentile line (right) (parameter available if Y-axis (in Data set configuration) is set to “Right”)
Status0percentile_right0 - (default) Disabled;
1 - Enabled.
Value0percentile_right_valueValid values range from 1-100.

Time period

The following parameters are supported for configuring Time period.

Parametertypenamevalue
Set custom time period0graph_time0 - (default) Disabled;
1 - Enabled.
From1time_fromValid time string in format YYYY-MM-DD hh:mm:ss.
Relative time period values (now, now/d, now/w-1w, etc.) are also supported.

Default: now-1h.
To1time_toValid time string value in format YYYY-MM-DD hh:mm:ss.
Relative time period values (now, now/d, now/w-1w, etc.) are also supported.

Default: now.

Axes

The following parameters are supported for configuring Axes.

Parametertypenamevalue
Left Y0lefty0 - Disabled;
1 - (default) Enabled.

Parameter available if Y-axis (in Data set configuration) is set to “Left”.
Right Y0righty0 - (default) Disabled;
1 - Enabled.

Parameter available if Y-axis (in Data set configuration) is set to “Right”.
Min1lefty_minAny numeric value.

Default: “” (empty).
righty_min
Max1lefty_maxAny numeric value.

Default: “” (empty).
righty_max
Units (type)0lefty_units0 - (default) Auto;
1 - Static.
righty_units
Units (value)1lefty_static_unitsAny string value.

Default: “” (empty).
righty_static_units
X-Axis0xaxis0 - Disabled;
1 - (default) Enabled.

Legend

The following parameters are supported for configuring Legend.

Parametertypenamevalue
Show legend0legend0 - Disabled;
1 - (default) Enabled.
Display min/max/avg0legend_statistic0 - (default) Disabled;
1 - Enabled.
Number of rows0legend_linesValid values range from 1-10.

Default: 1.
Number of columns0legend_columnsValid values range from 1-4.

Default: 4.

Problems

The following parameters are supported for configuring Problems.

Parametertypenamevalue
Show problems0show_problems0 - (default) Disabled;
1 - Enabled.
Selected items only0graph_item_problems0 - Disabled;
1 - (default) Enabled.
Problem hosts1problemhosts.0Host name.

Note: The number in the property name references the configured host.
To configure multiple hosts, create a dashboard widget field object for each host.
Severity0severities0 - Not classified;
1 - Information;
2 - Warning;
3 - Average;
4 - High;
5 - Disaster.

Default: 1, 2, 3, 4, 5 (all enabled).

Note: To configure multiple values, create a dashboard widget field object for each value.
Problem1problem_nameProblem event name (case insensitive, full name or part of it).
Tags (the number in the property name (e.g. tags.tag.0) references tag order in the tag evaluation list)
Evaluation type0evaltype0 - (default) And/Or;
2 - Or.
Tag name1tags.tag.0Any string value.

Parameter Tag name required if configuring Tags.
Operator0tags.operator.00 - Contains;
1 - Equals;
2 - Does not contain;
3 - Does not equal;
4 - Exists;
5 - Does not exist.

Parameter Operator required if configuring Tags.
Tag value1tags.value.0Any string value.

Parameter Tag value required if configuring Tags.

Overrides

The following parameters are supported for configuring Overrides.

The first number in the property name (e.g. or.hosts.0.0, or.items.0.0) represents the particular data set, while the second number, if present, represents the configured host or item.

Parametertypenamevalue
Host pattern
(required)
1or.hosts.0.0Host name or pattern (e.g. Zabbix).
Item pattern
(required)
1or.items.0.0Item name or pattern (e.g. : Number of processed *values per second).
Base color1or.color.0Hexadecimal color code (e.g. FF0000).
Width0or.width.0Valid values range from 1-10.
Draw0or.type.00 - Line;
1 - Points;
2 - Staircase;
3 - Bar.
Transparency0or.transparency.0Valid values range from 1-10.
Fill0or.fill.0Valid values range from 1-10.
Point size0or.pointsize.0Valid values range from 1-10.
Missing data0or.missingdatafunc.00 - None;
1 - Connected;
2 - Treat as 0;
3 - Last known.
Y-axis0or.axisy.00 - Left;
1 - Right.
Time shift1or.timeshift.0Valid time string (e.g. 3600, 1h, etc.).
You may use time suffixes. Negative values are allowed.

Examples

The following examples aim to only describe the configuration of the dashboard widget field objects for the Graph widget. For more information on configuring a dashboard, see dashboard.create.

Configuring a Graph widget

Configure a Graph widget in the following way:

  • 2 data sets for a total of 9 items on 1 host.
  • The first data set is of type “Item list” and consists of 3 items that are represented by lines with a different color, but the same width, transparency, and fill.
  • The second data set is of type “Item pattern”, consists of 6 items, has a configured aggregation, and is represented by a line with a custom color, width, transparency, and fill.
  • The second data set also has a custom data set label.
  • Data in the graph are displayed for a time period of the last 3 hours.
  • Problems in the graph are displayed only for the configured items.
  • Graph has two Y axes of which the right Y axis displays values only for the second data set.
  • Graph legend displays configured items in 4 rows, as well as minimum, maximum and average values of the data sets.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "dashboard.create",
  4. "params": {
  5. "name": "My dashboard",
  6. "display_period": 30,
  7. "auto_start": 1,
  8. "pages": [
  9. {
  10. "widgets": [
  11. {
  12. "type": "svggraph",
  13. "name": "Graph",
  14. "x": 0,
  15. "y": 0,
  16. "width": 12,
  17. "height": 5,
  18. "view_mode": 0,
  19. "fields": [
  20. {
  21. "type": 0,
  22. "name": "ds.dataset_type.0",
  23. "value": 0
  24. },
  25. {
  26. "type": 4,
  27. "name": "ds.itemids.0.1",
  28. "value": 23264
  29. },
  30. {
  31. "type": 1,
  32. "name": "ds.color.0.1",
  33. "value": "FF0000"
  34. },
  35. {
  36. "type": 4,
  37. "name": "ds.itemids.0.2",
  38. "value": 23269
  39. },
  40. {
  41. "type": 1,
  42. "name": "ds.color.0.2",
  43. "value": "BF00FF"
  44. },
  45. {
  46. "type": 4,
  47. "name": "ds.itemids.0.3",
  48. "value": 23257
  49. },
  50. {
  51. "type": 1,
  52. "name": "ds.color.0.3",
  53. "value": "0040FF"
  54. },
  55. {
  56. "type": 0,
  57. "name": "ds.width.0",
  58. "value": 3
  59. },
  60. {
  61. "type": 0,
  62. "name": "ds.transparency.0",
  63. "value": 3
  64. },
  65. {
  66. "type": 0,
  67. "name": "ds.fill.0",
  68. "value": 1
  69. },
  70. {
  71. "type": 1,
  72. "name": "ds.hosts.1.0",
  73. "value": "Zabbix server"
  74. },
  75. {
  76. "type": 1,
  77. "name": "ds.items.1.0",
  78. "value": "*: Number of processed *values per second"
  79. },
  80. {
  81. "type": 1,
  82. "name": "ds.color.1",
  83. "value": "000000"
  84. },
  85. {
  86. "type": 0,
  87. "name": "ds.transparency.1",
  88. "value": 0
  89. },
  90. {
  91. "type": 0,
  92. "name": "ds.fill.1",
  93. "value": 0
  94. },
  95. {
  96. "type": 0,
  97. "name": "ds.axisy.1",
  98. "value": 1
  99. },
  100. {
  101. "type": 0,
  102. "name": "ds.aggregate_function.1",
  103. "value": 3
  104. },
  105. {
  106. "type": 1,
  107. "name": "ds.aggregate_interval.1",
  108. "value": "1m"
  109. },
  110. {
  111. "type": 0,
  112. "name": "ds.aggregate_grouping.1",
  113. "value": 1
  114. },
  115. {
  116. "type": 1,
  117. "name": "ds.data_set_label.1",
  118. "value": "Number of processed values per second"
  119. },
  120. {
  121. "type": 0,
  122. "name": "graph_time",
  123. "value": 1
  124. },
  125. {
  126. "type": 1,
  127. "name": "time_from",
  128. "value": "now-3h"
  129. },
  130. {
  131. "type": 0,
  132. "name": "legend_statistic",
  133. "value": 1
  134. },
  135. {
  136. "type": 0,
  137. "name": "legend_lines",
  138. "value": 4
  139. },
  140. {
  141. "type": 0,
  142. "name": "show_problems",
  143. "value": 1
  144. }
  145. ]
  146. }
  147. ]
  148. }
  149. ],
  150. "userGroups": [
  151. {
  152. "usrgrpid": 7,
  153. "permission": 2
  154. }
  155. ],
  156. "users": [
  157. {
  158. "userid": 1,
  159. "permission": 3
  160. }
  161. ]
  162. },
  163. "id": 1
  164. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "dashboardids": [
  5. "3"
  6. ]
  7. },
  8. "id": 1
  9. }

See also