Reporting Tool - URL reports not working

reporting

(tom) #1

Hi there,

we are using Thruk with Naemon backend and we are very happy with it. Our OS is Ubuntu server 16.04.4 LTS.
We tried to schedule a report based on a URL (http://monitoring/thruk/cgi-bin/panorama.cgi?map=Network) by the Reporting Plugin. Unfortunately this will not work.

The error code on the page is this:

move /var/lib/thruk/reports/7.dat.pdf to /var/lib/thruk/reports/7.dat failed: No such file or directory at /etc/thruk/plugins//plugins-enabled/reports2/lib/Thruk/Utils/Reports/Render.pm line 295.
on reports/report_from_url.tt at /usr/share/thruk/lib/Thruk/Views/ToolkitRenderer.pm line 76.

Our Thruk version is 2.20 and the naemon version is 1.0.6.

dpkg -l | grep naemon
ii  libnaemon                           1.0.6                                      amd64        Library for Naemon - common data files
ii  naemon                              1.0.6                                      amd64        A host/service/network monitoring and management system
ii  naemon-core                         1.0.6                                      amd64        contains the Naemon core
ii  naemon-livestatus                   1.0.6                                      amd64        contains the Naemon livestatus eventbroker module
ii  naemon-thruk                        1.0.6                                      amd64        Thruk is a web gui for Naemon
ii  naemon-tools                        1.0.6                                      amd64        contains tools for the Naemon core

dpkg -l | grep thruk
ii  libthruk                            2.20                                       amd64        Thruk perl libraries
ii  naemon-thruk                        1.0.6                                      amd64        Thruk is a web gui for Naemon
ii  thruk                               2.20-2                                     amd64        Monitoring Webinterface for Nagios/Naemon/Icinga and Shinken
ii  thruk-base                          2.20-2                                     amd64        Monitoring Webinterface for Nagios/Icinga and Shinken
ii  thruk-plugin-reporting              2.20-2                                     amd64        This package contains the reporting addon for thruk useful for sla

Could it be that the problem is located on our proxy settings? The monitoring server is not directly connected to the internet and we have configured a proxy configuration for apt / wget. I tried to set the environment variables HTTP_PROXY etc. but no change.

I also checked the log files but couldn’t find the problem.

Does anybody had the same trouble and where able to solve it?

Any hints are welcome. :wink:


(Sven Nierlein) #2

i never tried to put dashboards into reports. But there is a panorama2img script in the support/ folder which can export dashboards into images. Maybe that helps.


(tom) #3

Thanks for your response.
But in general, if I like to use the URL functionality of the reporting plugin, do I have to configure at any place a proxy server?
I think it makes no difference if I use a URL from www or a URL from a dashboard. What do you think?

[edit]
I tried your suggestion (panorama2img). First time I run it, the script told me that there is no phantomjs installed on the server. So I changed the path to “/usr/lib/x86_64-linux-gnu/thruk/phantomjs”.

The second time I run it with these parameters:
./panorama2img 1024x768 thrukadmin 1 /tmp/test.png

On the command line I receive a lot of these messages, but it generates at the end a png file.
site:
cookie: 1532422753071294848
input: http://localhost/thruk/cgi-bin/panorama.cgi?map=1
ReferenceError: Can’t find variable: TP
undefined:2
:3
ReferenceError: Can’t find variable: TP

Unfortunately the content of the png told me that “session has expired”. :frowning:

Do you have any idea to fix this? How can I create a valid session to export the the panorama?


(Sven Nierlein) #4

Have a look at that script, it was a proof of concept and uses hard coded paths valid for OMD. If you have a standalone Thruk installation, you have to adjust the session path in that script. It will then create a session file for you.


(tom) #5

Perfect Sven,

thanks for your tipp.
After I found out where the session files are located in my setup, I modified your script and it is working fine.

Thank you so much!