Can UDP program use system shell environment variables?

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

Description:

System shell environment variables defined in the hserver user .profile is NOT passed over to the server side UDP program. That is because when CA SCM ( aka Harvest) server process create a child process to execute the UDP process. It is NOT going through a shell.

Solution:

Therefore, if user defines a UDP with a system environment variable, it will not expanding and will reporting errors.

For example, let us assume the broker is running on a Solaris box under an account named "harvestsys". Let us also assume that the harvestsys Unix user account .profile has the following environment variables set:

export UDP_HOME=/opt/CA/harvest/UDP

in the UDP command definition, user would like to use those enviornment variables, like this:

$perl -S $UDP_HOME/hform/formtest.pl

When executing this UDP, following error messages will be omitted:

E03020134: Can't open perl script "$UDP_HOME/hform/formtest.pl": No such file or directory.

As the result shows, since the $UDP_HOME is a shell variable which is NOT passed from harvest server process to the UDP process, it will fail to locate the perl script, and result in an error. One workaround for this limitation is to include the directory in the $PATH and let perl find it that way. For example:

export UDP_HOME=/opt/CA/harvest/UDP
PATH=$UDP_HOME/hform:$PATH;export PATH

Please note, it is necessary to restart the CA SCM server in order for this new $PATH value to be passed to perl.