Skip to Content

Script Probe for Restarting a Server Not Working as Expected

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


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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2015 at 09:36 AM

    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.


    Add a comment
    10|10000 characters needed characters exceeded

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

  • Posted on Aug 27, 2015 at 08:28 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.