Deze parameters en de mogelijke eigenschapswaarden voor de respectievelijke dashboardwidgetveldobjecten maken het mogelijk om de widget Gauge te configureren in de methoden dashboard.create
en dashboard.update
.
Widget fields
-eigenschappen worden niet gevalideerd tijdens het maken of bijwerken van een dashboard. Hierdoor kunnen gebruikers ingebouwde widgets wijzigen en aangepaste widgets maken, maar dit brengt ook het risico met zich mee dat widgets onjuist worden gemaakt of bijgewerkt. Om de succesvolle creatie of update van de widget Gauge te garanderen, raadpleegt u het parametergedrag dat in de onderstaande tabellen wordt beschreven.
De volgende parameters worden ondersteund voor de Gauge-widget.
Parameter | type | name | value | |
---|---|---|---|---|
Refresh interval | 0 | rf_rate | 0 - Geen refresh; 10 - 10 seconden; 30 - 30 seconden; 60 - (standaard) 1 minuut; 120 - 2 minuten; 600 - 10 minuten; 900 - 15 minuten. |
|
Item | 4 | itemid.0 | Item ID. Parametergedrag: - verplicht als Item (Widget) niet is ingesteld |
|
Item (Widget) | 1 | itemid._reference | In plaats van Item ID:ABCDE._itemid - stel een compatibele widget in (met de parameter Reference ingesteld op "ABCDE ") als de gegevensbron voor items.Parametergedrag: - vereist als Item niet is ingesteld |
|
Min | 1 | min | Een willekeurige numerieke waarde. Suffixen (bijv. "1d", "2w", "4K", "8G") worden ondersteund. Standaard: "0". |
|
Max | 1 | max | Elke numerieke waarde. Suffixen (bijv. "1d", "2w", "4K", "8G") worden ondersteund. Standaard: "100". |
|
Waarde arc | 1 | value_arc_color | Hexadecimale kleurcode (bijv. FF0000 ).Standaard: "" (leeg). |
|
Arc background | 1 | empty_color | Hexadecimale kleurcode (bijv. FF0000 ).Standaard: "" (leeg). |
|
Achtergrond | 1 | bg_color | Hexadecimale kleurcode (bijv. FF0000 ).Standaard: "" (leeg). |
|
Weergeven | 0 | weergeven.0 | 1 - Beschrijving; 2 - Waarde; 3 - Naald; 4 - Schaal; 5 - Waardeboog. Opmerking: Als u meerdere waarden wilt configureren, maakt u voor elke waarde een dashboardwidgetveldobject met een oplopend nummer in de eigenschapsnaam. Standaard: 1, 2, 4, 5. Waarden "Naald" en "Schaal" worden niet ondersteund als beide: - geen dashboardwidgetveldobject voor Weergeven met de waarde "Waardeboog" is ingesteld; - Weergevenboog geavanceerde configuratie parameter is ingesteld op "Uitgeschakeld". Geavanceerde configuratie parameters voor Weergeven opties worden niet ondersteund als er geen dashboardwidgetveldobjecten met de respectievelijke waarden zijn ingesteld. |
|
Host overschrijven | 1 | override_hostid._reference | ABCDE._hostid - stel een compatibele widget in (met de parameter Reference ingesteld op "ABCDE ") als de gegevensbron voor hosts;DASHBOARD._hostid - stel de Host-selector van het dashboard in als de gegevensbron voor hosts.Deze parameter wordt niet ondersteund als de widget wordt geconfigureerd op een template dashboard. |
The following advanced configuration parameters are supported for the Gauge widget.
The number in the Thresholds property name (e.g. thresholds.color.0) references the threshold place in a list, sorted in ascending order. However, if thresholds are configured in a different order, the values will be sorted in ascending order after updating widget configuration in Zabbix frontend (e.g. "threshold.threshold.0":"5"
→ "threshold.threshold.0":"1"
; "threshold.threshold.1":"1"
→ "threshold.threshold.1": "5"
).
Parameter | type | name | value |
---|---|---|---|
Angle | 0 | angle | Valid values: 180 (default) or 270. |
Description | |||
Description | 1 | description | Any string value, including macros. Supported macros: {HOST.*}, {ITEM.*}, {INVENTORY.*}, user macros. Default: {ITEM.NAME}. |
Size | 0 | desc_size | Valid values range from 1-100. Default: 15. |
Bold | 0 | desc_bold | 0 - (default) Disabled; 1 - Enabled. |
Vertical position | 0 | desc_v_pos | 0 - Top; 1 - (default) Bottom. |
Color | 1 | desc_color | Hexadecimal color code (e.g. FF0000 ).Default: "" (empty). |
Value | |||
Decimal places | 0 | decimal_places | Valid values range from 1-10. Default: 2. |
Size | 0 | value_size | Valid values range from 1-100. Default: 25. |
Bold | 0 | value_bold | 0 - (default) Disabled; 1 - Enabled. |
Color | 1 | value_color | Hexadecimal color code (e.g. FF0000 ).Default: "" (empty). |
Arc | 0 | value_arc | 0 - Disabled; 1 - (default) Enabled. |
Arc size | 0 | value_arc_size | Valid values range from 1-100. Default: 20. Parameter Arc size not available if Arc is set to "Disabled". |
Units | |||
Units (checkbox) | 0 | units_show | 0 - Disabled; 1 - (default) Enabled. |
Units (value) | 1 | units | Any string value. Parameter Units (value) not available if Units (checkbox) is set to "Disabled". |
Size | 0 | units_size | Valid values range from 1-100. Default: 25. Parameter Size not available if Units (checkbox) is set to "Disabled". |
Bold | 0 | units_bold | 0 - (default) Disabled; 1 - Enabled. Parameter Bold not available if Units (checkbox) is set to "Disabled". |
Position | 0 | units_pos | 0 - Before value; 1 - Above value; 2 - (default) After value; 3 - Below value. Ignored if Units is set to one of the following time-related units: unixtime, uptime, s. Parameter Position not available if Units (checkbox) is set to "Disabled". |
Color | 1 | units_color | Hexadecimal color code (e.g. FF0000 ).Default: "" (empty).Parameter Color not available if Units (checkbox) is set to "Disabled". |
Needle | |||
Needle (checkbox) | 0 | needle_show | 0 - (default) Disabled; 1 - Enabled. Parameter Needle (checkbox) not available if both Arc and Show arc are set to "Disabled". |
Color | 1 | needle_color | Hexadecimal color code (e.g. FF0000 ).Default: "" (empty).Parameter Color not available if Needle (checkbox) is set to "Disabled" or both Arc and Show arc are set to "Disabled". |
Scale | |||
Scale (checkbox) | 0 | scale_show | 0 - Disabled; 1 - (default) Enabled. Parameter Scale (checkbox) not available if both Arc and Show arc are set to "Disabled". |
Show units | 0 | scale_show_units | 0 - Disabled; 1 - (default) Enabled. Parameter Show units not available if Units (checkbox) or Scale (checkbox) is set to "Disabled", or if both Arc and Show arc are set to "Disabled". |
Size | 0 | scale_size | Valid values range from 1-100. Default: 10. Parameter Size not available if Scale (checkbox) is set to "Disabled", or if both Arc and Show arc are set to "Disabled". |
Decimal places | 0 | scale_decimal_places | Valid values range from 1-10. Default: 0. Parameter Decimal places not available if Scale (checkbox) is set to "Disabled", or if both Arc and Show arc are set to "Disabled". |
Thresholds | |||
Color | 1 | thresholds.color.0 | Hexadecimal color code (e.g. FF0000 ). |
Threshold | 1 | thresholds.threshold.0 | Any numeric value. Suffixes (e.g. "1d", "2w", "4K", "8G") are supported. |
Show labels | 0 | th_show_labels | 0 - (default) Disabled; 1 - Enabled. Parameter Show labels not available if Thresholds are not set, or if both Arc and Show arc are set to "Disabled". |
Show arc | 0 | th_show_arc | 0 - (default) Disabled; 1 - Enabled. Parameter Show arc not available if Thresholds are not set. |
Arc size | 0 | th_arc_size | Valid values range from 1-100. Default: 10. Parameter Arc size not available if Thresholds are not set, or if both Arc and Show arc are set to "Disabled". |
De volgende voorbeelden zijn bedoeld om alleen de configuratie van de dashboardwidgetveldobjecten voor de Gauge-widget te beschrijven. Voor meer informatie over het configureren van een dashboard, zie dashboard.create
.
Configure a Gauge widget that displays the item value for the item "44474" (Interface enp0s3: Bits sent). In addition, visually fine-tune the widget with multiple advanced options, including thresholds.
{
"jsonrpc": "2.0",
"method": "dashboard.create",
"params": {
"name": "My dashboard",
"display_period": 30,
"auto_start": 1,
"pages": [
{
"widgets": [
{
"type": "gauge",
"name": "Gauge",
"x": 0,
"y": 0,
"width": 6,
"height": 5,
"view_mode": 0,
"fields": [
{
"type": 4,
"name": "itemid",
"value": 44474
},
{
"type": 1,
"name": "min",
"value": "100000"
},
{
"type": 1,
"name": "max",
"value": "1000000"
},
{
"type": 0,
"name": "angle",
"value": 270
},
{
"type": 0,
"name": "desc_size",
"value": 10
},
{
"type": 0,
"name": "desc_bold",
"value": 1
},
{
"type": 0,
"name": "decimal_places",
"value": 0
},
{
"type": 0,
"name": "value_bold",
"value": 1
},
{
"type": 0,
"name": "units_size",
"value": 15
},
{
"type": 0,
"name": "units_pos",
"value": 3
},
{
"type": 0,
"name": "needle_show",
"value": 1
},
{
"type": 1,
"name": "needle_color",
"value": "3C3C3C"
},
{
"type": 1,
"name": "thresholds.color.0",
"value": "0EC9AC"
},
{
"type": 1,
"name": "thresholds.threshold.0",
"value": "100000"
},
{
"type": 1,
"name": "thresholds.color.1",
"value": "FFD54F"
},
{
"type": 1,
"name": "thresholds.threshold.1",
"value": "500000"
},
{
"type": 1,
"name": "thresholds.color.2",
"value": "FF465C"
},
{
"type": 1,
"name": "thresholds.threshold.2",
"value": "700000"
},
{
"type": 0,
"name": "th_show_labels",
"value": 1
},
{
"type": 0,
"name": "th_show_arc",
"value": 1
},
{
"type": 0,
"name": "th_arc_size",
"value": 15
}
]
}
]
}
],
"userGroups": [
{
"usrgrpid": 7,
"permission": 2
}
],
"users": [
{
"userid": 1,
"permission": 3
}
]
},
"id": 1
}
Response: