hint "SET rrd_cf LAST" not working ?

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
User avatar
ArthurDent
Posts: 1
Joined: Tue Nov 25, 2014 10:18 am

hint "SET rrd_cf LAST" not working ?

Post by ArthurDent »

Hello!

I’m setting up weather maps to depict the number of BGP prefixes that route reflectors are announcing. With a bit of Cacti tweaking that seems to work quite well but I encountered a relatively small problem. I’m using version 0.97c.

The .rrd files that are generated by the XML in Cacti define “AVERAGE” for the counters:
rrd_version = "0003"
step = 300
last_update = 1416562801
header_size = 1928
ds[bgpPrefixes].index = 0
ds[bgpPrefixes].type = "GAUGE"
ds[bgpPrefixes].minimal_heartbeat = 600
ds[bgpPrefixes].min = 0.0000000000e+00
ds[bgpPrefixes].max = NaN
ds[bgpPrefixes].last_ds = "5172"
ds[bgpPrefixes].value = 6.0553258800e+03
ds[bgpPrefixes].unknown_sec = 0
rra[0].cf = "AVERAGE"

All well, but when the number of prefixes change over time, the weathermap shows an average i.e. e.g. 220.33 prefixes, which is sort of incorrect: one has either 220, either 221 prefixes.
So I changed the .rrd file so that the consolidation function is “LAST” instead:


root@host:/var/lib/cacti/rra# rrdtool info file.rrd
filename = "file.rrd"
rrd_version = "0003"
step = 300
last_update = 1416562801
header_size = 1928
ds[bgpPrefixes].index = 0
ds[bgpPrefixes].type = "GAUGE"
ds[bgpPrefixes].minimal_heartbeat = 600
ds[bgpPrefixes].min = 0.0000000000e+00
ds[bgpPrefixes].max = NaN
ds[bgpPrefixes].last_ds = "3935"
ds[bgpPrefixes].value = 4.7184939150e+03
ds[bgpPrefixes].unknown_sec = 0
rra[0].cf = "LAST"

But then the error log shows: ReadData: At least one of your DS names (bgpPrefixes
and -) were not found, even though there was a valid data line. Maybe they are wrong?

So I set the "hint" in the weathermap config file:
SET rrd_cf LAST
TARGET gauge:/var/lib/cacti/rra/file.rrd:bgpPrefixes:-

because I found in WeatherMapDataSource_rrd.php:

$cfname = intval($map->get_hint('rrd_cf'));
if($cfname=='') $cfname='AVERAGE';

But I have the impression that this “hint” is not taken, although the "rrdtool fetch" command seems to work manually:

rrdtool fetch /var/lib/cacti/rra/file.rrd AVERAGE --start now-800 --end now
ERROR: the RRD does not contain an RRA matching the chosen CF

rrdtool fetch /var/lib/cacti/rra/file.rrd LAST --start now-800 --end now
bgpPrefixes

1416495900: 3.9350000000e+03

So is there a problem with setting the hint "set rrd_cf LAST" or am I using the wrong hint/keyword?
Many thanks in adavnce for your answer (in this !=42)
cheers,
Arthur
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests