Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming my capture files

Status
Not open for further replies.

bittergourd

Technical User
Aug 12, 2003
2
SG
Hi, I am writing a simple script that logs into a machine one after another to collect logs. Each machine has an IP address and a associated machine name (eg. 100.2.33.4, Machine1). The script written so far allows me to perform the login action, but I would like to automatically name each captured file with the machine name. Please advise on how I can modify the script. See below for what I have done so far. For simplicity, only 2 machines are shown below.

proc main
integer counter
string IPaddArray[2]

IPaddArray[0]= "100.3.95.5"
IPaddArray[1]= "100.3.95.9"

for counter = 0 upto 1

capture on

transmit "telnet "
transmit IPaddArray[counter]
waitfor "Login:"
transmit "myloginID"
waitfor "Password:"
transmit "mypassword"
waitfor "->"
transmit "logdump^M"
waitfor "->"
transmit "logout"

capture off

endfor
endproc


Also, what would be the best way to do it if I intend to use a separate file for the connection directory (of IPadds and names) and have this script call for it?

Thanks in advance for your help!

 
You can use the set capture file command to set the filename (only!) of the capture file. The format is set capture file "filename", where filename is either a hard-coded string or a string variable. If you want to choose a path different from the default capture path, then you would also need to use the set capture path command.

If you are using a Connection Directory, you could get the name of the entry that made this connection from the $DIALCONNECT system variable.

aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top