network map

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

Moderators: Developers, Moderators

Post Reply
Guest

Post by Guest »

Nice work. One thing though, the map assumes that the bandwidth is shared between one link/connection. This would rarely be the case...right?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Anonymous wrote:Nice work. One thing though, the map assumes that the bandwidth is shared between one link/connection. This would rarely be the case...right?
No, it does assume the line is symmetric though. The arrows show the percentage of their respective channels being used. The length of the arrow is always 50% of the link length, if that's what's got you thinking along those lines. If that makes any sense...

Actually, I don't use percentages anymore either. I switched the middle labels to show the bits/sec flowing in and out. I left it colouring the arrows based on the percentage, just so a busy link is obvious, but I added a config switch to display absolute data rates instead of percentages.

At the moment, you still need to figure out by hand which RRD to get data from, and which graph to link to for the click-through links. It'd be nice if there were some way to collate this automatically, although the flexibility of cacti means that's a bit fiddly, I think.

Anyway, I've just mailed Panagiotis Christias (who wrote weathermap) to see if they'll accept my additions.
Guest

Post by Guest »

Howie wrote:
Anonymous wrote:Nice work. One thing though, the map assumes that the bandwidth is shared between one link/connection. This would rarely be the case...right?
No, it does assume the line is symmetric though. The arrows show the percentage of their respective channels being used. The length of the arrow is always 50% of the link length, if that's what's got you thinking along those lines. If that makes any sense...

Actually, I don't use percentages anymore either. I switched the middle labels to show the bits/sec flowing in and out. I left it colouring the arrows based on the percentage, just so a busy link is obvious, but I added a config switch to display absolute data rates instead of percentages.

At the moment, you still need to figure out by hand which RRD to get data from, and which graph to link to for the click-through links. It'd be nice if there were some way to collate this automatically, although the flexibility of cacti means that's a bit fiddly, I think.

Anyway, I've just mailed Panagiotis Christias (who wrote weathermap) to see if they'll accept my additions.
Ok, thanks for clearing that up Howie
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

howie,
i have the same problem.
Each router i graph has at a minimum 3 rrd, one for CPU, LAN and WAN interfaces.

That makes generating these maps extremely long and tedious, as for each you need to find the proper rrd to add on the map, and its coordinates.

I have over 130 rotuers to add to this, i'm not looking forward to it.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Morgan wrote:howie,
That makes generating these maps extremely long and tedious, as for each you need to find the proper rrd to add on the map, and its coordinates.

I have over 130 rotuers to add to this, i'm not looking forward to it.
It's even worse than that, because there is also a different unique number for the graph itself, if you are using the popup graph bit too.

Layout of the nodes is relatively quick. It's finding the link data that takes ages. You probably don't really want 130 links on one map, purely because the arrows will all overlap each other too much. I have a 800x600 map with 15 links on it (our backbone) and it's cramped. That's partly because one site is pretty heavily connected, but there's definitely a fairly low limit before it's hard to read.

I'm thinking that some sort of wizard that can query the cacti database to get a list of candidate graphs would make it a lot nicer. I've been looking for a project to learn wxperl for, so maybe I'll have a look at it over the Christmas vacation.
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

i know what you mean about the maps. i'm having to create per country maps and even that i will have to break it down somehow to make it readable.

as for the popup, i find the right rrd by looking at the graph source of the interface i want to graph, so i just copy the link to that image as well.

works fine, tedious and long though.

Morgan
Hoffswell
Posts: 26
Joined: Fri Jan 07, 2005 10:28 am

Works... confirmed!

Post by Hoffswell »

Hiya.

I am pretty linux technical, so getting this to work wasn't too difficult.

Here's a outline of how I got it to work:

* Have good installation of Cacti, creating the rrd files
* Get rama's cacti2weathermap.pl script (in this thread), get it creating the weathermap compliant files
* Get weathermap from http://netmon.grnet.gr/weathermap/ to create the graphic.
* set up a cron job to run cacti2weathermap.pl and weathermap

The trick is getting the weathermap configuration targets right.

You have to correlate the instance of the interface in cacti, find the rll name, then assocate that to the weathermap configuration file. You will end up with something like that.

Code: Select all

TARGET  http://cactiserver.mydomain.com/weathermap/graphs/wea_wanrouter_traffic_in_65.html
This, I think, is the cumbersome part that the previous posters were discussing.

I hope that helps!
- Pete
Guest

Post by Guest »

Happy New Year to allo of you

Howie any news from your project?
Guest

Post by Guest »

As Hoffswell describes
if we use
*cacti
*cacti2weathermap.pl
*and Weathermap

will we have the opportunity to use Overlib (http://www.bosrup.com/web/overlib/)

See an example here http://netmon.grnet.gr/weathermap/examp ... b.html.txt

Mrtg extracts html file with png images?
Can Cacti do something like that?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Anonymous wrote: will we have the opportunity to use Overlib (http://www.bosrup.com/web/overlib/)

See an example here http://netmon.grnet.gr/weathermap/examp ... b.html.txt
You can do that by hand, regardless, but I've got a script which does the dirty work of making up the imagemap coordinates and overlib javascript for you, at least. I'll try and write up a quick bit of docs for it, and put it up somewhere soon. You'll still need to match up the graphical lines with the cacti rrd and graph ids by hand though.
stelaras1
Cacti User
Posts: 57
Joined: Wed Nov 03, 2004 10:11 am

Post by stelaras1 »

That sound great..
Can't way to try it!

thanx Howie

Let us know when is ready.. :wink:
madjeff
Posts: 11
Joined: Mon Feb 09, 2004 2:19 pm

Re: Works... confirmed!

Post by madjeff »

Hoffswell wrote: * set up a cron job to run cacti2weathermap.pl and weathermap
I've been messing around with this today and everything is working, except for trying to run cacti2weathermap.pl in cron. For the life of me I can't figure out what the issue is. Here's my cron entry for the moment:

Code: Select all

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root nice -n 19 run-parts /etc/cron.hourly
02 4 * * * root nice -n 19 run-parts /etc/cron.daily
22 4 * * 0 root nice -n 19 run-parts /etc/cron.weekly
42 4 1 * * root nice -n 19 run-parts /etc/cron.monthly
*/5 * * * * root php /var/www/html/poller.php > /dev/null 2>&1
*/5 * * * * root /var/www/html/weathermap/cacti2weathermap.pl >> test.log 2>&1
*/5 * * * * root /var/www/html/weathermap/weathermap > /dev/null 2>&1
I can run cacti2weathermap.pl from the command line and it creates the files perfectly. But when I run it via cron, it doesn't create/update the files. Any idea what might be causing this?
David R.

Bug fix on cacti2weathermap

Post by David R. »

Hi all and Happyr new year.

Just found a little bug in my script regarding defferenciating null values and '0'. As for PERL it seems that 0 == Null.
Need to replace the

Code: Select all

if(@$line[0] != null){
With

Code: Select all

if(defined(@$line[0])){
And this should correct the problem for links with '0' traffic.

Here's the full code:

Code: Select all

#!/usr/bin/perl5.8.0

use RRDs;

#Path to rrd files
$my_dir = "/var/www/cacti/rra/";

#Path to store weatehrmap compatible files
$my_htmldir = "/var/www/cacti/graphs/";

opendir RRDDIR, $my_dir or die "Impossible to open file: $!";
@rrd_files = grep /rrd/, readdir RRDDIR;

$my_counter = 0;

foreach my $router (@rrd_files){
        $my_counter ++;
        #Get the last cuin/cuout values
        my ($start,$step,$names,$data) = RRDs::fetch $my_dir.$router,"AVERAGE","--start","now";
        foreach my $line (@$data) {
            if(defined(@$line[0])){
                (my $name, my $ext)  = split /rrd/,$router;
                $weatherfile = $my_htmldir."weatherm/wea_".$name."html";
                #Open special html weathermap file
                open OUT,">$weatherfile" or die "bad luck: $!";
                print OUT "<html>\n<body>\n$router\n";
                $nice = sprintf "<!-- cuin d %d -->\n<!-- cuout d %d -->\n", @$line[0], @$line[1];
                print OUT $nice;
                print OUT "</body>\n</html>";
                close OUT;
                }
#            else {
#               print "ROUTER:: $router ";
#               print "PAS bon: ##@$line[0]## ##@$line[1]##\n";
#               }
        }
}
David R.
[/code]
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Bug fix on cacti2weathermap

Post by Howie »

David R. wrote:Hi all and Happyr new year.

Just found a little bug in my script regarding defferenciating null values and '0'. As for PERL it seems that 0 == Null.
David,

I'm just putting together a little package/page describing using cacti & weathermap, plus some extra stuff I've done. Do you mind if I include this script?
Davir R.

Re: Bug fix on cacti2weathermap

Post by Davir R. »

Howie wrote: David,

I'm just putting together a little package/page describing using cacti & weathermap, plus some extra stuff I've done. Do you mind if I include this script?
No problem for me, was provided as GPL, just mention my name ;p

Davir Ramahefason

Cheers
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests