This documentation supports the 20.08 version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.

tw_service_control

The tw_service_control utility enables you to start, stop, restart, and view the status of the BMC Discovery services on a stand-alone appliance. For information about controlling services across a cluster, see tw_cluster_control.

You must be logged in as the tideway user to use the tw_service_control utility. You cannot specify a user name and password as with the other tw_* utilities.

To use the utility, enter the following command:

tw_service_control [options] services

where options are any of the options described in the following table. The common command line options are described in Using command line utilities, and services is an optional list of services.

Command Line Option

Description

--conditional

Makes the operation conditional, that is, checks the status of the service or services before performing the operation. Use in conjunction with --restart, --start, and --stop. For example, using the --conditional option, if you attempt to stop a service which is already stopped, the stop operation is skipped. Similarly, if you attempt to restart a service which is stopped, the stop option is skipped and the service is started. See Conditionally stopping and starting a service for an example.

--restart

Restart local BMC Discovery application services.

--start

Start local BMC Discovery application services.

--status

Show status of local BMC Discovery application services and the process ID for each service. If you run the utility with no options, it is the same as running it with the --status option.

--stop

Stop local BMC Discovery application services.

The following are permissible services:

  • security
  • model
  • vault
  • discovery
  • mainframe_provider
  • sql_provider
  • cmdb_sync_exporter
  • cmdb_sync_transformer
  • reasoning
  • tomcat
  • reports
  • external_api
  • appserver

User examples 

The following examples show usage of the tw_service_control utility.

Show the current status of the local BMC Discovery services

In this example the External API service is not running.

[tideway@appliance01 ~]$ tw_service_control --status
BMC Discovery application services are running
    Security service:                        1458          [  OK  ]
    Model service:                           1506          [  OK  ]
    Vault service:                           1634          [  OK  ]
    Discovery service:                       3281          [  OK  ]
    Mainframe Provider service:              1772          [  OK  ]
    SQL Provider service:                    1834          [  OK  ]
    CMDB Sync (Exporter) service:            1897          [  OK  ]
    CMDB Sync (Transformer) service:         1979          [  OK  ]
    Reasoning service:                       2033          [  OK  ]
    Tomcat service:                          2273          [  OK  ]
    Reports service:                         2444          [  OK  ]
    External API service:                                  [ STOP ]
    Application Server service:              2575          [  OK  ]
[tideway@appliance01 ~]$

Stopping and starting a service

In this example, the external_api service is running. The service is stopped, and then the command to stop it is re-issued, resulting in the operation being skipped.

[tideway@appliance01 ~]$ tw_service_control --stop external_api
Stopping local BMC Discovery application services
    Stopping External API service:                         [  OK  ]
[tideway@appliance01 ~]$ 
[tideway@appliance01 ~]$ tw_service_control --stop external_api
Stopping local BMC Discovery application services
    Stopping External API service:                         [  SKIP  ]
[tideway@appliance01 ~]$ 
[tideway@appliance01 ~]$ tw_service_control --start external_api
Starting local BMC Discovery application services
    Starting External API service:                         [  OK  ]
[tideway@appliance01 ~]$

Conditionally stopping and starting a service 

In this example, the external_api service is running. The service is stopped, and then the command to stop it is re-issued. The --conditional option makes the utility check the status of the service, and after it finds that it is already stopped, does not attempt to stop it again.

[tideway@localhost ~]$ tw_service_control --conditional --stop external_api
Stopping running local BMC Discovery application services
    Stopping External API service:                         [  OK  ]
[tideway@localhost ~]$
[tideway@localhost ~]$ tw_service_control --conditional --stop external_api
Stopping running local BMC Discovery application services
[tideway@localhost ~]$

Restarting a service

In this example, the external_api service is running.

[tideway@appliance01 ~]$ tw_service_control --restart external_api
Restarting local BMC Discovery application services
    Stopping External API service:                         [  OK  ]
    Starting External API service:                         [  OK  ]
[tideway@appliance01 ~]$

Conditionally restarting a service

In this example, the external_api service is currently stopped.

[tideway@appliance01 ~]$ tw_service_control --conditional --restart external_api
Restarting local BMC Discovery application services
    Starting External API service:                         [  OK  ]
[tideway@appliance01 ~]$

Restarting all services

This example shows all services being restarted.

[tideway@appliance01 ~]$ tw_service_control --restart
Restarting local BMC Discovery application services
    Stopping Application Server service:                   [  OK  ]
    Stopping External API service:                         [  OK  ]
    Stopping Reports service:                              [  OK  ]
    Stopping Tomcat:                                       [  OK  ]
    Stopping Reasoning service:                            [  OK  ]
    Stopping CMDB Sync (Transformer) service:              [  OK  ]
    Stopping CMDB Sync (Exporter) service:                 [  OK  ]
    Stopping SQL Provider service:                         [  OK  ]
    Stopping Mainframe Provider service:                   [  OK  ]
    Stopping Discovery service:                            [  OK  ]
    Stopping Vault service:                                [  OK  ]
    Stopping Model service:                                [  OK  ]
    Stopping Security service:                             [  OK  ]
    Starting Security service:                             [  OK  ]
    Starting Model service:                                [  OK  ]
    Starting Vault service:                                [  OK  ]
    Starting Discovery service:                            [  OK  ]
    Starting Mainframe Provider service:                   [  OK  ]
    Starting SQL Provider service:                         [  OK  ]
    Starting CMDB Sync (Exporter) service:                 [  OK  ]
    Starting CMDB Sync (Transformer) service:              [  OK  ]
    Starting Reasoning service:                            [  OK  ]
    Starting Tomcat:                                       [  OK  ]
    Starting Reports service:                              [  OK  ]
    Starting External API service:                         [  OK  ]
    Starting Application Server service:                   [  OK  ]
    Updating cron tables:                                  [  OK  ]
    Updating baseline:                                     [  OK  ]
[tideway@appliance01 ~]$
Was this page helpful? Yes No Submitting... Thank you

Comments