network map

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

Moderators: Developers, Moderators

Post Reply
pmos
Posts: 3
Joined: Fri Apr 01, 2005 5:51 am
Location: Portugal

Post by pmos »

Hi Howie,

After a little hunting, I managed to find the original here:
ftp://202.90.128.22/pub/programs/netmea ... installer/

as referenced here:
http://noc.asti.dost.gov.ph/docus/tools ... hermap.php

Didn't actualy look at the source to compare it.
(and possibly won't: perhaps it's time to do a "clean room" implementation anyhow)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

pmos wrote: Didn't actualy look at the source to compare it.
(and possibly won't: perhaps it's time to do a "clean room" implementation anyhow)
Since it seems to require SNMP, that implies it does it's own polling. I don't see how it can be that closely related to GRNET's script. I didn't actually download it either though :-)

I think I'm just going to carry on as I was... first a pure-php version of GRNET+addtions, then a more cacti-integrated version, probably using mysql to store the configs with a wysiwyg web editor. Got some of the editing working now, and all but rrd-reading working in the straightforward port.
pmos
Posts: 3
Joined: Fri Apr 01, 2005 5:51 am
Location: Portugal

Post by pmos »

I think I'm just going to carry on as I was... first a pure-php version of GRNET+addtions, then a more cacti-integrated version, probably using mysql to store the configs with a wysiwyg web editor. Got some of the editing working now, and all but rrd-reading working in the straightforward port.
Great, looking forward to see it. :)

I actualy had started looking into building a wysiwyg (php+javascript+dhtml) editor for the config but, as with most of my intentions these days (and sleeping time :o ), it got kind of lost in the middle of work+family+newborn baby.
ggarbe
Posts: 6
Joined: Fri Apr 01, 2005 8:36 am
Contact:

Post by ggarbe »

Really it's a great job!!

I´ll hold...

:D
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

wrong output of cacti-to-weather

Post by oharel »

Hi Guys,

i am using Rossco's script to generate html files from the rrds (although this happens with the original cacti2weather file too). many of the files get updated properly, but some give the output:
root@home:/var/www/htdocs/cacti/weathermap/data# less wea_snmp_home_cat_traffic_in_579.html
<html>
<body>
snmp_home_cat_traffic_in_579.rrd
<!-- cuin d -->
<!-- cuout d -->
</body>
</html>

however, the graph in cacti *is* generated.
the arrows on the weathermap.html show 0...

is there a possibility to debug?
anyone can help?

Thanks
Harel
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: wrong output of cacti-to-weather

Post by Howie »

oharel wrote: however, the graph in cacti *is* generated.
the arrows on the weathermap.html show 0...

is there a possibility to debug?
anyone can help?
I had a similar problem once, and I can't remember how I fixed it. D'oh! :-)

Two things come to mind though: make sure you run cacti2weathermap right after the poller - it (and weathermap directly too) behave badly if you run them some time after the RRD was updated and sometimes give 0 values. I believe this is to do with the way RRDs are averaged. However, I think you would see 0 in the html then, not nothing.

The other is to check the layout of the RRD files that fail - cacti2weathermap assumes that the first two DSs inside the file are the ones you need.

Code: Select all

rrdtool info blahblah.rrd
will show you what datasources are inside the RRD - is it possible the 'broken' ones are collected in a more unusual way (like from a script)?

A "normal" one has a section at the top naming the DSs that looks a bit like:

Code: Select all

filename = "core_bs450_traffic_in_400.rrd"
rrd_version = "0001"
step = 300
last_update = 1103893200
ds[traffic_out].type = "COUNTER"
ds[traffic_out].minimal_heartbeat = 600
ds[traffic_out].min = 0.0000000000e+00
ds[traffic_out].max = 1.0000000000e+08
ds[traffic_out].last_ds = "0"
ds[traffic_out].value = 0.0000000000e+00
ds[traffic_out].unknown_sec = 0
ds[traffic_in].type = "COUNTER"
ds[traffic_in].minimal_heartbeat = 600
ds[traffic_in].min = 0.0000000000e+00
ds[traffic_in].max = 1.0000000000e+08
ds[traffic_in].last_ds = "0"
ds[traffic_in].value = 0.0000000000e+00
ds[traffic_in].unknown_sec = 0
rra[0].cf = "AVERAGE"
[etc...]
The order of the traffic_in and traffic_out in the file is important.
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

wrong output of cacti-to-weather

Post by oharel »

thanks Howie,

