[rrd-users] Python rrd.info() interface wrong?

Tobias Oetiker tobi at oetiker.ch
Sat Apr 3 00:58:37 CEST 2010


Hi Gregory,

Yesterday Gregory Guthrie wrote:

> Using the python rrd interface I find that the info() call syntax is different than the documentation.
>
> Documentation says:
>      info = rrdtool.info('downloads.rrd')
>      print info['last_update']
>      print info['ds']['downloads']['minimal_heartbeat']
>
> But I find that I have to use string literals to index instead: (for my example)
>     Print info['ds[downloads].last_ds']
>
> Here is a direct print of the info object:  (shortened..)
> {'rra[8].rows': 600L, 'rra[7].pdp_per_row': 288L,
>  ... 'filename': '/usr/local/database/temp.rrd',
>  ... 'last_update': 1270213204L,
>  ... 'ds[temp].last_ds': '42',
>  ... 'ds[temp].minimal_heartbeat': 172800L,
>  ... 'ds[temp].value': 1965784.529142, ...}
>
> I'm expert in neither Python nor RRD, so may be missing something!

the documentation is wrong, or rather it is wrong now, it was
corect for version 1.2.x (although there the python bindings were a
bit shaky) ... in any event, info simply returns keys into a single
hash, there is some structure to the keys, but it is not
guaranteed to be representable by a hash of hashes and the original
author of the python info interface thought ...

cheers
tobi


> -------------------------------------------
> Gregory Guthrie
> -------------------------------------------
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>

-- 
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-users mailing list