12 Item value

Description

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

Parameters

The following parameters are supported for the Item value 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.
Item
(required)
4itemidItem ID.
Show0show1 - Description;
2 - Value;
3 - Time;
4 - Change indicator.

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

Note: To configure multiple values, create a dashboard widget field object for each value.
Enable host selection0dynamic0 - (default) Disabled;
1 - Enabled.
Advanced configuration0adv_conf0 - (default) Disabled;
1 - Enabled.

Advanced configuration

The following parameters are supported if Advanced configuration is set to “Enabled”.

The number in the Thresholds property name (e.g. thresholds.color.0) references the threshold place in a list, sorted in ascending order. However, if thresholds are configured in a different order, the values will be sorted in ascending order after updating widget configuration in Zabbix frontend (e.g. "threshold.threshold.0":"5""threshold.threshold.0":"1"; "threshold.threshold.1":"1""threshold.threshold.1": "5").

Parametertypenamevalue
Background color1bg_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).
Thresholds
Color1thresholds.color.0Hexadecimal color code (e.g. FF0000).
Threshold1thresholds.threshold.0Any string value.
Description

The following parameters are supported if Advanced configuration is set to “Enabled”, and Show is set to “Description”.

Parametertypenamevalue
Description1descriptionAny string value, including macros.
Supported macros: {HOST.}, {ITEM.}, {INVENTORY.*}, User macros.

Default: {ITEM.NAME}.
Horizontal position0desc_h_pos0 - Left;
1 - (default) Center;
2 - Right.

Two or more elements (Description, Value, Time) cannot share the same Horizontal position and Vertical position.
Vertical position0desc_v_pos0 - Top;
1 - Middle;
2 - (default) Bottom.

Two or more elements (Description, Value, Time) cannot share the same Horizontal position and Vertical position.
Size0desc_sizeValid values range from 1-100.

Default: 15.
Bold0desc_bold0 - (default) Disabled;
1 - Enabled.
Color1desc_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).
Value

The following parameters are supported if Advanced configuration is set to “Enabled”, and Show is set to “Value”.

Parametertypenamevalue
Decimal places
Decimal places0decimal_placesValid values range from 1-10.

Default: 2.
Size0decimal_sizeValid values range from 1-100.

Default: 35.
Position
Horizontal position0value_h_pos0 - Left;
1 - (default) Center;
2 - Right.

Two or more elements (Description, Value, Time) cannot share the same Horizontal position and Vertical position.
Vertical position0value_v_pos0 - Top;
1 - (default) Middle;
2 - Bottom.

Two or more elements (Description, Value, Time) cannot share the same Horizontal position and Vertical position.
Size0value_sizeValid values range from 1-100.

Default: 45.
Bold0value_bold0 - Disabled;
1 - (default) Enabled.
Color1value_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).
Units
Units (checkbox)0units_show0 - Disabled;
1 - (default) Enabled.
Units (value)1unitsAny string value.
Position0units_pos0 - Before value;
1 - Above value;
2 - (default) After value;
3 - Below value.
Size0units_sizeValid values range from 1-100.

Default: 35.
Bold0units_bold0 - Disabled;
1 - (default) Enabled.
Color1units_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).
Time

The following parameters are supported if Advanced configuration is set to “Enabled”, and Show is set to “Time”.

Parametertypenamevalue
Horizontal position0time_h_pos0 - Left;
1 - (default) Center;
2 - Right.

Two or more elements (Description, Value, Time) cannot share the same Horizontal position and Vertical position.
Vertical position0time_v_pos0 - (default) Top;
1 - Middle;
2 - Bottom.

Two or more elements (Description, Value, Time) cannot share the same Horizontal position and Vertical position.
Size0time_sizeValid values range from 1-100.

Default: 15.
Bold0time_bold0 - (default) Disabled;
1 - Enabled.
Color1time_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).
Change indicator

The following parameters are supported if Advanced configuration is set to “Enabled”, and Show is set to “Change indicator”.

Parametertypenamevalue
Change indicator ↑ color1up_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).
Change indicator ↓ color1down_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).
Change indicator ↕ color1updown_colorHexadecimal color code (e.g. FF0000).

Default: “” (empty).

Examples

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

Configuring an Item value widget

Configure an Item value widget that displays the item value for the item “42266” (Zabbix agent availability). In addition, visually fine-tune the widget with multiple advanced options, including a dynamic background color that changes based on the availability status of Zabbix agent.

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": "item",
  13. "name": "Item value",
  14. "x": 0,
  15. "y": 0,
  16. "width": 4,
  17. "height": 3,
  18. "view_mode": 0,
  19. "fields": [
  20. {
  21. "type": 4,
  22. "name": "itemid",
  23. "value": 42266
  24. },
  25. {
  26. "type": 0,
  27. "name": "show",
  28. "value": 1
  29. },
  30. {
  31. "type": 0,
  32. "name": "show",
  33. "value": 2
  34. },
  35. {
  36. "type": 0,
  37. "name": "show",
  38. "value": 3
  39. },
  40. {
  41. "type": 0,
  42. "name": "adv_conf",
  43. "value": 1
  44. },
  45. {
  46. "type": 1,
  47. "name": "description",
  48. "value": "Agent status"
  49. },
  50. {
  51. "type": 0,
  52. "name": "desc_h_pos",
  53. "value": 0
  54. },
  55. {
  56. "type": 0,
  57. "name": "desc_v_pos",
  58. "value": 0
  59. },
  60. {
  61. "type": 0,
  62. "name": "desc_bold",
  63. "value": 1
  64. },
  65. {
  66. "type": 1,
  67. "name": "desc_color",
  68. "value": "F06291"
  69. },
  70. {
  71. "type": 0,
  72. "name": "value_h_pos",
  73. "value": 0
  74. },
  75. {
  76. "type": 0,
  77. "name": "value_size",
  78. "value": 25
  79. },
  80. {
  81. "type": 1,
  82. "name": "value_color",
  83. "value": "FFFF00"
  84. },
  85. {
  86. "type": 0,
  87. "name": "units_show",
  88. "value": 0
  89. },
  90. {
  91. "type": 0,
  92. "name": "time_h_pos",
  93. "value": 2
  94. },
  95. {
  96. "type": 0,
  97. "name": "time_v_pos",
  98. "value": 2
  99. },
  100. {
  101. "type": 0,
  102. "name": "time_size",
  103. "value": 10
  104. },
  105. {
  106. "type": 0,
  107. "name": "time_bold",
  108. "value": 1
  109. },
  110. {
  111. "type": 1,
  112. "name": "time_color",
  113. "value": "9FA8DA"
  114. },
  115. {
  116. "type": 1,
  117. "name": "thresholds.color.0",
  118. "value": "E1E1E1"
  119. },
  120. {
  121. "type": 1,
  122. "name": "thresholds.threshold.0",
  123. "value": "0"
  124. },
  125. {
  126. "type": 1,
  127. "name": "thresholds.color.1",
  128. "value": "D1C4E9"
  129. },
  130. {
  131. "type": 1,
  132. "name": "thresholds.threshold.1",
  133. "value": "1"
  134. }
  135. ]
  136. }
  137. ]
  138. }
  139. ],
  140. "userGroups": [
  141. {
  142. "usrgrpid": 7,
  143. "permission": 2
  144. }
  145. ],
  146. "users": [
  147. {
  148. "userid": 1,
  149. "permission": 3
  150. }
  151. ]
  152. },
  153. "id": 1
  154. }

Response:

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

See also