This is a translation of the original English documentation page. Help us make it better.

8 Graph

説明

これらのパラメーターと、各ダッシュボードウィジェットフィールドオブジェクトの有効なプロパティ値を使用することで、dashboard.createメソッドおよびdashboard.updateメソッドでグラフウィジェットを設定できます。

ウィジェットのfieldsプロパティは、ダッシュボードの作成または更新時に検証されません。 これにより、ユーザーは組み込みウィジェットを変更したり、カスタムウィジェットを作成したりできますが、ウィジェットを誤って作成または更新してしまうリスクも生じます。 グラフウィジェットを正常に作成または更新するには、以下の表に記載されているパラメーターの動作を参照してください。

パラメーター

グラフウィジェットでは、以下のパラメーターがサポートされています。

パラメーター type name value
リフレッシュ間隔 0 rf_rate 0 - 更新なし
10 - 10秒
30 - 30秒
60 - (デフォルト) 1分
120 - 2分
600 - 10分
900 - 15分
参照 1 reference 5文字で構成される文字列値(例: ABCDEまたはJBPNL)。この値は、ウィジェットが属するダッシュボード内で一意でなければなりません。

パラメーターの動作:
- 必須

Data set

The following parameters are supported for configuring a Data set.

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

Parameter type name value
Data set type 0 ds.0.dataset_type 0 - Item list;
1 - (default) Item patterns.
Items 4 ds.0.itemids.0 Item ID.

When configuring the widget on a template dashboard, only items configured on the template should be set.

Note: To configure multiple items, create a dashboard widget field object for each item with an incremented number in the property name.

Parameter behavior:
- required if Data set type is set to "Item list" and Items (Widget) is not set
Items (Widget) 1 ds.0.itemids.0._reference Instead of Item ID:
ABCDE._itemid - set a compatible widget (with its Reference parameter set to "ABCDE") as the data source for items.

Note: To configure multiple widgets, create a dashboard widget field object for each widget with an incremented number in the property name.

Parameter behavior:
- required if Data set type is set to "Item list" and Items is not set
Color 1 ds.0.color.0 Hexadecimal color code (e.g. FF0000).

Parameter behavior:
- required if Data set type is set to "Item list"
Host patterns 1 ds.0.hosts.0 Host name or pattern (e.g., "Zabbix*").

Parameter behavior:
- required if Data set type is set to "Item patterns"

This parameter is not supported if configuring the widget on a template dashboard.
Item patterns 1 ds.0.items.0 Item name or pattern (e.g., "*: Number of processed *values per second").

When configuring the widget on a template dashboard, only the patterns for items configured on the template should be set.

Parameter behavior:
- required if Data set type is set to "Item patterns"
Color 1 ds.0.color Hexadecimal color code (e.g. FF0000).

Default: FF465C.

Parameter behavior:
- supported if Data set type is set to "Item patterns"
Draw 0 ds.0.type 0 - (default) Line;
1 - Points;
2 - Staircase;
3 - Bar.
Stacked 0 ds.0.stacked 0 - (default) Disabled;
1 - Enabled.

Parameter behavior:
- supported if Draw is set to "Line", "Staircase", or "Bar"
Width 0 ds.0.width Possible values range from 1-10.

Default: 1.

Parameter behavior:
- supported if Draw is set to "Line" or "Staircase"
Point size 0 ds.0.pointsize Possible values range from 1-10.

Default: 3.

Parameter behavior:
- supported if Draw is set to "Points"
Transparency 0 ds.0.transparency Possible values range from 1-10.

Default: 5.
Fill 0 ds.0.fill Possible values range from 1-10.

Default: 3.

Parameter behavior:
- supported if Draw is set to "Line" or "Staircase"
Missing data 0 ds.0.missingdatafunc 0 - (default) None;
1 - Connected;
2 - Treat as 0;
3 - Last known.

Parameter behavior:
- supported if Draw is set to "Line" or "Staircase"
Override host 1 ds.0.override_hostid._reference ABCDE._hostid- set a compatible widget (with its "Reference" parameter set to "ABCDE") as the data source for hosts;
DASHBOARD._hostid - set the dashboard Host selector as the data source for hosts.

This parameter is not supported if configuring the widget on a template dashboard.
Y-axis 0 ds.0.axisy 0 - (default) Left;
1 - Right.
Time shift 1 ds.0.timeshift Valid time string (e.g. 3600, 1h, etc.).
You may use time suffixes. Negative values are also allowed.

Default: "" (empty).
Aggregation function 0 ds.0.aggregate_function 0 - (default) not used;
1 - min;
2 - max;
3 - avg;
4 - count;
5 - sum;
6 - first;
7 - last.
Aggregation interval 1 ds.0.aggregate_interval Valid time string (e.g. 3600, 1h, etc.).
You may use time suffixes.

Default: 1h.
Aggregate 0 ds.0.aggregate_grouping 0 - (default) Each item;
1 - Data set.

Parameter behavior:
- supported if Aggregation function is set to "min", "max", "avg", "count", "sum", "first", or "last"
Approximation 0 ds.0.approximation 1 - min;
2 - (default) avg;
4 - max;
7 - all.
Data set label 1 ds.0.data_set_label Any string value.

Default: "" (empty).

Display options

The following parameters are supported for configuring Display options.

Parameter type name value
History data selection 0 source 0 - (default) Auto;
1 - History;
2 - Trends.
Simple triggers 0 simple_triggers 0 - (default) Disabled;
1 - Enabled.
Working time 0 working_time 0 - (default) Disabled;
1 - Enabled.
Percentile line (left)
Status 0 percentile_left 0 - (default) Disabled;
1 - Enabled.

Parameter behavior:
- supported if Y-axis (in Data set configuration) is set to "Left"
Value 0 percentile_left_value Possible values range from 1-100.

Parameter behavior:
- supported if Y-axis (in Data set configuration) is set to "Left"
Percentile line (right)
Status 0 percentile_right 0 - (default) Disabled;
1 - Enabled.

Parameter behavior:
- supported if Y-axis (in Data set configuration) is set to "Right"
Value 0 percentile_right_value Possible values range from 1-100.

Parameter behavior:
- supported if Y-axis (in Data set configuration) is set to "Right"

Time period

The following parameters are supported for configuring Time period.

Parameter type name value
Time period 1 time_period._reference DASHBOARD._timeperiod - set the Time period selector as the data source;
ABCDE._timeperiod - set a compatible widget (with its Reference parameter set to "ABCDE") as the data source.

Default: DASHBOARD._timeperiod

Alternatively, you can set the time period only in the From and To parameters.
From 1 time_period.from Valid time string in absolute (YYYY-MM-DD hh:mm:ss) or relative time syntax (now, now/d, now/w-1w, etc.).

Parameter behavior:
- supported if Time period is not set
To 1 time_period.to Valid time string in absolute (YYYY-MM-DD hh:mm:ss) or relative time syntax (now, now/d, now/w-1w, etc.).

Parameter behavior:
- supported if Time period is not set

Axes

The following parameters are supported for configuring Axes.

Parameter type name value
Left Y 0 lefty 0 - Disabled;
1 - (default) Enabled.

Parameter behavior:
- supported if Y-axis (in Data set configuration) is set to "Left"
Right Y 0 righty 0 - (default) Disabled;
1 - Enabled.

Parameter behavior:
- supported if Y-axis (in Data set configuration) is set to "Right"
Scale 0 lefty_scale 0 - (default) Linear;
1 - Logarithmic.
righty_scale
Min 1 lefty_min Any numeric value.

Default: "" (empty).
righty_min
Max 1 lefty_max Any numeric value.

Default: "" (empty).
righty_max
Units (type) 0 lefty_units 0 - (default) Auto;
1 - Static.
righty_units
Units (value) 1 lefty_static_units Any string value.

Default: "" (empty).
righty_static_units
X-Axis 0 xaxis 0 - Disabled;
1 - (default) Enabled.

Legend

The following parameters are supported for configuring Legend.

Parameter type name value
Show legend 0 legend 0 - Disabled;
1 - (default) Enabled.

Parameter behavior:
- supported if Show legend is set to "Enabled"
Display min/avg/max 0 legend_statistic 0 - (default) Disabled;
1 - Enabled.

Parameter behavior:
- supported if Show legend is set to "Enabled"
Show aggregation function 0 legend_aggregation 0 - (default) Disabled;
1 - Enabled.

Parameter behavior:
- supported if Show legend is set to "Enabled"
Rows 0 legend_lines_mode 0 - (default) Fixed;
1 - Variable.

Parameter behavior:
- supported if Show legend is set to "Enabled"
Number of rows/
Maximum number of rows
0 legend_lines Possible values range from 1-10.

Default: 1.

Parameter behavior:
- supported if Show legend is set to "Enabled"
Number of columns 0 legend_columns Possible values range from 1-4.

Default: 4.

Parameter behavior:
- supported if Show legend is set to "Enabled", and Display min/avg/max is set to "Disabled"

Problems

The following parameters are supported for configuring Problems.

Parameter type name value
Show problems 0 show_problems 0 - (default) Disabled;
1 - Enabled.
Selected items only 0 graph_item_problems 0 - Disabled;
1 - (default) Enabled.
Problem hosts 1 problemhosts.0 Host 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 with an incremented number in the property name.

This parameter is not supported if configuring the widget on a template dashboard.
Severity 0 severities.0 0 - Not classified;
1 - Information;
2 - Warning;
3 - Average;
4 - High;
5 - Disaster.

Default: empty (all enabled).

Note: To configure multiple values, create a dashboard widget field object for each value with an incremented number in the property name.
Problem 1 problem_name Problem event name (case insensitive, full name or part of it).
Problem tags
Evaluation type 0 evaltype 0 - (default) And/Or;
2 - Or.
Tag name 1 tags.0.tag Any string value.

Note: The number in the property name references tag order in the tag evaluation list.

Parameter behavior:
- required if configuring Problem tags
Operator 0 tags.0.operator 0 - Contains;
1 - Equals;
2 - Does not contain;
3 - Does not equal;
4 - Exists;
5 - Does not exist.

Note: The number in the property name references tag order in the tag evaluation list.

Parameter behavior:
- required if configuring Problem tags
Tag value 1 tags.0.value Any string value.

Note: The number in the property name references tag order in the tag evaluation list.

Parameter behavior:
- required if configuring Problem tags

Overrides

The following parameters are supported for configuring Overrides.

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

Parameter type name value
Host patterns 1 or.0.hosts.0 Host name or pattern (e.g. Zabbix*).

This parameter is not supported if configuring the widget on a template dashboard.

Parameter behavior:
- required if configuring Overrides
Item patterns 1 or.0.items.0 Item name or pattern (e.g. *: Number of processed *values per second).
When configuring the widget on a template dashboard, only the patterns for items configured on the template should be set.

Parameter behavior:
- required if configuring Overrides
Base color 1 or.0.color Hexadecimal color code (e.g. FF0000).
Width 0 or.0.width Possible values range from 1-10.
Draw 0 or.0.type 0 - Line;
1 - Points;
2 - Staircase;
3 - Bar.
Transparency 0 or.0.transparency Possible values range from 1-10.
Fill 0 or.0.fill Possible values range from 1-10.
Point size 0 or.0.pointsize Possible values range from 1-10.
Missing data 0 or.0.missingdatafunc 0 - None;
1 - Connected;
2 - Treat as 0;
3 - Last known.
Y-axis 0 or.0.axisy 0 - Left;
1 - Right.
Time shift 1 or.0.timeshift Valid time string (e.g. 3600, 1h, etc.).
You may use time suffixes. Negative values are allowed.

次の例は、グラフウィジェットのダッシュボードウィジェットフィールドオブジェクトの設定を説明することだけを目的としています。 ダッシュボードの設定の詳細については、dashboard.createを参照してください。

