Adding new services or processes (nco_pa_addentry)
You can run the nco_pa_addentry utility to add new services or processes while the process agent is running.
- Add new services to a running process agent.
- Start a fire-and-forget process. Such processes start automatically and cannot be altered. When setting up a fire-and-forget process, define the process as unmanaged if you want to ensure that it runs only once. You can do this by specifying the -unmanaged command-line option when running the nco_pa_addentry utility.
- Add a new managed process to a service.
To add a service or process to a running process agent, enter the following command. The square brackets depict optional entries.
$NCHOME/omnibus/bin/nco_pa_addentry [-process string | -service string] command_line_options
In this command, command_line_options represents one or more command-line options that you can specify for the service or process, or for the nco_pa_addentry utility.
Command-line options for nco_pa_addentry
Command-line options for the nco_pa_addentry utility are described in the following table.
Command-line option | Description |
---|---|
-alert_msg string | Specifies the message to send to the UNIX syslog or the Windows Event Viewer if the process exits. On UNIX, enclose the string value in single quotation marks if the text contains spaces. On Windows, enclose the string value in double quotation marks if the text contains spaces. |
-auto -nonauto |
If -auto is specified, the service or process is started as soon as the process agent is started. By default, the service must be started manually with the nco_pa_start command. |
-command string | Specifies the process command line. For example:
|
-delay string | Specifies the time delay in seconds before the specified process is started. |
-depend string | Specifies a process on which the specified process depends. |
-help | Displays help on the command-line options and exits. |
-host string | Specifies the host on which to run the process. |
-managed -unmanaged |
If -managed is specified, the process is restarted automatically if it exits. The default is -managed. |
-master -nonmaster |
If -master is specified, the service type is set to master. The default is -master. |
-nosecure | Connects to process agents in a non-secure mode that does not encrypt login information during transmission. |
-pa_aware -not_pa_aware |
If -pa_aware is specified,
the ProcessType is set to PaPA_AWARE. By default, the process is not PA aware. |
-parentservice string | Specifies the service to which to add the process. Note: When adding a process to a service, you must define the parent
service by using -parentservice.
|
-password string | Specifies the password to use when connecting to the process agent. |
-process string | Specifies the name of the process to add. |
-restart_msg string | Specifies the message to send to the UNIX syslog or the Windows Event Viewer if the process is restarted. On UNIX, enclose the string value in single quotation marks if the text contains spaces. On Windows, enclose the string value in double quotation marks if the text contains spaces. |
-retrycount integer | Specifies the number of restart attempts to be made if the process exits in the time specified by the nco_pad -retrytime command-line option. If set to 0, there is no limit to the number of restart attempts. The default is 0. |
-runas integer | Specifies the user ID to run the process as. |
-server string | Specifies the name of the process agent. The default is NCO_PA. |
-service string | Specifies the name of the service to add. |
-user string | Specifies the user name to use when connecting to the process agent. The default is the user that is running the command. |
-version | Displays software version information and exits. |
Example: Use nco_pa_addentry to add a fire-and-forget process (UNIX) on 32-bit operating systems
- Enter the following command to add a fire-and-forget process named
simnet1, which starts automatically and runs only once (as an unmanaged
process):
./nco_pa_addentry -server TEST_PA -process 'simnet1' -command '$NCHOME/omnibus/probes/nco_p_simnet' -host 'owl' -retrycount 0 -unmanaged -restart_msg 'test' -alert_msg 'testalert'
- Run the nco_pa_status utility to retrieve the
status of services in the configuration:
$NCHOME/omnibus/bin/nco_pa_status -server TEST_PA
Where TEST_PA is the process agent name.
When the nco_pa_status utility is run,
the output does not show a simnet1
process definition
as part of a service entry. However, the ps -ef command shows the simnet1 process as running, although it does not
automatically restart if it exits.
Example: Use nco_pa_addentry to add a fire-and-forget process (Windows)
- Enter the following command to add a fire-and-forget process named
simnet1, which starts automatically and runs only once (as an unmanaged
process):
"%NCHOME%"\omnibus\bin\nco_pa_addentry -server TEST_PA -process simnet1 -command "%NCHOME%"\omnibus\probes\win32\nco_p_simnet -host owl -retrycount 0 -unmanaged -restart_msg "Probe restarted" -alert_msg "Probe stopped" -password secret
- Run the nco_pa_status utility to retrieve the
status of services in the configuration:
"%NCHOME%"\omnibus\bin\nco_pa_status -server TEST_PA
Where TEST_PA is the process agent name.
When the nco_pa_status utility is run,
the output does not show a simnet1
process definition
as part of a service entry. However, the Windows Task Manager shows the simnet1 process
as running, although it does not automatically restart if it exits.
Example: Use nco_pa_addentry to add a managed process to a service (Solaris) on 64-bit operating systems
- Enter the following command to add a process named simnet2 to
a Core service:
./nco_pa_addentry -server TEST_PA -process 'simnet2' -command '$NCHOME/omnibus/platform/solaris2/probes64/nco_p_simnet' -host 'owl' -retrycount 0 -managed -restart_msg 'test' -alert_msg 'testalert' -parentservice 'Core'
- Run the nco_pa_status utility to retrieve the
status of services in the configuration:
$NCHOME/omnibus/bin/nco_pa_status -server TEST_PA
Where TEST_PA is the process agent name.
When nco_pa_status is run, the output displays
a simnet2 process with a status of DEAD, as part
of the Core
service definition. The simnet2 process
does not start automatically because it is part of a service. To run
the process, use the nco_pa_start utility.
Example: Use nco_pa_addentry to add a managed process to a service (Windows)
- Enter the following command to add a process named simnet2 to
a Core service:
"%NCHOME%"\omnibus\bin\nco_pa_addentry -server TEST_PA -process simnet2 -command "%NCHOME%"\omnibus\probes\win32\nco_p_simnet -host owl -retrycount 0 -managed -restart_msg "test" -alert_msg "testalert" -parentservice "Core"
- Run the nco_pa_status utility to retrieve the
status of services in the configuration:
"%NCHOME%"\omnibus\bin\nco_pa_status -server TEST_PA
Where TEST_PA is the process agent name.
When nco_pa_status is run, the output displays
a simnet2 process with a status of DEAD, as part
of the Core
service definition. The simnet2 process
does not start automatically because it is part of a service. To run
the process, use the nco_pa_start utility.