Results 1 to 4 of 4

Thread: Silly Newbie Question

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Minneapolis, MN
    Posts
    2

    Talking Silly Newbie Question

    Greetings, I hope this isn't too stupid of a newbie question.

    I'm looking to write a VB script/form on my box that goes out and accesses a perl script on a remote server.

    The perl script is designed to monitor a few different servers for connectivity, etc... I want the script to run once a minute, but since I am putting it on a server I don't control, I'm writing a VB program on my server to go out and run the perl script once a minute...

    I need to know if using the Microsoft Winsock Control is the way to go. And if so, how would one run a perl script remotely??

    Hope this makes sense..

    Regards,
    Shane

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    How would you call the script remotely? If it's web accessible, you could use Winsock easily. Just connect to your server and send something like the following:

    VB Code:
    1. "GET /cgi-bin/script.pl HTTP/1.0" & vbcrlf & vbcrlf
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Minneapolis, MN
    Posts
    2

    That doesn't seem to work

    Josh,
    Here's what I have so far:

    Private Sub Command1_Click()

    Winsock1.RemoteHost = "127.0.0.1"
    Winsock1.RemotePort = 80

    Winsock1.Connect

    Do Until Winsock1.State = sckConnected
    DoEvents: DoEvents: DoEvents: DoEvents
    Loop

    Winsock1.Close

    End Sub

    I'm assuming I need something prior to the Winsock1.Close statement that actually runs the perl script...

    Thanks,
    Shane

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Once you're connected, request the script via HTTP, like I showed above.

    VB Code:
    1. Winsock1.SendData "Whatever"

    Then the DataArrival event should fire if it the script returns a web page or anything, and then the connection should close (test and make sure, though).
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width