WMWARN08 for every TARGET I try [solved]

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
charchess
Posts: 5
Joined: Mon Mar 27, 2017 6:54 pm

WMWARN08 for every TARGET I try [solved]

Post by charchess »

hello,
I always hate to ask help cause I feel like I failed ...but on that one I don't know anymore where to search so ...here I am

I'm kinda a linux and network hobbyist and know a bit of cacti (already did set up some cacti/weather map 2 or 3 times and they were working fine)

Right now, I'm trying to play with a docker version of it QuantumObject/docker-cacti and to add some weathermap in it.

After some work it's kinda working, got a nice weathermap with overlib graph ...everything is working BUT the arrow (link) coloring based on network usage...

After some hours of trying everything with rrd, I ended up trying a plain static thing ... nothing better, still got the following message in logs :

Code: Select all

03/27/2017 11:55:52 PM - WEATHERMAP: Poller[0] WARNING: [Map 2] simple.conf: ProcessTargets: LINK node1-node2, target: static:10M:20M on config line 67 of /usr/share/cacti/site/plugins/weathermap/configs/simple.conf was not recognised as a valid TARGET [WMWARN08]
Soooo ... either I'm missing something really simple (that's what I hope for) or the docker version got something missing and I can't spot what.

So if anyone feel like helping me ... I'd be really happy.

Thanks in advance

Charchess

Edit : cacti version is : Version 0.8.8f (docker version, can't change it easily)
Weathermap version : PHP Weathermap version 0.98
Last edited by charchess on Wed Mar 29, 2017 11:43 am, edited 1 time in total.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: WMWARN08 for every tARGET I try

Post by Howie »

OK, so try with DEBUG logging turned on, and look in cacti.log after 5 minutes.

Near the beginning you should see a series of lines talking about loading the data source plugins. Is there one there for WeatherMapDataSource_static.php?

The static one is a good place to test - it's very simple.

But all the processing of targets (and recognising particular strings as valid) is done by these plugins, so if none of them load for some reason, you might see this behaviour. If the container author did something strange with their Cacti install, maybe there are some assumptions about paths that are incorrect.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
charchess
Posts: 5
Joined: Mon Mar 27, 2017 6:54 pm

Re: WMWARN08 for every tARGET I try

Post by charchess »

thanks for the answer, I've been checking logs but around the warning and didn't see anything strange

here is the relevant part I think :
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:688] [Map 1] appart.conf: Beginning to load data plugins from lib/datasources
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping .
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping ..
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping README.txt
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_cactihost.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_cactithold.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_dbsample.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_dsstats.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_external.php.disabled
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_fping.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_mrtg.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_rrd.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_skeleton.php.txt
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_snmp.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_static.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_tabfile.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_time.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapDataSource_wmdata.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:688] [Map 1] appart.conf: Beginning to load pre plugins from lib/pre
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping .
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping ..
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapPreProcessorExample.php
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:688] [Map 1] appart.conf: Beginning to load post plugins from lib/post
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping .
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping ..
03/28/2017 08:00:53 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:736] [Map 1] appart.conf: Skipping WeatherMapPostProcessorExample.php
03/28/2017 08:00:54 PM - WEATHERMAP: Poller[0] DEBUG: [ReadConfig@Weathermap.class.php:2841] [Map 1] appart.conf: Running Pre-Processing Plugins...
03/28/2017 08:00:54 PM - WEATHERMAP: Poller[0] DEBUG: [ReadConfig@Weathermap.class.php:2847] [Map 1] appart.conf: Finished Pre-Processing Plugins...
03/28/2017 08:00:54 PM - WEATHERMAP: Poller[0] DEBUG: [DatasourceInit@Weathermap.class.php:748] [Map 1] appart.conf: Running Init() for Data Source Plugins...
03/28/2017 08:00:54 PM - WEATHERMAP: Poller[0] DEBUG: [DatasourceInit@Weathermap.class.php:766] [Map 1] appart.conf: Finished Initialising Plugins...


I don't understand the "skipping" part ... is there some place to enable/activate the plugins ?
I tried to chown www-data -R the weathermap, just in case but still the same skipping thing

thanks in advance for your help

charchess
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: WMWARN08 for every tARGET I try

Post by Howie »

Yes, that's not right. It shouldn't be skipping all those. What it does is scan through the files in the directory and checks for each one to see if it's a "real" file and not a symlink, and a .php file. Then it loads it and uses the code inside, or skips if it fails either of those two tests. So it's pretty simpleminded.

This is all done around line 710 of Weathermap.class.php

It does a few funky things to figure out the actual path for the files though, so it would be worth your while adding something like

Code: Select all

  wm_debug("Realfile is $realfile\n");
right after the line that says

Code: Select all

			$realfile = $dir . DIRECTORY_SEPARATOR . $file;
so that you can see the full filename it's trying in the debug log. The 'skipped' line only shows $file, not $realfile.

You should then also be able to check if the files are symbolic links for some strange reason as you'll have the full path. Or hopefully something about the paths should offer a clue.

What you should see is something like this (with that extra log line from above):

Code: Select all

DEBUG: [LoadPlugins@Weathermap.class.php:732] Instantiated WeatherMapDataSource_static.
DEBUG: [LoadPlugins@Weathermap.class.php:708] Realfile is lib\datasources\WeatherMapDataSource_tabfile.php
DEBUG: [LoadPlugins@Weathermap.class.php:712] Loading data Plugin class from WeatherMapDataSource_tabfile.php
DEBUG: [LoadPlugins@Weathermap.class.php:724] Loaded data Plugin class WeatherMapDataSource_tabfile from WeatherMapDataSource_tabfile.php
Mine has backslashes because it's on my windows system. You should see regular slashes.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
charchess
Posts: 5
Joined: Mon Mar 27, 2017 6:54 pm

Re: WMWARN08 for every tARGET I try

Post by charchess »

just a sample of the return as for realfile ...
03/28/2017 10:00:05 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:708] [Map 2] simple.conf: Realfile is lib/datasources/WeatherMapDataSource_static.php
03/28/2017 10:00:05 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:737] [Map 2] simple.conf: Skipping WeatherMapDataSource_static.php
I went a lil bit further by adding :

Code: Select all

wm_debug("is_file : " . is_file($realfile) . "\n");
wm_debug("is_php\$ : " . preg_match( '/\.php$/', $realfile ) . "\n");
and got
03/28/2017 10:25:47 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:708] [Map 2] simple.conf: Realfile is lib/datasources/WeatherMapDataSource_static.php
03/28/2017 10:25:47 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:709] [Map 2] simple.conf: is_file :
03/28/2017 10:25:47 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:710] [Map 2] simple.conf: is_php$ : 1
03/28/2017 10:25:47 PM - WEATHERMAP: Poller[0] DEBUG: [LoadPlugins@Weathermap.class.php:740] [Map 2] simple.conf: Skipping WeatherMapDataSource_static.php
from there, I stand in /usr/share/cacti/site/plugins/weathermap and run php -a
php > $file='lib/datasources/WeatherMapDataSource_static.php';
php > if(is_file($file)){echo "is file";}else{echo "is not file";}
is file

to check what php is thinking of this file and ... it is a file for it :/

am still doing some test but here is where I stand now

charchess
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: WMWARN08 for every tARGET I try

Post by Howie »

Just checked the Dockerfile for QuantumObject/docker-cacti... so this is Ubuntu with Cacti installed from packages. The Ubuntu/Debian packagers love to move things around to fit the Debian guidelines. I suspect it's related to that. I'll try to reproduce this myself tomorrow.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
charchess
Posts: 5
Joined: Mon Mar 27, 2017 6:54 pm

Re: WMWARN08 for every tARGET I try

Post by charchess »

yes, I love debian but sometimes ... it just so messes things ...
hope I'll write another post tonight with the "eureka"
thanks again for your help, at least now I have a new start as to where to search

charchess
charchess
Posts: 5
Joined: Mon Mar 27, 2017 6:54 pm

Re: WMWARN08 for every tARGET I try

Post by charchess »

EUREKA !!!

okay ... dunno what happened but guess I did some stupid command early ... still don't get why I'd do that but ...whatever

the problem was :
1924 drw-r--r-- 2 www-data www-data 4.0K Mar 25 01:52 datasources
I did chmod 755 the datasources folder and it's working again :/ I did chmod pre and post too ...guess I'll do a find on folder to check their permission.

Thanks again for the help, you totally pointed me in the right direction

charchess
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: WMWARN08 for every tARGET I try

Post by Howie »

Awesome. That was a new one on me.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest