Weathermap - Cacti 1.x compatible release available for testing

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

tfrench01
Posts: 22
Joined: Fri Dec 06, 2024 4:31 pm

Re: Weathermap - Cacti 1.x compatible release available for testing - RESOLVED

Post by tfrench01 »

Getting so close, When I tried to "Install the Plugin" I got this message. See attachement.

Not sure how to proceed. need some help. The error says to rename the config.php.dist file, what do I name it?
This is what the config.php.dist file shows, not sure where to put the required info for a Windows distro.
/**
* These two settings need to be defined per your Cacti install. In legacy
* versions of weathermap, these two files were located in the plugin
* directory. However, in Cacti 1.3, the archive function will interfere
* in that locations setting. So, pick a location that is owned by
* the apache user, but is not in the Cacti base path. Ensure that
* the path's end with a '/'.
*/
$configdir = '/usr/share/cacti/site/weathermap/configs/';
$outputdir = '/usr/share/cacti/site/weathermap/output/';

/* we will define them here */
if (!defined('WM_CONFIGDIR')) {
define('WM_CONFIGDIR', $configdir);
}

if (!defined('WM_OUTPUTDIR')) {
define('WM_OUTPUTDIR', $outputdir);
}
Attachments
action failed.PNG
action failed.PNG (26.81 KiB) Viewed 395 times
Last edited by tfrench01 on Tue Jan 07, 2025 7:27 am, edited 1 time in total.
Rno
Cacti Pro User
Posts: 709
Joined: Wed Dec 07, 2011 9:19 am

Re: Weathermap - Cacti 1.x compatible release available for testing

Post by Rno »

the name should be config.php

And if you confdir and outputdir are not the same, you have to change it to where it's pointing.
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
tfrench01
Posts: 22
Joined: Fri Dec 06, 2024 4:31 pm

Re: Weathermap - Cacti 1.x compatible release available for testing

Post by tfrench01 »

Rno,

Perfect, now that I changed the name it shows up, and lets me create a map.
Of course I still have an issue, if you have time.
I went to create the map, and clicked add map to weathermap.
When I select to change the title, I get the following error - see attached. Page not working

Thanks
Attachments
page not working.PNG
page not working.PNG (15.57 KiB) Viewed 374 times
no title.PNG
no title.PNG (23.09 KiB) Viewed 374 times
Rno
Cacti Pro User
Posts: 709
Joined: Wed Dec 07, 2011 9:19 am

Re: Weathermap - Cacti 1.x compatible release available for testing

Post by Rno »

Whats is the error on cacti.log ?
Are you sure about the right on the directory, to create a file ?
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
tfrench01
Posts: 22
Joined: Fri Dec 06, 2024 4:31 pm

Re: Weathermap - Cacti 1.x compatible release available for testing - RESOLVED

Post by tfrench01 »

I thank you for the help.
I am a novice user of this setup. It appears, I need to change the folder permissions for the lib directory.
Finally the Cacti has shown the sample map.
Do you agree?
Attachments
lib folder.PNG
lib folder.PNG (14.72 KiB) Viewed 370 times
sample map.PNG
sample map.PNG (611.44 KiB) Viewed 370 times
page not working.PNG
page not working.PNG (15.57 KiB) Viewed 370 times
log weathermap issue.PNG
log weathermap issue.PNG (202.83 KiB) Viewed 370 times
Last edited by tfrench01 on Tue Jan 07, 2025 7:28 am, edited 1 time in total.
Rno
Cacti Pro User
Posts: 709
Joined: Wed Dec 07, 2011 9:19 am

Re: Weathermap - Cacti 1.x compatible release available for testing

Post by Rno »

I'm not a windows expert
So I'm not sure about your path
For sure the process that run the web server, need to have read/write access.
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
tfrench01
Posts: 22
Joined: Fri Dec 06, 2024 4:31 pm

