Cisco Active Network Abstraction Administrator Guide, 3.6.6
Utility Scripts

Table Of Contents

Utility Scripts

Restarting the Cisco ANA Gateway

Restarting a Cisco ANA Unit

Adding Multiple VNEs

Command Syntax

Configuration File

Results

Changing Passwords for the Cisco ANA Database and Workflow Scheme

Running a Command on All Cisco ANA Units


Utility Scripts


This appendix describes the following Cisco ANA utility scripts:

Restarting the Cisco ANA Gateway

Restarting a Cisco ANA Unit

Adding Multiple VNEs

Changing Passwords for the Cisco ANA Database and Workflow Scheme

Running a Command on All Cisco ANA Units

Restarting the Cisco ANA Gateway

You can restart the gateway from the UNIX command line.

To restart the gateway:


Step 1 Open a Telnet session to the Cisco ANA gateway, and log into the machine.

Step 2 Run the following script:

~sheer/Main/mvm.csh 


Restarting a gateway affects units in the following ways:

All units that were up before the gateway was restarted remain up. They are not restarted.

All units that were down are restarted.

For information on restarting units, see:

Restarting a Cisco ANA Unit

Running a Command on All Cisco ANA Units


Note When the gateway is restarted, all clients are reconnected.



Note The server status can be verified using Cisco ANA Manage.


Restarting a Cisco ANA Unit

Restarting a unit stops all AVM processes on that unit and restarts them.

Given that the system saves part of its information within the process memory, restarting a unit causes some of the information to disappear. Therefore, it takes as long as the longest full polling cycle for the system to recover all information that was stored in the process memory prior to the restart. Data that was saved in persistent storage before restarting is available immediately.

Restarting a machine can cause some of the VNEs running on the machine to be reported as unreachable. This is due to handshake protocols with the unit that fail due to the unavailability of the VNEs.

Restarting a machine stops all active queries, flows, and transactions that are currently being run within the VNEs that run on the restarted Cisco ANA unit.

If a unit is running, you cannot restart it by restarting the gateway. The mvm.csh script restarts Cisco ANA only on the server (gateway or unit) on which you run mvm.csh. For more information, see Restarting the Cisco ANA Gateway.

To restart a unit:


Step 1 Open a Telnet session to the Cisco ANA unit and log into the machine.

Step 2 Run the following script:

~sheer/Main/mvm.csh 


Adding Multiple VNEs

Cisco ANA provides a sample Perl script that enables you to add multiple VNEs to Cisco ANA at the same time. The script name is vne_creation_script.pl and it resides in Main/scripts. This script reads a configuration file with the relevant VNE information, adds the VNEs to Cisco ANA, and produces a report log file for your reference. If appropriate for your network and environment, you can schedule this script to run as a cron job.

The high-level process for adding multiple VNEs includes the following tasks:

1. Create a configuration file that contains the VNEs that you want to add. For details, see Configuration File.

2. Run the command as described in Command Syntax.

3. Verify the results as described in Results.

Command Syntax

Log into the Cisco ANA gateway as user sheer to run this command.

The vne_creation_script.pl script uses the following command format:

perl vne_creation_script.pl [configuration_filename] [log_suffix]

where:

configuration_filename is the name of the file containing the information about the VNEs to be added to Cisco ANA. See Configuration File for more information about this file.

log_suffix is a unique identifier for the bulk VNE addition.

If you do not supply the arguments, the script prompts you for the information. For example:

% perl ./vne_creation_script.pl 
please enter input file name : 
vne_addition_1.txt 
please enter log file suffix 
( any number or id so you will know it belongs to your setup ):
333 
.
.
.
finished reading at : 16:42:37 
finished 

Configuration File

The vne_creation_script.pl script takes the name of a configuration file as one of its arguments. The configuration file contains information about the VNEs that you want to add to Cisco ANA and uses a flat text file format.

To create a configuration file for adding VNEs:


Step 1 Start the configuration file with the following entry:

mm gateway-ip

The configuration file must begin with this entry.

Step 2 (Optional) Enter the Cisco ANA username and password, as follows:

user username
password password

If you do not enter the username and password in the configuration file, you are prompted for them when the script runs.

Step 3 Enter information for the VNEs that you want to add by using any of the following entries:

Entry
Description

mc unit-ip

Adds the specified unit and uplinks to the gateway.

scheme scheme-name

Specifies the scheme to be used for the VNE. Options for the scheme name are:

product

ipcore

For more information about schemes, see General Tab, page 6-16.

scheme default

Sets the scheme to the default scheme (product).

avm number [memory-allocation]

Adds an AVM with the specified number and memory allocation (optional).

load avm-number

Loads the specified AVM.

agent-name ip [telnet "telnet-seq"] [snmpr read-community-string] [snmpw write-community-string]

Adds and loads the agent with any specified Telnet or SNMP information.

cloud-name ip cloud

Adds and loads a cloud with the specified name and IP address.

# remark

Treats this line as a comment.

read_file file-containing-BQL-commands

Puts the specified BQL file content into the gateway. This can be used for adding static links.

For more information about using BQL scripts to add AVMs and VNEs, see the Cisco Active Network Abstraction 3.6.6 Customization User Guide.



