[mrtg] FW: Anyone using --host-template

Jason Lixfeld jlixfeld at fastvibe.com
Mon Apr 22 22:37:08 MEST 2002


Hi again, List.

	I still haven't been able to iron out this --host-template=
problem I'm having.  I'd be very greatful for any help anyone can
provide.


Anxiously awaiting...

-----Original Message-----
From: Jason Lixfeld [mailto:jlixfeld at fastvibe.com] 
Sent: April 19, 2002 8:19 AM
To: 'mrtg at list.ee.ethz.ch'
Subject: RE: [mrtg] Anyone using --host-template


Hi List,

	The solution to this problem was to remove the whitespaces
before ECHO.  For some reason they cause problems (Thank you, Gabrielle
Roth).

Now then, after I clear up all the white spaces, I get this error.
Again, it refers to the very last line of the script which is just a
blank line.  I think it's complaining about variables that are set in
cfgmaker that aren't being exported into this template:  (Again, the
host-template I'm trying to run is included below.  I've corrected the
typos that Gabrielle  Roth found and those changes are reflected in the
cut and paste below.

"Global symbol "$target_name" requires explicit package name at (eval 6)
line 3, <IF_TEMPLATE> line 48. Global symbol "$if_ref" requires explicit
package name at (eval 6) line 3, <IF_TEMPLATE> line 48. 
Global symbol "$target_name" requires explicit package name at (eval 6)
line 3, <IF_TEMPLATE> line 48. 
Global symbol "$if_ip" requires explicit package name at (eval 6) line
3, <IF_TEMPLATE> line 48. 
Global symbol "$if_snmp_descr" requires explicit package name at (eval
6) line 3, <IF_TEMPLATE> line 48. 
Global symbol "$directory_name" requires explicit package name at (eval
6) line 10, <IF_TEMPLATE> line 48. 
Global symbol "$target_name" requires explicit package name at (eval 6)
line 11, <IF_TEMPLATE> line 48. 
Global symbol "$directory_name" requires explicit package name at (eval
6) line 11, <IF_TEMPLATE> line 48. 
Global symbol "$target_name" requires explicit package name at (eval 6)
line 14, <IF_TEMPLATE> line 48. 
Global symbol "$if_speed" requires explicit package name at (eval 6)
line 14, <IF_TEMPLATE> line 48. 
Global symbol "$target_name" requires explicit package name at (eval 6)
line 14, <IF_TEMPLATE> line 48. 
Global symbol "$html_desc_prefix" requires explicit package name at
(eval 6) line 14, <IF_TEMPLATE> line 48. 
Global symbol "$html_if_title_desc" requires explicit package name at
(eval 6) line 14, <IF_TEMPLATE> line 48. 
Global symbol "$target_name" requires explicit package name at (eval 6)
line 14, <IF_TEMPLATE> line 48. 
Global symbol "$html_desc_prefix" requires explicit package name at
(eval 6) line 14, <IF_TEMPLATE> line 48. 
Global symbol "$html_if_title_desc" requires explicit package name at
(eval 6) line 14, <IF_TEMPLATE> line 48. 
Global symbol "$html_if_description" requires explicit package name at
(eval 6) line 14, <IF_TEMPLATE> line 48. 
Global symbol "$html_if_type_desc" requires explicit package name at
(eval 6) line 14, <IF_TEMPLATE> line 48. 
Global symbol "$if_type_num" requires explicit package name at (eval 6)
line 14, <IF_TEMPLATE> line 48. 
Global symbol "$html_if_snmp_name" requires explicit package name at
(eval 6) line 14, <IF_TEMPLATE> line 48. 
Global symbol "$if_port_name" requires explicit package name at (eval 6)
line 26, <IF_TEMPLATE> line 48. 
Global symbol "$if_port_name" requires explicit package name at (eval 6)
line 28, <IF_TEMPLATE> line 48. 
Global symbol "$if_speed_str" requires explicit package name at (eval 6)
line 30, <IF_TEMPLATE> line 48. Global symbol "$if_ip" requires explicit
package name at (eval 6) line 34, <IF_TEMPLATE> line 48. 
Global symbol "$if_dns_name" requires explicit package name at (eval 6)
line 34, <IF_TEMPLATE> line 48. 
Global symbol "$if_ip" requires explicit package name at (eval 6) line
36, <IF_TEMPLATE> line 48. "


-----Original Message-----
From: mrtg-bounce at list.ee.ethz.ch [mailto:mrtg-bounce at list.ee.ethz.ch]
On Behalf Of Jason Lixfeld
Sent: April 18, 2002 5:15 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] Anyone using --host-template



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="";
}


---

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




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