Re: Weathermap - Cacti 1.x compatible release available for testing - RESOLVED

Post by tfrench01 »

Still having issues editing on any of the maps.

I cannot find the editor.php file that directions say I need to enable the editor, see below;
Since version 0.97, you now also need to enable the editor. The reason is so that you can't have the editor enabled without knowing about it. The editor allows access to your config files without authentication, so you should consider using features in your webserver to limit who can access editor.php. For example, on an Apache server, something like:

<Directory /var/www/html/weathermap>
<Files editor.php>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</FilesMatch>
</Directory>

When you are happy that the world can't edit your maps, then enable the editor. This is done by editing the top of editor.php and changing $ENABLED=false; to $ENABLED=true;
Attachments
pre-install.PNG
pre-install.PNG (57.93 KiB) Viewed 357 times
Last edited by tfrench01 on Tue Jan 07, 2025 7:28 am, edited 1 time in total.
tfrench01
Posts: 22
Joined: Fri Dec 06, 2024 4:31 pm

Re: Weathermap - Cacti 1.x compatible release available for testing - RESOLVED

Post by tfrench01 »

I guess, I am almost finished, reloaded cacti, and weathermap.
now the issues are smaller, but confusion.
This is the code in the config.php see below
---------------- snippet -----------
/**
* These two settings need to be defined per your Cacti install. In legacy
* versions of weathermap, these two files were located in the plugin
* directory. However, in Cacti 1.3, the archive function will interfere
* in that locations setting. So, pick a location that is owned by
* the apache user, but is not in the Cacti base path. Ensure that
* the path's end with a '/'.
*/
$configdir = '/usr/share/cacti/site/weathermap/configs/';
$outputdir = '/usr/share/cacti/site/weathermap/output/';

/* we will define them here */
if (!defined('WM_CONFIGDIR')) {
define('WM_CONFIGDIR', $configdir);
}

if (!defined('WM_OUTPUTDIR')) {
define('WM_OUTPUTDIR', $outputdir);
}
-------------------- end of snippet ----------------
The directories, is what bothers me, as I am not a programmer.
I created the directories on the windows desktop running cacti.
see the pictures. Was that correct? Nothing seems to be stored there.

It is funny, that when I tried to install weathermap, it fails with the config.php alert.
I still can see the weathermap image.

This is a small amount from the logs;
Log Filters
All 496 Entries
Log [Total Lines: 496 - Admin view - Unfiltered]
2024-12-31 11:05:14 - SYSTEM MAINT STATS: Time:0.01
2024-12-31 11:05:14 - SYSTEM STATS: WEATHERMAP Time:0.14 Maps:1 Warnings:1 Notes:None
2024-12-31 11:05:14 - WEATHERMAP WARNING: [Map 1] simple.conf: Your background image file could not be read. Check the filename, and permissions, for images/background1_950x625_197.jpg
2024-12-31 11:05:13 - SYSTEM STATS: Time:12.8317 Method:cmd.php Processes:1 Threads:1 Hosts:13 HostsPerProcess:13 DataSources:2273 RRDsProcessed:1148
2024-12-31 11:00:15 - SYSTEM MAINT STATS: Time:0.01
2024-12-31 11:00:14 - SYSTEM STATS: WEATHERMAP Time:0.14 Maps:1 Warnings:1 Notes:None
2024-12-31 11:00:14 - WEATHERMAP WARNING: [Map 1] simple.conf: Your background image file could not be read. Check the filename, and permissions, for images/background1_950x625_197.jpg
2024-12-31 11:00:14 - SYSTEM STATS: Time:13.4943 Method:cmd.php Processes:1 Threads:1 Hosts:13 HostsPerProcess:13 DataSources:2273 RRDsProcessed:1148
2024-12-31 10:55:14 - SYSTEM MAINT STATS: Time:0.01
2024-12-31 10:55:14 - SYSTEM STATS: WEATHERMAP Time:0.21 Maps:1 Warnings:1 Notes:None
2024-12-31 10:55:13 - WEATHERMAP WARNING: [Map 1] simple.conf: Your background image file could not be read. Check the filename, and permissions, for images/background1_950x625_197.jpg
2024-12-31 10:55:13 - SYSTEM STATS: Time:12.6262 Method:cmd.php Processes:1 Threads:1 Hosts:13 HostsPerProcess:13 DataSources:2273 RRDsProcessed:1148
2024-12-31 10:53:15 - CMDPHP PHP ERROR WARNING Backtrace: (C:\Apache24\htdocs\cacti\plugins\Weathermap\weathermap-cacti-plugin-editor.php[147]:drawMap(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\editor.actions.php[129]:WeatherMap->DrawMap(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\WeatherMap.class.php[3512]:file_get_contents(), CactiErrorHandler())
2024-12-31 10:53:15 - ERROR PHP WARNING: file_get_contents(configs/simple.conf): Failed to open stream: No such file or directory in file: C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\WeatherMap.class.php on line: 3512
2024-12-31 10:53:15 - CMDPHP PHP ERROR WARNING Backtrace: (C:\Apache24\htdocs\cacti\plugins\Weathermap\weathermap-cacti-plugin-editor.php[147]:drawMap(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\editor.actions.php[110]:WeatherMap->__construct(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\WeatherMap.class.php[372]:WeatherMap->Reset(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\WeatherMap.class.php[531]:WeatherMap->LoadPlugins(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\WeatherMap.class.php[826]:opendir(), CactiErrorHandler())

When I try to open the sample image I get this error, thing is the rights seem correct.

Log Filters
All 248 Entries
Log [Total Lines: 248 - Admin view - Filter active]
2024-12-31 11:15:14 - WEATHERMAP WARNING: [Map 1] simple.conf: Your background image file could not be read. Check the filename, and permissions, for images/background1_950x625_197.jpg
2024-12-31 11:14:25 - CMDPHP PHP ERROR WARNING Backtrace: (C:\Apache24\htdocs\cacti\plugins\Weathermap\weathermap-cacti-plugin-editor.php[147]:drawMap(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\editor.actions.php[129]:WeatherMap->DrawMap(), C:\Apache24\htdocs\cacti\plugins\Weathermap\lib\WeatherMap.class.php[3512]:file_get_contents(), CactiErrorHandler())

Thanks for looking.
Attachments
directory structure.PNG
directory structure.PNG (17.38 KiB) Viewed 209 times
simple map.PNG
simple map.PNG (43.9 KiB) Viewed 209 times
action failed.PNG
action failed.PNG (98.1 KiB) Viewed 209 times
Last edited by tfrench01 on Tue Jan 07, 2025 7:28 am, edited 1 time in total.
Rno
Cacti Pro User
Posts: 709
Joined: Wed Dec 07, 2011 9:19 am

Re: Weathermap - Cacti 1.x compatible release available for testing

Post by Rno »

Hmm ok so you raised a bug inside the WeatherMap.class.php
On line 816 the value of $DIR is wrong it should be $dir = 'datasources'
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Rno
Cacti Pro User
Posts: 709
Joined: Wed Dec 07, 2011 9:19 am

Re: Weathermap - Cacti 1.x compatible release available for testing

Post by Rno »

So version 1.3.1 is buggy, a lot.
I'mnot sure the 1.3 is good.

So go for the 1.1, instead of branch Develop, you choose tags 1.1

But it's look like in 1.3.1 is mostly the editor who is not working. I didn't have any trouble (so far) with the core of weathermap, but my map are made by hand, not via the editor.
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
tfrench01
Posts: 22
Joined: Fri Dec 06, 2024 4:31 pm

Re: Weathermap - Cacti 1.x compatible release available for testing

Post by tfrench01 »

Thanks will give it a try
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests