cancel
Showing results for 
Search instead for 
Did you mean: 

Script Probe for Restarting a Server Not Working as Expected

JohnClark
Active Participant
0 Kudos

I have written a small batch file to restart our ConnectionServer:

SET EXE="D:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64\ccm.exe"

SET CMS=ServerName

SET UID=UserName

SET PWD=Password

SET NODE=Node

%EXE% -disable %NODE%.ConnectionServer -cms %CMS% -username %UID% -password %PWD%

%EXE% -managedforceterminate %NODE%.ConnectonServer -cms %CMS% -username %UID% -password %PWD%

%EXE% -managedstart %NODE%.ConnectionServer -cms %CMS% -username %UID% -password %PWD%

%EXE% -enable %NODE%.ConnectionServer -cms %CMS% -username %UID% -password %PWD%


The batch file works great when I run it from the server.

When I set up the batch file as a Script Probe in the Monitoring section it runs fine if the ConnectionServer is enabled and running.  If the ConnectionServer is running but isn't enabled, the probe will restart the ConnectionServer but won't enable it.  (It does this if I run the batch file from the server instead of as a probe).  When the ConnectionServer is running but not enabled is when I need to the probe to run, kicked off by a Watch.

Does anyone have any ideas on why it would be doing this?

Also, whether the Script Probe restarts the server or not, it shows that it failed in the Probes window.  I suspect that this may be because there isn't anything returned from the batch file to indicate success but I can't figure out how to configure that part.  Any help with this issue would be appreciated.

This is configured in BI4.1sp5.

Accepted Solutions (0)

Answers (2)

Answers (2)

JohnClark
Active Participant
0 Kudos

OK, I figured out why the server wasn't being enabled.  The command to enable the server must have been sent too earlier, that is the ConnectionServer wasn't running yet to receive the command.  The command to enable the server was not being written to the InfoStore.  I solved this by adding this line before called the enable command:

timeout /t 30

This causes the batch file to wait between 29 and 30 seconds.

So I have the batch file working but the Probe that runs it is still showing as failed instead of success.  I still think there needs to be something output from the batch file but I'm not sure how to configure that.

I am getting this message in the History though it isn't very helpful:

Object failed to run due to an error while processing on the Job Server.

Former Member
0 Kudos

Looking at KBA 2114309 should give you some ideas.

I'd suggest echoing a status,%ERRORLEVEL% (Maybe one you caught after the restart of the service) at the end of the batch and set the script with virtual metric so the probe get an output result maybe?

JohnClark
Active Participant
0 Kudos

Actually KBA 2095578 that is referenced from KBA 2114309.  When I add the batch file to the InfoStore with the original name, the probe completes and shows successful.  I don't know why Business Objects has to rename the objects when they are uploaded.  It seems with BI4.1 they now append the QUID to the names of the files.

Adding an output of %ERRORLEVEL% wasn't very helpful.  It just returns 0 no matter if all of the calls run successfully or not.

My successful run of the probe yesterday must have been a fluke though.  I can't get it to complete the enable call.  It appears that the timeout line is ignored when it is run as a probe.  The probe is completing in 7 to 9 seconds even though the batch file should be taking at least 30 seconds.

KBA 2114309 is for UNIX and we are on Windows but I will look into it some more when I get a chance to see if there is anything there that may be helpful.

Former Member
0 Kudos

Interesting script

I know the connection server acts based on its own accord when trying to shut it down from CMC: stopping it when shutting down the SIA, no problem.

Stopping it from CMC or CCM/Managed Servers manually - it can stay up

The first question is what user runs the SIA and Job Server triggering the batch, as opposed to your user when you execute the batch manually. I've seen in the past differences running a batch through AT and the user account: LocalSystem does not have right to access network interfaces, which is critical for Corba and the likes of it.

Any chance to use the runas as part of your batch? Have you tried adding a log to your commands? And are you sure the Job Server executing the batch is on the same machine as CS?

To add a log:

SET LOG=C:\temp\restartCS.log

Start or finish every command with >> %LOG% (I prefer it at the start, but it's a choice). ie:

>>%LOG% your command

Also add a timestamp at beginning and end of the batch for easier troubleshooting purpose.

>>%LOG% ECHO %DATE%_%TIME%

>>%LOG% ECHO.

Regards

JohnClark
Active Participant
0 Kudos

Even though different users run the SIA and the Job Server versus the batch file, both users are members of the Administrators group on the server.  We run our SIA under a domain account, not the LocalSystem.

The Job Server is on the same machine as this a single server environment that I am testing on.

I will try adding some logging entries and see what that tells me.