[rrd-developers] No ordering information in info hash

Tobias Oetiker tobi at oetiker.ch
Tue Oct 27 21:43:40 CET 2009


Hi Hermann,

there was an extension recently added a ds[x].index entry which
will help you resolve this problem ...

make sure you use a current snapshot of the archive ...

cheers
tobi


 Today Hermann Lauer wrote:

> Hello all,
>
> I noticed that in the python bindings of rrdtool-1.3.99909060808
> the rrdtool.info() function the datasources in the flat hash dict returned
> are partly indexed with the datasource name and partly indexed with numbers
> (see example below). Besides beeing somehow inconsistent a problem arises:
>
> How to find out the ordering of datasources to
> find the datasource name for the rra[].cdp_prep[] values (or for
> using rrdtool.update('N:...:...:...')) without knowing the order
> of the datasources.
>
> How is this handled in other bindings (e.g. perl) ?
>
> Please tell me if I missed something obvious,
>   greetings
>    Hermann
>
>
> >>> import rrdtool
> >>> rrdtool.__version__
> '$Revision: 1.14 $'
> >>> rrdtool.create('/tmp/test.rrd','--step','20','DS:ds2:GAUGE:300:0:100','DS:x1:GAUGE:300:0:100','DS:ds0:GAUGE:300:-5:100','RRA:AVERAGE:0.5:3:2')
> >>> rrdtool.info('/tmp/test.rrd')
> {'rra[0].cdp_prep[0].value': None, 'ds[ds2].min': 0.0, 'ds[ds0].min': -5.0, 'rra[0].cdp_prep[1].unknown_datapoints': 1L, 'ds[ds2].value': 0.0, 'ds[ds2].last_ds': 'U', 'ds[x1].max': 100.0, 'ds[ds2].unknown_sec': 5L, 'ds[ds0].value': 0.0, 'ds[ds0].unknown_sec': 5L, 'ds[ds0].max': 100.0, 'ds[ds2].max': 100.0, 'rrd_version': '0003', 'filename': '/tmp/test.rrd', 'last_update': 1256646805L, 'rra[0].cf': 'AVERAGE', 'ds[x1].type': 'GAUGE', 'rra[0].pdp_per_row': 3L, 'rra[0].cur_row': 1L, 'header_size': 1172L, 'ds[ds0].last_ds': 'U', 'step': 20L, 'rra[0].cdp_prep[0].unknown_datapoints': 1L, 'ds[ds0].type': 'GAUGE', 'rra[0].cdp_prep[2].value': None, 'ds[x1].last_ds': 'U', 'ds[ds2].minimal_heartbeat': 300L, 'rra[0].rows': 2L, 'ds[x1].min': 0.0, 'ds[ds0].minimal_heartbeat': 300L, 'ds[x1].unknown_sec': 5L, 'rra[0].xff': 0.5, 'rra[0].cdp_prep[2].unknown_datapoints': 1L, 'ds[ds2].type': 'GAUGE', 'rra[0].cdp_prep[1].value': None, 'ds[x1].value': 0.0, 'ds[x1].minimal_heartbeat': 300L}
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-developers mailing list