network map
Moderators: Developers, Moderators
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
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...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?
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 HowieHowie wrote: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...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?
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.
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.
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.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
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.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.
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.
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
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
Works... confirmed!
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.
This, I think, is the cumbersome part that the previous posters were discussing.
I hope that helps!
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
I hope that helps!
- Pete
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?
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?
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
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.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
Re: Works... confirmed!
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:Hoffswell wrote: * set up a cron job to run cacti2weathermap.pl and weathermap
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
Bug fix on cacti2weathermap
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
With
And this should correct the problem for links with '0' traffic.
Here's the full code:
David R.
[/code]
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){
Code: Select all
if(defined(@$line[0])){
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";
# }
}
}
[/code]
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Bug fix on cacti2weathermap
David,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.
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?
Re: Bug fix on cacti2weathermap
No problem for me, was provided as GPL, just mention my name ;pHowie 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?
Davir Ramahefason
Cheers
Who is online
Users browsing this forum: No registered users and 10 guests