kozfelipe / centreon-weathermap

network weathermap module for centreon
5 stars 1 forks source link

Problem with the Weathermap #4

Closed Dobhars closed 1 week ago

Dobhars commented 3 weeks ago

Hello i discovered your weathermap recently and i decided to install it to try, when i go to "Configuration -> Weathermap -> Maps" i don't have anything to create a map like you can see on the picture. If you have any idea of what it could be, it would be cool. Thanks

image

kozfelipe commented 3 weeks ago

hello @Dobhars thanks for trying it out I can see by the centreon's logo at your screenshot you are using a centreon's version above 22.10.x which might be the cause modules/centreon-weathermap/maps.php is not rendering properly.

It was designed for 22.04.x / 22.10.x but I intend to adapt it to current version as soon as I manage to upgrade my environment.

image

Dobhars commented 3 weeks ago

Hello @kozfelipe, What’s strange is that on another of my servers centreon version 23.10.6, the map works perfectly, I do not understand why if it works on this one I can’t get it to work on my other centreon even if the module was made for earlier versions.

image

image

kozfelipe commented 3 weeks ago

Hello @kozfelipe, What’s strange is that on another of my servers centreon version 23.10.6, the map works perfectly, I do not understand why if it works on this one I can’t get it to work on my other centreon even if the module was made for earlier versions.

Are they both 23.10?

Is this page reporting javascript errors at your browser's console? Also, make sure these pages are checked into Accessible Pages under ACL Menu Access

Dobhars commented 3 weeks ago

It had the same version, i cloned the VM but since the map did not work I updated my second centreon to 24.04.6 but I think that was not necessarily a good idea and I did not backup the server before updating it so I can’t go back to an earlier version.

Do you have an idea of a release date for your module for versions 23+ or 24+?

kozfelipe commented 3 weeks ago

My OS only supports up to 22.10.7 I am requesting my IT team to deploy a 24.04 VMWare image into dev environment to test this.

In the meanwhile you could check this:

Is this page reporting javascript errors at your browser's console? Also, make sure these pages are checked into Accessible Pages under ACL Menu Access

Dobhars commented 3 weeks ago

Here is a screenshot with the console, i have same errors on my centreon where the map is working so i don't think that is the problem. And the pages are checked accessible in the ACL Menu Access.

image

kozfelipe commented 3 weeks ago

those stylesheet errors are not really relevant. If there are no errors on the frontend, we should check for backend errors. could you check logs from php usually stored at: /var/log/apache2/error.log

Dobhars commented 3 weeks ago

I’m at school this week so I won’t have access to my company's centreon, I’ll send you that as soon as possible =) Thank you again for taking the time to answer me.

kozfelipe commented 2 weeks ago

So I have installed 24.04.6 and noticed 'php' tag is no longer supported in Smarty Compiler according to https://github.com/smarty-php/smarty/discussions/734 causing this error:

PHP Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/usr/share/centreon/www/modules/centreon-weathermap/listMaps.ihtml" on line 31 "{php}" unknown tag 'php' <-- \n thrown in /usr/share/centreon/www/modules/centreon-weathermap/listMaps.ihtml on line 31'

image

So apparently replacing

{php}
     include('./include/common/pagination.php');
{/php}

for {pagination} on template files fix this issue

image

please apply these patches:

https://github.com/kozfelipe/centreon-weathermap/pull/5/commits/a9e120acd908e61c6e208b87794e8320293fa53e https://github.com/kozfelipe/centreon-weathermap/pull/5/commits/a111afb0ef43f998c15495e5c849f134bc371141

or download the new branch files

Dobhars commented 1 week ago

I downloaded the new branch files but still have the problem, so i checked the log and in the listMaps.ihtml you made a typo on line 73 you writed "ppagination", so I corrected it and it works.

Thank you again for taking the time to answer me and help me !

kozfelipe commented 1 week ago

I am glad it worked