Hi people.. I have a config file containing MRTG interfaces configuration. There are many of blocks of text like the block below:
### Interface 13 >> Descr: 'Ethernet2/3' | Name: 'Et2/3' | Ip: '10.16.5.250' | Eth: '00-60-83-7f-53-43' ###
Target[loopgersp_13]: 13:xptoandr2d2@loopgersp
SetEnv[loopgersp_13]: MRTG_INT_IP="10.16.5.250" MRTG_INT_DESCR="Ethernet2/3"
MaxBytes[loopgersp_13]: 1250000
Title[loopgersp_13]: Traffic Analysis for 13 -- DRSPMV01
PageTop[loopgersp_13]: <H1>Traffic Analysis for 13 -- DRSPMV01</H1>
<TABLE>
<TR><TD>System:</TD> <TD>DRSPMV01 in Jupiter, ESSP.P</TD></TR>
<TR><TD>Maintainer:</TD> <TD>ciscoworks@jupiter.com.br 55-21-555-6969</TD></TR>
<TR><TD>Description:</TD><TD>LINK TO DOWNTOWN OFFICE</TD></TR>
<TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
<TR><TD>ifName:</TD> <TD>Et2/3</TD></TR>
<TR><TD>Max Speed:</TD> <TD>10.0 Mbits/s</TD></TR>
<TR><TD>Ip:</TD> <TD>10.16.5.250 ()</TD></TR>
</TABLE>
I would like to make a script capable to capture de number of Interface on the first lines of the blocks, and the descrition of the interfaces on the "Descrition" line, put it in columns and save on another text file, that I could read with Excel or Open Office, something like below:
13 ; Ethernet2/3 ; LINK TO DOWNTOWN OFFICE
14 ; Ethernet2/4 ; LINK TO COPACABANA OFFICE
15 ; Serial 2/0 ; LINK TO SAO PAULO
and so on...
Help welcome...
Thanks
Davi