Batch file to execute client on either master or slave

I’m trying to make a batch file (Windows 7) (or any other method) that will execute the Ignition client on the master server, but if it fails (ie. the server is down), then I want it to try to execute it on the slave server. Here’s what I’ve looked at.

I’ve tried to do error checking in a batch file, but it appears that java is executing just fine and it doesn’t appear to return an error code when it fails to find the jnlp file.

I’ve thought about pinging-- that would get close, but it only tells me if the computer is up or not… Doesn’t say anything about whether the service is running or not.

My backup plan is just to have two batch files, one to the master and one to the slave and tell everybody if one doesn’t work, then try the other.

Anybody ever done this?

Are the master and the slave set up in a redundant setup, or are they two independent gateways? Also, what kind of error checking are you performing in your batch file?

The two servers are set up as redundant. I’m not a batch file expert by any means, so I may be going about it all wrong. Obviously where I echo’d “did not run” I would insert the command to the backup server.

%windir%\System32\javaws.exe 10.111.6.27:8088/main/system/lau … S_AVE.jnlp
IF ERRORLEVEL 1 GOTO NOFILE
ECHO IT RAN
PAUSE
EXIT
:NOFILE
ECHO DID NOT RUN
PAUSE
EXIT

It seems this is only necessary when the user first launches the Ignition client (as in has never opened the client before on their computer). Once installed, the client will check both servers for you as long as you have Ignition configured correctly. I could be wrong. Also this will be resolved for you with the Ignition launcher from the upcoming 7.7, I think.

Yeah, native client launchers are definitely going to be the way to go for you. The native launcher has functionality that can launch against a backup gateway when it detects that the master is down. We are uploading 7.6.4-rc1 within the next day or so, which will have the native launchers available in the gateway.