Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Database rule, command execution

Highlighted
Leep
Regular Collector

Database rule, command execution

Hi!
In database rule, I can define command execution.
Under this condition this, execute followings:
- cmd1
- cmd2
- cmd3

Is there a way that I let cmd2 wait until cmd1 is finished, cmd3 wait until cmd2 is finished?
5 REPLIES
Robert S. Falko
Honored Contributor

Re: Database rule, command execution

No, OVSD does not guarantee the order of execution of the actions in a single rule (although I heard that this would come with a certain Service Pack).

The workaround is to split the actions amongst multiple rules, and use a field, such as some boolean, as a flag to trigger the execution of each rule in sequence.

-Josh
Ruth Porter
Honored Contributor

Re: Database rule, command execution

Hi there,

If all the commands are on the same system, you could set up a batch file containing:

@cmd1
@cmd2
@cmd3

and then DOS would do it for you

Hope this helps

Ruth
http://www.teamultra.net
Leep
Regular Collector

Re: Database rule, command execution

Hi, Ruth and Vasily!
Many thanks for a great idea.I have not thought about it.
I have two commands:
1. /fullpath/java [field1]
2. /fullpaht/java [field2]

I put them seperately in a DB rule, both works fine. I created a command file (mycommand.sh) under Unix
/fullpath/java [value1]
/fullpath/java [value2]

It runs fine. I have also checked execute access, I give it all can run access.

But I put /fullpath/mycommand.sh in DB rule, it doesn't run. Have I missed something?


Many thanks for help.
Lee
Leep
Regular Collector

Re: Database rule, command execution

I found this in HP's support page:
###################################
PROBLEM: SD 4.0 (same for SD 4.5)
Defining a DB Rule and using a Command exec action calling SD agent running on HP-UX (or other Unix platforms), sometimes, it will NOT be executed.


CONFIGURATION
Operating System - HP-UX, Sun Solaris
Version - 4.0, 4.5
Product - service desk

RESOLUTION: Manual description creating DB Rules: "Create a Command Exec Action":
...
In the Command line field, enter the command to execute,
for example: banner.exe
...

This works fine for Windows platform and the named example (banner.exe). Unix commands will not always be executed when typed in directly (e. g. whoami). As a workaround for this, a shell script can be used. A script containing the following command can be used (e. g. who-am-i-script.sh) instead of using the whoami command directly.

Example: ksh /who-am-i-scrip.sh
########################################

It works now.
Leep
Regular Collector

Re: Database rule, command execution

From HP's online support:
############################################
PROBLEM: SD 4.0 (same for SD 4.5)
Defining a DB Rule and using a Command exec action calling SD agent running on HP-UX (or other Unix platforms), sometimes, it will NOT be executed.


CONFIGURATION
Operating System - HP-UX, Sun Solaris
Version - 4.0, 4.5
Product - service desk

RESOLUTION: Manual description creating DB Rules: "Create a Command Exec Action":
...
In the Command line field, enter the command to execute,
for example: banner.exe
...

This works fine for Windows platform and the named example (banner.exe). Unix commands will not always be executed when typed in directly (e. g. whoami). As a workaround for this, a shell script can be used. A script containing the following command can be used (e. g. who-am-i-script.sh) instead of using the whoami command directly.

Example: ksh /who-am-i-scrip.sh
//Add this to "OnDomLoad" event