[mrtg] I lost in --if-template

Tao Yaoning yonienjcn at gmail.com
Wed Sep 28 18:27:26 MEST 2005


Hi, All
I try to use --if-tempate optoin with cfgmaker to make some cfg files that
can display more detail information about each port.
I want to give my extreme switch port 3/1 a specified title, so I write the
template file like this:

if($target_name == "192.168.0.253_3001")
{
$target_lines .=<<ECHO;
Target[$target_name]:$if_ref:public at 192.168.0.253:::::2
SetEnv[$target_name]: MRTG_INT_IP="" MRTG_INT_DESCR="BD6808/G8Ti-Port-3:1"
MaxBytes[$target_name]: 125000000
Title[$target_name]:#BlueARC ArguGate1
PageTop[$target_name]: <H1>BlueARC ArguGate1</H1>
<TABLE>
<TR><TD>System:</TD> <TD>MeteorBD in </TD></TR>
<TR><TD>Description:</TD><TD>BD6808/G8Ti-Port-3:1 </TD></TR>
<TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
<TR><TD>ifName:</TD> <TD>3/1</TD></TR>
<TR><TD>Max Speed:</TD> <TD>1000.0 Mbits/s</TD></TR>
</TABLE>
ECHO
}

I use the cfgmaker to create extreme.cfg like
../bin/cfgmaker --ifdesc=name
--output=extreme.cfg--if-template=./template/extreme.template
public at 192.168.0.253:::::2

and I got the result like
### Interface 2008 >> Descr: 'BD6808/G8Ti-Port-2:8' | Name: '2/8' | Ip: '' |
Eth: '' ###
Target[192.168.0.253_2008]:2008:public.168.0.253:::::2
SetEnv[192.168.0.253_2008]: MRTG_INT_IP=""
MRTG_INT_DESCR="BD6808/G8Ti-Port-3:1"
MaxBytes[192.168.0.253_2008]: 125000000
Title[192.168.0.253_2008]:#BlueARC ArguGate1
PageTop[192.168.0.253_2008]: <H1>BlueARC ArguGate1</H1>
<TABLE>
<TR><TD>System:</TD> <TD>MeteorBD in </TD></TR>
<TR><TD>Description:</TD><TD>BD6808/G8Ti-Port-3:1 </TD></TR>
<TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
<TR><TD>ifName:</TD> <TD>3/1</TD></TR>
<TR><TD>Max Speed:</TD> <TD>1000.0 Mbits/s</TD></TR>
</TABLE>

### Interface 3001 >> Descr: 'BD6808/G8Ti-Port-3:1' | Name: '3/1' | Ip: '' |
Eth: '' ###
Target[192.168.0.253_3001]:3001:public.168.0.253:::::2
SetEnv[192.168.0.253_3001]: MRTG_INT_IP=""
MRTG_INT_DESCR="BD6808/G8Ti-Port-3:1"
MaxBytes[192.168.0.253_3001]: 125000000
Title[192.168.0.253_3001]:#BlueARC ArguGate1
PageTop[192.168.0.253_3001]: <H1>BlueARC ArguGate1</H1>
<TABLE>
<TR><TD>System:</TD> <TD>MeteorBD in </TD></TR>
<TR><TD>Description:</TD><TD>BD6808/G8Ti-Port-3:1 </TD></TR>
<TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
<TR><TD>ifName:</TD> <TD>3/1</TD></TR>
<TR><TD>Max Speed:</TD> <TD>1000.0 Mbits/s</TD></TR>
</TABLE>

the template works on all the ports. There must be something wrong, but I
couldn't find what's wrong with my template flie.
anybody can help?

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



More information about the mrtg mailing list