Coder Social home page Coder Social logo

Comments (27)

jpconfessor avatar jpconfessor commented on April 28, 2024 5

file is located here: /usr/share/zabbix/api_jsonrpc.php

then, I just had to include the additional line provided by bpbp-boop after $data variable:

...
header('Content-Type: application/json');
$data = $http_request->body();
$data = str_replace('"user"', '"username"', $data);

don't forget to make a makup before adding any changes! ;) hope this will be fixed in the future

from grafana-zabbix.

solitprojects avatar solitprojects commented on April 28, 2024 3

update: apparently the "user" parameter was deprecated in version 5.4. Support for it is dropped in 6.4, see [ZBXNEXT-8085]. Please update the API call in the plugin

from grafana-zabbix.

spectroman avatar spectroman commented on April 28, 2024 3

field "user" is now only accepted as "username"

(not) nice, useless zabbix changes.

from grafana-zabbix.

solitprojects avatar solitprojects commented on April 28, 2024 2

got it "solved" since this afternoon :

delete MANIFEST.txt from the plugin directory and restart

then it will load as "unsigned" plugin, if you add it to
[plugins]
allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel

in short: unsigned plugins can be overwritten, incorrect signed plugins, cannot
so the trick is to delete the signing key ...

from grafana-zabbix.

valdoltra avatar valdoltra commented on April 28, 2024 1

I installed 4.2.10 but still getting the same problems with sending user instead of username. Any workarounds?
I have tried almost everything except compiling it from the source(which I am doing right now as I write).

As for digital signature I have no issues. I enabled unsigned plugins as per below, updated it through grafana UI from 4.2.6 to 4.2.10 and it can be used...

[plugins]
allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel

But it still throws the user param error.

Any suggestions?

from grafana-zabbix.

bpbp-boop avatar bpbp-boop commented on April 28, 2024 1

Another option is editing api_jsonrpc.php on your zabbix servers to update the user parameter

52a53
> $data = str_replace('"user"', '"username"', $data);

from grafana-zabbix.

alexanderzobnin avatar alexanderzobnin commented on April 28, 2024

Yes, user was renamed to username.

from grafana-zabbix.

lfernandosg avatar lfernandosg commented on April 28, 2024

dear,

I'm on zabbix 6.4 b5 and grafana 9.3.2. Until version 6.4 b4 it was working but now I get the same error. I'm not finding in my debian file /usr/share/zabbix/api_jsonrpc.php that part to change the name to username.

follow my file

