These parameters and the possible property values for the respective dashboard widget field objects allow to configure the Item card widget in dashboard.create
and dashboard.update
methods.
Widget fields
properties are not validated during the creation or update of a dashboard. This allows users to modify built-in widgets and create custom widgets, but also introduces the risk of creating or updating widgets incorrectly. To ensure the successful creation or update of the Item card widget, please refer to the parameter behavior outlined in the tables below.
The following parameters are supported for the Item card 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. |
|
Item | 4 | itemid.0 | Item ID. Parameter behavior: - required if Item (Widget) is not set |
|
Item (Widget) | 1 | itemid._reference | Instead of Item ID:ABCDE._itemid - set a compatible widget (with its Reference parameter set to "ABCDE ") as the data source for item.Parameter behavior: - required if Item is not set |
|
Show | 0 | sections.0 | 0 - Description; 1 - Error text; 2 - Metrics; 3 - Latest data; 4 - Type of information; 5 - Triggers; 6 - Host interface; 7 - Type; 8 - Host inventory; 9 - Tags. Note: The number in the property name references section order in the section list. To configure multiple sections, create a dashboard widget field object for each section with an incremented number in the property name. |
|
Override host | 1 | 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.Default: "" (empty)This parameter is not supported if configuring the widget on a template dashboard. |
The following parameters are supported if Show is set to "Latest data".
Parameter | type | name | value | |
---|---|---|---|---|
Width | 0 | sparkline.width | Possible values range from 0-10. Default: 1. |
|
Fill | 0 | sparkline.fill | Possible values range from 0-10. Default: 3. |
|
Color | 1 | sparkline.color | Hexadecimal color code (e.g. FF0000 ).Default: 42A5F5 . |
|
Time period | 1 | sparkline.time_period._reference | DASHBOARD._timeperiod - set the Time period selector as the data source;ABCDE._timeperiod - set a compatible widget (with its reference parameter equal to ABCDE ) as the data source.Default: "" (empty)Alternatively, you can set the time period only in the From and To parameters. |
|
From | 1 | sparkline.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.).Default: now-1h. Parameter behavior: - supported if Time period is not set |
|
To | 1 | sparkline.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.).Default: now. Parameter behavior: - supported if Time period is not set |
|
History data | 0 | sparkline.history | 0 - (default) Auto; 1 - History; 2 - Trends. |
The following examples aim to only describe the configuration of the dashboard widget field objects for the Item card widget. For more information on configuring a dashboard, see dashboard.create
.
Configure an Item card widget that displays these sections: "Description", "Latest data", "Triggers", and "Tags".
{
"jsonrpc": "2.0",
"method": "dashboard.create",
"params": {
"name": "My dashboard",
"display_period": 30,
"auto_start": 1,
"pages": [
{
"widgets": [
{
"type": "itemcard",
"name": "Item card",
"x": 0,
"y": 0,
"width": 14,
"height": 7,
"view_mode": 0,
"fields": [
{
"type": 4,
"name": "itemid.0",
"value": 42257
},
{
"type": 0,
"name": "sections.0",
"value": 0
},
{
"type": 0,
"name": "sections.1",
"value": 3
},
{
"type": 0,
"name": "sections.2",
"value": 5
},
{
"type": 0,
"name": "sections.3",
"value": 9
}
]
}
]
}
],
"userGroups": [
{
"usrgrpid": 7,
"permission": 2
}
],
"users": [
{
"userid": 1,
"permission": 3
}
]
},
"id": 1
}
Response: