grafana / grafana-zabbix

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

ZabbixAPI maintenance.delete causes error #1178

Open timyllym opened 3 years ago

timyllym commented 3 years ago

We have built our custom Grafana panels where we utilize Zabbix datasource heavily. We call ZabbixAPI directly through your datasource.

Now after recent update when we call: zabbix.zabbixAPI.request('maintenance.delete', [maintenanceID])

That causes error: json: cannot unmarshal array into Go struct field ZabbixAPIResourceRequest.params of type map[string]interface {}

That's because maintenance.delete call takes only an array while most ZabbixAPI-calls take normal json object and in the models.go file the type of ZabbixAPIResourceRequest is defined to be map[string]interface{}

Screenshot Screenshot 2021-03-17 at 12 49 22

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
7.3.1 5.0.5 4.0.2
alexanderzobnin commented 3 years ago

Yes, in that case ZabbixAPIResourceRequest.Params should be more general, like interface{}. I think I anyway need this in future, so I'll change this.

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had activity in the last 2 years. It will be closed in 60 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!