I just install the Zabbix plugin and it doesn’t appear at “Add data source”. This is a know bug? How to fix it? (Grafana: v7.1.5 and Zabbix v5.0.3.)
I was running into the same issue, Ubuntu 20.04
, Zabbix 5.0-1
, Grafana 7.1.5
, alexanderzobnin-zabbix-app 4.0.1
. I noticed in /var/log/grafana/grafana.log
a few things,
"Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
"Config loaded from" logger=settings file=/etc/grafana/grafana.ini
"Connecting to DB" logger=sqlstore dbtype=sqlite3"
"Failed to load plugin" logger=plugins error="plugin \"alexanderzobnin-zabbix-datasource\" is unsigned" pluginPath=/var/lib/grafana/plugins/alexanderzobnin-zabbix-app/datasource-zabbix"
I had changed my /etc/grafana/grafana.ini
to use my MySQL Grafana database yet it was using sqlite3. I also had added “alexanderzobnin-zabbix-datasource” to “allow_loading_unsigned_plugins” in /etc/grafana/grafana.ini
. The Zabbix data source was still not loading.
So I added my MySQL database settings and “alexanderzobnin-zabbix-datasource” to “allow_loading_unsigned_plugins” to /usr/share/grafana/conf/defaults.ini
. I then reinstalled the plugin using “sudo grafana-cli plugins install alexanderzobnin-zabbix-app
” . I checked the log after restarting and now the Grafana log shows,
"Connecting to DB" logger=sqlstore dbtype=mysql"
"Running an unsigned backend plugin" logger=plugins pluginID=alexanderzobnin-zabbix-datasource pluginDir=/var/lib/grafana/plugins/alexanderzobnin-zabbix-app/datasource-zabbix"
So Grafana looks like it is ignoring the config file “/etc/grafana/grafana.ini
” and only using “/usr/share/grafana/conf/defaults.ini
” The permissions on “/etc/grafana/grafana.ini
” are 640 and 644 on “/usr/share/grafana/conf/defaults.ini
” . So maybe that is the issue.
So add any changes you made to “/etc/grafana/grafana.ini
” and put them in “/usr/share/grafana/conf/defaults.ini
”
------------------------------------------Update----------------------------------------------------------------------
So I compared “/etc/grafana/grafana.ini
” and “/usr/share/grafana/conf/defaults.ini
” . I’m new to Grafana and did not notice how the config files are commented. I assumed #
was the only way to comment yet ;
is also used. I also assumed since ;
was used on every option in “/etc/grafana/grafana.ini
” that it was the way Grafana declared options. So what is happening is that no options are commented out in “/usr/share/grafana/conf/defaults.ini
” but all options are commented out in “/etc/grafana/grafana.ini
”.
From "`/etc/grafana/grafana.ini`".
##################### Grafana Configuration Example #####################
#
# Everything has defaults so you only need to uncomment things you want to
# change
# possible values : production, development
;app_mode = production
# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
;instance_name = ${HOSTNAME}
#################################### Paths ####################################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
;data = /var/lib/grafana
From "`/usr/share/grafana/conf/defaults.ini`"
##################### Grafana Configuration Defaults #####################
#
# Do not modify this file in grafana installs
#
# possible values : production, development
app_mode = production
# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
instance_name = ${HOSTNAME}
#################################### Paths ###############################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
data = data
So make sure you remove the ;
before each option in “/etc/grafana/grafana.ini
” that you want to enable.
@jwuorenmaa, thank you so much!!!
I was getting crazy because all I have done (even including the plugin in unsigned option) haven’t worked …
this tip saved me a ton of hours…
Hey! But what option did you have to enable to make it work?
In /etc/grafana/grafana.ini (around line 696) add the plugin name “alexanderzobnin-zabbix-datasource” to the allow_loading_unsigned_plugins variable and restart Grafana:
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
allow_loading_unsigned_plugins = alexanderzobnin-zabbix-datasource
hi i have similar issue plugin added but unable to add zabbix datasource its not visible
i had added above lines but still not showing, can u please help
regards
Ajit
when i create datasource, and then test and save it, i have allert thats the data source was updated and the others allert thats " request failed, status: 404 Not Found"
can u help me about this, coz when i go to the dashboard i cant see all data from my zabbix server
Hello, You may want to look here: https://community.grafana.com/t/trouble-connecting-grafana-with-zabbix/36518