network map

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

Moderators: Developers, Moderators

Post Reply
kbriggs
Posts: 2
Joined: Wed Sep 21, 2005 12:18 pm

Post by kbriggs »

Ok, I believe I found an interesting issue with Howie's mapping script.

This is what a normal response looks like from one of our bandwidth rras using the same command syntax as weathermap uses.

timestamp traffic_out_ifNametraffic_in_ifName

1127322600: 1.0515077508e+06 5.9182373654e+06
1127322900: nan nan
1127323200: nan nan

When someone setup our cacti graphs they extended the DS names to the point there is no whitespace between them. Just wanted to mention it in case others came across it and I am sorry if it has already been posted.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

kbriggs wrote: When someone setup our cacti graphs they extended the DS names to the point there is no whitespace between them. Just wanted to mention it in case others came across it and I am sorry if it has already been posted.
Oh dear. That is a problem :-) Could you verify the rrdtool & OS version? I have some code I received from someone to use the native php rrd module, which would solve this for those prepared to mess around a bit. I think the best solution would be for me to switch to the XML output from rrdtool - no field lengths there!
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!)
kbriggs
Posts: 2
Joined: Wed Sep 21, 2005 12:18 pm

Post by kbriggs »

I cheated and added a line to set the ds values to what is expected in the class file and mine is now working so I guess you as a short term fix could add command line options for it. Also is there any easy way to change the background color of the png without adding a background image?

RRDtool 1.0.49 Copyright 1997-2004 by Tobias Oetiker <tobi@oetiker.ch>

CentOS release 3.5 (Final)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

kbriggs wrote:I cheated and added a line to set the ds values to what is expected in the class file and mine is now working so I guess you as a short term fix could add command line options for it. Also is there any easy way to change the background color of the png without adding a background image?

RRDtool 1.0.49 Copyright 1997-2004 by Tobias Oetiker <tobi@oetiker.ch>

CentOS release 3.5 (Final)
I just tried this with RRDtool 1.2.11 on OS X, and I got:

Code: Select all

             traffic_out_ifName   traffic_in_ifName

1127500200: 5.5357366606e+06 5.5357357376e+06
1127500500: 8.7808229423e+06 1.4316551429e+07
So I guess it's solved in the latest version too, at least.

As for the colour, there isn't an easy way at the moment. The not-so-easy way is to add a line to the code. From memory, gd always uses the first colour allocated as the background colour, so if you want to change it, you would find the line in DrawMap in Weathermap.class.php where it allocates white, and just before that, add a:

Code: Select all

imagecolorallocate($image,255,0,255);
Assuming you want a purple background, anyway ;-)

That ought to work... (not tested)
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!)
cl
Posts: 3
Joined: Tue Jun 14, 2005 2:59 pm

link aggregate

Post by cl »

Hi all,

Is it possible to show the aggregate utilisation from two RRDs on one link on the map? I have multiple links at each sites, but only want to show total usage for each site.

If it's not possible from weathermap, is there a way to have one RRD with aggregated usage from multiple devices in cacti, so that weathermap can use it? (I am not looking for an aggregate usage cacti graph)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: link aggregate

Post by Howie »

cl wrote:Hi all,

Is it possible to show the aggregate utilisation from two RRDs on one link on the map? I have multiple links at each sites, but only want to show total usage for each site.

If it's not possible from weathermap, is there a way to have one RRD with aggregated usage from multiple devices in cacti, so that weathermap can use it? (I am not looking for an aggregate usage cacti graph)
The only way I can think of to create an RRD to do it would be with a bit of perl or awk, and rrd export and import. Export both RRDs, then add together the values from each XML or text file and create a composite that way. All of the compositing in rrd graphing is done on the fly, using CDEFs, so it doesn't help.

I have a similar issue where I want to count "errors" in a generic way, but for an ethernet switch port, there are actually a dozen different SNMP error counters (IP layer error, CRC error, collision, overrun etc). I don't want all those (mostly zero) graphs for each switch port :-)

It wouldn't be too hard to add this ability to weathermap, but it might mean implementing some kind of expression language for the TARGET lines. If it were only simple addition, and the same targets for both in and out sides, then this could just be a list of RRDs in the same format as the current ones. Is that enough?

One other question though... where would the one arrow go to? I guess all the links from site A aren't to site B. Or do you just want to show arrows into something like an ATM or Frame Relay 'cloud', with the local bearer usage?
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!)
cl
Posts: 3
Joined: Tue Jun 14, 2005 2:59 pm