'json-rpc', 'application/json' => 'json-rpc', 'application/jsonrequest' => 'json-rpc' ]; $http_request = new CHttpRequest(); $content_type = $http_request->header('Content-Type'); $content_type = explode(';', $content_type); $content_type = $content_type[0]; if (!isset($allowed_content[$content_type])) { header('HTTP/1.0 412 Precondition Failed'); return; } require_once dirname(__FILE__).'/include/classes/core/APP.php'; header('Content-Type: application/json'); $data = $http_request->body(); try { APP::getInstance()->run(APP::EXEC_MODE_API); $apiClient = API::getWrapper()->getClient(); // unset wrappers so that calls between methods would be made directly to the services API::setWrapper(); $jsonRpc = new CJsonRpc($apiClient, $data); echo $jsonRpc->execute(); } catch (Exception $e) { // decode input json request to get request's id $jsonData = json_decode($data, true); $response = [ 'jsonrpc' => '2.0', 'error' => [ 'code' => 1, 'message' => $e->getMessage(), 'data' => '' ], 'id' => (isset($jsonData['id']) ? $jsonData['id'] : null) ]; echo json_encode($response); } session_write_close();

from grafana-zabbix.

alexanderzobnin avatar alexanderzobnin commented on April 28, 2024

Here's a test build (linux+windows). You can try it and see if issue is fixed

alexanderzobnin-zabbix-app.zip

from grafana-zabbix.

solitprojects avatar solitprojects commented on April 28, 2024

from grafana-zabbix.

lfernandosg avatar lfernandosg commented on April 28, 2024

Alexandre, the commands you have in the readme are the same ones we install in normally. How do I apply this build? is it by cli? which command? or is it through the web gui? which way?

Here's a test build (linux+windows). You can try it and see if issue is fixed

alexanderzobnin-zabbix-app.zip

Alexandre, the commands you have in the readme are the same ones we install in normally. How do I apply this build? is it by cli? which command? or is it through the web gui? which way?

from grafana-zabbix.

lfernandosg avatar lfernandosg commented on April 28, 2024

Alexandre, the commands you have in the readme are the same ones we install in normally. How do I apply this build? is it by cli? which command? or is it through the web gui? which way?

Here's a test build (linux+windows). You can try it and see if issue is fixed
alexanderzobnin-zabbix-app.zip

Alexandre, the commands you have in the readme are the same ones we install in normally. How do I apply this build? is it by cli? which command? or is it through the web gui? which way?

when copying the files to the /var/lib/grafana/plugins/alexanderzobnin-zabbix-app folder it deactivates the plugin and does not let it activate asking to reinstall the plugin.

from grafana-zabbix.

kestjones avatar kestjones commented on April 28, 2024

Here's a test build (linux+windows). You can try it and see if issue is fixed

alexanderzobnin-zabbix-app.zip
@alexanderzobnin , I uninstalled the old plugin, applied the bug fix and the problem still exists. I get the following message: Invalid params. Invalid parameter "/": unexpected parameter "user".

from grafana-zabbix.

byteschubser avatar byteschubser commented on April 28, 2024

Here's a test build (linux+windows). You can try it and see if issue is fixed

alexanderzobnin-zabbix-app.zip

Please sign this test version.

plugin=alexanderzobnin-zabbix-app path=/var/lib/grafana/plugins/alexanderzobnin-zabbix-app/gpx_zabbix-plugin_freebsd_arm64
logger=plugin.loader t=2023-01-10T09:50:13.860210076Z level=warn msg="Skipping loading plugin due to problem with signature" pluginID=alexanderzobnin-zabbix-datasource status=modified
logger=plugin.loader t=2023-01-10T09:50:13.860429449Z level=warn msg="Skipping loading plugin due to problem with signature" pluginID=alexanderzobnin-zabbix-triggers-panel status=modified
logger=plugin.loader t=2023-01-10T09:50:13.860523876Z level=warn msg="Skipping loading plugin due to problem with signature" pluginID=alexanderzobnin-zabbix-app status=modified

from grafana-zabbix.

gimguang avatar gimguang commented on April 28, 2024

Although the unsigned plug-in is set in grafana.ini, it still cannot be used

[plugins]
enable_alpha = true
app_tls_skip_verify_insecure = true
# Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
allow_loading_unsigned_plugins = alexanderzobnin-zabbix-datasource
# Enable or disable installing / uninstalling / updating plugins directly from within Grafana.
plugin_admin_enabled = true
;plugin_admin_external_manage_enabled = false

from grafana-zabbix.

greenaar avatar greenaar commented on April 28, 2024

Also running Zabbix 6.4b5. Unsigned option in grafana does not seem to work. Could you sign either your test build or a new release?

from grafana-zabbix.

byteschubser avatar byteschubser commented on April 28, 2024

Thanks for the hint. The following works for me:

[plugins]
allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel

from grafana-zabbix.

kestjones avatar kestjones commented on April 28, 2024

I can't get the plugin to work. It gives the error:

level=warn msg="Skipping loading plugin due to problem with signature" pluginID=alexanderzobnin-zabbix-datasource status=modified.
Even adding the line:

[plugins]
allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel

According to grafana documentation plugins with modified signature cannot be loaded. Has anyone managed to resolve?

from grafana-zabbix.

kestjones avatar kestjones commented on April 28, 2024

got it "solved" since this afternoon :

delete MANIFEST.txt from the plugin directory and restart

then it will load as "unsigned" plugin, if you add it to [plugins] allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel

in short: unsigned plugins can be overwritten, incorrect signed plugins, cannot so the trick is to delete the signing key ...

@solitprojects , It worked thank you very much.

from grafana-zabbix.

clintclil avatar clintclil commented on April 28, 2024

I can't get the plugin to work. It gives the error: Plugin disabled
grafanan

from grafana-zabbix.

clintclil avatar clintclil commented on April 28, 2024

Is it any tricky way to avoid this bug in pluggin side

from grafana-zabbix.

jdbarondo avatar jdbarondo commented on April 28, 2024

Hi, I also have the same problem. I have upgraded everything (Zabbix and Grafana) to their latest versions, and I still continue to get the same error:

Invalid params. Invalid parameter "/": unexpected parameter "user".

logger=plugin.alexanderzobnin-zabbix-datasource t=2023-02-21T15:10:45.300991485Z level=error msg="Zabbix API request error" error="Invalid params. Invalid parameter "/": unexpected parameter "user"."
logger=context userId=1 orgId=1 uname=admin t=2023-02-21T15:10:45.301609358Z level=error msg="Request Completed" method=POST path=/api/datasources/10/resources/zabbix-api status=500 remote_addr=X.X.X.X time_ms=60 duration=60.692836ms size=117 referer=https://grafana.test.es:3000/datasources/edit/mBeMTU0Vk handler=/api/datasources/:id/resources/*

from grafana-zabbix.

javier-lancharro avatar javier-lancharro commented on April 28, 2024

Hi, and thanks for excellent integration...

I installed the last version of plugin that you has published in this thread... i solved "unsigned plugin" errors... but the error persist: "Invalid params. Invalid parameter "/": unexpected parameter "user".

Zabbix 6.4.0rc2

Can you help me please? I'm migrating from PRTG Network Monitor to Zabbix + Grafana and this error stops our migration.

Sorry for my poor english

Thx for advance

Best regards

from grafana-zabbix.

Xileck avatar Xileck commented on April 28, 2024

got it "solved" since this afternoon :

delete MANIFEST.txt from the plugin directory and restart

then it will load as "unsigned" plugin, if you add it to [plugins] allow_loading_unsigned_plugins = alexanderzobnin-zabbix-app,alexanderzobnin-zabbix-datasource,alexanderzobnin-zabbix-triggers-panel

in short: unsigned plugins can be overwritten, incorrect signed plugins, cannot so the trick is to delete the signing key ...

Thanks a lot mate this worked for me and thanks @alexanderzobnin for providing the test build, I was able to do these changes on my Grafana docker container and it worked!, you saved my life (Got a meeting this monday on how we are now monitoring network and servers using this awesome plugin)

from grafana-zabbix.

simonecerbone avatar simonecerbone commented on April 28, 2024

hello @bpbp-boop, where is the file ? I have docker installation
thanks

from grafana-zabbix.

glange84 avatar glange84 commented on April 28, 2024
= str_replace('"user"', '"username"', $data);

Top man! Thanks!

from grafana-zabbix.

pptfz avatar pptfz commented on April 28, 2024

Thank you. That solves the problem

from grafana-zabbix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.