[mrtg] Anyone using --host-template

Jason Lixfeld jlixfeld at fastvibe.com
Thu Apr 18 23:14:59 MEST 2002


I'm trying to use --host-template to implement what I posted about
earlier.  I get the following error when it evaluates the template:

-----------------------------------------------------------------------
Evaluation of the contents in the file

template
gave the error

"Can't find string terminator "
ECHO" anywhere before EOF at (eval 6) line 3, <IF_TEMPLATE> line 47.
"

Exiting cfgmaker
------------------------------------------------------------------------

I'm using the code right out of the cfgmaker man page to get a feel for
it.  Line 47 is the very last line of the code, which is blank.  I'm not
very versed with perl so I don't know what is expected at line 47.

---

 if(not $problem_lines)
 {
   $target_lines .= <<ECHO;


 Target[$target_name]: $if_ref:$router_connect
 SetEnv[$target_name]: MRTG_INT_IP="$if_ip"
MRTG_INT_DESCR="$if_snmp_descr"
 ECHO

   if ($directory_name) {
       $target_lines .= "Directory[$target_name]: $directory_name\n";
   }

   $target_lines .= <<ECHO;
 MaxBytes[$target_name]: $if_speed
 Title[$target_name]: $html_desc_prefix$html_if_title_desc -- $sysname
 PageTop[$target_name]: <H1>$html_desc_prefix$html_if_title_desc --
$sysname</H1>
  <TABLE>
    <TR><TD>System:</TD>     <TD>$sysname in $html_syslocation</TD></TR>
    <TR><TD>Maintainer:</TD> <TD>$html_syscontact</TD></TR>
    <TR><TD>Description:</TD><TD>$html_if_description</TD></TR>
    <TR><TD>ifType:</TD>     <TD>$html_if_type_desc
($if_type_num)</TD></TR>
    <TR><TD>ifName:</TD>     <TD>$html_if_snmp_name</TD></TR>
 ECHO

   $target_lines .= <<ECHO if defined $if_port_name;
    <TR><TD>Port Name:</TD>  <TD>$if_port_name</TD></TR>
 ECHO

   $target_lines .= <<ECHO;
    <TR><TD>Max Speed:</TD>  <TD>$if_speed_str</TD></TR>
 ECHO

   $target_lines .= <<ECHO if $if_ip;
    <TR><TD>Ip:</TD>         <TD>$if_ip ($if_dns_name)</TD></TR>
 ECHO

   $target_lines .= <<ECHO;
  </TABLE>
 ECHO
 } else {
   $head_lines="";
   $problem_lines="";
   $target_lines="";
   $separator_lines="";
 }
**THIS IS LINE 47**
---

Any help would be appreciated!



--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list