PDA

Click to See Complete Forum and Search --> : Silly Newbie Question


bravescotland
Jul 5th, 2001, 10:45 AM
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

JoshT
Jul 5th, 2001, 12:53 PM
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:


"GET /cgi-bin/script.pl HTTP/1.0" & vbcrlf & vbcrlf

bravescotland
Jul 5th, 2001, 01:36 PM
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

JoshT
Jul 5th, 2001, 01:58 PM
Once you're connected, request the script via HTTP, like I showed above.


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).