2 Clock

Description

These parameters and the possible property values for the respective dashboard widget field objects allow to configure the Clock 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 Clock widget, please refer to the parameter requirements outlined in the tables below.

Parameters

The following parameters are supported for the Clock widget.

Parameter type name value
Refresh interval 0 rf_rate 0 - No refresh;
10 - 10 seconds;
30 - 30 seconds;
60 - 1 minute;
120 - 2 minutes;
600 - 10 minutes;
900 - (default) 15 minutes.
Time type 0 time_type 0 - (default) Local time;
1 - Server time;
2 - Host time.

The following parameters are supported if Time type is set to "Host time".

Parameter type name value
Item
(required)
4 itemid Item ID.

Examples

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

Configuring a Clock widget

Configure a Clock widget that displays Zabbix server time.

Request:

{
           "jsonrpc": "2.0",
           "method": "dashboard.create",
           "params": {
               "name": "My dashboard",
               "display_period": 30,
               "auto_start": 1,
               "pages": [
                   {
                       "widgets": [
                           {
                               "type": "clock",
                               "name": "Clock",
                               "x": 0,
                               "y": 0,
                               "width": 4,
                               "height": 3,
                               "view_mode": 0,
                               "fields": [
                                   {
                                       "type": 0,
                                       "name": "time_type",
                                       "value": 1
                                   }
                               ]
                           }
                       ]
                   }
               ],
               "userGroups": [
                   {
                       "usrgrpid": 7,
                       "permission": 2
                   }
               ],
               "users": [
                   {
                       "userid": 1,
                       "permission": 3
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

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

See also