tw_sync_control
The tw_sync_control
utility enables you to control CMDB sync activities from the command line. The utility is primarily intended to be used as a means of automating certain CMDB sync procedures rather than an all purpose controller for CMDB sync. To use the utility, type the following command:
tw_sync_control [options]
where options are any of the options described in the following table and the common command line options described in Using command line utilities.
Common password options are described in this table
Common password options are described in this table to make it clear whether the password referred to is for the local or remote system.
Command Line Option | Description |
---|---|
| Add a new CMDB sync connection. |
| Enables continuous synchronization for the specified ( |
| Target datamodel number (2-6). See Data models. |
| Name of dataset (default = BMC.ADDM). |
| Disable the specified ( |
| Enable the specified ( |
| The IP address or hostname of the BMC Atrium CMDB server. |
| Export filter definition for the specified ( |
| Specify a filter definition file to write ( |
| Specify the identifier or name of the CMDB sync connection. Determine the identifier using the |
| Import a filter definition |
| Display a list of configured CMDB sync connections, together with the configuration information supplied when the connection was added or last updated |
| Specify the name of a connection. Used when adding a new connection. |
| Disable continuous sync on the specified ( |
| Specify that a new connection should not actually export to a CMDB, but just maintain the local shadow copy of the data within BMC Discovery. |
| Specifies the password of the BMC Discovery UI user specified using the |
| Specifies a file from which the password for the user specified using the |
| Pause synchronization for the specified ( |
| Port of target server (default = 0). Used with the |
| Remove the specified ( |
| Reset the counts of nodes inserted, updated, and deleted. |
| RPC queue port of CMDB (default = 0). Used when configuring a private queue. |
| Show status of all connections, including recently synced devices. The creates, updates, deletes, and errors counts are cumulative |
| Sync root nodes selected by query. |
| The password of the BMC Atrium CMDB target user specified using the |
| The username for the BMC Atrium CMDB target. |
| Test credential. |
| Unpause synchronization for the specified ( |
| Update the configuration of the specified ( |
| The user to run the utility as. This has to be a valid BMC Discovery UI user such as the system user, not a username used to access the command line via ssh. |
--workers=WORKERS | Number of concurrent workers (default = 1). |
Resync commands | For examples of using these commands, see To resync a connection. |
--auto-commit | Automatically commit after the resync prepare stage. |
--incremental | Perform incremental resync commit. |
--resync | Initiate resync. That is, perform the prepare and commit stages. |
| Cancel resync on the specified ( |
| Initiate resync commit on the specified ( |
--resync-prepare | Initiate the resync prepare stage. |
--resync-resume | Resume interrupted resync. |
| Show connection resync status. |
Data models
CMDB data models are assigned simple integer values:
Data model | CMDB versions | Effect |
---|---|---|
6 | 7.6.03 and later | HasImpact and ImpactDirection attributes are set as appropriate. |
5 | 7.6.03 and later | Only to be used with legacy SIM version 7.4. BMC_Impact relationships with Name “ImpactOnly” are created. |
4 | 7.6.03 and later | No impact details are set by BMC Discovery. They may be set by Impact Normalization in the CMDB. |
3 | 7.6 before 7.6.03 | BMC_Impact relationships with name “IMPACT” are created. |
2 | 7.5 | BMC_Impact relationships with name “IMPACT” are created. |
User examples
To modify an existing connection
You can modify the configuration of an existing CMDB connection using the --update
option:
[tideway@appliance01 ~]$ tw_sync_control --update --id 2d104b55361df7974e4d1bf86e434d444253796e63436f6e666967 --username=system --name 8102_4 Password: Target successfully updated: Id: 2d104b55361df7974e4d1bf86e434d444253796e63436f6e666967 Name: 8102_4 Type: CMDB Endpoint: <IP address> User: Demo Dataset: John_4 Datamodel: CMDB 7.6.03 and later (with impact attributes) Continuous: False [tideway@appliance01 ~]$
The most likely usage of the tw_sync_control
utility is to automate regular synchronization of an existing CMDB connection using cron updated with tw_cron_update. The following command is modified to use a password file and a query for the same connection:
[tideway@appliance01 ~]$ tw_sync_control --id 2d104b55361df7974e4d1bf86e434d444253796e63436f6e666967 --username=system --passwordfile=/usr/tideway/etc/passwd.txt --sync="search Host where name has subword 'example'"
The automation requires the command to be entered into a .cron file in the /usr/tideway/etc/cron
directory. In this example, tw_sync_control.cron
.
[tideway@appliance01 ~]$ cd etc/cron [tideway@appliance01 cron]$ ls tw_appliance_stats.cron tw_compress_logs.cron tw_cron.header tw_cron.previous tw_log_performance.cron tw_sync_control.cron [tideway@appliance01 cron]$ more tw_sync_control.cron # # cron job to sync Windows hosts # runs every day at 01:00 # 0 1 * * * /usr/tideway/bin/tw_sync_control --id 2d104b55361df7974e4d1bf86e434d444253796e63436f6e666967 --username=system --passwordfile=/usr/tideway/etc/passwd.txt --sync="search Host where name has subword 'example'" [tideway@appliance01 cron]$
Comments
Log in or register to comment.