Why is my UNIX shell action script not running or failing under CA SystemEdge?

Document ID : KB000023780
Last Modified Date : 14/02/2018
Show Technical Document Details

Question: 

Why is my action script not running or failing under CA SystemEdge

Environment:  

UNIX

Answer: 

There are 2 typical things that should be checked if an Action script is failing under the agent.

When you login to the server and run the script manually, does it require any user intervention? Does it return/work manually?

If it does work and return while logged in (without any user intervention), ensure the following:

1) By default /opt/CA/SystemEDGE/config/port16*/sysedge.cf has a parameter named:

no_actions

This parameter is there to prevent execution of scripts unless authorized. If no_actions is commented in, for an action script to work you must comment it out by adding a # or the word template in front of it.

2) Does the written script have the 1st line to associate a shell interpreter? 

For example, to invoke the action script within the Bourne shell, the following line should be added to the top of the script:

#!/bin/sh

Since the CA SystemEdge agent does not run in a shell because its a process. You must invoke the shell script with a shell interpreter. When running it manually as a logged in user this parameter is not needed due to the fact the script runs under the logged in users default shell. And for the same reason if there are any accessed/specified user environment variables you should not utilize these in a script that runs under a process.