[rrd-developers] Import a RRD XML file

Benny Baumann BenBE at geshi.org
Sun Feb 6 23:25:09 CET 2011


Hi,

Am 27.07.2010 15:50, schrieb Thodie:
> Hi experts!
>
> I'm an ABAP developer and my job is to import (parse) a XML file which is
> generated by the RRDTool (and Nagios). See parts of the XML-file below. 
> In my mind the XML-file looks a little bit strange. Especially that the date
> and time are added as comment and not as tag. Also the values are displayed
> exponential ("1.7500000000e+02 ") without any reason. I don't know the
> RRDTool and Nagios. What is here the problem? The RRDTool or Nagios? Is
> there an option to optimize the XML?
The comments in the file result only from conversion or calculation of
values derived from the internal storage format or values actually
printed. In short this means that given the date of the last
modification RRDTool can calculate itself which node belongs to which
timeslot in the file, thus this information is not required to read and
process the actual information.

Yes, that's not the best way to do XML, but as the XML dumps are mostly
used for backup purposes this is sufficient.
> Kind regards 
> Thodie 
Regards,
BenBE.

P.S.: You can stream in the XML information directly from librrd using a
callback function since version 1.4. This should make it easier to use
RRDTool without dumping everything to the filesystem first since those
XML dumps can get quite large.
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
> <!-- Round Robin Database Dump --><rrd>	<version> 0003 </version>
> 	<step> 60 </step> <!-- Seconds -->
> 	<lastupdate> 1279184004 </lastupdate> <!-- 2010-07-15 10:53:24 CEST -->
>
> 	<ds>
> 		<name> 1 </name>
> 		<type> GAUGE </type>
> 		<minimal_heartbeat> 8640 </minimal_heartbeat>
> 		<min> NaN </min>
> 		<max> NaN </max>
>
> 		<!-- PDP Status -->
> 		<last_ds> 175 </last_ds>
> 		<value> 4.2000000000e+03 </value>
> 		<unknown_sec> 0 </unknown_sec>
> 	</ds>
>
> <!-- Round Robin Archives -->	<rra>
> 		<cf> AVERAGE </cf>
> 		<pdp_per_row> 1 </pdp_per_row> <!-- 60 seconds -->
>
> 		<params>
> 		<xff> 5.0000000000e-01 </xff>
> 		</params>
> 		<cdp_prep>
> 			<ds>
> 			<primary_value> 1.7500000000e+02 </primary_value>
> 			<secondary_value> 1.7500000000e+02 </secondary_value>
> 			<value> NaN </value>
> 			<unknown_datapoints> 0 </unknown_datapoints>
> 			</ds>
> 		</cdp_prep>
> 		<database>
> 			<!-- 2010-07-13 10:54:00 CEST / 1279011240 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 10:55:00 CEST / 1279011300 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 10:56:00 CEST / 1279011360 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 10:57:00 CEST / 1279011420 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 10:58:00 CEST / 1279011480 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 10:59:00 CEST / 1279011540 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 11:00:00 CEST / 1279011600 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 11:01:00 CEST / 1279011660 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 11:02:00 CEST / 1279011720 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 11:03:00 CEST / 1279011780 --> <row><v> 1.6196000000e+02
> </v></row>
> 			<!-- 2010-07-13 11:04:00 CEST / 1279011840 --> <row><v> 1.6597333333e+02
> </v></row>
> 			<!-- 2010-07-13 11:05:00 CEST / 1279011900 --> <row><v> 1.6597333333e+02
> </v></row>
> 			<!-- 2010-07-13 11:06:00 CEST / 1279011960 --> <row><v> 1.6597333333e+02
> </v></row>
> 			<!-- 2010-07-13 11:07:00 CEST / 1279012020 --> <row><v> 1.6597333333e+02
> </v></row>
> 			<!-- 2010-07-13 11:08:00 CEST / 1279012080 --> <row><v> 1.6597333333e+02
> </v></row>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20110206/1f2a902d/attachment-0001.pgp 


More information about the rrd-developers mailing list