secure crt 스크립트 짜는데 좀 도와주세요~

cycix의 이미지

secureCRT에 접속해서 출력되는 내용들을 저장하기위해
File/Raw Log Session 메뉴를 이용을 하고 있읍니다.

그런데 일일이 하자니 시간이 너무오래걸려서...
접속하면 자동으로 파일열고 커멘드 실행후 화면에 출력되는 내용을 저장하는
스크립트를 만들려고 하는데
잘 안되네요 -ㅅ-;;;

#$language = "VBScript"
#$interface = "1.0"
 
'파일입출력을 위한 변수
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 3
 
Sub main
crt.Screen.Synchronous = True
 
'이것저것 변수선언
Dim saveObj, saveLog, ServName
ServName="서버이름"
 
'세션을 이용해 저장하려고 했지많 아직 이해부족
'Set object = crt.Session
'object.Log(start, apend..., raw)
 
 
'서버접속
crt.Screen.WaitForString "Username:"
crt.Screen.Send "아이디" & VbCr
crt.Screen.WaitForString "Password:"
crt.Screen.Send "비밀번호" & VbCr
crt.Screen.WaitForString ServName
crt.Screen.Send "아이디" & VbCr
crt.Screen.WaitForString "Password:"
crt.Screen.Send "비밀번호" & VbCr
 
'파일시스템open
Set saveObj = CreateObject("Scripting.FileSystemObject")
Set saveLog = saveObj.OpenTextFile(c:\Documents and Settings\Master\바탕 화면\backUpFolder\_test.txt", ForWriting, True)
 
'저장할 커멘드
crt.Screen.WaitForString ServName
crt.Screen.Send "show running-config" &VbCr
 
'지금까지 출력된 화면내용 쓰기 시작
Do While saveLog.AtEndOfStream <> True
 
  '여기 부터 잘 안되네요...
  result = crt.Screen.WaitForStrings(waitStrs)
 
Loop
 
'쓰기종료
saveLog.Close
 
End Sub

지금까지 메뉴얼 보고 만든 내용입니다.
파일 입출력만 빼면 커멘드도 자동으로 잘되는데...

중간에 화면에 내용을 읽어와서 파일에 써야 하는데
이게 잘 안되네요 ㅜ.ㅜ

도와주세요~
참조할수 있는 좌표라도 ~~

waitStrs 는 변수인가요? 아니면 secureCRT에서 쓰는 함수같은건가요?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.