thanks for the answer. i am comparing an rrd that works and one that does not. other than the fact that the order of traffic_in and traffic_out are reversed, i dont see anything. however, i checked on another rrd that does not work, and the order there is correct, so i dont know what to make of it. below are two rrds, one that works and one that doesn't:
this one does not work:
filename = "/var/www/htdocs/cacti/rra/snmp_home_cataccess_traffic_in_1975.rrd"
rrd_version = "0001"
step = 300
last_update = 1112780401
ds[traffic_in].type = "COUNTER"
ds[traffic_in].minimal_heartbeat = 600
ds[traffic_in].min = 0.0000000000e+00
ds[traffic_in].max = 1.0000000000e+08
ds[traffic_in].last_ds = "2458670191"
ds[traffic_in].value = 1.3216684767e+06
ds[traffic_in].unknown_sec = 0
ds[traffic_out].type = "COUNTER"
ds[traffic_out].minimal_heartbeat = 600
ds[traffic_out].min = 0.0000000000e+00
ds[traffic_out].max = 1.0000000000e+08
ds[traffic_out].last_ds = "2632332055"
ds[traffic_out].value = 3.2320670000e+04
ds[traffic_out].unknown_sec = 0
rra[0].cf = "AVERAGE"
etc

this one does:
filename = "../rra/snmp_alex_gw_traffic_in_1413.rrd"
rrd_version = "0001"
step = 300
last_update = 1112781001
ds[traffic_out].type = "COUNTER"
ds[traffic_out].minimal_heartbeat = 600
ds[traffic_out].min = 0.0000000000e+00
ds[traffic_out].max = 1.0000000000e+08
ds[traffic_out].last_ds = "3208794629"
ds[traffic_out].value = 1.1321493033e+06
ds[traffic_out].unknown_sec = 0
ds[traffic_in].type = "COUNTER"
ds[traffic_in].minimal_heartbeat = 600
ds[traffic_in].min = 0.0000000000e+00
ds[traffic_in].max = 1.0000000000e+08
ds[traffic_in].last_ds = "2728922162"
ds[traffic_in].value = 2.6683734300e+06
ds[traffic_in].unknown_sec = 0
rra[0].cf = "AVERAGE"
etc

any ideas?
alos, how do i change the order of traffic_in and traffic_out, if needed? i thought is is automatic...
i am not using any script to generate these. i am using cacti's built in template for cisco that other wise works to generate the graphs.

Thanks
Harel
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

RRD's show 0.

Post by mgb »

@oharel

I had the same problem that all of my connections showed 0 (black link). Solved this by creating a little script in which first cacti is run and afterward the weathermap script. This solved the problems for me. It looks like cacti locks the RRD files for some reason.

hope this helps
Michael
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

thanks mgb,

as i am using the same machine for the weathermap and for cacti, i stopped using the cacti2weather file and instead i am extracting the data right from the rrds.
i am trying to use the update.sh script that i think Howie put together to run both cacti and weathermap.

i now get things like:
FILE: /var/www/htdocs/cacti/rra/snmp_home_catbackup_traffic_in_575.rrd
LINK: Reading from RRD: /var/www/htdocs/cacti/rra/snmp_home_catbackup_traffic_in_575.rrd
RRD: /var/www/htdocs/cacti/rra/snmp_home_catbackup_traffic_in_575.rrd: 1112789400, 300
RRD: Names: traffic_in,traffic_out
RRD: Data: ARRAY(0x8347a58),ARRAY(0x8347a70)
LINK: SWITCH200_3-HEL2, Input: 0
LINK: SWITCH200_3-HEL2, Output: 0


when there should be something on that input and output...

here is the output of the rrd that is working:
filename = "/var/www/htdocs/cacti/rra/snmp_home_cataccess_traffic_in_1975.rrd"
rrd_version = "0001"
step = 300
last_update = 1112791201
ds[traffic_in].type = "COUNTER"
ds[traffic_in].minimal_heartbeat = 600
ds[traffic_in].min = 0.0000000000e+00
ds[traffic_in].max = 1.0000000000e+08
ds[traffic_in].last_ds = "1581716177"
ds[traffic_in].value = 1.6758044867e+06
ds[traffic_in].unknown_sec = 0
ds[traffic_out].type = "COUNTER"
ds[traffic_out].minimal_heartbeat = 600
ds[traffic_out].min = 0.0000000000e+00
ds[traffic_out].max = 1.0000000000e+08
ds[traffic_out].last_ds = "3144540713"
ds[traffic_out].value = 4.5290300000e+04
ds[traffic_out].unknown_sec = 0
rra[0].cf = "AVERAGE"
etc