グラフウィジェットの設定

グラフウィジェットを次のように設定します。

  • 1つのホストに合計9つのアイテムの2つのデータセットがあります。
  • 最初のデータセットはタイプが"アイテムリスト"で、3つのアイテムで構成され、異なる色で幅、透明度および塗りつぶしは同じ線で表されます。
  • 2番目のデータセットはタイプが"アイテムパターン"で、6つのアイテムで構成され、集計を設定されており、カスタムの色、幅、透明度および塗りつぶしの線で表されます。
  • 2番目のデータセットには、カスタムデータセットラベルもあります。
  • グラフのデータは、過去3時間のデータが表示されます。
  • グラフ内の障害は、設定されたアイテムについてのみ表示されます。
  • グラフには2つのY軸があり、右側のY軸には2番目のデータセットの値のみが表示されます。
  • グラフの凡例には、設定されたアイテムが4行で表示され、データセットの最小値、最大値、平均値を表します。

リクエスト:

{
           "jsonrpc": "2.0",
           "method": "dashboard.create",
           "params": {
               "name": "My dashboard",
               "display_period": 30,
               "auto_start": 1,
               "pages": [
                   {
                       "widgets": [
                           {
                               "type": "svggraph",
                               "name": "Graph",
                               "x": 0,
                               "y": 0,
                               "width": 36,
                               "height": 5,
                               "view_mode": 0,
                               "fields": [
                                   {
                                       "type": 0,
                                       "name": "ds.0.dataset_type",
                                       "value": 0
                                   },
                                   {
                                       "type": 4,
                                       "name": "ds.0.itemids.1",
                                       "value": 23264
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.0.color.1",
                                       "value": "FF0000"
                                   },
                                   {
                                       "type": 4,
                                       "name": "ds.0.itemids.2",
                                       "value": 23269
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.0.color.2",
                                       "value": "BF00FF"
                                   },
                                   {
                                       "type": 4,
                                       "name": "ds.0.itemids.3",
                                       "value": 23257
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.0.color.3",
                                       "value": "0040FF"
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.0.width",
                                       "value": 3
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.0.transparency",
                                       "value": 3
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.0.fill",
                                       "value": 1
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.1.hosts.0",
                                       "value": "Zabbix server"
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.1.items.0",
                                       "value": "*: Number of processed *values per second"
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.1.color",
                                       "value": "000000"
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.1.transparency",
                                       "value": 0
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.1.fill",
                                       "value": 0
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.1.axisy",
                                       "value": 1
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.1.aggregate_function",
                                       "value": 3
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.1.aggregate_interval",
                                       "value": "1m"
                                   },
                                   {
                                       "type": 0,
                                       "name": "ds.1.aggregate_grouping",
                                       "value": 1
                                   },
                                   {
                                       "type": 1,
                                       "name": "ds.1.data_set_label",
                                       "value": "Number of processed values per second"
                                   },
                                   {
                                       "type": 0,
                                       "name": "graph_time",
                                       "value": 1
                                   },
                                   {
                                       "type": 1,
                                       "name": "time_period.from",
                                       "value": "now-3h"
                                   },
                                   {
                                       "type": 0,
                                       "name": "legend_statistic",
                                       "value": 1
                                   },
                                   {
                                       "type": 0,
                                       "name": "legend_lines",
                                       "value": 4
                                   },
                                   {
                                       "type": 0,
                                       "name": "show_problems",
                                       "value": 1
                                   },
                                   {
                                       "type": 1,
                                       "name": "reference",
                                       "value": "YZABC"
                                   }
                               ]
                           }
                       ]
                   }
               ],
               "userGroups": [
                   {
                       "usrgrpid": 7,
                       "permission": 2
                   }
               ],
               "users": [
                   {
                       "userid": 1,
                       "permission": 3
                   }
               ]
           },
           "id": 1
       }

レスポンス:

{
           "jsonrpc": "2.0",
           "result": {
               "dashboardids": [
                   "3"
               ]
           },
           "id": 1
       }

参照

OSZAR »