G
guser
I have a set of files that get generated from a login script that I
need to integrate into our database.
The format in each file is like this
Machine:blah
User:foo
Domain:foo.bar
SN:nnnnnnn
Asset:nnnnnnnnnnnnn
OS:blah
SP:blah
Windows IP Configuration
Host Name . . . . . . . . . . . . : blah
Primary Dns Suffix . . . . . . . : foo.bar
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : foo.bar
foo.bar
foo.bar
Ethernet adapter Wireless Network Connection:
Media State . . . . . . . . . . . : Media disconnected
Description . . . . . . . . . . . : blah
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : blah
Description . . . . . . . . . . . : blah Gigabit Integrated
Controller
Physical Address. . . . . . . . . : mac
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : n.n.n.n
Subnet Mask . . . . . . . . . . . : n.n.n.n
Default Gateway . . . . . . . . . : n.n.n.n
DHCP Server . . . . . . . . . . . : n.n.n.n
DNS Servers . . . . . . . . . . . : n.n.n.n
n.n.n.n
Primary WINS Server . . . . . . . : n.n.n.n
Secondary WINS Server . . . . . . : n.n.n.n
n.n.n.n
Lease Obtained. . . . . . . . . . : Tuesday, June 27, 2006
7:05:51 AM
Lease Expires . . . . . . . . . . : Wednesday, June 28, 2006
7:05:51 AM
Ethernet adapter Network Connect Adapter:
Description . . . . . . . . . . . : blah Virtual Adapter
Physical Address. . . . . . . . . : mac
Here is the logic I am trying to convert to code:
while (<FILE>)
do until $_ =~ /Windows IP Configuration/
get Machine:blah
User:foo
Domain:foo.bar
SN:nnnnnnn
Asset:nnnnnnnnnnnnn
OS:blah
SP:blah
}
do until $_ =~ /Ethernet adapter/
get Host Name . . . . . . . . . . . . : blah
Primary Dns Suffix . . . . . . . : foo.bar
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : foo.bar
foo.bar
foo.bar
#at this point i need some help as I have N interface chunks to loop
through before reaching the end of file.
any suggestions?
thanks.
need to integrate into our database.
The format in each file is like this
Machine:blah
User:foo
Domain:foo.bar
SN:nnnnnnn
Asset:nnnnnnnnnnnnn
OS:blah
SP:blah
Windows IP Configuration
Host Name . . . . . . . . . . . . : blah
Primary Dns Suffix . . . . . . . : foo.bar
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : foo.bar
foo.bar
foo.bar
Ethernet adapter Wireless Network Connection:
Media State . . . . . . . . . . . : Media disconnected
Description . . . . . . . . . . . : blah
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : blah
Description . . . . . . . . . . . : blah Gigabit Integrated
Controller
Physical Address. . . . . . . . . : mac
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : n.n.n.n
Subnet Mask . . . . . . . . . . . : n.n.n.n
Default Gateway . . . . . . . . . : n.n.n.n
DHCP Server . . . . . . . . . . . : n.n.n.n
DNS Servers . . . . . . . . . . . : n.n.n.n
n.n.n.n
Primary WINS Server . . . . . . . : n.n.n.n
Secondary WINS Server . . . . . . : n.n.n.n
n.n.n.n
Lease Obtained. . . . . . . . . . : Tuesday, June 27, 2006
7:05:51 AM
Lease Expires . . . . . . . . . . : Wednesday, June 28, 2006
7:05:51 AM
Ethernet adapter Network Connect Adapter:
Description . . . . . . . . . . . : blah Virtual Adapter
Physical Address. . . . . . . . . : mac
Here is the logic I am trying to convert to code:
while (<FILE>)
do until $_ =~ /Windows IP Configuration/
get Machine:blah
User:foo
Domain:foo.bar
SN:nnnnnnn
Asset:nnnnnnnnnnnnn
OS:blah
SP:blah
}
do until $_ =~ /Ethernet adapter/
get Host Name . . . . . . . . . . . . : blah
Primary Dns Suffix . . . . . . . : foo.bar
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : foo.bar
foo.bar
foo.bar
#at this point i need some help as I have N interface chunks to loop
through before reaching the end of file.
any suggestions?
thanks.