<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
-->
</style><style>
<!--
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
@font-face
        {font-family:Verdana}
@font-face
        {font-family:"Arial Narrow"}
@font-face
        {font-family:Webdings}
@font-face
        {font-family:Consolas}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-right:0cm;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New"}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {margin-right:0cm;
        margin-left:36.0pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
span.HTMLPreformattedChar
        {font-family:Consolas}
span.EmailStyle19
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" style="margin: 4px 4px 1px; font: 10pt Tahoma;" link="blue" lang="EN-NZ" vlink="purple">
<div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 13px;">
<div style="">It is hard to tell from the code you posted earlier, but isn't there a leading space added to the final ECHO line? Remove this, the ECHO should be at the start of the line with no trailing characters.<br>
<br>
Steve <br>
</div>
<div><br>
<div style="font-family: Tahoma; font-size: 13px;">
<div style="font-family: Tahoma; font-size: 13px;"><strong>Steve Shipway</strong></div>
<div style="font-family: Tahoma; font-size: 13px;">University of Auckland ITS</div>
<div style="font-family: Tahoma; font-size: 13px;"><em>UNIX Systems Design Lead</em></div>
<div style="font-family: Tahoma; font-size: 13px;"><a href="mailto:s.shipway@auckland.ac.nz">s.shipway@auckland.ac.nz</a></div>
<div style="font-family: Tahoma; font-size: 13px;">Ph: +64 9 373 7599 ext 86487</div>
<div style="font-family: Tahoma; font-size: 13px;"><em></em> </div>
</div>
</div>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF267513"><font size="2" color="#000000" face="Tahoma"><b>From:</b> mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch [mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch] on behalf of Arvon Griffiths [Arvon.Griffiths@txdot.gov]<br>
<b>Sent:</b> Wednesday, 10 November 2010 10:36 a.m.<br>
<b>To:</b> mrtg<br>
<b>Subject:</b> [mrtg] gvolk's interface-errors.template not working now...<br>
</font><br>
</div>
<div></div>
<div>
<div>When I run my script:</div>
<div> ...</div>
<div> cfgdir="/home/mrtg/cfgs-err"<br>
workdir="/home/mrtg/workdir"<br>
router="router1"<br>
cfgmaker --global "WorkDir:$workdir/" --global "LogFormat: rrdtool" --if-template=interface-errors.template '--if-filter=$default && ($if_type==30 || $if_type==32)' --output $cfgdir/$router-err.cfg
<a href="mailto:public@$router:::::2" target="_blank">public@$router:::::2</a></div>
<div> ...</div>
<div> </div>
<div>I get:</div>
<div> Evaluation of the contents in the file</div>
<div> </div>
<div> interface-errors.template<br>
gave the error</div>
<div> </div>
<div> "Can't find string terminator "<br>
ECHO" anywhere before EOF at (eval 13) line 26, <IF_TEMPLATE> line 65.<br>
"</div>
<div> </div>
<div> Exiting cfgmaker<br>
</div>
<div> </div>
<div>For every "<<ECHO;", I have a terminating ECHO... What obvious thing am I missing?</div>
<div> </div>
<div> </div>
<div>Here's the template file:</div>
<div>###############################################################################<br>
#<br>
# interface-errors.template v20030106 by <a href="mailto:gvolk@gvolk.com" target="_blank">
gvolk@gvolk.com</a><br>
#<br>
# The following is a mrtg template that can be used in conjunction with<br>
# cfgmaker for automatically building configs for monitoring interface<br>
# errors.<br>
#<br>
# Usage: cfgmaker --if-template=interface-errors.template <a href="mailto:public@router" target="_blank">
public@router</a><br>
#<br>
#<br>
# This template is available under the GNU GPL. For more information, please<br>
# see <a href="http://www.gnu.org/copyleft/gpl.html" target="_blank">http://www.gnu.org/copyleft/gpl.html</a>.<br>
#<br>
#z<br>
# Version History:<br>
# 20020806 - Initial Release<br>
# 20030106 - Added GPL Licensing Note<br>
#</div>
<div> </div>
<div>if ($if_ok) {</div>
<div> </div>
<div> my $target_name = $target_name . ".err";<br>
my $directory_name = $directory_name . "err";</div>
<div> </div>
<div> $head_lines .= <<ECHO;<br>
# Input/output errors for $target_name<br>
#---------------------------------------------------------------------<br>
ECHO</div>
<div> </div>
<div><br>
$target_lines .= <<ECHO;</div>
<div> </div>
<div> Target[$target_name]: ifInErrors.$if_index&ifOutErrors.$if_index:$router_connect * 300<br>
RouterUptime[$target_name]: $router_connect<br>
Directory[$target_name]: $directory_name<br>
YLegend[$target_name]: Error Packets<br>
ShortLegend[$target_name]: /s<br>
Legend1[$target_name]: Error Packets<br>
ShortLegend[$target_name]: /s<br>
Legend1[$target_name]: Error Packets<br>
Legend2[$target_name]:<br>
Legend3[$target_name]: Error Packets<br>
Legend4[$target_name]:<br>
LegendI[$target_name]: &nbsp;Inbound Error Packets:&nbsp;<br>
LegendO[$target_name]: &nbsp;Outbound Error Packets:&nbsp;<br>
MaxBytes[$target_name]: 1000<br>
Options[$target_name]: growright, nopercent, unknaszero<br>
Title[$target_name]: $router_name $if_ref Errors<br>
PageTop[$target_name]: <H1>$router_name $if_ref</H1><br>
<TABLE><br>
<TR><TD>System:</TD><TD>$router_name in $html_syslocation</TD></TR><br>
<TR><TD>Maintainer:</TD><TD>$html_syscontact</TD></TR><br>
<TR><TD>Description:</TD><TD> In/Out Error counters </TD></TR><br>
<TR><TD>Resource:</TD><TD>$if_ref</TD></TR><br>
</TABLE><br>
ECHO<br>
}</div>
<div> </div>
<div>#print $target_lines;</div>
<div> </div>
<div> </div>
<pre>===================
Texas Transportation Forum
www.texastransportationforum.com
</pre>
</div>
</div>
</div>
</body>
</html>