Solved

VBScript and Windows Clustering

Posted on 2007-04-02
1
596 Views
Last Modified: 2008-01-09
I have a Windows Clustering question.  We have a software application that isn't cluster aware.  All services are running on a mapped SAN drive E:.  When a connection is lost on Production, the E: drive is mapped to the failover, and services go up.  We have a situation where a file needs to be copied from one directory to another before the services are started.  I have written a VBS file to copy the files, but can not figure out how to configure the clustering software to kick off a VBS file.  Any help would be greatly appreciated.  Currently, the cluster group is the E: drive..no aliases to the services.  

I would really like to Map the E: drive, copy the file, then start the services.
VBS file:
Dim objNet
Dim objFSO, objFileCopy, objGuyFile
Dim strFilePath, strDestination

strFilePathprod = "E:\inserver6\etc\node_id_CHWINCL2A\in_hwfp"
strFilePathfail = "E:\inserver6\etc\node_id_CHWINCL2B\in_hwfp"
strDestination ="E:\inserver6\etc\in_hwpf"


Set objNet = CreateObject("WScript.NetWork")
Set FileSystemObject = CreateObject("Scripting.FileSystemObject") 'Create a filesystem
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Drives = FileSystemObject.Drives 'Create a drives collection
Set objFileCopy = objFSO.GetFile(strFilePathprod)
Set objFileCopy2 = objFSO.GetFile(strFilePathfail)
For Each DiskDrive in Drives
DriveLetter = DiskDrive.DriveLetter
if DriveLetter = "E" then
    mydrive = DriveLetter
end if
Next

Dim strInfo
strInfo = objNet.ComputerName
if strinfo = "CHWINCL2A" and mydrive = "E" then
   
   ' Copy the file to its destination
   objFileCopy.Copy (strDestination)
   WSCript.Echo "Copied to " & strDestination
   Wscript.Quit
else
   ' Copy the file to its destination
   objFileCopy2.Copy (strDestination)
   WSCript.Echo "Copied to " & strDestination
   Wscript.Quit
end if
      
Set objNet = Nothing                    'Destroy the Object to free the Memo

0
Comment
Question by:ntiguy
1 Comment
 
LVL 8

Accepted Solution

by:
jwarnken earned 500 total points
ID: 18862030
I do not work with clustering and am taking a stab in the dark based on http://msdn2.microsoft.com/en-us/library/ms952401.aspx 
But it seams that the command line could be modified to launch your script (i.e. cscript clusterfix.vbs)
You would then have to add the command live for your app into your script as well

Sounds simplet but I am sure there are some important considerations that you are aware of being that you work with it more.

Good luck
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question