<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">if rrdrestore finds a error it spits out an error similar to&nbsp;<div><br></div><div><div><div style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-family: Helvetica; font-size: medium; ">ERROR: line 210: expected &lt;ds&gt; element but found &lt;/cdp_prep&gt;</span></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Which is annoying because line 210 isn't the line number in the file, but the xml parser line number.</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Anyway I found this script useful to finding the incorrect element.</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div><div><font face="Lucida Grande"><span style="font-size: 10px;">use XML::LibXML;</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">my $parser = XML::LibXML-&gt;new( line_numbers =&gt; 1 );</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">my $xml = $parser-&gt;load_xml( location =&gt; '&lt;filename&gt;' );</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">foreach my $nodes ( $xml-&gt;childNodes ) {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; hasChild($nodes);</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">}</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">sub hasChild {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; my $nodes = shift;</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; if ( $nodes-&gt;hasChildNodes() ) {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; &nbsp; &nbsp; foreach my $node ( $nodes-&gt;childNodes ) {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $line &nbsp; &nbsp;= $node-&gt;line_number();</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $nodeStr = $node-&gt;nodeName();</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $nodeval = $node-&gt;to_literal();</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print "line $line :: $nodeStr :: $nodeval\n";</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hasChild($node);</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; &nbsp; &nbsp; }</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">&nbsp; &nbsp; }</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">}</span></font></div></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">I'm sure someone could write a much better script, but here is my solution.</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">Sean</span></font></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">=======================================</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Sean Whitney</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">PMB #120,&nbsp;16505A SE First Street<br>Vancouver, WA&nbsp; 98684</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">T. 360.326.2740&nbsp;</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">C. 360.607.7945</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">F. 815.364.0687</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">aim: seanmwhitney</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">email:&nbsp;<a href="mailto:sean@visionary-networks.com">sean@visionary-networks.com</a></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">skype: sean_whitney</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">=======================================</div></div></div>
</div>
<br></div></body></html>