これらのパラメーターと、各ダッシュボードウィジェットフィールドオブジェクトの有効なプロパティ値を使用することで、dashboard.create
メソッドおよびdashboard.update
メソッドでグラフ(クラシック)ウィジェットを設定できます。
ウィジェットのfields
プロパティは、ダッシュボードの作成または更新時に検証されません。 これにより、ユーザーは組み込みウィジェットを変更したり、カスタムウィジェットを作成したりできますが、ウィジェットを誤って作成または更新してしまうリスクも生じます。 グラフ(クラシック)ウィジェットを正常に作成または更新するには、以下の表に記載されているパラメーターの動作を参照してください。
The following parameters are supported for the Graph (classic) widget.
Parameter | type | name | value |
---|---|---|---|
Refresh interval | 0 | rf_rate | 0 - No refresh; 10 - 10 seconds; 30 - 30 seconds; 60 - (default) 1 minute; 120 - 2 minutes; 600 - 10 minutes; 900 - 15 minutes. |
Source | 0 | source_type | 0 - (default) Graph; 1 - Simple graph. |
Graph | 6 | graphid | Graph ID. Parameter Graph required if Source is set to "Graph". |
Item | 4 | itemid | Item ID. Parameter Item required if Source is set to "Simple graph". |
Show legend | 0 | show_legend | 0 - Disabled; 1 - (default) Enabled. |
Enable host selection | 0 | dynamic | 0 - (default) Disabled; 1 - Enabled. |
次の例は、Graph (classic)ウィジェットのダッシュボードウィジェットフィールドオブジェクトの設定を説明することだけを目的としています。 ダッシュボードの設定の詳細については、dashboard.create
を参照してください。
Configure a Graph (classic) widget that displays a simple graph for the item "42269".
{
"jsonrpc": "2.0",
"method": "dashboard.create",
"params": {
"name": "My dashboard",
"display_period": 30,
"auto_start": 1,
"pages": [
{
"widgets": [
{
"type": "graph",
"name": "Graph (classic)",
"x": 0,
"y": 0,
"width": 12,
"height": 5,
"view_mode": 0,
"fields": [
{
"type": 0,
"name": "source_type",
"value": 1
},
{
"type": 4,
"name": "itemid",
"value": 42269
}
]
}
]
}
],
"userGroups": [
{
"usrgrpid": 7,
"permission": 2
}
],
"users": [
{
"userid": 1,
"permission": 3
}
]
},
"id": 1
}
Response: