Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Weathermap data from external RRD

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
robgolding63



Joined: 05 Apr 2008
Posts: 16

PostPosted: Mon Apr 07, 2008 9:47 am    Post subject: Weathermap data from external RRD Reply with quote

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:

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:

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:

<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:

<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>
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2061
Location: United Kingdom

PostPosted: Mon Apr 07, 2008 10:04 am    Post subject: Reply with quote

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)?
Back to top
robgolding63



Joined: 05 Apr 2008
Posts: 16

PostPosted: Mon Apr 07, 2008 10:19 am    Post subject: Reply with quote

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:

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2061
Location: United Kingdom

PostPosted: Mon Apr 07, 2008 10:44 am    Post subject: Reply with quote

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...

Quote:

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
Back to top
robgolding63



Joined: 05 Apr 2008
Posts: 16

PostPosted: Mon Apr 07, 2008 11:06 am    Post subject: Reply with quote

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!

Thanks again,

Rob
Back to top
xtremebassist



Joined: 17 Feb 2007
Posts: 4

PostPosted: Tue Jul 15, 2008 12:39 am    Post subject: IPCop2Cacti Reply with quote

Check out this post
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group