Bingo Steve! Yep, it was the TABs that I added (in interface-errors.template) to make it more readable. Thnx!
>>> Steve Shipway <[email protected]> 11/9/2010 5:22 PM >>> 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. Steve Steve Shipway University of Auckland ITS UNIX Systems Design Lead [email protected] Ph: +64 9 373 7599 ext 86487 From: [email protected] [[email protected]] on behalf of Arvon Griffiths [[email protected]] Sent: Wednesday, 10 November 2010 10:36 a.m. To: mrtg Subject: [mrtg] gvolk's interface-errors.template not working now... When I run my script: ... cfgdir="/home/mrtg/cfgs-err" workdir="/home/mrtg/workdir" router="router1" 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 pub...@$router:::::2 ... I get: Evaluation of the contents in the file interface-errors.template gave the error "Can't find string terminator " ECHO" anywhere before EOF at (eval 13) line 26, <IF_TEMPLATE> line 65. " Exiting cfgmaker For every "<<ECHO;", I have a terminating ECHO... What obvious thing am I missing? Here's the template file: ############################################################################### # # interface-errors.template v20030106 by [email protected] # # The following is a mrtg template that can be used in conjunction with # cfgmaker for automatically building configs for monitoring interface # errors. # # Usage: cfgmaker --if-template=interface-errors.template pub...@router # # # This template is available under the GNU GPL. For more information, please # see http://www.gnu.org/copyleft/gpl.html. # #z # Version History: # 20020806 - Initial Release # 20030106 - Added GPL Licensing Note # if ($if_ok) { my $target_name = $target_name . ".err"; my $directory_name = $directory_name . "err"; $head_lines .= <<ECHO; # Input/output errors for $target_name #--------------------------------------------------------------------- ECHO $target_lines .= <<ECHO; Target[$target_name]: ifInErrors.$if_index&ifOutErrors.$if_index:$router_connect * 300 RouterUptime[$target_name]: $router_connect Directory[$target_name]: $directory_name YLegend[$target_name]: Error Packets ShortLegend[$target_name]: /s Legend1[$target_name]: Error Packets ShortLegend[$target_name]: /s Legend1[$target_name]: Error Packets Legend2[$target_name]: Legend3[$target_name]: Error Packets Legend4[$target_name]: LegendI[$target_name]: Inbound Error Packets: LegendO[$target_name]: Outbound Error Packets: MaxBytes[$target_name]: 1000 Options[$target_name]: growright, nopercent, unknaszero Title[$target_name]: $router_name $if_ref Errors PageTop[$target_name]: <H1>$router_name $if_ref</H1> <TABLE> <TR><TD>System:</TD><TD>$router_name in $html_syslocation</TD></TR> <TR><TD>Maintainer:</TD><TD>$html_syscontact</TD></TR> <TR><TD>Description:</TD><TD> In/Out Error counters </TD></TR> <TR><TD>Resource:</TD><TD>$if_ref</TD></TR> </TABLE> ECHO } #print $target_lines; =================== Texas Transportation Forum www.texastransportationforum.com =================== Texas Transportation Forum www.texastransportationforum.com
_______________________________________________ mrtg mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
