Important

   

Starting version 8.9.03, BMC Network Automation is renamed to TrueSight Network Automation. This space contains information about BMC Network Automation 8.9.02 and previous versions. For TrueSight Network Automation 8.9.03 and later releases, see the TrueSight Network Automation documentation.

Understanding tools and scripts

The BCAN_HOME/tools directory contains a variety of scripts for maintaining the BMC Network Automation system. Each of these scripts has corresponding .sh scripts for Linux and .bat scripts for Microsoft Windows. Any differences in command-line parameters or functionality are noted.

Some of the scripts are included only with installations that use the embedded PostgreSQL database. These scripts are noted. Scripts, their syntax, and descriptions are listed in the following table:

Tools and scripts

Script

Syntax and description

backup_db.sh backup_db.bat

backup_db.sh [backup file name]

This script creates a backup of your PostgreSQL database. This script takes a single optional parameter of the backup file name. If not provided, the backup is saved to bcan.dump. The backup file is always placed in the BCAN_DATA/dbbackup directory.

The backup can be restored by using the restore_db.sh script.

Note: Embedded PostgreSQL only.

create_db.sh create_db.bat

create_db.sh

Creates the bcan database on an embedded PostgresSQL instance.

Note: Embedded PostgreSQL only.

create_guid.sh create_guid.bat

create_guid.sh

Prints a globally unique identifier (GUID) to the screen. Typically, this is used only when developing a new custom device type or custom action to assign a GUID value to the Device Type, Vendor, Custom Action, or Trail that does not collide with others that might be added in the future.

create_keystore.sh create_keystore.bat

create_keystore.sh

Creates the certificate and keystore file used by the application HTTPS connector. Typically this is only used by the installer. However, you can use this script as a sample to regenerate or recreate a certificate or the keystore.

ena_control.sh ena_control.bat

ena_control.sh [start | stop]

Starts or stops all of the product services together.

export_keystore.sh export_keystore.bat

export_keystore.sh [path\output_file_name]

Exports the certificate used by the HTTPS connector of the application into a file by the supplied name (or, if no name is supplied, into the bca-networks.cert file in the current directory).

You can use this script to share the certificate with another application (for example, BMC Atrium Orchestrator).

import_users.sh import_users.bat

import_users.sh [path\input_file_name] 

This script imports users from an XML file into the application database. The XML file user records can indicate whether the user data should be updated or skipped if the user already exists.
Note: Stop the BCA-Networks web server before running this script.

 Click here to see the XML template that you can use to import users
<?xml version="1.0" encoding="UTF-8"?>
<import>
    <!-- mergeMode affects editing of existing users 
(based on query for the supplied username).
use "skip" not to edit the user; use "overlay"
to replace all values with these new values. Has no effect
when adding a new user (i.e. when username does not lookup
to an existing user). --> <user mergeMode="overlay"> <name>userName</name> <password>cleartextPassword</password> <email>userName@domain</email> <enabled>true</enabled> <!-- or false --> <roles> <role>roleName1</role> <role>roleName2</role> </roles> <dynamicFields> <dynamicField name="Full Name"> myFullName </dynamicField> </dynamicFields> </user> </import>

init_dbms.sh init_dbms.bat

init_dbms.sh [BCAN_USER_account_password]

Warning

Running this script erases all existing data in the database.

This script re-creates the entire BMC Network Automation database. After running init_dbms, run restore_db or populate_db to create the database tables and data.

Notes:

  • Stop the BCA-Networks web server before running this script.
  • Embedded PostgresSQL only.

populate_db.sh populate_db.bat

populate_db.sh

This script creates the database tables and populates the tables with the default (initial) set of application data. This script works with the embedded PostgreSQL database and distributed Oracle, Microsoft SQL Server, and PostgreSQL databases.

This script attempts to drop and recreate all the database tables. However, for best results, it is better to start with an empty database.

query_db.sh
query_db.bat

query_db.sh

This script launches a PostgresSQL interactive query prompt. Refer to PostgreSQL documentation for additional information about how to run queries on the database.

Note: Embedded PostgresSQL only.

reset_password.sh reset_password.bat

reset_password.sh [-all] [new_password]

This script is used to reset the passwords of the sysadmin account or all users passwords.

The script is relevant only for installations configured for local authentication. The script does not reset passwords for remote authentication such as RADIUS, TACACS, LDAP, or Active Directory.

By default, the sysadmin password is reset to sysadmin1. You can also provide a specific password on the command line.

The following restrictions apply to local passwords:

  • Cannot be blank (empty string)
  • Cannot contain a space character
  • Must be at least 6 characters in length
  • Cannot exceed 40 characters in length
    User accounts that are authenticated by a third-party application such as Active Directory must conform to the policies of that application.

To change all user account passwords, run the script as follows:

reset_password.sh -all

restore_db.sh
restore_db.bat

restore_db.sh [-d] {restore file name}
restore_db.bat [/d] {restore file name}

This script is applicable for embedded PostgresSQL only. It restores a previously backed-up copy of your database. If the backed-up version is not the same as the current application version, the restore script also performs an update by running the upgrade_db script (described below). All stored reports are deleted from the resulting database.

This script takes two parameters.

  • The -d or /d option is used to drop the existing database before performing the restore. If this parameter is not specified and the database already exists, an error is displayed.
  • The second parameter is the file to restore. The file should be located in the BCAN_DATA/dbbackup directory.

Note:

Stop the BCA-Networks web server before running this script.

Warning

Do not use this script to restore a database that was backed up in versions prior to 8.3.00. Otherwise, unexpected failures could occur. You need to first upgrade to BMC Network Automation version 8.3.00 and then to version 8.9.x.

upgrade_db.sh

upgrade_db.bat

This script performs an upgrade of the database tables to align with the version of the BMC Network Automation software that is installed on your system. If the database tables are set up for the same version as the current version of the BMC Network Automation software that is installed, the script exits silently. If the database tables are set up for a version newer than the version of the BMC Network Automation software that is installed, the script displays an error.

Note that all stored reports are deleted by this script.

This script works with the embedded PostgreSQL database and distributed Oracle, SQL Server, and PostgreSQL databases.

Warning

Do not use this script to upgrade a database that was backed up in versions prior to 8.3.00. Otherwise, unexpected failures could occur. You need to first upgrade to BMC Network Automation version 8.3.00 and then to version 8.9.x.

The following files in BCAN_HOME/tools are used by the installation process or invoked indirectly. Do not run these scripts. Each script comes in a .sh and .bat version.

  • create_system_parameter.sh
  • create_user.sh
  • enable_custom_actions.sh
  • setenv.sh
  • setenv_db.sh
  • publish_services.sh
  • pg_ctl_start.sh
  • pg_ctl_wrapper.sh
  • start_service.sh
  • initdb_wrapper.sh
  • generate_import_schema.sh .
  • import_csm_artifacts.sh
  • validate_db.sh 


Was this page helpful? Yes No Submitting... Thank you

Comments