wiredfool

Keep It Up

Overview

This is a little perl script for Windows machines that monitors the state of Frontier on the local machine. If Frontier does not respond to an http or Ole query, It assumes that Frontier has crashed and needs to be restarted.

While this crashing thing never happens with release software, it is useful for trying out beta versions or debugging corrupted DLLs.

What it Does.

Every minute or so (configured in the script), the script does a http query of a provided URL. It also does an OLE/COM query of a provided function. It currently doesn’t use the returned value of either the function or the http request, but that could be done rather easily.

If the http request and a second OLE request fail, then Frontier is restarted using the Win32 Process object.

How To Use It

Yon need a recent build of ActiveState Perl, http://www.activeState.com (free) Download the script and customize the OLE function name and the request url. The script should be in the filesystem and not contained within a frontier ODB. Typicall, perl scripts have a .pl extension assotiated with them. Run the script by double clicking on it. If frontier wasn’t running before, it should be now.

The OLE function that I use for this is simply return(“I’m alive”), entered in user.com.heartbeat.

What it shows

How to start processes in perl.

How to call com/ole functions hosted in frontier from perl.

How to do a simple URL call from perl.

All very useful things for a frontier developer to know. “;->”

No comments

No comments yet. Be the first.

Leave a reply

You must be logged in to post a comment.