grafana / grafana-zabbix

Zabbix plugin for Grafana dashboard
http://play.grafana-zabbix.org
Apache License 2.0
2.06k stars 458 forks source link

Can't get IT Services status inZabbix 6.0 #1571

Open DmitriyGrebenshikoff opened 1 year ago

DmitriyGrebenshikoff commented 1 year ago

Describe the bug Plugin return null status of IT Service in Zabbix 6.0.

Expected behavior Plugin return -1 if status of IT Service is OK, as described in docs

Screenshots

image

Query inspector ``` JSON { "request": { "url": "api/datasources/16/resources/db-connection-post", "method": "POST", "hideFromInspector": false, "data": { "series": [ { "ts": [ { "time": 1676160000, "value": null } ], "meta": { "name": "App Service Status", "interval": null, "item": {} } } ], "query": { "application": { "filter": "" }, "datasource": { "type": "alexanderzobnin-zabbix-datasource", "uid": "000000016" }, "functions": [], "group": { "filter": "" }, "hide": false, "host": { "filter": "" }, "itServiceFilter": "App Service", "item": { "filter": "" }, "itemTag": { "filter": "" }, "options": { "disableDataAlignment": false, "showDisabledItems": false, "skipEmptyValues": false, "useZabbixValueMapping": false }, "proxy": { "filter": "" }, "queryType": "1", "refId": "A", "resultFormat": "time_series", "slaInterval": "none", "slaProperty": { "name": "Status", "property": "status" }, "table": { "skipEmptyValues": false }, "tags": { "filter": "" }, "trigger": { "filter": "" }, "triggers": { "acknowledged": 2, "count": true, "minSeverity": 3 } }, "timeRange": {} } }, "response": [ { "schema": { "name": "App Service Status", "fields": [ { "name": "Time", "type": "time", "typeInfo": { "frame": "time.Time" } }, { "name": "Value", "type": "number", "typeInfo": { "frame": "float64", "nullable": true }, "labels": { "item": "", "item_key": "" }, "config": { "displayNameFromDS": "App Service Status", "custom": { "scopedVars": { "__zbx_item": { "text": "", "value": "" }, "__zbx_item_interval": { "text": "", "value": "" }, "__zbx_item_key": { "text": "", "value": "" }, "__zbx_item_name": { "text": "", "value": "" } }, "units": "" } } } ] }, "data": { "values": [ [ 1676160000000 ], [ null ] ] } } ] } ```

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
8.4.6 6.0.10 4.2.10
kapaevnn commented 1 year ago

We have the same problem. We use Zabbix 6.0.10, Grafana v8.5.13 and Grafana-Zabbix Plugin 4.2.10

kitealex commented 1 year ago

Hello. I have the same issue. Null data in Sevice status.

alexanderzobnin commented 1 year ago

Could you check it in the latest version? Is it still happening?

DmitriyGrebenshikoff commented 1 year ago

It works, thanks. But I find another bug on grafana 9.4.7 and plugin 4.3.1 When I create panel with statuses of my services panel show "No data" when I add second query to panel:

Screenshot

![image](https://user-images.githubusercontent.com/19803145/227603842-40143c77-27e9-48de-8416-f74ef8e1d558.png)

JSON query

```json { "request": { "url": "api/datasources/1/resources/zabbix-api", "method": "POST", "hideFromInspector": false, "data": { "datasourceId": 1, "method": "service.get", "params": { "output": "extend", "serviceids": [ "28" ] } } }, "response": { "result": [ { "algorithm": "2", "created_at": "946684800", "description": "", "name": "Databases", "propagation_rule": "0", "propagation_value": "0", "readonly": true, "serviceid": "28", "sortorder": "0", "status": "-1", "uuid": "ea2ef9b0d0954f999f4973633b485340", "weight": "0" } ] } } ```

But when I make it in one query with regular expression it works fine:

Screenshot

![image](https://user-images.githubusercontent.com/19803145/227604058-f280aed5-54ae-44a2-a671-d935237d7ca5.png)

JSON query

```json { "request": { "url": "api/datasources/1/resources/zabbix-api", "method": "POST", "hideFromInspector": false, "data": { "datasourceId": 1, "method": "service.get", "params": { "output": "extend", "serviceids": [ "27", "28" ] } } }, "response": { "result": [ { "algorithm": "1", "created_at": "946684800", "description": "", "name": "Hardware", "propagation_rule": "0", "propagation_value": "0", "readonly": true, "serviceid": "27", "sortorder": "0", "status": "-1", "uuid": "3c02a379965a40df8d77b1c484450433", "weight": "0" }, { "algorithm": "2", "created_at": "946684800", "description": "", "name": "Databases", "propagation_rule": "0", "propagation_value": "0", "readonly": true, "serviceid": "28", "sortorder": "0", "status": "-1", "uuid": "ea2ef9b0d0954f999f4973633b485340", "weight": "0" } ] } } ```

DmitriyGrebenshikoff commented 1 year ago

And it's happens not only with statuses, but also with all other fields