No graph but link works

While looking for icinga2 grafana api examples, I found an reference to grafana.ini and “allow_embedding = true” . That seemed to do the trick but now you made me curious and I want to find out how to get this api access working :wink:

For now I created a API key in grafana and changed the configuration in icinga2 to indirect proxy and set the api key in there. Still investigating, but for now I get an internal server error 500 in icinga2.

Any good examples/references will help.


(Disabled anonymous access in grafana.ini and restarted service)

The api works testing with curl:

Icinga2 config:

Debug output:

Putting the debug data in the browser directly gives me the same image as in icinga2, no idea if this is BS or not, but maybe it helps

Now the output when copy pasting the icinga2 url using Curl with the API authorization:

It’s showing that I’m missing something but I’m lost…hope you have another hint.

Tried another thing that was used here and it’s called Modify Header info chrome extention. Filling in the api key like describes shows me that I can see the graphs in grafana using the api key… So in my eye’s there must be something wrong with Icinga not using the authentication header api key to retreive the graph ?!

What OS are you using and how did you install Grafana? Maybe a look into the syslog will give more details.
I think the API is not the problem, more that the renderer of Grafana is missing something.

Some steps I’ve taken to install it on RPI:

#install grafana ( )
sudo dpkg -i grafana-rpi_6.3.5_armhf.deb

#Grafana module for icinga
cd /usr/share/icingaweb2/modules
git clone grafana

I think there are the fonts missing, can you check the syslog for any messages from grafana while view a host/service object and also watch syslog during startup of grafana. The message you posted shows that grafana has problems to load something during renderer run.

Just found that you should run

sudo apt-get upgrade
sudo apt --fix-broken install

after instaling Grafana package.

updated and restarted grafana-server. Unfortunately it didnt seem to solve the problem.

then check the syslog about messages.

Found this article, Grafana on Pi doesnt contain the phantom.js renderer anymore :frowning: You have to use Chrome Headless now.

Also turned on and referred log to /var/log/grafana/grafana.log

filters = rendering:debug

It indeed shows an error in the log:

It talking about phantomJS missing ?

Reading “Also I note that the plugin has been updated recently so the instructions may not be accurate.” )-:

You can also install phantomjs yourself

But you have to copy it to the right location i think.

yarn install --pure-lockfile

PhantomJS seems not to solve the problem if this guy is right. (14 days ago)

This is also a possibility:

Using grafana-cli

NOTE: Installing this plugin using grafana-cli is supported from Grafana v6.4.

grafana-cli plugins install grafana-image-renderer

But I have:

Grafana cli version 6.3.5

Is it possible to upgrade to 6.4 on RPI ? Suggestion how ?

Tried multiple bin files but all give the same errors:

root@icinga:/home/pi# ./phantomjs --version
./phantomjs: error while loading shared libraries: cannot open shared object file: No such file or directory

LOL, did you pull a string? :slight_smile:

Update post:


Update - Sept 2019 - I am currently building a new RPI4 unit and found that the compile will fail. This seems to be due to the Google Remote Procedure Call (grpc) not working on Buster/RPI4. Will update when this changes.

Reaction from a thread github thread
Tried the suggestion but doesnt work. Think it for now not possible to render on rpi and thus use a API key to get graphs in Icinga.

Seems like pre-built binaries for grpc v1.11.3 on arm are not available, only arm64. Not sure that there are prebuilt grpc node binaries at all for arm. I don’t currently have an arm device so hard for me to help out.

Seems like the only way is to build it from source and looking at your error seems like it tries to compile it but fails. Maybe your lacking some dependency like node-gyp and/or C++ build tools?

I would start with trying to install node-gyp:

npm install -g node-gyp

Then grpc:

npm install grpc@1.11.3 --build-from-source

Maybe you can use the alternate route with Graphite, and integrate that into Icinga Web.

I’ve managed to get it working using the Anonymous route and using iFrame in icinga2. Will be using that and play some more with Grafana :wink: Thanks for your help!

logs = /var/log/grafana
allow_embedding = true

#enable anonymous access
enabled = true

Using api token / indirect proxy and apt-get install chromium seems to solve the Error: Cannot fetch Grafana graph: Internal Server Error 500: