[mrtg] Template Use

Cornwell, Eric J. EJCORNWELL at coopertire.com
Thu Jun 19 16:11:13 MEST 2003


Hello,

	Has anyone hand any luck with the use of templates?  I'm trying to
define a threshold program and value for each interface of every router we
monitor.  When ever I tell cfgmaker to use it I get this error: "Can't find
string terminator "ECHO" anywhere before EOF at (eval 6) line 1,
<IF_TEMPLATE> line 39."

Here is the file I'm trying to use:
----------------------------------------------------------------------------
-------------------------------------------------------
 $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
 ThreshMaxO[$target_name]: 90%
 ThreshProgO[$target_name]: c:\mrtg\thresholds\sendtrap.bat
 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
----------------------------------------------------------------------------
-------------------------------------------------------
I would also like to be able to change the ThreshMax0 with a command line
option but I think much more has to be done before that will work.   If you
have any ideas please let me know!

Thanks,
Eric

--
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