View Single Post
  #5  
Old 03-24-2020, 04:00 PM
aqelmo aqelmo is offline
Registered User
 
Join Date: Mar 2020
Posts: 6
Hi.

I'm initially connected to the management system (jump host?) and then within the same session connect, issue commands and disconnect from managed nodes.
If I record the session as a script it looks like this:

Code:
Sub Main
	crt.Screen.Send "amos 0001" & chr(13)
	crt.Screen.WaitForString "[0m> "
	crt.Screen.Send "al" & chr(13)
	crt.Screen.WaitForString "[0m> "
	crt.Screen.Send "q" & chr(13)
crt.Screen.WaitForString chr(126) & "]$ "
	crt.Screen.Send "amos 0002" & chr(13)
	crt.Screen.WaitForString "[0m> "
	crt.Screen.Send "al" & chr(13)
	crt.Screen.WaitForString "[0m> "
	crt.Screen.Send "q" & chr(13)
crt.Screen.WaitForString chr(126) & "]$ "
	crt.Screen.Send "amos 0003" & chr(13)
	crt.Screen.WaitForString "[0m> "
	crt.Screen.Send "al" & chr(13)
	crt.Screen.WaitForString "[0m> "
	crt.Screen.Send "q" & chr(13)
End Sub


Code:
Sub Main
	crt.Screen.Send "amos 0001" & chr(13) <- connect to node 0001
	crt.Screen.WaitForString "[0m> " <- node prompt
	crt.Screen.Send "al" & chr(13) <- send command
	crt.Screen.WaitForString "[0m> " <- node prompt
	crt.Screen.Send "q" & chr(13) <- send disconnect command
crt.Screen.WaitForString chr(126) & "]$ " <- management system prompt
	crt.Screen.Send "amos 0002" & chr(13)  <- connect to node 0002
	crt.Screen.WaitForString "[0m> "  <- node prompt
	crt.Screen.Send "al" & chr(13) <- send command
	crt.Screen.WaitForString "[0m> "  <- node prompt
	crt.Screen.Send "q" & chr(13) <- send disconnect command
crt.Screen.WaitForString chr(126) & "]$ " <- management system prompt
	crt.Screen.Send "amos 0003" & chr(13)  <- connect to node 0003
	crt.Screen.WaitForString "[0m> " <- node prompt
	crt.Screen.Send "al" & chr(13)  <- send command
	crt.Screen.WaitForString "[0m> "   <- node prompt
	crt.Screen.Send "q" & chr(13)  <- send disconnect command
End Sub
I was looking at RunCommandsOnMultipleHostsAndLogResults and JumpHost-HandleSecondaryHostConnectionAttempts but both are just too much code go get few things I need.

Last edited by aqelmo; 03-24-2020 at 11:41 PM.
Reply With Quote