and here is the one that is not:
filename = "/var/www/htdocs/cacti/rra/snmp_home_catbackup_traffic_in_575.rrd"
rrd_version = "0001"
step = 300
last_update = 1112789702
ds[traffic_in].type = "COUNTER"
ds[traffic_in].minimal_heartbeat = 600
ds[traffic_in].min = 0.0000000000e+00
ds[traffic_in].max = 1.0000000000e+08
ds[traffic_in].last_ds = "3452030373"
ds[traffic_in].value = 9.0763455150e+02
ds[traffic_in].unknown_sec = 0
ds[traffic_out].type = "COUNTER"
ds[traffic_out].minimal_heartbeat = 600
ds[traffic_out].min = 0.0000000000e+00
ds[traffic_out].max = 1.0000000000e+08
ds[traffic_out].last_ds = "3419441663"
ds[traffic_out].value = 6.8592922658e+06
ds[traffic_out].unknown_sec = 0
rra[0].cf = "AVERAGE"

how frustrating :-?

harel
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

oharel wrote: i now get things like:
FILE: /var/www/htdocs/cacti/rra/snmp_home_catbackup_traffic_in_575.rrd
LINK: Reading from RRD: /var/www/htdocs/cacti/rra/snmp_home_catbackup_traffic_in_575.rrd
RRD: /var/www/htdocs/cacti/rra/snmp_home_catbackup_traffic_in_575.rrd: 1112789400, 300
RRD: Names: traffic_in,traffic_out
RRD: Data: ARRAY(0x8347a58),ARRAY(0x8347a70)
LINK: SWITCH200_3-HEL2, Input: 0
LINK: SWITCH200_3-HEL2, Output: 0
You should be getting an extra RRD line at the end there, like:

Code: Select all

RRD: data to return |3525.20265780731|4199.72757475083|
I noticed that yhe timestamp on the two entries is around 5 minutes apart. Is it possible that your poller.php takes that long to run? You can see this in the SYSTEM STATS lines in the cacti logfile.

I just did a quick test with a live rrd in my own cacti install, and a retired (no longer updating) one, and I get similar results. All weathermap is doing is the same as

Code: Select all

rrdtool fetch blahblah.rrd AVERAGE --start now
If that gives NaN as the first line, then weathermap and cacti2weathermap both would too. I think this is what happens when there isn't a sample in the last 5 minutes (or very close to that).

If that is it, then it's time to look at increasing the number of poller threads, or cactid, I guess. I halved my poll time this way - very nice :-)
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

Hello,

Does anyone know if there are plans to incorporate the network map into a future release of Cacti?
predou
Posts: 45
Joined: Fri Jan 07, 2005 8:42 am

Post by predou »

Hi !

I have a problem when i try to generate the MAP .

Code: Select all

Can't locate object method "newFromPng" via package "GD::Image" at ./weathermap line 56, <CONF> line 27.
I don't understand why, cause i'have install all package and lib necessary on my Linux FEDORA.

Someone have an idea maybe ?

Thanx :)
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

@Predou

This message is generated when the weathermap program can't find the background picture. Check your spelling of the filename in the .conf file, It's case sensitive.
predou
Posts: 45
Joined: Fri Jan 07, 2005 8:42 am

Post by predou »

thx for your reply !
I checked .conf and nothing are wrong!

i have PNG weathermap-background.png in my directory and the .conf is :

Code: Select all

BACKGROUND weathermap-background.png

KEYPOS 1 520
#     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
NODE athens3
        POSITION 320 365
        LABEL ATH
NODE thessaloniki
        POSITION 262 105
        LABEL THE
LINK ath-the
        NODES   athens thessaloniki
        TARGET  /var/www/html/cacti/rra/sw_traffic.rrd
        BANDWIDTH 70656

Maybe is it a problem of lib perl ?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

predou wrote:Hi !

I have a problem when i try to generate the MAP .

Code: Select all

Can't locate object method "newFromPng" via package "GD::Image" at ./weathermap line 56, <CONF> line 27.
I don't understand why, cause i'have install all package and lib necessary on my Linux FEDORA.
That sounds like a problem with the GD perl module and the gd/gd-devel rpms. If you install GD by hand, and GD.pm by hand, then you must make sure that the parameters for the configuration match (JPEG support, PNG support etc). If you did install GD.pm by hand/CPAN and not from RPM, did the 'make test' work?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests