10 Graph prototype

Description

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

Parameters

The following parameters are supported for the Graph prototype 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.
Source0source_type2 - (default) Graph prototype;
3 - Simple graph prototype.
Graph prototype7graphidGraph prototype ID.

Parameter behavior:
- required if Source is set to “Graph prototype”
Item prototype5itemidItem prototype ID.

Parameter behavior:
- required if Source is set to “Simple graph prototype”
Show legend0show_legend0 - Disabled;
1 - (default) Enabled.
Enable host selection0dynamic0 - (default) Disabled;
1 - Enabled.
Columns0columnsValid values range from 1-24.

Default: 2.
Rows0rowsValid values range from 1-16.

Default: 1.

Examples

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

Configuring a Graph prototype widget

Configure a Graph prototype widget that displays a grid of 3 graphs (3 columns, 1 row) created from an item prototype (ID: “42316”) by low-level discovery.

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": "graphprototype",
  13. "name": "Graph prototype",
  14. "x": 0,
  15. "y": 0,
  16. "width": 16,
  17. "height": 5,
  18. "view_mode": 0,
  19. "fields": [
  20. {
  21. "type": 0,
  22. "name": "source_type",
  23. "value": 3
  24. },
  25. {
  26. "type": 5,
  27. "name": "itemid",
  28. "value": 42316
  29. },
  30. {
  31. "type": 0,
  32. "name": "columns",
  33. "value": 3
  34. }
  35. ]
  36. }
  37. ]
  38. }
  39. ],
  40. "userGroups": [
  41. {
  42. "usrgrpid": 7,
  43. "permission": 2
  44. }
  45. ],
  46. "users": [
  47. {
  48. "userid": 1,
  49. "permission": 3
  50. }
  51. ]
  52. },
  53. "id": 1
  54. }

Response:

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

See also