Map generated only manually - SOLVED SEE PAGE 3

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

hi,

I chowned all my cacti web directory plus rras to user and group www-data, but i still have the same problem :
12/01/2008 09:22:54 AM - WEATHERMAP: Poller[0] [Map 5] toto.conf: Weathermap 0.95b run complete - 2 maps were run in 2 seconds
12/01/2008 09:22:54 AM - WEATHERMAP: Poller[0] [Map 5] toto.conf: Wrote map to /usr/share/cacti/site/plugins/weathermap/output/af80da3a9de22919704a.jpg and /usr/share/cacti/site/plugins/weathermap/output/af80da3a9de22919704a.thumb.jpg
12/01/2008 09:22:53 AM - WEATHERMAP: Poller[0] [Map 5] toto.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
12/01/2008 09:22:53 AM - WEATHERMAP: Poller[0] [Map 5] toto.conf: ReadData: LINK W4I600-W5I600, target: /usr/share/cacti/site/rra/w4i600_traffic_in_3419.rrd on config line 285 had no valid data, according to WeatherMapDataSource_rrd
...
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

Howie wrote:OK, well I guess it uses a '.' because it's working :-)

The fix will be in lib/datasources/WeatherMapDataSource_rrd.php

on line 266 and 270 (roughly), change the preg_match() lines to say

/^\-?\d+(,\.)?\d*e?[+-]?\d*:?$/i

instead of
/^\-?\d+\.?\d*e?[+-]?\d*:?$/i

so that it will match a , or a .
I do not know if it is a problem, but i ind the line only once, at line 243.
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

i tried to run it manually on command line, with version 0.9a and 0.9b, with and without code modification, and it is still the same problem

what is the difference when i run it through cacti site ?
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

another point is that with this :
/^\-?\d+(,\.)?\d*e?[+-]?\d*:?$/i

i ve got the same problem when i use "Recalculate all Maps"
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

You could also try the current subversion copy of this file, which already has this 'fix' applied... see if it helps you.

http://www.network-weathermap.com/svn/r ... ce_rrd.php
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!)
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

Howie wrote:You could also try the current subversion copy of this file, which already has this 'fix' applied... see if it helps you.

http://www.network-weathermap.com/svn/r ... ce_rrd.php
it still works with recalculate button, but still the same problem :(

what exactly is the difference between command line/poller and the recalculate button ?
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

i upgraded my cacti with debian package, version 0.8.7b-2.1, and plugin arch too, in version 2.2
still the same :(
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

tomate wrote:
Howie wrote:You could also try the current subversion copy of this file, which already has this 'fix' applied... see if it helps you.

http://www.network-weathermap.com/svn/r ... ce_rrd.php
it still works with recalculate button, but still the same problem :(

what exactly is the difference between command line/poller and the recalculate button ?
Only the user it runs as.

If you are using the actual command-line weathermap script and not the poller, then it's possible that it's using a different rrdtool - the rrdtool path is in the script itself, whereas Recalc Now and the poller both use Cacti's path to rrdtool.
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!)
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

Howie wrote:
tomate wrote:
Howie wrote:You could also try the current subversion copy of this file, which already has this 'fix' applied... see if it helps you.

http://www.network-weathermap.com/svn/r ... ce_rrd.php
it still works with recalculate button, but still the same problem :(

what exactly is the difference between command line/poller and the recalculate button ?
Only the user it runs as.

If you are using the actual command-line weathermap script and not the poller, then it's possible that it's using a different rrdtool - the rrdtool path is in the script itself, whereas Recalc Now and the poller both use Cacti's path to rrdtool.
my rrdtool is in /usr/bin/rrdtool
weathermap uses /usr/local/bin/rrdtool, that is a symlink to /usr/bin/rrdtool

i have just tested on another installation : new installation of apache2, mysql5, php5, cacti 0.8.7b-2.1
all debian packages

only 1 host and 1 graph in cacti, i am waiting for first results
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

no valid data :cry:
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

here some debug lines from command line :
DEBUG: [ReadData@Weathermap.class.php:574] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: ReadData: Updating link data for all links and nodes
DEBUG: [ReadData@Weathermap.class.php:599] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf:
DEBUG: [ReadData@Weathermap.class.php:600] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: ReadData for LINK -toto-swa--toto-swb-G2/2:
DEBUG: [ReadData@Weathermap.class.php:606] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: ReadData: New Target: /usr/share/cacti/site/rra/swa_traffic_in_752.rrd
DEBUG: [ReadData@Weathermap.class.php:637] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: ReadData: Matched for WeatherMapDataSource_rrd. Calling WeatherMapDataSource_rrd->ReadData()
DEBUG: [ReadData@WeatherMapDataSource_rrd.php:462] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: SCALING result by 8
DEBUG: [ReadData@WeatherMapDataSource_rrd.php:519] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: RRD ReadData: Target DS names are traffic_in and traffic_out
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:292] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: RRD ReadData: traditional style
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:307] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: RRD ReadData: Running: /usr/bin/rrdtool fetch /usr/share/cacti/site/rra/swa_traffic_in_752.rrd AVERAGE --start now-800 --end now
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:327] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: > 1228137600: 1,7890805614e+03 2,3089453548e+03
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:327] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: > 1228137900: 1,9146342174e+03 2,2465161826e+03
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:327] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: > 1228138200: nan nan
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:327] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: > DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:335] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: RRD ReadData: Read 4 lines from rrdtool
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:336] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: RRD ReadData: Headings are: traffic_in traffic_out

DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:345] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: --
DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:345] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: --1228138200: nan nan

DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:345] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: --1228137900: 1,9146342174e+03 2,2465161826e+03

DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:345] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: --1228137600: 1,7890805614e+03 2,3089453548e+03

DEBUG: [wmrrd_read_from_real_rrdtool@WeatherMapDataSource_rrd.php:401] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: RRD ReadDataFromRealRRD: Returning (NULL,NULL,0)
DEBUG: [ReadData@WeatherMapDataSource_rrd.php:549] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: RRD ReadData: Returning (NULL,NULL,0)
/usr/share/cacti/site/plugins/weathermap/configs/toto.conf: ReadData: LINK -toto-swa--toto-swb-G2/2, target: /usr/share/cacti/site/rra/swa_traffic_in_752.rrd on config line 153 had no valid data, according to WeatherMapDataSource_rrd
DEBUG: [ReadData@Weathermap.class.php:674] /usr/share/cacti/site/plugins/weathermap/configs/toto.conf: ReadData complete for LINK -toto-swa--toto-swb-G2/2: 0 0

as you can see, there is still ',' instead of '.' :o
and i use your new WeatherMapDataSource_rrd.php
line 364 :

Code: Select all

                                                if(array_key_exists($n,$values))
                                                {
                                                        $candidate = $values[$n];
#                                                       if(preg_match('/^\-?\d+\.?\d*e?[+-]?\d*:?$/i', $candidate))
                                                        if(preg_match('/^\-?\d+(,\.)?\d*e?[+-]?\d*:?$/i', $candidate))
                                                        {
                                                                $data[$dir] = $candidate;
                                                                debug("$candidate is OK value for $n\n");
                                                                $data_ok = TRUE;
                                                        }
                                                }
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

ok, i really think the problem comes from the regexp
with this '/^\-?\d+[,\.]?\d*e?[+-]?\d*:?$/i'
i have some weird results but results are not invalid nor 0 !
i have to learn more about perl regexp :D
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I've given up trying to follow what you've changed.

It seems that you have a system where rrdtool's output changes without you doing anything.
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!)
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

Howie wrote:I've given up trying to follow what you've changed.

It seems that you have a system where rrdtool's output changes without you doing anything.
:(

it seems that the regexp does not match for the moment when there is ','
but i do not know how to fix it
tomate
Cacti User
Posts: 73
Joined: Mon Jun 05, 2006 5:45 am

Post by tomate »

i tried with a third new installation from cacti package, not debian one and the result is the same

so you think i should try to install rrdtool from sources ?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests