InfluxDB+Grafana persistence and graphing

Tags: #<Tag:0x00007f74566de490> #<Tag:0x00007f74566de300> #<Tag:0x00007f74566de1e8>

Did you solve this ?? I just upgrade grafana to latest (5.4.x) from 5.1.4. And now I´m facing the same… Need phantomjs. And it´s not included with Grafana, plus very limited info on how to use it.

I found the solution… Actually it´s the link provided from Udo above… And a few messages above that from BobRak :slight_smile:

Anyway - this is it:

But… openhabian does not have permission to that folder… So you´ll need to enter a terminal and use Sudo to copy the file into there. Like this:

 sudo cp /home/openhabian/phantomjs /usr/share/grafana/tools/phantomjs/

After that, you´ll need to set the execute permission to the phantomjs file:

sudo chmod 755 /usr/share/grafana/tools/phantomjs/*

And you´re good to go!

Thanks for the info, if you could just help me one more little bit. I dont know how i can get the file into /home/openhabian. Do you download it from the above link via commandline? If so how do you do that? (Im a complete linux noob :frowning_face: sorry) or do you do this via the openhab share? If so, Wich directory do you put it in? Cant find /home/openhabian here.
Sorry for my stupid question, i have a lot of learning to do when it comes to linux and ssh commands.
Thanks

Edit:
Is this right?

wget -P /home/openhabian/“https://github.com/fg2it/phantomjs-on-raspberry/blob/master/rpi-2-3/wheezy-jessie/v2.1.1/phantomjs
?

Thanks

Edit:
I must have done something wrong. I used the wget command above to download the file, then copied it with first command you gave and then set the permissions as per your second command. When i go look in /usr/grafana/tools/ i can see the file phantomjs, so i think i did it. But i still cant visualise the chart in basic ui. When i click on ‘direct link rendered image’ i no longer get the error that phantomjs is missing but just an error ‘rendering failed’. Do you have any idea how i can get to the grafana server log? I think i managed to install phantomjs correctly because the error message changed. Might be an other problem.

cd ~
wget https://github.com/fg2it/phantomjs-on-raspberry/raw/master/rpi-2-3/wheezy-jessie/v2.1.1/phantomjs
chmod 755 phantomjs
sudo chown root: phantomjs
sudo mv phantomjs /usr/share/grafana/tools/phantomjs/

However, as I didn’t upgrade grafa yet, I don’t know if the path exists per default, so maybe you have to create the folder first:

sudo mkdir -p /usr/share/grafana/tools/phantomjs
1 Like

Thanks for your help on the linux commands, but still no victory. when i use the “direct link rendered image” buttun in the share tab of my grafana chart i still get the message “Rendering failed.”.

When i look in the grafana server log I get these entries:

t=2018-12-30T11:03:56+0100 lvl=info msg=Rendering logger=rendering path="d-solo/s4ZZzUZRk/eetkamer-temperatuur?orgId=1&from=1546142584388&to=1546164184388&panelId=2&width=1000&height=500&tz=Europe%2FBrussels"
t=2018-12-30T11:03:56+0100 lvl=eror msg="Phantomjs exited with non zero exit code" logger=rendering error="fork/exec /usr/share/grafana/tools/phantomjs/phantomjs: exec format error"
t=2018-12-30T11:03:56+0100 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="fork/exec /usr/share/grafana/tools/phantomjs/phantomjs: exec format error"
t=2018-12-30T11:03:56+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/s4ZZzUZRk/eetkamer-temperatuur status=500 remote_addr=192.168.1.17 time_ms=13 size=1703 referer="http$

But thanks alot for your help on the linux commands, now I am shure phantomjs is insalled correctly. Now i’m going to take a look at the grafana docs to see how i can expand the logging for grafana and phantomjs. Maybe this way i will get some wiser. :wink:

Edit:
Tried setting the logs to debug in grafana.ini, but still the same 4 lines in the logs. No extra info :unamused:

Grafana is highly difficult, in my opinion, (I´m a Linux noob as well). I dont get the same errros you do, but I do seem to have problems rendering as well, if I render more than one chart at a time, the whole system lock up, (did the same with Grafana 5.1.4 after openhab has been upgraded from 2.3 to 2.4, thats why I thought updating Grafana to latest version would fix it… It didn´t).
So I can render one chart at at time… If I try to render more, my system locks up, crash and reboot. And Grafana log file is no good in this situation.

Something odd surely goes on, but I cant say for sure it´s because of Grafana. Since I updated openhab from 2.3 to 2.4, Grafana acting strange, and my system tend to crash and reboot a few minutes after I have rendered a few charts (one at a time).
I did make other changes as well, than just upgrade openhab. I also change from modbus1 to modbus 2 binding. But this was after openhab 2.3 has been running for a week or something like that, while Grafana was still acting strange.
I also get tons of binding errors and warnings when starting openhab, which never happened with openhab 2.3

Right now I´m close to give up on my system and start all over. I simply cant find the reason other than something seems very wrong on my system. I have a feeling its something with the openhab upgrade, in combination with grafana, maybe some permission problems somewhere.
But since I´m a total noob at Linux too, I have no knowledge of to how to correct or fix things like that.

PS. While writing this, I entered a sitemap on my system with two charts… System crashed and rebooted, again!
This is what Grafana log shows:

t=2018-12-30T17:51:53+0100 lvl=info msg=Rendering logger=rendering path="d-solo/pq1-vpgRz/casper-temperatur?orgId=1&panelId=2&from=now-12h&to=now&refresh=15s&width=1000&height=500"
t=2018-12-30T17:52:14+0100 lvl=info msg=Rendering logger=rendering path="d-solo/znwsvpRRz/lille-bad?refresh=30s&orgId=1&panelId=2&from=now-12h&to=now&width=1000&height=500"
t=2018-12-30T17:52:14+0100 lvl=info msg=Rendering logger=rendering path="d-solo/znwsvpRRz/lille-bad?refresh=30s&orgId=1&panelId=4&from=now-12h&to=now&width=1000&height=500"
t=2018-12-30T17:52:23+0100 lvl=eror msg="Phantomjs exited with non zero exit code" logger=rendering error="signal: killed"
t=2018-12-30T17:52:23+0100 lvl=eror msg="Phantomjs exited with non zero exit code" logger=rendering error="signal: killed"
t=2018-12-30T17:52:23+0100 lvl=eror msg="Rendering failed." logger=context userId=0 orgId=1 uname= error="signal: killed"
t=2018-12-30T17:52:23+0100 lvl=eror msg="Rendering failed." logger=context userId=0 orgId=1 uname= error="signal: killed"
t=2018-12-30T17:52:23+0100 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/render/d-solo/znwsvpRRz/lille-bad status=500 remote_addr=10.4.28.30 time_ms=9597 size=1722 referer="http://10.4.28.237:8080/basicui/app?sitemap=lillebad"
t=2018-12-30T17:52:23+0100 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/render/d-solo/znwsvpRRz/lille-bad status=500 remote_addr=10.4.28.30 time_ms=9656 size=1722 referer="http://10.4.28.237:8080/basicui/app?sitemap=lillebad"

First line is one sitemap with one chart.
Second line is a sitemap with two charts…
BAM! openhab restarted (notice my Rpi didn´t reboot, openhab just restart).

This is just great! :rage:

Maybe someone else on the forum can shine some light on our problems?

I wish.
But I still believe your problems is more concetrated to Grafana, where my problems are everywhere, and probably Linux related. Maybe some files are missing or perhaps damaged, even though I use SSD.

This worked perfectly for me. Thx!

I didn’t have to create the /usr/share/grafana/tools/phantomjs folder, it already existed.

Hello,

first of all, thanks a lot for this great tutorial!
Despite the good instructions I sadly got stuck and would be grateful for a hint.

I am running an Openhabian (OpenHAB 2.4) installation on a Raspberry Pi 2.
I followed the steps in post 1 respectively post 84 for the installation and setup of InfluxDB as well as the installation of Grafana (all on that pi). All without any errors.

However when trying to progress and setup Grafana I can’t reach http://monitoring-host:3000.

I double and triple checked all previous steps but couldn’t find anything. Any Ideas what could be wrong? Is there a way to find out whether Grafana was installed correctly? What would you recommend to do for debugging?

try with the IP of your Rpi insted… Like this:
http://IP_RPI:3000

Or go to the ip of your pi, there should be an option grafana. Http://:8080

It will only be there if he installed influx and grafana through the openhabian-config.
If he follow the #1 post, it will not be there.

Oops sorry, thats how i did it :grinning:

Thanks a lot! Afterwards it is always so clear :see_no_evil:.
Good to know that installing through openhabian-config is also an option. I guess this could have been even a little easier for a beginner like me. Maybe this option could be included in the tutorial of post 1.
Out of curiosity, does the installation via openhabian-config also assist in configuration or are the steps for configuration the same?

Installing through openhabian-config does everything for you, except the persits file. That part you´ll have to do yourself, ofcouse…
Oh, and the binding ofcouse (through PaperUI). Dont forget the binding, like I just did :slight_smile:

Same here:


t=2019-01-06T17:06:29+0100 lvl=eror msg="Phantomjs exited with non zero exit code" logger=rendering error="signal: killed"
t=2019-01-06T17:06:29+0100 lvl=eror msg="Phantomjs exited with non zero exit code" logger=rendering error="signal: killed"
t=2019-01-06T17:06:29+0100 lvl=eror msg="Rendering failed." logger=context userId=0 orgId=1 uname= error="signal: killed"
t=2019-01-06T17:06:29+0100 lvl=eror msg="Rendering failed." logger=context userId=0 orgId=1 uname= error="signal: killed"

… and openhab just restarts :frowning: . But my installation is fresh from the scratch. So i’ve no clue how to fix it.

Best,
Olli

Neither have I :frowning:

I have struggled with it for some time now on my main setup using an Rpi 3B and openhab 2.4.

At first I refused to accept is was due to the limited Rpi. So I installed a brand new openhab 2.4 on a Rpi3B+ with a very limited setup, (IHC binding, 5 channels and items, and the system binding to monitor whats happens), and then added Influxdb and Grafana from the openhabian-config…

On this test setup Grafana can render 5 charts at the same time. 6 charts will crash openhab and restart.

System monitor shows when Grafana is rendering the charts it takes up nearly 100% cpu and aprox 90-100% of the memory available.

This tells me, Rpi is no longer suitable to a system with many Grafana charts at the same time, at least not when using openhab 2.4 (and openhab 2.5, which I tested as well, though the difference is close to zero as the 2.5 is almost a copy of the released 2.4).

On my main system I can render 2 charts at the same time. 3 will make openhab crash and restart.
On the old openhab 2.3 (before I updated), I could render 4 charts without any problems. Openhab never crashed. I have tested Grafana 5.1.4 - 5.3.4 and 5.4.2 all doing the same.

Something changed in openhab 2.4. And since it simply crash I would say there is a fatal problem somewhere either in openhab 2.4 og a combination of openhab 2.4, Grafana and the limited Rpi 3B. No matter how limited a computer might be, it should never crash like that.

I get the a similar log error message.
However OpenHAB does not crash.
Did all the above steps, downloaded Phantomjs and CHMOD the directory.

I’m stuck now :confused:

t=2019-01-17T19:56:36+0100 lvl=eror msg=“Phantomjs exited with non zero exit code” logger=rendering error=“fork/exec /usr/share/grafana/tools/phantomjs/phantomjs: exec format error”
t=2019-01-17T19:56:36+0100 lvl=eror msg=“Rendering failed.” logger=context userId=1 orgId=1 uname=admin error=“fork/exec /usr/share/grafana/tools/phantomjs/phantomjs: exec format error”

The problem is far more serious that expected. It´s caused by Grafana (PhantomJS) which simply takes a huge amount of computer resources. PhantomJS throws an Java error, and Java process is beeing killed, which result in openhab restarts.
Since this is probably due to using PhantomJS, there isn´t much to do. PhantomJS isn´t supported anymore, and infact Grafana does really recommend it, (however I just noticed last night, that the windows version of Grafana comes with PhantomJS).

I changed to use webview insted. But if you plan to use webview in sitemaps and use remote/cloud connection, you´ll not be able to see the charts for some reason I can´t seem to find.

I gave up trying to use Grafana on my Rpi. Last night I installed the windows version on my Windows server. Then I can use rendering again.

It is very sad with these problems, and I believe it would be wise no longer to recommend rendering Grafana charts if using an Rpi. Webview is fine to recommend, but not without a notice about problems using webview for local URL´s, cause it simple doesn´t work.