Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when Trying to Use the "Problems" Query Type #1834

Closed
LinekerCalseverini opened this issue Jun 5, 2024 · 10 comments
Closed

Problem when Trying to Use the "Problems" Query Type #1834

LinekerCalseverini opened this issue Jun 5, 2024 · 10 comments

Comments

@LinekerCalseverini
Copy link

When I select the "Problems" Query Type it throws the following error:
Invalid params. Invalid parameter "/output/2": value must be one of "proxyid", "name", "proxy_groupid", "local_address", "local_port", "operating_mode", "allowed_addresses", "address", "port", "description", "tls_connect", "tls_accept", "tls_issuer", "tls_subject", "custom_timeouts", "timeout_zabbix_agent", "timeout_simple_check", "timeout_snmp_agent", "timeout_external_check", "timeout_db_monitor", "timeout_http_agent", "timeout_ssh_agent", "timeout_telnet_agent", "timeout_script", "timeout_browser", "lastaccess", "version", "compatibility", "state".

The API is sending this body to the zabbix API:
{"datasourceId":2,"method":"proxy.get","params":{"output":["proxyid","host"]}}

I'm pretty sure the problem is because in the new Zabbix Version, there's a new proxy table, and this also changed how the proxy.get procedure call works, since the proxy object now doesn't have a field called "host" (it was changed for "name", see Zabbix 7.0 Proxy Object)

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
10.4.2 7.0.0 4.4.9
@zoltanbedi
Copy link
Member

duplicate of #1714

@zoltanbedi zoltanbedi closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
@github-project-automation github-project-automation bot moved this to Complete in OSS Big Tent Jun 5, 2024
@fabio-oliveira-efeo
Copy link

fabio-oliveira-efeo commented Jun 5, 2024

@LinekerCalseverini As it was changed from 'host' to 'name', can we find it in the code to test as a temporary fix? I know we are looking for a quick solution and maybe they will resolve it quickly in a new release of the plugin. My fear is that it will take time to fix it.
I thought about editing the ...grafana/plugins/alexanderzobnin-zabbix-app/datasource/module.js file and changing it from ...this.request("proxy.get",{output:["proxyid","host" ]})... for this.request("proxy.get",{output:["proxyid","name"]})

@LinekerCalseverini
Copy link
Author

@fabio-oliveira-efeo

Yeah, that should work. Would recommend backing up the module.js file and restarting the Grafana server.

@intan-it
Copy link

intan-it commented Jun 6, 2024

@fabio-oliveira-efeo

Yeah, that should work.

Unfortunately, after editing module.js, the plugin is disabled due to "Modified signature".

@LinekerCalseverini
Copy link
Author

LinekerCalseverini commented Jun 6, 2024

@intan-it You can change the "allow_loading_unsigned_plugins" in grafana.ini to allow the plugin to be enabled.
For the signature, you have to edit the plugin.json and comment the "build" attribute.

Then restart Grafana server.

@intan-it
Copy link

intan-it commented Jun 7, 2024

@intan-it

Excuse me :)
I understand "allow_loading_unsigned_plugins" and "restart Grafana server" - it is obvious.
But I am stuck on "edit plugin.json and comment the "build" attribute". Should I create a new hash or just change the build number?

P.S. Thanks for your time.

@DonPook
Copy link

DonPook commented Jun 7, 2024

@intan-it

Excuse me :) I understand "allow_loading_unsigned_plugins" and "restart Grafana server" - it is obvious. But I am stuck on "edit plugin.json and comment the "build" attribute". Should I create a new hash or just change the build number?

P.S. Thanks for your time.

For me the plugin.json was here and it allowed me to start the application by commenting the whole build block:

/var/lib/grafana/plugins/alexanderzobnin-zabbix-app/plugin.json

The issue I have now, is that I don't see the "Zabbix Problems" visualization and it only returns the alerts in a table. Any clue why I lost the visualizations?

@LinekerCalseverini
Copy link
Author

@DonPook The Zabbix Problems visualization doesn't work in Table view (the panel option), it works in the List view (the one that has a broken heart icon).

Unfortunately, I have not found a way to circumvent this.

@mdubell
Copy link

mdubell commented Jun 8, 2024

I used the following steps to modify this plugin and restore functionality with Zabbix 7.0 .

  1. Add the following line to /etc/grafana/grafana.ini to allow unsigned plugins to be loaded.
    allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel

  2. Remove the digital signature from the grafana-zabbix plugin. Grafana will never load modified plugins that are signed
    mv /var/lib/grafana/plugins/alexanderzobnin-zabbix-app/MANIFESST.txt ~/

  3. Edit /var/lib/grafana/plugins/alexanderzobnin-zabbix-app/datasource/module.js
    Changes:
    {output:["proxyid","host"]} to {output:["proxyid","name"]}

If you're using the Zabbix Problems visualization with the Table Layout the following modification was needed to remove the error "Invalid params. Invalid parameter "/selectUsers": an array or a character string is expected." when an alert line is expanded.

  1. Edit /var/lib/grafana/plugins/alexanderzobnin-zabbix-app/datasource/module.js
    Changes:
    getEventAlerts(e){const t={eventids:e,output:["alertid","eventid","message","clock","error"],selectUsers:!0} to
    getEventAlerts(e){const t={eventids:e,output:["alertid","eventid","message","clock","error"],selectUsers:"extend"}

  2. Restart grafana-server service

@SkrzypekAdam
Copy link

I used the following steps to modify this plugin and restore functionality with Zabbix 7.0 .

  1. Add the following line to /etc/grafana/grafana.ini to allow unsigned plugins to be loaded.
    allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel
  2. Remove the digital signature from the grafana-zabbix plugin. Grafana will never load modified plugins that are signed
    mv /var/lib/grafana/plugins/alexanderzobnin-zabbix-app/MANIFESST.txt ~/
  3. Edit /var/lib/grafana/plugins/alexanderzobnin-zabbix-app/datasource/module.js
    Changes:
    {output:["proxyid","host"]} to {output:["proxyid","name"]}

If you're using the Zabbix Problems visualization with the Table Layout the following modification was needed to remove the error "Invalid params. Invalid parameter "/selectUsers": an array or a character string is expected." when an alert line is expanded.

  1. Edit /var/lib/grafana/plugins/alexanderzobnin-zabbix-app/datasource/module.js
    Changes:
    getEventAlerts(e){const t={eventids:e,output:["alertid","eventid","message","clock","error"],selectUsers:!0} to
    getEventAlerts(e){const t={eventids:e,output:["alertid","eventid","message","clock","error"],selectUsers:"extend"}
  2. Restart grafana-server service

I confirm, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

No branches or pull requests

7 participants