Sample shell script to run OMEGAMON Data Connect
You can use a shell script to run OMEGAMON® Data Connect on operating systems such as z/OS® UNIX and Linux. In addition to running OMEGAMON Data Connect, the supplied sample script can also create a user directory containing a sample OMEGAMON Data Connect configuration file as a starting point for you to edit.
Location
The sample shell script is supplied under the OMEGAMON Data Connect installation directory in the relative file path:
bin/connect
The script file name connect has no file extension (no trailing .sh).
Example absolute file path:
/usr/lpp/omdp/kay-110/bin/connect
PATH
environment variable, then, in that other directory, create a symbolic link that refers to the
script in the installation directory. Running the symbolic link will run the script in the
installation directory.Syntax
connect action
The script requires an action
argument:
create
or run
.
The script refers to the value of the environment variable ODP_CONNECT_USER_DIR
.
Before calling the script, set the variable to the path of a user directory: depending on the
action, either a directory that you want to create or an existing directory that you want to use to
run OMEGAMON Data Connect.
create
action
connect create
The create
action creates an OMEGAMON Data Connect
user directory.
Before performing the create
action, set the environment variable
ODP_CONNECT_USER_DIR
to the path of the user directory that you want to create.
If the directory specified by ODP_CONNECT_USER_DIR
already exists, the script
exits without performing any action.
If intermediate directories in the path don't already exist, the script creates them. For example, if the user directory path is /var/omdp/config, but the omdp directory doesn't already exist, the script creates it.
The create
action copies a sample connect.yaml
configuration file from the installation directory as a starting point for you to edit.
The create
action also copies another file,
connect.sample.yaml, containing numerous examples of configuration parameters.
OMEGAMON Data Connect does not use
connect.sample.yaml
. Use the examples in connect.sample.yaml
as a reference for inserting new parameters into connect.yaml.
You can use the create
action regardless of how you plan to run OMEGAMON Data Connect. For example, on z/OS, you can use the script to perform the create
action, and then use JCL
to run OMEGAMON Data Connect.
The create
action assumes that the script is located in the OMEGAMON Data Connect installation directory. The create
action uses the path of the running script to locate the sample configuration files under the
installation directory.
run
action
connect run
The run
action uses a Java™ command line to start OMEGAMON Data Connect.
Before performing the run
action, set the environment variable
ODP_CONNECT_USER_DIR
to the path of an existing user directory that you want to use
to run OMEGAMON Data Connect.
The run
action expects to find a configuration file at:
${ODP_CONNECT_USER_DIR}/config/connect.yaml
The run
action assumes that the script is located in the OMEGAMON Data Connect installation directory. The run
action uses the path of the running script to locate the core JAR file and mapping extension JAR
files in the installation directory.
If the JAVA_HOME
environment variable is not set, the script uses the following
shell command to get the path of the java command:
command -v java
Usage
Typical usage involves three steps:
- Perform the script
create
action. - Edit the config/connect.yaml configuration file in the user directory to meet your site-specific requirements.
- Perform the script
run
action.
Example: Create an OMEGAMON Data Connect user directory
Suppose that:
- You want to create the OMEGAMON Data Connect user directory /var/omdp/prod-a
- The OMEGAMON Data Connect installation directory is /usr/lpp/omdp/kay-110
At a shell prompt, change to the directory /usr/lpp/omdp/kay-110/bin, and then enter the following command line:
ODP_CONNECT_USER_DIR=/var/omdp/prod-a ./connect create
- This example shows a single command line that sets the environment variable
ODP_CONNECT_USER_DIR
and then runs the script. Instead of setting the variable each time you run the script, consider using an export shell command to set the variable in your user profile. - The dot and slash (./) preceding the script name connect assumes that the script is in the current directory. That is, the current directory is the bin directory under the OMEGAMON Data Connect installation directory.
- Replace /var/omdp/prod-a with your user directory path.
Example: Run OMEGAMON Data Connect
Suppose that:
- You have performed the
create
action in the previous example. - You have edited the configuration file in /var/omdp/prod-a/config/connect.yaml to meet your site-specific requirements.
To run OMEGAMON Data Connect, enter the following shell command line:
ODP_CONNECT_USER_DIR=/var/omdp/prod-a ./connect run