These parameters and the possible property values for the respective dashboard widget field objects allow to configure the Host 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 Host card widget, please refer to the parameter behavior outlined in the tables below.
The following parameters are supported for the Host 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. |
|
Host | 3 | hostid.0 | Host ID. Parameter behavior: - required if Host (Widget/Dashboard) is not set This parameter is not supported if configuring the widget on a template dashboard. |
|
Host (Widget/Dashboard) | 1 | hostid._reference | Instead of Host ID:DASHBOARD.hostid - set the Host selector as the data source for host;ABCDE._hostid - set a compatible widget (with its Reference parameter set to "ABCDE ") as the data source for host.Parameter behavior: - required if Host is not set This parameter is not supported if configuring the widget on a template dashboard. |
|
Show suppressed problems | 0 | show_suppressed | 0 - (default) Disabled; 1 - Enabled. |
|
Show | 0 | sections.0 | 0 - Host groups; 1 - Description; 2 - Monitoring; 3 - Availability; 4 - Monitored by; 5 - Templates; 6 - Inventory; 7 - 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. |
The following parameters are supported if Show is set to "Inventory".
Parameter | type | name | value |
---|---|---|---|
Inventory fields | 0 | inventory.0 | Inventory ID. Note: To configure multiple inventory fields, create a dashboard widget field object for each inventory field with an incremented number in the property name. |
The following examples aim to only describe the configuration of the dashboard widget field objects for the Host card widget. For more information on configuring a dashboard, see dashboard.create
.
Configure a Host card widget that displays these sections: "Monitoring", "Availability", "Monitored by", "Inventory", and "Tags".
{
"jsonrpc": "2.0",
"method": "dashboard.create",
"params": {
"name": "My dashboard",
"display_period": 30,
"auto_start": 1,
"pages": [
{
"widgets": [
{
"type": "hostcard",
"name": "Host card",
"x": 0,
"y": 0,
"width": 14,
"height": 7,
"view_mode": 0,
"fields": [
{
"type": 3,
"name": "hostid.0",
"value": 10084
},
{
"type": 0,
"name": "show_suppressed",
"value": 1
},
{
"type": 0,
"name": "sections.0",
"value": 2
},
{
"type": 0,
"name": "sections.1",
"value": 3
},
{
"type": 0,
"name": "sections.2",
"value": 4
},
{
"type": 0,
"name": "sections.3",
"value": 6
},
{
"type": 0,
"name": "sections.4",
"value": 7
},
{
"type": 0,
"name": "inventory.0",
"value": 25
},
{
"type": 0,
"name": "inventory.1",
"value": 26
}
]
}
]
}
],
"userGroups": [
{
"usrgrpid": 7,
"permission": 2
}
],
"users": [
{
"userid": 1,
"permission": 3
}
]
},
"id": 1
}
Response: