1 <!--
2 - Document type definition for RRDTool
3 -
4 - This document type definition describes the current XML style used by
5 - RRDTool when dumping RRD files. It was reverse engineered by reading
6 - rrd_dump.c and should cover all the tags it uses. Use this DTD if you want
7 - the libxml2 based restore utility to catch invalid definitions and
8 - ordering of elements early on, i. e. within the XML library.
9 -
10 - This DTD is in some ways more strict than the actual restore utility: It
11 - enforces the exact ordering of tags even if the restore utility doesn't
12 - mind.
13 -
14 - Author:
15 - Florian Forster <octo at verplant.org>
16 -->
18 <!--
19 - The <param> tag
20 -
21 - The <param> tag inside a DS definition depends on the type of DS that is
22 - defined. While this DTD cannot check if the type defined matches with the
23 - tags present here, we can at least check that the tags aren't mixed
24 - wildly.
25 -->
26 <!ELEMENT delta_neg (#PCDATA)>
27 <!ELEMENT delta_pos (#PCDATA)>
28 <!ELEMENT dependent_rra_idx (#PCDATA)>
29 <!ELEMENT failure_threshold (#PCDATA)>
30 <!ELEMENT hw_alpha (#PCDATA)>
31 <!ELEMENT hw_beta (#PCDATA)>
32 <!ELEMENT seasonal_gamma (#PCDATA)>
33 <!ELEMENT seasonal_smooth_idx (#PCDATA)>
34 <!ELEMENT smoothing_window (#PCDATA)>
35 <!ELEMENT window_len (#PCDATA)>
36 <!ELEMENT xff (#PCDATA)>
38 <!ENTITY % param.hwpredict "(hw_alpha, hw_beta, dependent_rra_idx)">
39 <!ENTITY % param.seasonal "(seasonal_gamma, seasonal_smooth_idx, smoothing_window?, dependent_rra_idx)">
40 <!ENTITY % param.failures "(delta_pos, delta_neg, window_len, failure_threshold)">
41 <!ENTITY % param.devpredict "(dependent_rra_idx)">
42 <!ENTITY % param.avg_min_max "(xff)">
44 <!ELEMENT params (%param.hwpredict; | %param.seasonal; | %param.failures; | %param.devpredict; | %param.avg_min_max;)>
46 <!--
47 - The <ds> tag within a <cdp_prep> block.
48 -
49 - There are two <ds> tags: One for defining the data source itself and one
50 - describing it further in a <cdp_prep> area. The tags allowed within the
51 - <ds> tag in the <cdp_prep> area depend on the type of the DS, but we
52 - cannot verify that in the DTD. We check that the combination of tags makes
53 - some sense, though.
54 -->
55 <!ELEMENT history (#PCDATA)>
56 <!ELEMENT init_flag (#PCDATA)>
57 <!ELEMENT intercept (#PCDATA)>
58 <!ELEMENT last_intercept (#PCDATA)>
59 <!ELEMENT last_nan_count (#PCDATA)>
60 <!ELEMENT last_seasonal (#PCDATA)>
61 <!ELEMENT last_slope (#PCDATA)>
62 <!ELEMENT nan_count (#PCDATA)>
63 <!ELEMENT primary_value (#PCDATA)>
64 <!ELEMENT seasonal (#PCDATA)>
65 <!ELEMENT secondary_value (#PCDATA)>
66 <!ELEMENT slope (#PCDATA)>
67 <!ELEMENT unknown_datapoints (#PCDATA)>
68 <!ELEMENT value (#PCDATA)>
70 <!ENTITY % ds.cdp.hwpredict "(intercept, last_intercept, slope, last_slope, nan_count, last_nan_count)">
71 <!ENTITY % ds.cdp.seasonal "(seasonal, last_seasonal, init_flag)">
72 <!ENTITY % ds.cdp.failures "(history)">
73 <!ENTITY % ds.cdp.avg_min_max "(value, unknown_datapoints)">
74 <!ENTITY % ds.cdp "(primary_value, secondary_value, (%ds.cdp.hwpredict; | %ds.cdp.seasonal; | %ds.cdp.failures; | %ds.cdp.avg_min_max;)?)">
76 <!--
77 - The <ds> tag in the root <rrd> tag.
78 -
79 - This <ds> tag is different than the one above in that is defines a data
80 - source rather than it's parameters within an RRA. Yet, there is an little
81 - exception for CDEF data sources..
82 -->
83 <!ELEMENT cdef (#PCDATA)>
84 <!ELEMENT last_ds (#PCDATA)>
85 <!ELEMENT max (#PCDATA)>
86 <!ELEMENT minimal_heartbeat (#PCDATA)>
87 <!ELEMENT min (#PCDATA)>
88 <!ELEMENT name (#PCDATA)>
89 <!ELEMENT type (#PCDATA)>
90 <!ELEMENT unknown_sec (#PCDATA)>
92 <!ENTITY % ds.decl.normal "(minimal_heartbeat,min,max)">
93 <!ENTITY % ds.decl.cdef "(cdef)">
94 <!ENTITY % ds.decl "(name, type, (%ds.decl.normal; | %ds.decl.cdef;), last_ds, value, unknown_sec)">
96 <!ELEMENT ds (%ds.decl; | %ds.cdp;)>
98 <!-- The <ds> tag in <cdp_prep> differs from the one in <rrd>, but we cannot
99 check this in the DTD :/ -->
100 <!ELEMENT cdp_prep (ds+)>
102 <!-- The actual data.. -->
103 <!ELEMENT v (#PCDATA)>
104 <!ELEMENT row (v+)>
105 <!ELEMENT database (row+)>
107 <!ELEMENT cf (#PCDATA)>
108 <!ELEMENT pdp_per_row (#PCDATA)>
110 <!ELEMENT rra (cf,pdp_per_row,params,cdp_prep,database)>
112 <!ELEMENT lastupdate (#PCDATA)>
113 <!ELEMENT step (#PCDATA)>
114 <!ELEMENT version (#PCDATA)>
115 <!ELEMENT rrd (version,step,lastupdate,ds+,rra+)>