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

Command exec action problem

Jan Gunnar Helg
Senior Member

Command exec action problem


We have DB rules using sd_event via Command exec action running sucessfully.

However I now have a custom exec I want to run, however nothing happens when I call this.

So I create a simple test.bat, this either does not get execute.

I can see that the DB rule gets triggerd in the serverlog.log, other than that the agent.log doesnt provide anything.

Am I doing something wrong?
Jan Gunnar Helg
Senior Member

Re: Command exec action problem

Im now able to run it by invoking the exec from a bat file, however Im having problems passing the parameters from the DB rule to it.

My DB rule runs command exec action on:
C:/Program Files/Hewlett-Packard/OpenView/Service Desk 4.5/Server/bin/test.bat

To verify that it worked I hardcoded test.bat with test parameters (it requires 3). And invoked the DB rule again this was worked fine and HPOVSD called the test.bat and the info got updated.

However when Im trying to pass the parameters via the DB rule it will not work.

I have added %1 %1 %3 for the parameters in the bat file.

The parameters Im passing looks like this:
[Search code] info "[Remark]"

If I look in agent.log (running it with /monitor) I see this string

Test rule DB citest (Command Exec Action) Agent: Executed: C:/Program Files/Hewlett-Packard/OpenView/Service Desk 4.5/Server/bin/test.bat PCNAME info "test2ddydd"

But its not working, I get no results....

If I go to a CMD prompt on the server and type: test.bat PCNAME info "test2ddydd" it works fine!

What gives :| ?

Raymond Crijnen
Frequent Visitor

Re: Command exec action problem

Maybe you have line breaks or " in the remark field?
You can contact me at raymond || @ || smt-x || . || com
Jan Gunnar Helg
Senior Member

Re: Command exec action problem

I figured it out, I dont even have to use the bat file to pass the params.

1. Added c:\test to PATH system variable on the server
2. Changed command line i DB rule to: cmd /C
3. Changed parametre in DB rule to: c:\test\bdd.exe [Search code] info "[Remark]"

Works! :)
Jan Gunnar Helg
Senior Member

Re: Command exec action problem

Now I have another problem :(

The content of the Remark field when I tested was just letters.

But what the actual content is going to be is "|||text=|||"

Servicedesk really doesnt like | (pipe) and = , and refuses to pass these as params even if the agent.log says they were executed fine.

Any ideas how I can pass these? I've already added "" that didnt help.
Jan Gunnar Helg
Senior Member

Re: Command exec action problem

Solved my own problem yet again :D

HPOVSD wont let you pass | or = but if you hardcode these in a bat file which grabs the params this works fine!

E.g. contents of test.bat:
c:\script.exe %1 "||=%2"

Then one would simply call test.bat from the DB rule with the two params for %1 and %2 which again passes this to the exe in the correct format!

//Add this to "OnDomLoad" event