When you are done, your configuration file might resemble the following:

mm 172.20.68.122
user root 
password admin 

scheme product

mc 172.20.68.122

avm 208 350
22.2.4.22_10 20.0.10.17 telnet ":,admin,Router>,enable,:,admin,Router#,"
22.3.9.22_10 20.0.10.33 telnet ":,admin,Router>,enable,:,admin,Router#,"
22.10.2.22_10 20.0.10.103 telnet ":,admin,Router>,enable,:,admin,Router#,"
22.8.4.22_10 20.0.10.83 telnet ":,admin,Router>,enable,:,admin,Router#,"
22.5.7.22_10 20.0.10.53 telnet ":,admin,Router>,enable,:,admin,Router#,"
22.7.1.22_10 20.0.10.69 telnet ":,admin,Router>,enable,:,admin,Router#,"
22.7.6.22_10 20.0.10.74 telnet ":,admin,Router>,enable,:,admin,Router#,"
Cloud1 10.10.10.1       cloud
Cloud6 10.10.10.6       cloud
Cloud54 10.10.10.54     cloud
Cloud4 10.10.10.4       cloud

A more complete example of a configuration file is provided with Cisco ANA at ~/Main/scripts/vne-examples.txt.

Results

When the vne_creation_script.pl script has successfully executed, you can view the additions in Cisco ANA Manage (see Figure B-1) or the log file. The log file resides in the directory from which the script was run and is named scriptlogxxx.txt where xxx is the suffix that you specified when issuing the command. Using the example that was provided in Command Syntax, the log file would be named scriptlog333.txt.

Figure B-1 Bulk VNE Addition in Cisco ANA Manage

If the vne_creation_script.pl script fails, it displays the errors it encounters. For example:

<Description type="String">ERROR (5111): An VNE by that name already exists</Description>
<ErrorStackTrace type="java.lang.String_Array">
<java.lang.String>com.sheer.metromission.plugin.bosmanage.handlers.ElementManagementElemen
tHandler.validateNewElement(ElementManagementElementHandler.java:442)</java.lang.String>
.

If errors appear, correct the configuration file or BQL script and run the command again.

Changing Passwords for the Cisco ANA Database and Workflow Scheme

The passwords for user sheer and the workflow scheme sheer are established during Cisco ANA installation. In releases prior to Cisco ANA 3.6.4, these passwords cannot be modified by editing their associated files because the passwords are encrypted.

Beginning with Cisco ANA 3.6.4, a script is included that allows you to change the passwords for the Cisco ANA database and the workflow scheme.


Note This script changes only the password that Cisco ANA uses to connect to the database; it does not change the Oracle password for the user sheer.


Before You Begin

Change the Oracle password of the user sheer before changing the Cisco ANA database password as described in this procedure.

Shut down Cisco ANA on the gateway. If you do not, Cisco ANA will be shut down by the procedure.

To change the password for the Cisco ANA database user sheer or for the workflow scheme sheer:


Step 1 Open a Telnet session to the Cisco ANA gateway and log in as user sheer.

Step 2 At the prompt, enter the following command:

sheer@server12 [~]%DatabasePasswordChange.pl 
+ This application changes the database references in ANA.
+ IF YOU DECIDE TO CONTINUE, ANA WILL BE SHUT DOWN.

Step 3 When prompted, enter Y to continue or N to exit the procedure:

Are you sure you want to continue? (Y,N) [default N] Y 

Step 4 As the script proceeds, enter the required information:

Oracle IP address

Oracle SID

New password for the Cisco ANA database

Oracle listener port number

For example:

Please provide the following database parameters:
  - Would you like to use a remote database? (y or n) [default n] y 
  - Please enter Oracle IP address [default 172.20.68.73] 172.20.68.74 
  - Enter the Oracle sid: MCDB
  - Enter the password for the scheme sheer: 
  - Enter the Oracle Listener port: 1521

Step 5 When prompted, indicate whether you would like to edit the attributes for the workflow scheme sheer:

  - Use defaults for WorkFlow Scheme? (Y,N) [default Y] 

Step 6 If you do not use the default values for the workflow scheme, enter the required information:

Oracle SID

Oracle IP address

Oracle listener port number

New password for workflow scheme sheer

For example:

Please enter WorkFlow scheme DB parameters
  - Enter the Oracle sid: MCDB 
  - Would you like to use a remote database? (y or n) [default n] y 
  - Please enter Oracle IP address [default 172.20.68.121] 127.0.0.1 
  - Enter the Oracle Listener port: 1521 
  - Enter the password for the scheme sheer: 

After you enter this information, the system updates the associated files:

  - updating avm11.xml
  - updating avm66.xml
Done. Please restart ANA with mvm.csh.

Step 7 Restart the Cisco ANA gateway by running the following script:

~sheer/Main/mvm.csh 


Running a Command on All Cisco ANA Units

The script rall.csh is a utility used to run a given command on all units (not on the gateway), as follows:

~sheer/Main/rall.csh script 

where script is the script name.

The following script example restarts all units (not the gateway):

~sheer/Main/rall.csh mvm.csh