View Single Post
  #9  
Old 03-27-2020, 09:08 AM
aqelmo aqelmo is offline
Registered User
 
Join Date: Mar 2020
Posts: 6
After a lot of try and error, I managed to hack something that does what I want to do.


stop logging my session

loop
connect to node
get alarms
append to log file for that node
quit
stop logging
end loop

start logging my normal session



Now I need to get it to populate hosts aray from a file, instead of hardcoding it.
But coffee 1st.


Code:
# $language = "VBScript"
# $interface = "1.0"

g_strLogFileTemplate = "C:\path\Log\NODEID.txt"
crt.Screen.Synchronous = True
vHosts = Array(_
    "0001",_
    "0002",_
    "0003")


nIndex = 0

	crt.Session.Log False
Do
    Do
		crt.Screen.Send "amos " & vHosts(nIndex) & chr(13)
		crt.Screen.WaitForString "[0m> "
		crt.Screen.Send "alt" & chr(13)
		crt.Session.LogFileName = Replace( _
            g_strLogFileTemplate, _
            "NODEID", _
             vHosts(nIndex))
			crt.Session.Log True, True
		crt.Screen.WaitForString "[0m> "
		crt.Session.Log False
		crt.Screen.Send "q" & chr(13)
		crt.Screen.WaitForString chr(126) & "]$ "
                Exit Do
    Loop

    nIndex = nIndex + 1


    If nIndex > Ubound(vHosts) Then Exit Do

Loop
	crt.Session.LogFileName = "C:\path\logs\%Y.%M.%D - %S_ENM.log"
	crt.Session.Log True, True

Last edited by aqelmo; 03-27-2020 at 09:15 AM.
Reply With Quote