No longer receiving zabbix data

I’ve had a working zabbix connection receiving data as expected. I found the zabbix plugin will not display all data. It will only provide 3 weeks or months, I don’t remember the time period. I read if I turn on trends I will see more data. I tried it and I no longer got updates. I turned trends back off but it didn’t fix the problem. I’ve tried restarting, I even rebooted but it still isn’t working. Here is the weirdest part. There is a demo screen setup that had the zabbix display. I never touched it and it is still working. I only have 1 instance of grafana so its the same server. I did a tcpdump and found the working station is still sending requests but the monitoring stations are not. I need some assistance troubleshooting. I’ve not found a log that helps. Do you think switching to direct db connection would help?

I see this in the browser dev tools

PanelQueryRunner Error TypeError: Cannot read property ‘1’ of null
at Object.t.parseInterval (utils.js:163)
at e.value (datasource.js:548)
at eval (datasource.js:146)
at Qt (lodash.js:639)
at Function.$a [as map] (lodash.js:9553)
at e.value (datasource.js:118)
at runRequest.ts:199
at v (runRequest.ts:180)
at e. (PanelQueryRunner.ts:182)
at tslib.es6.js:97

Are there any clues in there?

Hi dslaughter,

do you have a solution to this issue? I also encountered similar issue here. All the dashboards created and worked well for few months suddenly failed to load (spinning on top right hand corner of each panel). I was also testing the loading performance between 24 hours , 48 hr,…till 30 days then I found the setting which forces to collect trend data from Zabbix DB instead. I even switched back to default and all the dashboard still failed to load ( even the new dashboard created after this issue occurred)

TypeError: Cannot read property ‘prefix’ of undefined
at L (valueFormats.ts:15)
at h (module.ts:466)
at module.ts:661
at u. (module.ts:721)
at u.emit (index.js:150)
at e.emit (emitter.ts:27)
at t.e.render (panel_ctrl.ts:223)
at panel_editor_tab.ts:25
at angular.js:20566
at p (angular.js:6428)

Any suggestion is highly appreciated.

Thanks!

Hello,

I found the problem and resolved it. Hope this helps your scenario.

I created a ‘clean’ Grafana + Zabbix plugin on a test vm.

This is the database /var/lib/grafana/grafana.db

I moved the production database to the test vm. Zabbix graphs stopped updating. The problem is in the database.

I went through the database table by table and the table data_source was different between the working database and the broken database. I pulled up the working config for Zabbix plugin.

select * from data_source;

id = 1

org_id = 1

version = 2

type = alexanderzobnin-zabbix-datasource

name = Zabbix

access = proxy

url = http://x.x.x.x/zabbix/api_jsonrpc.php

password =

user =

database =

basic_auth = 0

basic_auth_user =

basic_auth_password =

is_default = 1

json_data = {“addThresholds”:false,“alerting”:false,“alertingMinSeverity”:3,“dbConnectionDatasourceId”:null,“dbConnectionEnable”:false,“disableReadOnlyUsersAck”:false,“password”:“zabbix”,“trends”:false,“username”:“Admin”,“zabbixVersion”:3}

created = 2020-02-09 02:36:33

updated = 2020-02-09 02:39:28

with_credentials = 0

secure_json_data = {}

read_only = 0

Here is the record from the broken install.

select * from data_source where id=4;

id = 4

org_id = 1

version = 28

type = alexanderzobnin-zabbix-datasource

name = Zabbix

access = proxy

url = http://x.x.x.x/zabbix/api_jsonrpc.php

password =

user =

database =

basic_auth = 0

basic_auth_user = Admin

basic_auth_password =

is_default = 0

json_data = {“addThresholds”:false,“alerting”:false,“alertingMinSeverity”:3,“dbConnectionDatasourceId”:null,“dbConnectionEnable”:false,“disableReadOnlyUsersAck”:false,“keepCookies”:[],“password”:“zabbix”,“trends”:false,“trendsFrom”:“60”,“trendsRange”:“14”,“username”:“Admin”,“zabbixVersion”:3}

created = 2019-08-20 14:52:34

updated = 2020-02-10 20:45:15

with_credentials = 0

secure_json_data = {“basicAuthPassword”:“QjN5OHo1RTADJMSLBWeCZ+kLdxvSfKzDcUTjD5xS”}

read_only = 0

There are a couple of fields that are different.

In the broken install basic_auth_user is populated with Admin. In the working install the field is blank. I updated the record by removing Admin.

The field json_data does not match. Here is the working json_data

{

“addThresholds”: false,

“alerting”: false,

“alertingMinSeverity”: 3,

“dbConnectionDatasourceId”: null,

“dbConnectionEnable”: false,

“disableReadOnlyUsersAck”: false,

“password”: “zabbix”,

“trends”: false,

“username”: “Admin”,

“zabbixVersion”: 3

}

Here is json_data from the broken install

{

“addThresholds”: false,

“alerting”: false,

“alertingMinSeverity”: 3,

“dbConnectionDatasourceId”: null,

“dbConnectionEnable”: false,

“disableReadOnlyUsersAck”: false,

“keepCookies”: [],

“password”: “zabbix”,

“trends”: false,

“trendsFrom”: “60”,

“trendsRange”: “14”,

“username”: “Admin”,

“zabbixVersion”: 3

}

I updated the broken install json_data field with the json_data from the working install.

The field secure_json_data is populated in the broken install. I updated the record by removing the field data.

After that I restarted, logged in and its working. Somehow the database record was corrupted. I don’t know how this happened but it started after I turned trends on. Now that production is working I turned on trends and it worked this time. I see the graphs and trends are working.

image009.jpg

image010.png

image011.png

image012.png

Hi dslaughter,

thanks for the quick response. I didnt need to go this far as I removed both values for “After” and “Range” and it worked. As long as I dont have any value for “Range” and it will work regardless of the value for “After”.
i’m using Grafana v6.6.0 and plugin 3.10.5.

btw, what’s the difference between “After” and “Range” in Grafana? I copied and pasted below.
After - Time after which trends will be used. Best practice is to set this value to your history storage period (7d, 30d, etc).
Range - Time range width after which trends will be used instead of history. It’s better to set this value in range of 4 to 7 days to prevent loading large amount of history data.

if put 7 days in After, does that mean for 30 days of data in panel, the first 7 days data is collected from Zabbix history and the rest of days ( day 8 to day 30) collects only trend data from Zabbix. Is My interpretation correct? If so, what does Range get to do here?

Thanks!