Weathermap data from external RRD

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
robgolding63
Posts: 18
Joined: Sat Apr 05, 2008 8:58 am

Weathermap data from external RRD

Post by robgolding63 »

Hi,
I have a simple weathermap for my network, which at present only contains 2 servers and a switch. The info for the 2 servers is working fine (traffic in and out). I am trying to add information for my internet connection, which is shared via IPCop. The IPCop machine does not have SNMP, and it would seem it is impossible to add this feature.

It does, however, monitor itself - publishing RRD files ready for it to make graphs locally. I have copied an RRD file, which should contain data about the traffic on my internet connection, and told weathermap to use this as the TARGET for the link representing the internet.

However, I receive this error:

Code: Select all

04/07/2008 03:44:07 PM - WEATHERMAP: Poller[0] [Map 1] simple.conf: ReadData: LINK IPCOP-VM, target: /var/www/html/cacti/rra/RED.rrd:incoming:outgoing on config line 78 had no valid data, according to WeatherMapDataSource_rrd
So, trying an RRDTOOL command myself, this is returned:

Code: Select all

rrdtool fetch RED.rrd AVERAGE --start now-800 --end now
                       incoming            outgoing

1207596600: nan nan
1207596900: nan nan
1207597200: nan nan
1207597500: nan nan
The DS names for this RRD file are incoming and outgoing, which are specified in the weathermap config, but obviously the data being returned is NaN, and I don't know why. These are valid RRD files, as graphs are being created from them on the IPCop machine itself.

Can anyone offer a potential solution? I'd be happy to provide any more details if needed.

Thanks a lot,

Rob

P.S.

I have dumped the contents of the RRD files, one from my server (working) and one from the IPCop (not working). Here is the incoming DS from each, for comparison:

Server:

Code: Select all

<ds>
<name> traffic_in </name>
<type> COUNTER </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+09 </max>
<!-- PDP Status -->
<last_ds> 3910382835 </last_ds>
<value> 2.4437833610e+05 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
IPCop:

Code: Select all

<ds>
<name> incoming </name>
<type> ABSOLUTE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.2500000000e+07 </max>
<!-- PDP Status -->
<last_ds> UNKN </last_ds>
<value> 7.9371739130e+03 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Did you do all that within 800 seconds of copying the file? (weathermap only asks for data from the last 15 minutes or so).

What you're doing in weathermap looks correct to me, and it seems that the error you are getting is indeed true, so I guess it's more of an rrd issue. Your XML dump is also showing the last_ds as UKN. Does it show that on the ipcop server too (vs the copy I mean)?
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!)
robgolding63
Posts: 18
Joined: Sat Apr 05, 2008 8:58 am

Post by robgolding63 »

Yep this is all within 200 seconds, I checked that :). The fact is that 3 rows are being returned by rrdtool when I fetch the data, so there is something there - but the values are all NaN.

Unfortunately the IPCop machine is an extremely minimal linux installation, and doesn't have rrdtool ready for me to use at the command line. The function to create the rrd files is as follows:

Code: Select all

sub updateifdata {
	my $interface = $_[0];

	if ( ! -e "$rrdlog/$interface.rrd") {
		RRDs::create ("$rrdlog/$interface.rrd", "--step=300",
			"DS:incoming:ABSOLUTE:600:0:12500000",
			"DS:outgoing:ABSOLUTE:600:0:12500000",
			"RRA:AVERAGE:0.5:1:576",
			"RRA:AVERAGE:0.5:6:672",
			"RRA:AVERAGE:0.5:24:732",
			"RRA:AVERAGE:0.5:144:1460");
		$ERROR = RRDs::error;
		print "Error in RRD::create for $interface: $ERROR\n" if $ERROR;
	}

	my $traffic = gettraffic ($interface);
	RRDs::update ("$rrdlog/$interface.rrd",
		"-t", "incoming:outgoing", 
		"N:$traffic");
	$ERROR = RRDs::error;
	print "Error in RRD::update for $interface: $ERROR\n" if $ERROR;
}
I don't really know how it works, but I get command not found when trying to run rrdtool from the command line, so they're using it differently obviously. Anyway, maybe something from that function can be of use to you to help fix the issue.

Thanks a lot for the fast reply,

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

Post by Howie »

robgolding63 wrote:Yep this is all within 200 seconds, I checked that :). The fact is that 3 rows are being returned by rrdtool when I fetch the data, so there is something there - but the values are all NaN.
I'm pretty sure rrdtool will give you that even with a brand new file...
I don't really know how it works, but I get command not found when trying to run rrdtool from the command line, so they're using it differently obviously. Anyway, maybe something from that function can be of use to you to help fix the issue.
That's using the RRD perl bindings to do all it's work. makegraph does the same (just did some research on ipcop :-) ). Does the timestamp on the rrd file update then?

On another angle, how's your italian? here's an article about installing SNMP on ipcop :-)
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!)
robgolding63
Posts: 18
Joined: Sat Apr 05, 2008 8:58 am

Post by robgolding63 »

Okay, I had looked around for SNMP installation on IPCop but found nothing - so your searching skills must be far better than mine :).

Anyway, I think I've found a much more elegant way to achieve this. I was under the impression that my switch would not report traffic on it's interfaces (I was getting all zero's), but the graphs have literally just started populating!

So, I can use the port that the firewall is plugged into to report the internet utilization. I've configured it and it seems to be working perfectly.

Thanks a lot for your hard work and research, this is a brilliant program and you create a lively community! :D

Thanks again,

Rob
User avatar
xtremebassist
Posts: 7
Joined: Sat Feb 17, 2007 2:42 pm
Contact:

IPCop2Cacti

Post by xtremebassist »

Check out this post
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests