network map

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

i have the dimensions settings in weathermap.conf:
HEIGHT 600
WIDTH 740

# low high red green blue
SCALE 1 10 140 0 255
SCALE 10 25 32 32 255
SCALE 25 40 0 192 255
SCALE 40 55 0 240 0
SCALE 55 70 240 240 0
SCALE 70 85 255 192 0
SCALE 85 100 255 0 0


# Define Node
NODE internet
POSITION 542 381
LABEL Freebackbone

NODE bastille2
POSITION 124 174
LABEL Bastille2

NODE k7
POSITION 91 401
LABEL K7


LINK bastille2-internet
NODES bastille2 internet
TARGET ../rra/juniper_m10i1_traffic_in_39.rrd
BANDWIDTH 316

i recieve :
[root@cacti weathermap]# ./weathermap

Warning: imagecreate(): Invalid image dimensions in /www/cacti/weathermap/Weathermap.class.php on line 1175

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1178

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1179

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1180

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1181

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1126

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1126

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1126

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1126

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1126

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1126

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 1126
Clipped 531.32208157% to 100%

Warning: imagefilledpolygon(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 255

Warning: imagepolygon(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 259

Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 586

Warning: imagerectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 587

Warning: imagestring(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 589
Clipped 307.763713089% to 100%

Warning: imagefilledpolygon(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 255

Warning: imagepolygon(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 259

Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 586

Warning: imagerectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 587

Warning: imagestring(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 589

Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 95

Warning: imagerectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 105

Warning: imagestring(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 110

Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 95

Warning: imagerectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 105

Warning: imagestring(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 110

Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 95

Warning: imagerectangle(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 105

Warning: imagestring(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 110

Warning: imagestring(): supplied argument is not a valid Image resource in /www/cacti/weathermap/Weathermap.class.php on line 743

Fatal error: Call to undefined function imagepng() in /www/cacti/weathermap/Weathermap.class.php on line 1212
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

kslt wrote: [root@cacti weathermap]# ./weathermap

Warning: imagecreate(): Invalid image dimensions in /www/cacti/weathermap/Weathermap.class.php on line 1175
Everything after this is because the imagecreate() failed.

Except this:
kslt wrote: Fatal error: Call to undefined function imagepng() in /www/cacti/weathermap/Weathermap.class.php on line 1212
which looks like you don't have PNG support in your php gd module. You can test that by pasting the following into a text file (say test.php) and then running it with php ('php test.php'):

Code: Select all

<?
    $gdinf = gd_info();
    if(! $gdinf['PNG Support'])
    {
        die("Your GD php module doesn't support PNG format.");
    }
    else
    {
        die("You have PNG support");
    }   
    
?>
Version 0.7 now has this test built-in. I'll also make sure it just stops if the imagecreate() fails, too. I still don't see why you get the 'dimensions' error, but having PNG support would certainly help.
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!)
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

you are right :
[root@cacti www]# php test_gd.php
Your GD php module doesn't support PNG format.
but it can draw an png in another version ...

but .. i tried around to fix the error and i took from 1.1.1hj3 version this script :
print "Opening log files...\n\n" if($DEBUG);
foreach $link (keys %target){

$data = $target{$link};
print "FILE: $data\n" if($DEBUG);

if($data =~ /\.rrd$/i)
{
print "LINK: Reading from RRD: $data\n" if($DEBUG);
( $input{$link}, $output{$link} ) = read_rrd_data($data);

print "LINK: $link, Input: $input{$link}\n" if($DEBUG);
print "LINK: $link, Output: $output{$link}\n" if($DEBUG);
}
else
{
if(($data =~ /^https?:\/\//i) || ($data =~ /^ftp:\/\//i) ) {
open(LOG, "$WGET $data |") or warn "$data: $!\n";
} else {
open(LOG, "$data") or warn "data file $data: $!\n";
}

while(<LOG>){
# <!-- cuin d 5585966 -->
# <!-- cuout d 10589424 -->
if(/<\!-- cuin d (\d+) -->/){
if($REVERSEDIRECTION)
{
$output{$link}=$1;
}
else
{
$input{$link}=$1;
}
print "LINK: $link, Input: $input{$link}\n" if($DEBUG);
}
if(/<\!-- cuout d (\d+) -->/){
if($REVERSEDIRECTION)
{
$input{$link}=$1;
}
else
{
$output{$link}=$1;
}
print "LINK: $link, Output: $output{$link}\n" if($DEBUG);
}
}
close(LOG);
}
}
and from weathermap4rrd this one:
print "Reading rrd files...\n\n" if($DEBUG);
foreach $link (keys %target){
$data = $target{$link};
print "FILE: $data\n" if($DEBUG);
if ( ! $DATE ) {
$DATE= RRDs::last "$data";
$version=&rrdtool_getversion();
print "RRDTool binary version detected : $version\n" if ($DEBUG);
if ($version=="1.2") {
$DATE= $DATE-300;
}
print "No date specified, last value will be read : ".scalar localtime($DATE)."\n" if ($DEBUG);
}
my ($start,$step,$names,$data) = RRDs::fetch "$data","AVERAGE","--start","$DATE","--end","$DATE";
my $ERR=RRDs::error;
die "W4RRD ERROR while reading $target{$link}: $ERR\n" if $ERR;
print "Start: ", scalar localtime($start), " ($start)\n" if($DEBUG);
print "Step size: $step seconds\n" if($DEBUG);
print "DS names: ", join (", ", @$names)."\n" if($DEBUG);
print "Data points: ", $#$data + 1, "\n" if($DEBUG);
foreach my $line (@$data) {
if(@$line[0] != null) {
$input{$link}=@$line[$inpos{$link}];
$output{$link}=@$line[$outpos{$link}];
print "LINK: $link, Input: $input{$link}\n" if($DEBUG);
print "LINK: $link, Output: $output{$link}\n" if($DEBUG);
}
}
}

and changed the
$input{$link}=@$line[$inpos{$link}-1]*$coef{$link};
$output{$link}=@$line[$outpos{$link}-1]*$coef{$link};
to
$input{$link}=@$line[$inpos{$link}];
$output{$link}=@$line[$outpos{$link}];
so, now the version, that didn't get the data and drawing ok - working ok, but it recieve in inpos and outpos the same data :(
[root@cacti weathermap]# ./weathermap

Reading configuration file...

found HEIGHT: 600
found WIDTH: 740
found KEY POSITION: 476 91
found SCALE DATA: 1:10 140:0:255
found SCALE DATA: 10:25 32:32:255
found SCALE DATA: 25:40 0:192:255
found SCALE DATA: 40:55 0:240:0
found SCALE DATA: 55:70 240:240:0
found SCALE DATA: 70:85 255:192:0
found SCALE DATA: 85:100 255:0:0
found NODE: internet
found NODE: internet XPOS: 542 YPOS: 542
found NODE: internet LABEL: Freebackbone
found NODE: bastille2
found NODE: bastille2 XPOS: 124 YPOS: 124
found NODE: bastille2 LABEL: Bastille2
found LINK: bastille2-internet
found LINK: bastille2-internet NODEA: bastille2 NODEB: internet
found LINK: bastille2-internet TARGET: /www/cacti/rra/kslt_noip_com_traffic_in_72.rrd
found LINK: bastille2-internet BANDWIDTH: 1500

Reading rrd files...

FILE: /www/cacti/rra/kslt_noip_com_traffic_in_72.rrd
RRDTool binary version detected : 1.2
No date specified, last value will be read : Thu Sep 29 12:09:32 2005
Start: Thu Sep 29 12:10:00 2005 (1127985000)
Step size: 30 seconds
DS names: traffic_in, traffic_out
Data points: 1
LINK: bastille2-internet, Input: 2219.08888888889
LINK: bastille2-internet, Output: 2219.08888888889


Calculating rates...

/www/cacti/rra/kslt_noip_com_traffic_in_72.rrd: outrate=1%, inrate=1%
Producing a Polygon for bastille2-internet
Producing a Polygon for bastille2-internet

Producing a Rectangle for internet
Producing a Rectangle for bastille2
Generating image file weathermap.png...

Generating HTML file weathermap.html...
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

and i think that the wrong data :)
cause in my graph it's 26.14 and 2.21 and not
LINK: bastille2-internet, Input: 3047.42222222222
LINK: bastille2-internet, Output: 3047.42222222222
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

and also i want to try to fix the gd support
[root@cacti www]# php test_gd.php
Your GD php module doesn't support PNG format.
already compiled the gd 1.2.8
[root@cacti libpng-1.2.8]# ./pngtest
Testing libpng version 1.2.8
with zlib version 1.1.4

libpng version 1.2.8 - December 3, 2004
Copyright (c) 1998-2004 Glenn Randers-Pehrson
Copyright (c) 1996-1997 Andreas Dilger
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
library (10208): libpng version 1.2.8 - December 3, 2004 (header)
pngtest (10208): libpng version 1.2.8 - December 3, 2004 (header)
png_sizeof(png_struct)=712, png_sizeof(png_info)=288
Testing pngtest.png:
Pass 0: rwrwrwrwrwrwrwrwrw
Pass 1: rwrwrwrwrwrwrwrwrw
Pass 2: rwrwrwrwrwrwrwrw
Pass 3: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Pass 4: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Pass 5: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
rwrwrwrw
Pass 6: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
rwrwrwrwrw
PASS (9782 zero samples)
Filter 0 was used 21 times
Filter 1 was used 15 times
Filter 2 was used 52 times
Filter 3 was used 10 times
Filter 4 was used 33 times
tIME = 7 Jun 1996 17:58:08 +0000
libpng passes test
and recompiled the php (5) --with-gd ..
doesn't help ...
:(
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

kslt wrote:and also i want to try to fix the gd support
[root@cacti www]# php test_gd.php
Your GD php module doesn't support PNG format.
and recompiled the php (5) --with-gd ..
doesn't help ...
:(
You might need to tell the php configure command where to find it. You may need to add somehing like

Code: Select all

--with-png-dir=/usr/local
to the end of your config line (for wherever you installed libpng). The configure output includes a little section of which image formats will be supported if you look through it.
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!)
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

did it already..
the php was compiled with:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/bin/mysql --with-png-dir=/usr/local --with-gd=/usr/local/lib --with-zlib-dir=/usr/local/lib
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

kslt wrote:did it already..
the php was compiled with:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/bin/mysql --with-png-dir=/usr/local --with-gd=/usr/local/lib --with-zlib-dir=/usr/local/lib
Then it seems you might need to ask a PHP forum :-)

Actually - one other thing! Make sure you don't somehow have two PHPs installed. If you do 'php -v' and 'which php' on the command-line, do they give the values you expect? I got burned this way once - updating and updating but somehow still running the old PHP 4.0.3 I had in /usr/bin and not the one in /usr/local/bin
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!)
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

yes, tested ..
i havn't another version from the begining ...

ok .. doesn't metter ..

can you help me with the getting data from rrd's ?
cause i found already that it get wrong data and in and out data equal and wrong ...

maybe another version ? can you recommend me to try any one ?
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

can you help me with the getting data from rrd's ?
cause i found already that it get wrong data and in and out data equal and wrong ...
anybody ?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

kslt wrote:
can you help me with the getting data from rrd's ?
cause i found already that it get wrong data and in and out data equal and wrong ...
anybody ?
If I understood which version you were talking about, it was my old perl version, but with some code taken from somewhere else added on. The part that actually reads RRDs is not very complex. If you understand it enough to modify it, then you probably understand it enough to debug it. From memory, you will run into problems if you have a custom RRD, where there are more than two DS in it, or where the order is different.

I still recommend that you get one of the PHP versions (mine, or wm4rrd) working as there will be no bug fixes or updates for my perl version. I'm spending my spare time working on the next release for php-weathermap.
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!)
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

I tried already php version, but i don't know what is wrong, i can't see the picture and i have no DEBUG and no ERRORS :(

problemaitic ..
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

Hi,
I freshly install Cacti 0.86g
Weathermap4rrd-perl-1.2rc3
when I want to run weathermap I got this error message
[root@PIONEER weathermap]# ./weathermap
Can't locate RRDs.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.6/i386-linux-thread-multi /usr/lib/perl5/5.8.6 .) at ./weathermap line 12.
BEGIN failed--compilation aborted at ./weathermap line 12.
Line 12 is:
use RRDs;
and I change the RRDTOOL_PATH as:
$RRDTOOL_PATH = "/usr/local/rrdtool/bin/";
Can anybody tell me the solution?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

TFC wrote:Hi,
Can anybody tell me the solution?
I've never used wm4rrd ;-) but the error is to do with the perl module not the rrdtool executable. Somewhere near the top of the script there should be something like:

Code: Select all

use lib qw(/usr/local/rrdtool-1.2.3/lib/perl);
or wherever you installed the RRD perl modules to. ('locate RRDs.pm' should tell you).
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!)
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

I installed perl
I installed rrdtool like
./configure --prefix=/usr/local/rrdtool
then i searched RRD.pm, i found in source directory.
I copied it to /usr/local/rrdtool/lib directory.
Then I tried to run werahermap4rrd
But i still get same message.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests