|
Script required to get a required info from file. Pls. help me.
Hi All,
I have Information in the file like,
============ Interface Information ====================
+++++++++++++++++ NMInterface ++++++++++++++
ObjID:251c55a2-2257-71dd-0f68-9887a1f10000
NNMObjID:82857
EntityName:aust00m1.mis.amat.com[ 0 [ 161 ] ]
Description:ATM9/0/0-atm layer
Discovered in Zone:0
EntityType:Interface
IPLevel:4
OverallStatus:NotMon
OADId:0
StatusChangeTime:0
CreateTime:1210839357
ChangeTime:1210839357
Containment Parent:aust00m1.mis.amat.com(1d5ebb70-2257-71dd-0f68-9887a1f10000)
==========Interface Property===============
VPI:0
VCI:0
BoardNo:-
PortNum:0
AuxPortNum:0
IfIndex:161
IfName:AT9/0/0
IfAlias:-
IfType:37
PhysicalAddress:-
L2DomainID:-1
IfOperStatus:2
IfAdminStatus:2
VlanPortType:2001689792
isDiscoContrivedIF:0
IfSpeed:0
IF Capability :
Requirement:
Whenever the string matches "+++++++++++++++++ NMInterface ++++++++++++++" then It should print the following informations.
EntityName:
OverallStatus:
IfName:
Example result:
EntityName:aust00m1.mis.amat.com[ 0 [ 161 ] ]
OverallStatus:NotMon
IfName:AT9/0/0
Note: File contains mutiple records. The above example is one record.
If the string match again it should do the same operation.
I attached example file in this thread. Pls. provide me a script for this requirement.
Thanks,
Gobinathan.S
|