Re: link aggregate

Post by cl »

Howie wrote:
It wouldn't be too hard to add this ability to weathermap, but it might mean implementing some kind of expression language for the TARGET lines. If it were only simple addition, and the same targets for both in and out sides, then this could just be a list of RRDs in the same format as the current ones. Is that enough?

One other question though... where would the one arrow go to? I guess all the links from site A aren't to site B. Or do you just want to show arrows into something like an ATM or Frame Relay 'cloud', with the local bearer usage?
Hi Howie,

What you describe would be more than enough, that would be exactly what I am looking for! :D

As for the arrow, they would go to an ATM cloud.
kslt
Cacti User
Posts: 85
Joined: Tue Aug 02, 2005 4:12 am

Post by kslt »

Hello

I recieve every time the message
Can't locate object method "png" via package "GD::Image" at ./weathermap line 193.
Already installed an libpng and libdg.
[root@cacti1 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
What am i missing ?
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:Hello

I recieve every time the message
Can't locate object method "png" via package "GD::Image" at ./weathermap line 193.
What am i missing ?
You also need to (re)compile libgd with PNG support if it wasn't before, and then probably rebuild the GD perl module too.

Alternatively, switch to the php version, which is still developed, assuming this is my 'hj' version of perl weathermap :-) Recent versions of php also come with GD bundled, and easy to enable.
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 »

tried php version already .. but i recieve the (X) and link down to it and it's do nothing .. a link somethink like /w4rrd.php?config=weathermap.conf that bring a blank page..

with GD was recompiled and it working ok.

BUT

i have 2 versions of weathermap.
one of them can draw, but it doesn't get the data at all (recieving zeros),
the second one - getting the data and calculating ok (can see that in DEBUG mode), but draw a strange file (can't open as png) that somethink about 8k (instead of 2.5k that the first version do :))

so..
does any body know how to get this 2 not-woriking-version to 1 working ?
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:tried php version already .. but i recieve the (X) and link down to it and it's do nothing .. a link somethink like /w4rrd.php?config=weathermap.conf that bring a blank page..

with GD was recompiled and it working ok.

BUT

i have 2 versions of weathermap.
one of them can draw, but it doesn't get the data at all (recieving zeros),
the second one - getting the data and calculating ok (can see that in DEBUG mode), but draw a strange file (can't open as png) that somethink about 8k (instead of 2.5k that the first version do :))

so..
does any body know how to get this 2 not-woriking-version to 1 working ?
There is another php one then (mine) that you haven't tried. It sounds like you should be clear about which version each of these programs is. The two - one that draws and one that produces a strange file - what versions are they? GRNET? HJ? weathermap4rrd? (the last two have several different versions and two languages - perl and php).

Any answer about how to get it working might be different depending on what software you are actually using!

If you are using a Unix-alike, you might want to try 'file filename.png' on the output of no 2, to see if that can guess what format the file is. The first one (of those two) sounds like GRNET, which doesn't understand RRD files at all. The first one you mention is weathermap4rrd, which I've never used, but it's writer is on this forum sometimes, too.
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 »

ok, so i'm on redhat enterprise 3.

the first version, that can't get the data is 1.1.1hj3.

the second are weathermap4rrd and the version are 1.2RC3
the file that its make is:
[root@cacti weathermap4rrd]# file weathermap.png
weathermap.png: data
the php version that i tried was 0.6 (weathermap). what php version should i try or what can i do with my strange data image ?
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: the php version that i tried was 0.6 (weathermap). what php version should i try or what can i do with my strange data image ?
So what happened with 0.6? I don't think you said what the output was then... I would say php-weathermap 0.6 is the php version to try, but I guess Alexandre would say weathermap4rrd :-)
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 »

in php version i recieve that :
Warning: imagecreate(): Invalid image dimensions in /www/cacti/weathermap_php/Weathermap.class.php on line 1175

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

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

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

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

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

....
...
...
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:in php version i recieve that :
Warning: imagecreate(): Invalid image dimensions in /www/cacti/weathermap_php/Weathermap.class.php on line 1175...
OK, so what do you have as WIDTH and HEIGHT at the top of your config? It sounds like you have something funny... maybe negative or zero?

You need to have either a WIDTH and HEIGHT pair (with the size of the map in pixels) or a BACKGROUND line with a PNG filename for a file to read in as the background. If you have both, then the BACKGROUND is used.
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 0 guests