command line interface (9030664-03) - ca...

111
Command Line Interface SPECTRUM Enterprise Manager SPECTRUM Management

Upload: buiduong

Post on 17-Jun-2019

230 views

Category:

Documents


0 download

TRANSCRIPT

Command Line Interface

SPECTRUM Enterprise ManagerSPECTRUM Management

Summary of Changes

Command Line Interface

Version Date Reason for Change Description of Change

9030664-00 Oct 1999 Technical accuracy, new functionality.

- Added UNIX to DOS Conversion.- The environmental variable, SPECTOP, is now called SPECROOT. See CLI Environment Variables.- Revised all command syntaxes. See Command Descriptions.

9030664-01 Feb 2000 Standardization to a new, “more readable” format, technical accuracy, new functionality.

- Reformatted in accordance with 7”x9” portrait layout.- Revised the syntax of the create command. See Command Descriptions.

9030664-02 May 2000 Usability - Minor editorial updates.

9030664-03 Jun 2000 Technical accuracy. - Updated the information in What is the Command Line Interface?

Command Line Interface Page 3

Notice

Aprisma Management Technologies, Inc. (Aprisma) reserves the right to make changes in speciÞcations and other information contained in this document without prior notice. The reader should in all cases consult Aprisma to determine whether any such changes have been made.The hardware, Þrmware, or software described in this manual is subject to change without notice.IN NO EVENT SHALL APRISMA, ITS EMPLOYEES, OFFICERS, DIRECTORS, AGENTS, OR AFFILIATES BE LIABLE FOR ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT OF OR RELATED TO THIS MANUAL OR THE INFORMATION CONTAINED IN IT, EVEN IF APRISMA HAS BEEN ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF SUCH DAMAGES.

Copyright © June, 2000 by Aprisma Management Technologies, Inc. All rights reserved.Printed in the United States of America.Order Number: 9030664-03

Aprisma Management Technologies, Inc.121 Technology WayDurham NH 03824

SPECTRUM

, the

SPECTRUM

IMT/VNM

logo,

DCM

,

IMT

, and

VNM

are registered trademarks, and

SpectroGRAPH

,

SpectroSERVER

,

Inductive Modeling Technology

,

Device Communications Manager

, and

Virtual Network Machine

are trademarks of Aprisma or its afÞliates.

C++

is a trademark of American Telephone and Telegraph, Inc.

UNIX

is a trademark of UNIX System Laboratories, Inc.

OSF/Motif

and

Motif

are trademarks of the Open Software Foundation, Inc.

X Window System

is a trademark of X Consortium, Inc.

Ethernet

is a trademark of Xerox Corporation.

Cisco

is a trademark of Cisco Systems, Inc.

SGI

is a trademark of Silicon Graphics, Inc.

IBM

is a registered trademark of International Business Machines Corporation.

Virus Disclaimer

Aprisma makes no representations or warranties to the effect that the Licensed Software is virus-free.Aprisma has tested its software with current virus checking technologies. However, because no anti-virus system is 100% reliable, we strongly caution you to write protect and then verify that the

Command Line Interface Page 4

Licensed Software, prior to installing it, is virus-free with an anti-virus system in which you have conÞdence.

Restricted Rights Notice

(Applicable to licenses to the United States Government only.)1. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in

subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013.

Aprisma Management Technologies, Inc., 121 Technology Way, Durham, New Hampshire 03824.

2. (a) This computer software is submitted with restricted rights. It may not be used, reproduced, or disclosed by the Government except as provided in paragraph (b) of this Notice or as otherwise expressly stated in the contract.

(b) This computer software may be:

(1) Used or copied for use in or with the computer or computers for which it was acquired, including use at any Government installation to which such computer or computers may be transferred;

(2) Used or copied for use in a backup computer if any computer for which it was acquired is inoperative;

(3) Reproduced for archival or backup purposes;

(4) Modified, adapted, or combined with other computer software, provided that the modified, combined, or adapted portions of the derivative software incorporating restricted computer software are made subject to the same restricted rights;

(5) Disclosed to and reproduced for use by support service contractors in accordance with subparagraphs (b) (1) through (4) of this clause, provided the Government makes such disclosure or reproduction subject to these restricted rights; and

(6) Used or copied for use in or transferred to a replacement computer.

(c) Notwithstanding the foregoing, if this computer software is published copyrighted computer software, it is licensed to the Government, without disclosure prohibitions, with the minimum rights set forth in paragraph (b) of this clause.

(d) Any other rights or limitations regarding the use, duplication, or disclosure of this computer software are to be expressly stated in, or incorporated in, the contract.

(e) This Notice shall be marked on any reproduction of this computer software, in whole or in part.

Command Line Interface Page 5

Contents

Preface 7

What is the Command Line Interface? 11

Two Ways of Accessing SPECTRUM Information.......................................................11Why Use CLI? ..............................................................................................................12CLI Commands Versus UNIX Commands ...................................................................12Using CLI in Shell Scripts.............................................................................................12Major CLI Components ................................................................................................13CLI Environment Variables ..........................................................................................13CLIÕs Interaction with VnmShd .....................................................................................15CLI Architecture ...........................................................................................................15Error Checking .............................................................................................................16Accessing CLI from Windows NT.................................................................................16CLI Commands ...........................................................................................................17An Outline of a CLI Session ........................................................................................18

Example Uses of CLI 19

Creating a New SPECTRUM User...............................................................................19Running UNIX CLI Shell Scripts on NT........................................................................23Example CLI Script File Creating a New User .............................................................23Other Example Uses of CLI ........................................................................................25

Using CLI for Event Reporting..................................................................................25Using CLI to Disable the Yellow Alarm for ÒBad Port StatusÓ ...................................26Using CLI to Jump Between Models ........................................................................26

Command Descriptions 27

ack alarm......................................................................................................................27connect.........................................................................................................................28create ...........................................................................................................................33current ..........................................................................................................................39

Contents

Contents

Command Line Interface Page 6

destroy .........................................................................................................................41disconnect ....................................................................................................................44jump .............................................................................................................................45seek..............................................................................................................................47setjump ........................................................................................................................52show.............................................................................................................................54stopShd ........................................................................................................................75update ..........................................................................................................................77

Sample Scripts 83

active_ports..................................................................................................................84app_if_security .............................................................................................................84cli_script .......................................................................................................................85database_tally ..............................................................................................................86update_mtype ..............................................................................................................86

How to Suppress Headers 88

Error Messages 90

Error Locations and Conventions.................................................................................90Messages.....................................................................................................................90

CLI Command Format Summary 102

UNIX to DOS Conversion 106

Index 109

Command Line Interface Page 7

Preface

This preface describes the purpose and content of this manual, related documentation, assumptions about SPECTRUM Command Line Interface users, and

typographical conventions used in this manual.

Who Should Read This Guide

This guide is intended for users who want to use the SPECTRUM Command Line Interface (CLI) to access information in the SPECTRUM knowledge-base without running the SpectroGRAPH graphical user interface. This guide also provides the information needed for developers who wish to write UNIX

shell scripts to access the SPECTRUM knowledge-base.

Prerequisites for Users and Developers

Users of the SPECTRUM Command Line Interface are expected to have an understanding of:

• Object oriented systems

• SPECTRUM

• Organization of information in the SPECTRUM knowledge-base.

• UNIX

Developers who want to create shell scripts to access SPECTRUM should have significant experience using SPECTRUM, UNIX, and scripts.

Preface

Command Line Interface Page 8

How to Use This Guide

This guide describes how to use the SPECTRUM Command Line Interface to communicate with SPECTRUM. It is organized into the following format:

Typographical Conventions

This manual uses the following typographical conventions:

Section Description

What is the Command Line Interface?

This section describes the SPECTRUM CLI (Command Line Interface) commands.

Example Uses of CLI

This section gives a short tutorial on using CLI commands to create a new SPECTRUM user. It also includes brief examples of other CLI functions.

Command Descriptions

This section alphabetically describes each Command Line Interface command.

Sample Scripts

This section describes the sample scripts included with CLI. You can access these scripts in the sample_scripts directory, which is in the $SPECROOT/vnmsh directory.

How to Suppress Headers

This section explains how to suppress headers in CLI output.

Error Messages

This section alphabetically lists CLI error messages, with the solutions to and/or reasons for the errors.

CLI Command Format Summary

This section provides a quick reference guide to CLI commands.

UNIX to DOS Conversion

This section provides a quick reference guide for UNIX-to-DOS command conversions.

Preface

Command Line Interface Page 9

Convention Description

$ (dollar sign) In command examples, the $ represents the system prompt.

# (pound sign) In script examples, the # represents a comment in the code.

| (vertical line) In a command format line, the | represents an

either/or

choice; you can use the parameter on either side of the line.

<arrow brackets>

In a command format line or in a system message, arrow brackets (< >) enclosing an italicized parameter(s) indicate that part of the command that is user or system supplied. The italicized parameter(s) indicates the type of information the user or system supplies. For example:

connect [<

hostname>]

[square brackets] In a command format line, square brackets ([ ]) indicate an optional part of a command. For example:setjump [-n] <text_string>

Italics Referenced SPECTRUM publications are in bold italics. For example: the Command Line Interface User’s Guide.User supplied parameter names appear in italics. For example, the word filename is a generic name referring to a specific filename on your system.Referenced section titles and section headings appear in italics (hypertext-blue italics for on-line readers).

Monospaced typeface Command names and file names such as command and .vnmshrc appear in monospace typeface.Code examples and text displayed on-screen appear in monospace typeface.For example: show landscapesSSName LHandledvsgi 0x400000

Preface

Command Line Interface Page 10

Bold Monospaced typeface

In command descriptions, a Bold Monospaced typeface is used to emphasize the name of the command when the command has different forms like create alarm or create event.

Parameter Names In code examples, parameter names are used instead of fictitious literal names so that the developer can see what the parameter is. These parameter names are displayed in italics. For example, a message that displays a specific host system name on the screen would be shown in the manual as:

connect: successful hostname

The actual screen display would show a literal host name, such as:

connect: successful fennario

Note:Note:Calls your attention to information of special importance.

Caution:Caution:

Calls your attention to procedures which, if not followed exactly, could damage or otherwise incapacitate your software or hardware.

Convention Description

Command Line Interface Page 11

What is the Command Line Interface?

This section describes the SPECTRUM CLI (Command Line Interface) commands.

Two Ways of Accessing SPECTRUM InformationYou can access SPECTRUM from its graphical user interface (the SpectroGRAPH) with its menus, buttons, and icons. Or you can run SPECTRUM from a UNIX system prompt (or DOS window on NT) with CLI commands.

Starting with SPECTRUM version 6.0, CLI on NT no longer relies strictly upon a UNIX shell as a command interpreter. You can use either:

• A native DOS shell accessed fromStart>Programs>Command Prompt

or,

• A bash shell invoked by typing bash at the DOS prompt.

If you use a DOS shell, for all instances of UNIX (not CLI) commands in this manual, substitute the equivalent DOS command whenever necessary. For example, use find instead of grep. See UNIX to DOS Conversion for examples of commonly used UNIX commands and their DOS equivalents. See also the SPECTRUM 6.0 Core SRN for more details concerning SPECTRUM’s native NT support.

What is the Command Line Interface? Why Use CLI?

Command Line Interface Page 12

Why Use CLI?The Command Line Interface (CLI) provides access to the SpectroSERVER in situations where it is not possible or not desirable to use the SpectroGRAPH graphical user interface. One such situation is the use of a character-based terminal to remotely access the SpectroSERVER.

CLI Commands Versus UNIX CommandsCLI commands are similar to UNIX commands and can be used in conjunction with UNIX or DOS commands, especially grep (find), pipes, and redirect symbols. Some CLI commands, however, can conflict with UNIX commands of the same name. For example, the CLI update command can conflict with the UNIX update command. To avoid conflict, when typing at the command line, use ./update from within the vnmsh directory; when using a script, use the full pathname for the CLI command (for example, $SPECROOT/vnmsh/update).

Using CLI in Shell ScriptsThe CLI commands can be incorporated into shell scripts or menu systems to give you a more powerful and versatile interface. You can also define aliases to enter commands more conveniently.

Each of the CLI commands sends output regarding the success or failure of the command to standard error. Normal output expected as the result of the success of a command, however, is sent to standard output. Each of the commands also generates a return code of zero on success and a non-zero error code on failure. These return codes enable shell scripts

Note:Note:

The CLI update command always responds back to the user with either a confirmation that the update was made to the attribute or that the update failed. If you get no response back from CLI when using the update command, then you should type which update and more than likely, the system will respond with “/etc/update.”

What is the Command Line Interface? Major CLI Components

Command Line Interface Page 13

using the CLI commands to make decisions based on the success or failure of each command.

Major CLI ComponentsThe SPECTRUM Command Line Interface (CLI) consists of a set of executable commands, four environment variables, and a daemon that maintains communication with a SpectroSERVER. All the CLI commands are listed in the section CLI Commands.

The SPECTRUM Command Line Interface is a core SPECTRUM component, and is installed by default with the core SPECTRUM product using the standard SPECTRUM installation program, Install. Therefore, no custom installation script options are required. See the SPECTRUM Installation Guide for more information.

CLI Environment VariablesThere are four environment variables you can set for CLI:

¥ CLIMNAMEWIDTH

By default, the create, the seek, and the show commands each display a maximum of 16 characters for the model name. However, with the environment variable CLIMNAMEWIDTH, you can specify a dif-ferent number of characters (up to 1024) to be displayed for model names. For example, using the C shell:

setenv CLIMNAMEWIDTH 32

You can set this variable in your .login file, in a script, or just before you issue a command. You can set or change it more than once in a CLI session to suit your needs, depending on the length of the model names you use.

What is the Command Line Interface? CLI Environment Var iables

Command Line Interface Page 14

¥ CLISESSID

The CLISESSID environment variable is for use in scripts. Set the CLISESSID variable to $$, which represents the process ID of the run-ning shell script. This is necessary when using cron to run CLI scripts concurrently. For example, using the C shell:

setenv CLISESSID $$

Also, setting the CLISESSID environment variable to a unique value for each CLI session is required if you run CLI on NT using the bash shell instead of a DOS window. One way to do this is to give a unique time stamp to each bash shell. For example:

export CLISESSID=Ôdate +%sÔ

¥ SPECROOT

The SPECROOT environment variable is required for the show alarms or show events commands when the -x option is specified. This will grab the description of the alarm or event from the SG-Support direc-tory tree if it can be located so that the output from the show alarms and the show events commands are expanded.

On UNIX, you can specify the SPECROOT variable in your login shell and you should set this variable to the SPECTRUM home directory. For example, using the C shell:

setenv SPECROOT /home/spectrum

On NT, you can can modify the environment variables by navigating to Start>Control Panel>System>Environment.

¥ CLIPATH

The CLIPATH environment variable is for use in scripts. It specifies the $SPECROOT/vnmsh directory, so that the scripts can use CLI com-mands.

What is the Command Line Interface? CLI ’s Interact ion wi th VnmShd

Command Line Interface Page 15

CLIÕs Interaction with VnmShdThe first user to issue the connect command on a given workstation automatically kicks off the CLI Local Server (VnmShd daemon) on that workstation and establishes a connection to a SpectroSERVER. Only one CLI Local Server can be running per node (workstation) and that daemon makes only one connection to a SpectroSERVER.

Once the CLI Local Server is started on a workstation, all subsequent users who connect to CLI on that workstation use the same CLI Local Server and can therefore connect to only the SpectroSERVERs or landscapes, in the landscape map of the initial SpectroSERVER connected to.

CLI ArchitectureFigure 1 outlines the CLI architecture.

Figure 1: Command Line Interface Architecture

Local System NETWORK Remote System

CLI Commands

daemon

connect

show

update

seek

.vnmshrcresource file

.

..

VnmShd

VnmShd

SpectroSERVERs

What is the Command Line Interface?

Error Checking

Command Line Interface Page 16

The CLI Local Server, which uses

.

vnmshrc

at startup, has two major functions:

• To maintain a constant network connection with SpectroSERVER in order to avoid performing a connection and disconnection each time a command is executed. The CLI Local Server maintains a

single

connection to SpectroSERVER regardless of the number of CLI users connected to the daemon. Because socket connects and disconnects are expensive (as far as time and resources used are concerned), this saves time and resources.

• To maintain state information for each CLI user. The

current

and

setjump

commands, for example, require the CLI Local Server to store state information. The

current

command stores a model handle and a landscape handle for use in future commands. The

setjump

command stores a text string to identify the user’s current position in a SPECTRUM landscape.

Error Checking

When working in SpectroGRAPH, SPECTRUM enforces certain rules; for example, when creating or moving device models in the different views. CLI does not enforce these rules and makes the assumption that users know the rules. So, CLI will allow users to create models and place them wherever they want

without doing any SPECTRUM error checking

. You will

get an error if you attempt to use a CLI command in a manner that does not conform to its format.

Accessing CLI from Windows NT

Access to CLI is available through the NT Administrative Tools menu. To launch CLI from the NT desktop:

1

Click the

Start

button.

2

Navigate to:

Programs>Command Prompt

What is the Command Line Interface?

CLI Commands

Command Line Interface Page 17

A DOS prompt window appears, ready to accept CLI commands.

CLI Commands

The CLI commands are summarized in the following table. See

Command Descriptions

for a complete description of each command. See

CLI Command Format Summary

for a format summary of the commands.

These commands are described in detail in

Command Descriptions

.

Command Description

ack alarm

Acknowledges an alarm.

connect

Connects to SpectroSERVER.

create

Creates a new alarm, association, event, or model in a specified landscape.

current Sets a model as the “current” model or a landscape as the “current” landscape to be acted on by other CLI commands, or display the current model and current landscape.

destroy Destroys an alarm, association, or model in a specified landscape.

disconnect Disconnects from SpectroSERVER.jump Returns to a model and landscape saved with the

setjump command.seek Finds a model in a specified landscape.setjump Saves the current model and the current landscape

under a user-defined text string label, so that the jump command can be used to subsequently return to this model and landscape.

show Displays information about objects in a specified landscape.

stopShd Disconnects all users from SpectroSERVER and terminate the CLI Local Server.

update Updates the attributes of a model or model type.

Note:Note:

Use the command line continuation character “\” for any command line greater than 256 characters.

What is the Command Line Interface? An Out l ine of a CLI Session

Command Line Interface Page 18

An Outline of a CLI Session The following is an outline of a CLI session, using all the CLI commands:

1. connect Use the connect command to start the CLI Local Server daemon (VnmShd) and attach to the SpectroSERVER.

2. show models Use the show command to display the models currently in the landscape.

3. show types Display the model types in the landscape. 4. seek Find a particular model in the landscape. 5. setjump Save the current model and current landscape

to return to later. 6. current Set this model or landscape as the current

model and landscape. 7. jump Return to the model and landscape previously

saved by setjump. 8. create Create a new model.

ordestroy Destroy an existing model.orupdate Change the attributes of an existing model.

9. ack alarm Acknowledge an alarm for a model.10. disconnect Use the disconnect command to detach from

SpectroSERVER.orstopShd Detach all CLI users from the

SpectroSERVERs and terminate the CLI Local Server.

Caution:Caution:

The SPECTRUM Command Line Interface allows a user to make changes directly to the SPECTRUM knowledge-base without the error-checking present in SpectroGRAPH. It is possible to cause database corruption or a system crash by entering incorrect information. Therefore, you should be extremely careful when you use the create, destroy, or update commands.

Command Line Interface Page 19

Example Uses of CLI

This section gives a short tutorial on using CLI commands to create a new SPECTRUM user. It also includes brief examples of other CLI functions.

Creating a New SPECTRUM UserThe following is a step-by-step example of how to create a new SPECTRUM user with CLI commands. This is a good place to start if you are new to CLI. It is also useful to know since you cannot use SPECTRUM unless a SPECTRUM user model has been been created for your login ID.

1 The first thing to do when starting any CLI session is to connect to the SpectroSERVER. If you have a problem connecting, see Error Messages. If you have trouble with any other command, also check the Error Messages appendix.

a Navigate to the <$SPECROOT>/vnmsh directory, then at the prompt, type (example from a bash shell with a $ prompt):

b $ ./connect

2 To create a new user, we must create a model in the SpectroSERVER database. To do this, we must know the model type we want to create. In this case, it is a model of type User.

3 To identify the model type, we need to know its handle; that is, the hexadecimal number SPECTRUM gives it to uniquely identify or point to it. We can find the model type handle through the following command:

$ ./show types | grep User

Note:Note:

The ./ is important. Some UNIX systems use the show command for reading mail. If the . is not the first path in the user’s environment, then it will be required.

Example Uses of CLI Creat ing a New SPECTRUM User

Command Line Interface Page 20

The CLI show command will return something resembling the follow-ing lines. This will depend on what model types you have modeled.

The model we are interested in is the User model type:

4 For someone to use the SpectroSERVER, a user model must exist for that person’s login ID.

Imagine we have a user, John Doe, whose login id is j_doe. If we are going to allow him access to the SpectroSERVER database, we have to create a user model with j_doe as the model’s name.

Thus, we need to create a model of model type "User" (0x10004) with model name to be j_doe. To do this, we have to find out the attribute handle for the model name. This is the hexadecimal value identifying the name associated with the model.

$ ./show attributes mth=0x10004 | grep -i name

The output from this command should look like this:

Handle Name Flags

0x10004 User V,I,D

0x1040a UserGroup V,I,D

0x1040f DefUserGroup V,I,N,U,R

0xaa000dÊÊÊÊÊÊ GenSwUserPortÊÊÊÊÊÊ V,I,D

0xf000d ForeUserAgen V,I,D

0xaf000c ForeUserApp V,I,D

0x10004 User V,I,D

Id Name Type Flags0x10000Ê Modeltype_Name Text String R,S,M0x1006e Model_NameÊÊÊÊ Text String R,W,G,O,M,D

Example Uses of CLI Creat ing a New SPECTRUM User

Command Line Interface Page 21

5 We want the Model_Name attribute:

6 Now that we know the model type handle and the attribute id for model name, we can go ahead and create the model using the CLI create command:

$ ./create model mth=0x10004 attr=0x1006e,val=j_doe

When the command completes, you should see a line resembling:

created model handle = 0x40000e

7 Use the CLI current command to store it internally to CLI:

$ ./current mh=0x40000e

This will return:

current model is 0x40000e

current landscape is 0x400000

0x10074 User_Full_Name Text String R,W,O,D0x1155f gib_mtype_name Text String R,W,S,D0x11560 gib_mtype_name_menu Text String R,W,S,D0x11561 gib_model_name Text String R,W,D0x11563 gib_model_name_menu Text String R,W,D0x1197d WatchNames Tagged OctetÊ R,W,D

0x1006e Ê Model_NameÊ Text StringÊ R,W,G,O,M,D

Note:Note:

The actual hexadecimal number will be different. It will be whatever your system creates for it.

Example Uses of CLI Creat ing a New SPECTRUM User

Command Line Interface Page 22

8 One other thing you may want to do is to change the user’s community string. By default, the community string is ADMIN,0. This gives the user access to everything in the SpectroSERVER database.

Again we use the show attributes command to find the attribute we need:

9 This can be modified with the update command:

This means the user now has access to only those models or views that have a Security_String of Subnet3. The 5 indicates the type of access granted to the user, in this case read-only access. See the SPECTRUM document, Security and User Maintenance, for more information on SPECTRUM Security.

There are several shortcuts to this task:

• In the create and update commands, you can update more than one attribute at a time. We could have shortened this process to:

$ ./create model mth=0x10004 attr=0x1006e,val=j_doe attr=0x1007a,val=Subnet3,5

• Another way to shorten this procedure is through a script. If the script were called new_user it could look like this:

$ new_user j_doe Subnet3,5

New user j_doe has been successfully added to the SPECTRUM database. j_doeÕs Community string was successfully set to Subnet3,5.

$ ./show attributes | grep Community_String

0x1007a User_Community_StringÊ ADMIN,0

$ ./update attr=0x1007a,val=Subnet3,5

Id ÊÊÊÊÊÊÊÊ Name Value0x1007aÊ User_Community_StringÊ Subnet3,5

Example Uses of CLI Running UNIX CLI Shel l Scr ipts on NT

Command Line Interface Page 23

The script would take in one or more command line parameters, run the programmed CLI commands and inform the administrator whether the commands were successful or not.

Running UNIX CLI Shell Scripts on NTYou can run UNIX CLI shell scripts on Windows NT by invoking the bash shell. To access the bash shell on NT:

1 Open a DOS window.

2 Type bash at the system prompt.

A bash shell appears. You can now run your script(s).

Example CLI Script File Creating a New User

Note:Note:

Any UNIX CLI shell scripts you may have will execute in this environment, as if on a native UNIX platform.

## Check to see if CLIPATH is set. If it is not then we will have to create it.## Setup a variable to point to the /install_area/vnmsh directory so we can# find the commands we need.#if [ -z Ò$CLIPATHÓ ] then CLIPATH=/usr/data/Spectrum/6.0/vnmsh export CLIPATHfi

## Test to make sure the CLIPATH points to a valid directory#if [ ! -d $CLIPATH ] then echo ÒERROR: could not find $CLIPATHÓ echo ÒPlease find the correct path to the vnmsh directory and setÓ echo Òthe CLIPATH environment variable to it.Ó

Example Uses of CLI Example CLI Scr ipt Fi le Creat ing a New User

Command Line Interface Page 24

exit 0fi## Now check to see how many command line arguments there are. If there are# none, then echo a usage message. If there is one, that is all we really# need to create a new user... If there is a second argument then we can# set the Community_String at the same time.## This setup is only for creating a user on the local system or what the# .vnmshrc file points to for the vnm_hostname. A third field could be# added that accepts the vnm_hostname to connect to.## Optionally, the getopts shell command can be used to parse ÒswitchesÓ to# the script: -n for name, -c for community string and -v for vnm_hostname.## (NOTE: getopts should be located in /usr/bin/getopts if the script is done# in bourne shell (sh). k-shell has a built in getopts function)#if [ $# -eq 0 ] then echo ÒUsage: $0 username [Community_String]Ó exit 1

elif [ $# -eq 1 ] then command=Óattr=0x1006e,val=$1Ó flag=0elif [ $# -eq 2 ] then command=Óattr=0x1006e,val=$1 attr=0x1007a,val=$2Ó flag=1fi

## Okay, we should be all set now to go ahead and create the new user.# The first thing we have to do is connect.#$CLIPATH/connect

## Now letÕs check the exit status of the connection to see if we got in...#if [ $? -ne 0 ] then echo ÒERROR: could not connect to SpectroSERVER. $0 exitingÓ exit 0

Example Uses of CLI Other Example Uses of CLI

Command Line Interface Page 25

Other Example Uses of CLI

Using CLI for Event ReportingCLI keeps a list of the most current 2000 events that occur on a landscape. However, if there are many events occurring on a landscape, then it is likely that the most recent events only date back an hour or so.

Note that you need to set the SPECROOT environment variable when using the -x option with the “show events” command. The following is an example of using CLI for event reporting:

$ ./show events | more$ ./setenv SPECROOT /home/spectrum$ ./show events -x > event_rpt

fi## Okay if we made it this far then we have a connection. LetÕs try the# create command.#$CLIPATH/create model mth=0x10004 $command

## Now we check the exit status again and see if we actually created a model.#if [ $? -ne 0 ] then echo ÒERROR: could not create a new user. $0 exitingÓ exit 0

else echo -n ÒNew user $1 createdÓ if [ $flag -eq 1 ] then echo Ò Community_String was set to $2Ó fi echo ÒSuccessfully created new model... exiting.Ófi

$CLIPATH/disconnectexit 1

Example Uses of CLI Other Example Uses of CLI

Command Line Interface Page 26

Using CLI to Disable the Yellow Alarm for ÒBad Port StatusÓA script in the $SPECROOT/vnmsh/sample_scripts directory called update_mtype allows users to update a non-shared attribute for a model type. For example, if you want to update the BadInterfaceAlarm (0x11b3e) attribute for all models of model type HubCSIEMME, you could use this script to do that. The BadInterfaceAlarm (0x11b3e) attribute needs to be set to False to disable this alarm.

Using CLI to Jump Between ModelsThe jump and setjump commands are very useful in scripts when you may want to “jump” back and forth between different models. The setjump command allows you to assign a text string to represent a model handle and its corresponding landscape handle. Then you can use the jump command with that text string to bring that information back as the current model handle. For example:

$ ./current mh=0xb6000f8current model is 0xb6000f8current landscape is 0xb600000

$ ./setjump emmemodel 0xb6000f8 and landscape 0xb600000 stored under emme

$ ./jump emmecurrent model is 0xb6000f8current landscape is 0xb600000

Command Line Interface Page 27

Command Descriptions

This section alphabetically describes each Command Line Interface command.

ack alarmAcknowledges an alarm.

Syntax: ack alarm aid=<alarm_id> [lh=<landscape_handle>]

Parameters: alarm_id decimal numberlandscape_handle hexadecimal number

Description: This command acknowledges the alarm specified by alarm_id in the landscape specified by landscape_handle. If landscape_handle is not specified, then the command acknowledges the alarm specified by alarm_id in the current landscape.

Output: If ack alarm is entered with a valid alarm_id and a valid landscape_handle, the following message is displayed:

ack alarm: successful

Examples: $ ack alarm aid=42 lh=0x400000ack alarm: successful

Note:Note:

Acknowledging one alarm for a model acknowledges all alarms for that model.

Command Descriptions connect

Command Line Interface Page 28

connectConnects to SpectroSERVER.

Syntax: connect [<hostname>] [lh=<landscape_handle>][vnmsocket=<vnmsocket>]

Parameters: hostname character stringlandscape_handle hex numbervnmsocket hex number

Description: This command connects the user of the SPECTRUM Command Line Interface to the SpectroSERVER running on host system hostname and sets the landscape specified by landscape_handle to be the current landscape. If the CLI Local Server is not already running, the connect command starts it.

If hostname is not specified, the command connects the user to the host specified in the CLI resource file .vnm-shrc.

If landscape_handle is not specified, the command sets the current landscape to the landscape of the hostname specified.

If vnmsocket is not specified, the command connects to the SpectroSERVER using the socket specified in the .vnmshrc. You would use vnmsocket when you want to connect to another SpectroSERVER on a different port connection, defined by vnmsocket.

Error messages reported by the CLI Local Server are dis-played in the Console window on UNIX. On NT, these errors are displayed in the user’s bash shell window.

Rules Governing a CLI Session

The following rules apply to the use of the connect com-mand:

Command Descriptions connect

Command Line Interface Page 29

•Each user on each terminal device is required to use the connect command to initiate communications with SpectroSERVER and the disconnect command to terminate communication with SpectroSERVER.

•Once the first user has entered the connect command, the CLI Local Server is connected to the SpectroSERVER. Other CLI users using the same CLI Local Server can connect only to those SpectroSERVERs that are in the initial SpectroSERVER’s landscape map. Once all users have disconnected, the connect command may be used to connect to SpectroSERVERs in a different landscape map.

•The first user of the connect command must be defined as a user in the SPECTRUM database of the original SpectroSERVER in order to successfully connect to the SpectroSERVER.

•NT users running CLI in the bash shell also must define CLISESSID. See CLI Environment Variables.

•The terminal device for a particular user is determined using the ttyslot(3V) function. This introduces some special considerations if you intend to run a CLI script as a cron script. cron scripts are not attached to a ttyslot, so the ttyslot function returns 0 for all cron scripts. This means that two CLI scripts running as cron scripts at the same time would appear to the CLI Local Server as one CLI user. This situation could lead to unpredictable results. Therefore, if you intend to run a CLI script as a cron script, you are required to put a line at the top of the script, exporting the environment variable CLISESSID, set to a unique numeric value, so that CLI can distinguish between the different cron scripts.

Using CLISESSID Within a Script

The following example defines a unique CLI session ID within a script:

Command Descriptions connect

Command Line Interface Page 30

setenv CLISESSID $$

This sets CLISESSID to the process ID of the shell running the script. The CLISESSID environment variable is required by CLI to identify a user when the ttyslot func-tion returns zero. The CLISESSID environment variable should only be set once for each CLI session. Therefore, if a CLI script running as a cron script calls other CLI scripts, only the top-level script should set the CLISESSID environment variable. The other CLI scripts will run under the same process ID as long as you do not invoke a new shell (#!/bin/csh) at the top of the script. If you want to invoke a new shell in the other scripts, you need to export the CLISESSID and do another connect and disconnect.

Certain configurations or windowing environments (such as NT) may also cause the ttyslot function to return zero, even when a CLI command is entered from the com-mand line. This will cause the connect command to return the following error:

connect: variable CLISESSID not set

In this situation, simply set the CLISESSID environment variable as indicated above, either from the command line or from within your .cshrc or other startup file.

Because CLI uses the user’s name and terminal device to identify each CLI user, a user running more than one CLI script at the same time from the same terminal device (running a script in background while running another in foreground or running multiple scripts in background) will appear to CLI as the same user and unpredictable behav-ior may result.

Command Descriptions connect

Command Line Interface Page 31

For example, if one script sets the current model to be a certain model, then another script (run by the same user from the same terminal device) sets the current model to be a different model, then the first script performed some operation on the current model using the update com-mand, the update command would be performed on the current model set by the second script.

Because of this, only one CLI session should be run by a user from a particular terminal device at one time. If the user wants to run more than one CLI session at once, he or she should do so from separate terminal devices or run them using the at(1) or batch(1) commands (with the CLISESSID environment variable set to a unique value for each).

Example: #! /usr/bin/sh# A sample script to get alarms of a specific # severity and set the CLISESSID

if [$# !=1]thenecho ÒUsage: $0 <alarm severity>Óexit 0fi

CLISESSID=$$

$SPECROOT/vnmsh/connect$SPECROOT/vnmsh/show alarms | grep -i $1$SPECROOT/vnmsh/disconnect

exit 0

Command Descriptions connect

Command Line Interface Page 32

Output: If the command is successful, the following message is displayed:

connect: successful hostnamecurrent landscape is landscape_handle

where hostname is the user-entered SpectroSERVER host or the host specified in .vnmshrc and landscape_handle is the user-entered landscape or the landscape for the host.

Command Descriptions create

Command Line Interface Page 33

createCreates an object.

Syntax: create alarm [-nr] sev=<alarm_severity>cause=<probable_cause_id> mh=<model_handle>|

create association rel=<relation>lmh=<left_model_handle> rmh=<right_model_handle>|

create event type=event_type text=event_text [mh=model_handle|lh=landscape_handle] [-a] |

create model ip=<IP Address|Low_IP-High_IP>[comm=Community_Name][to=Time_Out][tc=Try_Count] [lh=landscape_handle]|

create model mth=model_type_handle[attr=attribute_id,val=value ...]lh=landscape_handle]

Options: -a If the -a option is specified with the create eventcommand, then the event generates any associatedalarm. If the [-a] is not specified with createevent, then the event will be logged but noassociated alarms will be generated.

-nr If the -nr (no replace) option is specified withcreate alarm, then the new alarm will be added tothe list of alarms for the model, without replacingany existing alarms.

Parameters: alarm_severity character stringattribute_id hex numbercomm character stringevent_text character string (quoted if

spacesare included)

event_type hex numberip_address valid IP address in dotted

decimal formatlandscape_handle hex numberleft_model_handle hex numbermodel_handle hex number

Command Descriptions create

Command Line Interface Page 34

model_type_handle hex numberprobable_cause_id hex numberrelation character stringright_model_handlehex numbertc integerto integervalue hex or decimal number,

character string, or otherattribute type, depending on theattribute

Description: create alarm creates an alarm with severity alarm_severity and cause probable_cause_id for the model with model_handle. Valid alarm severity options are: Critical, Major, Minor, OK, Maintenance, Lost_Contact, or Initial. By default the new alarm will replace an existing alarm. For more information on alarm severities, see Getting Started with SPECTRUM for Administrators or the appropriate management module guide.

create association creates an instance of the relation (an association) between the model with left_model_handle and the model with right_model_handle.

create event creates an event with type event_type and text event_text for the model specified by model_handle or the landscape specified by landscape_handle. If model_handle or landscape_handle is not specified, then the event is created for the current landscape (not the current model). Some events in SPECTRUM do not have an associated model. For example, when an application connects to the SpectroSERVER, no model is associated with the event.

Command Descriptions create

Command Line Interface Page 35

event_type (also called an event code in SPECTRUM) is a 4-byte hexadecimal number: the two most significant bytes specify the developer ID for the event (0001 for Aprisma-generated event codes), and the two least significant bytes are a unique identifier for the event. Only certain event types include user-entered text. Examples of such event types are those which include the variable {S 0} in their event format files. For those event types which do not include user-entered text, the event_text parameter is ignored but must still be present on the command line. See Modeling with the GnSNMPDev Toolkit for more information on events, event codes, and event messages.

create model can be specified with an IP address or with a model type handle. In either case, the system creates the model in the landscape specified by landscape_handle. If landscape_handle is not specified, the command creates the model in the current landscape.

If you specify create model with an IP address, the sys-tem finds the object at the specified ip_address and cre-ates a model for it, having all the properties of that object including any associated children. This means, for exam-ple, if the object is a hub, the create model command cre-ates a model of a hub with all its ports. The IP address has to be in dotted decimal and this command does not sup-port the setting of attribute IDs. You can also define a range of IP addresses with the create model command by specifying the Low_IP and High_IP parameters separated by “-”, to create several models at once. If the Community_Name is not specified, the newly created model

Note:Note:

The model_name attribute is required only when creating a model of type “User”. See Creating a New SPECTRUM User for details on creating a user model.

Command Descriptions create

Command Line Interface Page 36

will be of type "Pingable". If the Community_Name is speci-fied, the device will be modeled to appropriate model type. The Try _Count and Time_Out options are similar to those in SpectroGRAPH’s ‘create model by IP’ dialog box.

If you specify the create model command with a model type handle, the system creates a model of type model_type_handle. With this use of the create model command, you can optionally set the value of one or more attributes for the created model.

When you specify the create model command with a model type handle, you can also specify multiple attributes in that one command by specifying multiple attribute_id,value pairs, each pair separated from adjacent pairs by a space.

The attribute values that the user specifies when creating a model of a particular model type while using Spec-troGRAPH should be specified in the create model com-mand, otherwise Inference Handler errors may occur within SpectroSERVER when the model is created. For example, when creating a Hub_CSI_IRM3 model using SpectroGRAPH, the user is presented with a window in which he enters values for Model Name, Network Address, Community Name, etc. The user should specify values for these attributes when using the create model command to create a model of the same type using CLI.

Output: If create alarm is entered with a valid alarm_severity, a valid probable_cause_id, and a valid model_handle, the created entry in the alarm table is displayed. The create time is displayed in hh:mm:ss format.

If create association is entered with a valid relation between a valid left_model_handle and right_model_handle, the following message is displayed:

create association: successful

Command Descriptions create

Command Line Interface Page 37

If create event is entered with a valid event_type, valid event_text, and a valid model_handle or landscape_handle (if present), the created entry in the event table is displayed. The create time is displayed in hh:mm:ss format.

If create model is entered with a valid model_type_handle and valid attribute_id,value pairs (if present), the created model handle is displayed.

If create model is entered with a valid ip_address, the created model handle is displayed.

Examples:

Note:Note:

By default, the create command displays a maximum of 16 characters for the model name. However, with the environment variable CLIMNAMEWIDTH, you can specify a different number of characters (up to 1024) to be displayed for model names. See CLI Environment Variables formore details.

$ create alarm sev=Critical cause=0x10308 mh=0x400134

ID Date Time PCauseID MHandle MName MTypeName Severity Ack984 05/11/2000 12:33:27 0x10308 0x400134 12.84 Bdg_CSI_CN Critical No

$ create association rel=Collects lmh=0x400009 rmh=0x400134

create association: successful

Command Descriptions create

Command Line Interface Page 38

$ create event type=0x1061a text=“fan down” mh=0x40013

Date Time Type MHandle MName MTypeName05/11/2000Ê 12:39:42Ê 0x1061aÊ 0x400134Ê 12.84Ê Bdg_CSI_CNB20

$ create model mth=0x102d attr=0x1027f,val=132.177.12.84\

  attr=0x1006e,val=12.84 lh=0x400000

created model handle = 0x400134

$ create model ip=131.141.145.144

created model handle = 0xac0017

$ create model ip=206.61.231.1-206.61.231.5

Creating model for IP=206.61.231.

created model handle = 0x9a00259

Creating model for IP=206.61.231.2

create model: DCM device unreachable

Creating model for IP=206.61.231.3

create model: DCM device unreachable

Creating model for IP=206.61.231.4

create model: DCM device unreachable

Creating model for IP=206.61.231.5

created model handle = 0x9a0025a

Command Descriptions current

Command Line Interface Page 39

currentSets current model or current landscape.

Syntax: current [mh=<model_handle>|lh=<landscape_handle>]

Parameters: model_handle hex numberlandscape_handle hex number

Description: The current command sets the model specified by model_handle to be the current model or the landscape specified by landscape_handle to be the current landscape. If neither the model_handle nor the landscape_handle is specified, then current displays the current model handle and the current landscape handle.

When the user sets a current model, CLI sets the current landscape to the landscape in which the model is con-tained. When a user sets the current landscape, the CLI sets the current model as undefined.

Separate current model and current landscape values are maintained for each session connected to the CLI Local Server.

The current command retains state information (i.e., the current model and the current landscape) only for the ses-sion that called it.

Output: If a valid model_handle is specified as input, the following message is displayed:

current model is model_handlecurrent landscape is current_landscape_handle

If a valid landscape_handle is specified as input, the fol-lowing message is displayed:

current model is undefinedcurrent landscape is landscape_handle

Command Descriptions current

Command Line Interface Page 40

If no model_handle and no landscape_handle are speci-fied, the following message is displayed:

current model is current_model_handlecurrent landscape is current_landscape_handle

If no model_handle and no landscape_handle are speci-fied and no current model is defined, the following mes-sage is displayed:

current model is undefinedcurrent landscape is current_landscape_handle

Examples: $ current mh=0x400142

current model is 0x400142current landscape is 0x400000

$ current lh=0x500000

current model is undefinedcurrent landscape is 0x500000

$ current

current model is undefinedcurrent landscape is 0x500000

Note:Note:

The current landscape will always contain a value because it is set by the connect command.

Command Descriptions destroy

Command Line Interface Page 41

destroyDestroys an object.

Syntax: destroy alarm [-n] aid=<alarm_id> [lh=<landscape_handle>]destroy association [-n] rel=<relation> lmh=<left_model_handle>

rmh=<right_model_handle>destroy model [-n] mh=<model_handle>

Options: -n If the -n (no prompt) option is specified with thedestroy command, then the system does notprompt for confirmation. This option is useful inCLI scripts.

Parameters: alarm_id decimal numbermodel_handle hex numberlandscape_handle hex numberleft_model_handle hex numberrelation character stringright_model_handlehex number

Description: destroy alarm destroys the alarm specified by alarm_id in the landscape specified by landscape_handle. Unless the -n option is specified, destroy alarm prompts the user for confirmation before destroying the alarm. If the landscape_handle is not specified, then the command destroys the alarm specified by alarm_id in the current landscape. Use the show alarms command to determine the alarm_ids for a model.

destroy association destroys the association (instance of the relation) between the model with left_model_handle and the model with right_model_handle. Unless the -n option is specified, destroy association prompts the user for confirmation before destroying the association.

destroy model destroys the model with model_handle. Unless the -n option is specified, destroy model prompts the user for confirmation before destroying the model.

Command Descriptions destroy

Command Line Interface Page 42

Output: Unless the -n option is specified, one of the following messages is always displayed:

destroy model: are you sure?destroy association: are you sure?destroy alarm: are you sure?

Valid responses are y, yes, Y, Yes, n, no, N, No.

If destroy alarm is entered with a valid alarm_id and valid landscape_handle, the following message is dis-played:

destroy alarm: successful

If destroy association is entered with a valid relation between a valid left_model_handle and right_model_handle, the following message is displayed:

destroy association: successful

If destroy model is entered with a valid model_handle, the following message is displayed:

destroy model: successful

Examples: $ destroy alarm aid=300

destroy alarm: are you sure? ydestroy alarm: successful

$ destroy association rel=Lost_and_Found lmh=0x400001 rmh=0x40h0142

destroy association: are you sure? ydestroy association: successful

Command Descriptions destroy

Command Line Interface Page 43

$ destroy model mh=0xa600715

Following model will be destroyed:

Model_Handle -> 0xa600715Model_Type_Handle -> 0x10004Model_Name -> garciaparraModel_Type_Name -> User

destroy model: are you sure? ydestroy model: successful

Command Descriptions d isconnect

Command Line Interface Page 44

disconnectDisconnects from SpectroSERVER.

Syntax: disconnect

Parameters: None

Description: This command disconnects the SPECTRUM Command Line Interface user from the currently-connected SpectroSERVER.

Output: If the command is successful, the following message is displayed, where hostname is the name of the SpectroSERVER host to which the user was connected:

disconnect: successful from hostname - connected for xx hours, yy minutes

See Also: See the stopShd command for information about disconnecting all CLI users and terminating the CLI Local Server.

Command Descriptions jump

Command Line Interface Page 45

jumpJumps to previously saved model and landscape.

Syntax: jump [<text_string>]

Parameters: text_string character string

Description: The jump command sets the current model and the current landscape to be the model and landscape previously saved under the label text_string by the setjump command. If text_string is not specified, then a list of text_strings given in previous setjump commands is displayed.

Output: If jump is entered with a valid text_string that has been previously defined, the new current model and the current landscape are displayed:

current model is current_model_handle current landscape is current_landscape_handle

If jump is entered without a text_string, a list of the cur-rently defined text_strings is displayed. For example:

text_string1text_string2

:

:

If jump is entered and the new current model is undefined, the following message is displayed:

current model is undefinedcurrent landscape is current_landscape_handle

Example: $ jump tutorial

current model is 0x400142current landscape is 0x400000

Command Descriptions jump

Command Line Interface Page 46

See Also: See the setjump command for more information on saving a model and landscape.

Command Descriptions seek

Command Line Interface Page 47

seekLooks up a model.

Syntax: seek [-i] [-s] attr=<attribute_id>,val=<value>[lh=<landscape_handle>]

Options: -i If the -i (ignore case sensitivity) option isspecified with the seek command, then themodel information specified with the valparameter is returned without regard to case.

-s If the -s (substrings allowed) option is specifiedwith the seek command, then the model information specified with the val parameter isreturned with substrings, if applicable.

These options can be used in any order (e.g., -i -s, or -s -i).

Parameters: attribute_id hex numberlandscape_handle hex numbervalue hex or decimal number, character

string, null value, or other attributetype, depending on the attribute

Description: The seek command finds the model(s) in the landscape specified by landscape_handle for which the attribute specified by attribute_id has the specified value. If landscape_handle is not specified, the command finds the model(s) in the current landscape for which the attribute with attribute_id has value. You can also use a wildcard (*) with seek to find instances of models containing a specified substring. If you enter a null value, you will find all models which have no name (i.e. attr=0x1006e).

Command Descriptions seek

Command Line Interface Page 48

Output: If seek is entered with a valid attribute_id and a valid value, all matching models are displayed in the following format:

If no matching models are found, the following message is displayed:

seek: no models found

Examples:

MHandle MName MTypeHnd MTypeNamemodel handle name model type handle name

Note:Note:

By default, the seek command displays a maximum of 16 characters for the model name. However, with the environment variable CLIMNAMEWIDTH, you can specify a different number of characters (up to 1024) to be displayed for model names. See CLI Environment Variables for more details.

$ seek attr=0x1006e,val=spectrum

MHandle MName MTypeHnd MTypeName0xb100018 spectrum 0x1004 User0xb10008d  spectrum 0x820000 ScmConfig

$ seek attr=0x1006e,val=SPECTRUM

MHandle MName MTypeHndÊ MTypeName0xb100018 SPECTRUM  0x820000 ScmConfig

$ seek attr=0x1006e,val=SPE

seek: no models found

Command Descriptions seek

Command Line Interface Page 49

$ seek attr=0x1006e,val=spe lh=0xb100000

seek: no models found

$ seek -i attr=0x1006e,val=spectrum

MHandle MName MTypeHndÊÊ MTypeName0xb10018 spectrum 0x10004 User0xb1008c SPECTRUM   0x820000 ScmConfig0xb1008d   spectrum 0x820000 ScmConfig

$ seek -i -s attr=0x1006e,val=SPECTRUM

MHandle MName MTypeHnd MTypeName0xb10018 spectrum 0x10004 User0xb10089 spectrum 0x820000 ScmConfig0xb1008c SPECTRUM 0x820000 ScmConfig0xb1008d   spectrum   0x820000   ScmConfig

$ seek -i -s attr=0x1006e,val=spectrum lh=0xb100000

MHandle MName MTypeHnd MTypeName0xb10018 spectrum 0x10004 User0xb10089 spectrum 0x820000 ScmConfig0xb1008c SPECTRUM 0x820000 ScmConfig0xb1008d   spectrum   0x820000   ScmConfig

Command Descriptions seek

Command Line Interface Page 50

$ seek -s attr=0x1006e,val=SPECTRUM

MHandle MName MTypeHnd MTypeName0xb10008c   SPECTRUM   0x820000   ScmConfig

$ seek attr=0x110df,val=0.0.C.18

seek: no models found

$ seek -s attr=0x110df,val=0.0.C.18

MHandle MName MTypeHnd MTypeName0xb100070 frog10 0x210022 Rtr_CiscoIGS0xb100072 frog10_1 0x220011 Gen_IF_Port0xb10005b cisco rtr 0x210022 Rtr_CiscoIGS0xb100070 frog10_2 0x220011 Gen_IF_Port0xb100070 cisco rtr_1 0x220011 Gen_IF_Port0xb100070   cisco rtr_2   0x220011   Gen_IF_Port

$ seek attr=0x1006e,val=spe*

MHandle MName MTypeHnd MTypeName0xb10018 spectrum 0x10004 User0xb10089 spectrum 0x820000 ScmConfig0xb1008d   spectrum   0x820000   ScmConfig

Command Descriptions seek

Command Line Interface Page 51

See Also: See the show attributes command for more information on attribute values.

$ seek attr=0x1006e,val=

MHandle MNameÊÊ MTypeHnd MTypeName0xd00258 0x102c8 Physical_Addr0xd002f8 0x102c8 Physical_Addr0xd00368 0x820000 ScmConfig0xd00259 0x102c8 Physical_Addr0xd002f9 0x102c8 Physical_Addr0xd00301   0x102c8   Physical_Addr

$ seek attr=0x1027f,val=192.168.93.*

MHandle MNameÊÊ MTypeHnd MTypeName0x28000190 192.168.93.14 0xd0004 HubCSIEMME0x280001a0 192.168.93.14_Sy 0x23001c System2_App0x28000198 192.168.93.14_St 0x590006 RMONApp0x28000191 192.168.93.14_A 0xd000a CSIIfPort0x280001a1 192.168.93.14_IC 0x230012 ICMP_App0x28000199 192.168.93.14_E 0x590013 RMONEthProbe0x280001a2 192.168.93.14_UD 0x230019 UDP2_App0x280001c2 DLM App 0x830001 DLM_Agent0x2800019a 192.168.93.14_E 0x590013 RMONEthProbe0x28000192 192.168.93.14_B 0xd000a CSIIfPort0x2800019b 192.168.93.14_E 0x590013 RMONEthProbe

Command Descriptions set jump

Command Line Interface Page 52

setjump Saves model and landscape.

Syntax: setjump [-n] <text_string>

Options: -n If the -n (no prompt) option is specified with thesetjump command, then the system does notprompt if text_string has been used before.

Parameters: text_string character string

Description: The setjump command saves the current model handle and current landscape handle under the label text_string. The user can subsequently use the jump command with text_string to set the current model handle and the current landscape handle back to the one stored under text_string. The user is prompted for verification if the same text_string is used in two setjump commands.

Separate setjump values are maintained for each session connected to the CLI Local Server. The setjump command retains information (that is, the session-assigned setjump text strings) only for the session that called it.

Output: If setjump is entered with a new text_string and a current model exists, the following message is displayed:

model current_model_handle and landscape current_landscape_handle stored under text_string

where current_model_handle is the handle of the current model and current_landscape_handle is the handle of the current landscape.

Command Descriptions set jump

Command Line Interface Page 53

If setjump is entered with a new text_string and a cur-rent model doesn’t exist, the following message is dis-played:

model undefined and landscape current_landscape_handle stored under text_string

If setjump is entered with a text_string that has already been defined in a previous setjump command, the follow-ing message is displayed:

setjump model: text_string already used. Overwrite?

Valid responses are y, yes, Y, Yes, n, no, N, No.

Examples: $ current mh=0x400142

current model is 0x400142current landscape is 0x400000

$ setjump -n tutorial

model 0x400142 and landscape 0x400000 stored under tutorial

See Also: See the current command for information on how to set a current model handle and a current landscape handle.

See the jump command for more information on jumping to a position saved using the setjump command.

Command Descriptions show

Command Line Interface Page 54

showShows objects.

Syntax: show models [mhr=low_model_handle-high_model_handle][mth=model_type_handle] [mname=model_name][lh=landscape_handle] |

show landscapes | show types [mthr=low_mth-high_mth] [mtname=mt_name]

[flags=V|I|D|N|U|R] [lh=landscape_handle] | show relations [lh=landscape_handle] | show associations [mh=model_handle] | show parents [rel=relation] [mh=model_handle] | show children [rel=relation] [mh=model_handle] | show attributes [-e] [attr=attribute_id[,iid=instance_id][,next]...|

[attrr=low_attr-high_attr] [attrname=attr_name]][mh=model_handle] |

show attributes mth=model_type_handle [attrr=low_attr-high_attr][attrname=attr_name] [flags=E|R|W|S|T|G|O|M|D|P|L][lh=landscape_handle] |

show alarms [-a] [-x] [mh=model_handle|lh=landscape_handle] | show events [-x] [-a | -n no_events]

[mh=model_handle|lh=landscape_handle] | show inheritance mth=model_type_handle [lh=landscape_handle] | show rules rel=relation [lh=landscape_handle] | show enumerations [attr=attribute_id] [mth=model_type_handle]

[lh=landscape_handle] show watch [mh=model_handle] [lh-landscape_handle]

Options: -a If the -a (all) option is specified, show alarms does not perform any masking and displays all Critical, Major, Minor, Maintenance, Lost_Contact, and Initial alarms.

-x If the -x (expand) option is specified (and the variable $SPECROOT is set), the output of the show alarms com-mand displays the text for the probable causes at the end of the output. The output of the show events command displays event formats.

-e If the -e (enumerations) option is specified, the out-put of the show attributes command displays database enumeration strings.

Command Descriptions show

Command Line Interface Page 55

-n If the -n (number of events) option is specified, the output of the show events command displays the speci-fied number of events.

Parameters: attribute_id hex numberinstance_id positive integer, or sequence of

dot-separated positive integerslandscape_handle hex numbermodel_handle hex numbermodel_type_handle hex numberno_events positive integerrelation character string

Description: show alarms shows all alarms for the model specified by model_handle or only the most severe alarm (if the alarm is Critical, Major, or Minor) for each model in the landscape specified by landscape_handle. If landscape_handle is specified, show alarms masks out any models that have Initial, Lost_Contact, or Maintenance alarms. As a result, only models with Critical, Major, or Minor alarms are displayed. If neither model_handle nor landscape_handle is specified, show alarms also performs masking and shows only the most severe alarm (if the alarm is Critical, Major, or Minor) for each model in the current landscape. The Ack field indicates whether the alarm has been acknowledged. The possible values for this field are Yes and No. The Assignment and Status fields show the alarm troubleshooter information and the alarm status, respectively. The alarm creation time is displayed in hh:mm:ss format.

show associations shows all instantiated relations (associations) defined for the model with model_handle. If model_handle is not specified, show associations shows all instantiated relations for the current model.

show attributes shows the attributes specified by attr=attribute_id for the model with model_handle. If

Command Descriptions show

Command Line Interface Page 56

no attribute_id is specified, show attributes lists all attributes and their values for the model with model_handle. If model_handle is not specified, show attributes shows all applicable attributes for the current model. A range of attributes can be specified by attrr=low_attr-high_attr. The instance ID for an attribute can be specified in instance_id when displaying a single attribute or a list of attributes for a particular model. instance_id must be a sequence of positive inte-gers separated by dots. Instance IDs can only be specified for list attributes. List attributes are attributes that have the list flag set.

When you work with list attributes remember these rules:

•To display all attribute values and instance IDs for a list attribute, do not enter an instance_id with the attribute_id. Just enter an attribute_id.

•To display the first attribute value and instance ID for a list attribute, enter ,next after the attribute_id.

•To display a specific attribute value and instance ID for a list attribute, enter an instance_id with the attribute_id.

•Finally, to display the next attribute value and instance ID after a specific instance ID of a list attribute, enter ,next after the instance_id.

•An instance ID cannot be specified when displaying all of the attributes of a model, for two reasons:

•An instance ID only applies to list attributes (for example, board and port attributes of a hub).

•The instance ID for certain attributes of a model may differ from the instance ID of other attributes within the same model.

Command Descriptions show

Command Line Interface Page 57

show attributes shows all the attributes (by ID, name, type, and flags) for model_type_handle in the landscape specified by landscape_handle. If landscape_handle is not specified, this command shows all model types defined in the current landscape. The Flags field will list the abbreviations of each of fifteen attribute flags (separated by commas) that are currently set. If a flag is not set, its abbreviation will not be in the list.

The following list includes the attribute flags and their abbreviations:

For a more detailed description of attribute flags, refer to the SPECTRUM Model Type Editor User’s Guide.

show children shows the children in relation for the model with model_handle. If relation is not specified, show children shows the children in all relations. If model_handle is not specified, show children shows the children for the current model.

show enumerations shows enumerated string value map-pings for the corresponding enumerated value specified.

show events shows the events for the model with model_handle or the events for all models in the land-scape specified by landscape_handle. The show events command will show by default the 2,000 most recent

Flag Abbreviation Flag Abbreviation

External E Global O

Readable R Memory M

Writable W Database D

Shared S Polled P

List T Logged L

Guaranteed G

Command Descriptions show

Command Line Interface Page 58

events for the model specified by model_handle or landscape_handle. If the -a option is specified, this com-mand shows a maximum of 10,000 events for the model specified by model_handle or landscape_handle. If the -n option is specified with an explicit no_events, the spec-ified number of events is displayed for the model specified by model_handle or landscape_handle. If neither model_handle nor landscape_handle is specified, this command shows events for all models in the current land-scape. If the -x option is specified, CLI displays text mes-sages explaining the event types. The event time is displayed in hh:mm:ss format.

show inheritance shows the model type inheritance for the model type specified by model_type_handle in the landscape specified by landscape_handle. If the landscape_handle is not specified, the current landscape is used. The possible values for this field are Base or Derived.

show landscapes shows all landscapes defined for each SpectroSERVER. The landscape map that is displayed is the map of the initial SpectroSERVER.

show models shows all models defined in the landscape specified by landscape_handle. If landscape_handle is not specified, this command shows all models defined in the current landscape. A range of model handles can be specified by mhr=low_model_handle-high_model_handle. Specific models can be searched for by specifying mname=model_name.

User models are identified by the show models command as either (Active) or (Not Active). If the user model's sta-tus is (Not Active), the user cannot yet connect to the server. Once the user model's status is (Active), the user can connect to the server.

show parents shows the parents in relation for the model with model_handle. If relation is not specified,

Command Descriptions show

Command Line Interface Page 59

show parents shows the parents in all relations. If model_handle is not specified, show parents shows the parents for the current model.

show relations shows all relations currently defined in the landscape specified by landscape_handle. If landscape_handle is not specified, this command shows all relations defined in the current landscape.

show rules shows the rules for the relation specified by relation in the landscape specified by landscape_handle. If landscape_handle is not specified, the current landscape is used.

show types shows all model types currently defined in the landscape specified by landscape_handle. If landscape_handle is not specified, this command shows all model types defined in the current landscape. The Flags field lists the abbreviations for each of six attribute flags that are currently set. If a flag is not set, its abbrevi-ation is not in the list.

The following list includes the model type flags and their abbreviations:

show types [mth=low_mth-high_mth] shows all model types within the range between low_mth and high_mth.

For a more detailed description of model type flags, refer to the SPECTRUM Model Type Editor User’s Guide.

Flag Abbreviation Flag Abbreviation

Visible V No Destroy N

Instantiable I Unique U

Derivable D Required R

Command Descriptions show

Command Line Interface Page 60

show watch shows a listing of applicable SpectroWATCH data for a model specified by model_handle defined in the landscape specified by landscape_handle.

The show commands use the following defaults when landscape_handle and model_handle are not specified:

COMMAND DEFAULT

show alarms current landscape

show associations current model

show attributes current model

show attributes mth current landscape

show children current model

show enumerations current landscape

show enumerations mth current landscape

show events current landscape

show inheritance current landscape

show models current landscape

show parents current model

show relations current landscape

show rules current landscape

show types current landscape

show watch current landscape

Command Descriptions show

Command Line Interface Page 61

Output: show alarms displays information in the following format:

If show alarms is used with the -x option, a table of cause codes and probable cause text messages is displayed after the last alarm. For example:

0x10402 DUPLICATE PHYSICAL ADDRESS0x10302 SpectroSERVER has lost contact with this device.

show associations displays information in the following format:

Note:Note:

For the show alarms and show events commands to work with the -x option, which displays probable cause messages for alarms and expanded event messages, SpectroGRAPH must be installed on the local server, and the environment variable SPECROOT must be set to the path of the SpectroGRAPH Support root directory (SG-Support). For example, if the SG-Support files are in/usr/Spectrum/SG-Support, set SPECROOT to /usr/Spectrum.

ID Date Time PCauseId MHandle MName MTypeName Severity Ack

id mm/dd/yyyy hh:mm:ss cause_id handle name name severity ack

Assignment Status

assignment status

Note:Note:

By default, the show command displays a maximum of 16 characters for the model name. However, with the environment variable CLIMNAMEWIDTH, you can specify a different number of characters (up to 1024) to be displayed for model names. See CLI Environment Variables for more details.

LMHandle LMName Relation RMHandle RMName

handle name relation handle name

Command Descriptions show

Command Line Interface Page 62

show attributes displays information in the following format:

show attributes mth displays information in the follow-ing format:

show children displays information in the following for-mat:

show enumerations displays information in the following format:

show enumerations mth displays information in the fol-lowing format:

show events displays information in the following format:

Id Name Iid Value

id name iid value

Id Name Type Flags

id name type flags

MHandle MName MTypeHnÊ MTypeName Relation

handle name handle name relation

Id String Value

id string value

MHandle String Value

handle string value

Date Time Type MHandle MName MTypeName

mm/dd/yyyy hh:mm:ss type handle name name

Command Descriptions show

Command Line Interface Page 63

If show events is used with the -x option, the events dis-played do not have a fixed format. The following is an example of typical output:

Thur 11 May, 2000 - 8:04:01 - Alarm number 10 generated for device AntLAN of type LAN_802_3. Current condition is Initial(DEFAULT). (event [00010701])

show inheritance displays information in the following format:

show landscapes displays information in the following format:

show models displays information in the following format:

show parents displays information in the following for-mat:

show relations displays information in the following for-mat:

MHandle MName Flags Inheritance

handle name flags inheritance

SSName Precedence Port Service LHandle

ssname precedence port service handle

MHandle MName MTypeHnd MTypeName

handle name handle name

MHandle MName MTypeHnd MTypeName Relation

handle name handle name relation

Name Type

relation_name relation_type

Command Descriptions show

Command Line Interface Page 64

show rules displays information in the following format:

show types displays information in the following format:

show watch displays information in the following format:

Examples:

LMTHandle LMTName RMTHandle RMTName

handle name handle name

Handle Name Flags

handle name flags

Watch_Id Watch_Name Watch_Type

watch_id watch_name watch_type

$ show alarms lh=0x110000

ID Date Time PCauseId MHandle MName MTypeName Severity Ack

928 05/11/2000 02:33:22 0x10c04 0x110000c infinity VNM Critical No

Assignment Status

mcdonald Working on it

$ show associations mh=0x400141

LMHandle LMName Relation RMHandle RMName

0x400001 LostFound Lost_and_Found 0x400141 12.77-bridge

Command Descriptions show

Command Line Interface Page 65

$ show attributes mh=0xcd00011

Id Name Iid Value

0xd0000 Modeltype_Name User

0x10000 Modeltype_Handle 0x10004

0x10004 Contact_Status 1

0x10009 Security_String ADMIN

0x1000a Condition 0

$ show attributes -e mh=0xcd00011

Id Name Iid Value

0xd0000 Modeltype_Name User

0x10000 Modeltype_Handle 0x10004

0x10004 Contact_Status Established

0x10009 Security_String ADMIN

0x1000a Condition Normal

$ show attributes -e attrr=0x1000-0x11fff attrname=status mh=0xcd00011

Id Name Iid Value

0x10004 Contact_Status Established

0x110ed Dev_Contact_Status 2

0x111a56 ContactStatusEventSwitc FALSE

Command Descriptions show

Command Line Interface Page 66

$ show attributes attr=0x1006e mh=0x400165

Id Name Iid Value

0x1006e Model_Name 142.77

$ show attributes attr=0x100d4 mh=0x400165

Id Name Iid Value

0x100d4 If_Out_Ucast_Pkts 1 1169585

0x100d4 If_Out_Ucast_Pkts 2 1227557

0x100d4 If_Out_Ucast_Pkts 3 1227557

0x100d4 If_Out_Ucast_Pkts 4 8624873

$ show attributes attr=0x100d4,next mh=0x400165

Id Name Iid Value

0x100d4 If_out_Ucast_Pkts 1 1169589

$ show attributes attr=0x100d4,iid=2 mh=0x400165

Id Name Iid Value

0x100d4 If_Out_Ucast_Pkts 2 1227569

Command Descriptions show

Command Line Interface Page 67

$ show attributes attr=0x100d4,iid=2,next mh=0x400165

Id Name Iid Value

0x100d4 If_out_Ucast_Pkts 3 1227573

$ show attributes mth=0x10004 lh=0xd00000

Id Name Type Flags

0xd0000 namingTree Group ID S,D

0x10000 Modeltype_Name Text String R,S,M,K

0xd0200 upsBatteryCapacity Integer E,R

$ show attributes mth=0x3d0002 attrname=port

Id Name Type Flags

0x10023 Agent_Port Integer R,W,M,D

0x112e3 IF_Port_Types Octet String R,W,S,D

0x11554 Create_IF_Port Boolean R,S,D

0x11d28 PortLinkDownEventCode Counter R,S,D

0x11d29 PortLinkUpEventCode Counter R,S,D

0x11d3d support_ICMP Boolean R,W,D

0x11d41 Poll_Linked_Ports Boolean R,W,M,D

0x11e24 TelnetPortNum Integer R,W,G,D

Command Descriptions show

Command Line Interface Page 68

$ show attributes mth=0x3d0002 attrname=port flags=rwmd

Id Name Type Flags

0x10023 Agent_Port Integer R,W,M,D

0x11d41 Poll_Linked_Ports Boolean R,W,M,D

$ show attributes -e attrname=port mh=0xcd00023

Id Name Iid Value

0x10023 Agent_Port 161

0x112e3 IF_Port_Types 11.0.22.0

0x11554 Create_IF_Port TRUE

0x11d28 PortLinkDownEventCode 66312

0x11d29 PortLinkUpEventCode 66313

0x11d3d support_ICMP TRUE

0x11d41 Poll_Linked_Ports TRUE

0x11e24 TelnetPortNum 0

$ show children mh=0x400009

MHandle Name MTypeHnd MTypeName Relation

0x40000d 12.84 0x100d6 Bdg_CSI_CNB2 Collects

Command Descriptions show

Command Line Interface Page 69

$ show enumerations attr=0x10004

ID String Value

0x10004 Lost 0

0x10004 Established 1

0x10004 Initial 2

$ show enumerations mth=0x10004

ID String Value

0x10004 Lost 0

0x10004 Established 1

0x10004 Initial 2

$ show events lh=0x400000

Date Time Type MHandle MName MTypeName

04/25/1999 13:27:38 0x10302 0x4000f9 1.3 Host_IBM

04/25/1999 13:27:38 0x10202 0x400131 qa1sgi Host_SGI

Command Descriptions show

Command Line Interface Page 70

$ show events -n 5

Date Time Type MHandle MName MTypeName

08/25/1999 11:30:02 0x10009 0xcd00067 els100-01.india RMONApp

08/25/1999 11:25:33 0x10009 0xcd00067 els100-01.india RMONApp

08/25/1999 11:20:17 0x10009 0xcd00067 els100-01.india RMONApp

08/25/1999 11:15:52 0x10009 0xcd00067 els100-01.india RMONApp

08/25/1999 11:10:27 0x10009 0xcd00067 els100-01.india RMONApp

$ show inheritance mth=0x1037b lh=0x400000

Handle Name Flags Inheritance

0x10000 Root V,D Base

0x103ad BanVinesFS V,I,U Derived

$ show landscapes

SSName Precedence Port Service LHandle

devsgi 10 0xbeef 0x10101 0x28000000

devibm 10 0xbeef 0x10101 0x11f00000

$ show models lh=0x400000

MHandle MName MTypeHnd MTypeName

0x400004 World 0x10040 World

0x4000d9 0x10020 AUI

Command Descriptions show

Command Line Interface Page 71

$ show models mname=

MHandle MName MTypeHnd MTypeName

0xcd00016 0x1120002 AppDataServer

0xcd00022 0x1006b SnmpPif

0xcd00030 0x1028f IcmpPif

$ show models mhr=0xcd00000-0xcd000ff mth=0x230018 mname=india lh=0xcd00000

MHandle MName MTypeHnd MTypeName

0xcd000a3 hplaser.zeitnet.India.com 0x230018 TCP2_App

0xcd0002b desire.zeitnet.India.com 0x230018 TCP2_App

$ show parents mh=0x40000d

MHandle MName MTypeHnd MTypeName Relation

0x400009 auto-lan-3 0x1003c LAN_802_3 Collects

$ show relations

Name Type

Passes_Through MANY_TO_MANY

Lost_and_Found ONE_TO_MANY

Owns ONE_TO_MANY

Contains ONE_TO_MANY

Command Descriptions show

Command Line Interface Page 72

$ show rules rel=Owns lh=0x400000

LMTHandle LMTName RMTHandle RMTName

0x102da Org_Owns 0x10043 Site

0x102da Org_Owns 0x210023 Rtr_CiscoMGS

$ show types lh=0x400000

Handle Name Flags

0x10000 Root V,D

0x10080 Gen_Rptr_Prt V,D

$ show types mth=0x10000-0x10005

Handle Name Flags

0x10000 Root V,D

0x10001 CabletronFrags V,D

0x10002 Network_Entity

0x10003 VNM V,I,D,N,U,R

0x10004 User V,I,D

0x10005 VIB

Command Descriptions show

Command Line Interface Page 73

$ show types mth=0x210020-0x21002f mtname=Rtr_Cisco lh=0xcd00000

Handle Name Flags

0x210020 Rtr_CiscoAGS V,I,D

0x210021 Rtr_CiscoCGS V,I,D

0x210022 Rtr_CiscoIGS V,I,D

0x210023 Rtr_CiscoMGS V,I,D

0x210024 Rtr_CiscoMIM V,I,D

0x21002b Rtr_Cisco2500 V,I,D

0x21002c Rtr_CiscoMIM3T V,I,D

0x21002d Rtr_Cisco3000 V,I,D

0x21002e Rtr_Cisco4000 V,I,D

0x21002f Rtr_Cisco7000 V,I,D

$ show types flags=VIDNUR lh=0xcd00000

Handle Name Flags

0x25e0000 MgmtInventory V,I,D,N,U,R

0x10040 World V,I,D,N,U,R

0x102cf Top_Org V,I,D,N,U,R

0x10003 VNM V,I,D,N,U,R

0x102be LostFound V,I,D,N,U,R

0x25e0001 TopologyWrkSpc V,I,D,N,U,R

0x10091 Universe V,I,D,N,U,R

Command Descriptions show

Command Line Interface Page 74

See Also: See the current command for information on how to set a current model and a current landscape. See the seek command for more information on searching for attributes.

$ show watch mh=0xc600015

Watch_Id Watch_Name Watch_Type

0xffff0001 watch798 Calc

Note:Note:

For the show alarms and show events commands to work with the -x option, which displays probable cause messages for alarms and expanded event messages, SpectroGRAPH must be installed on the local server, and the environment variable SPECROOT must be set to the path of the SPECTRUM Support root directory. For example, if the SG-Support files are in /usr/Spectrum/SG-Support, set SPECROOT to /usr/Spectrum.

Command Descriptions stopShd

Command Line Interface Page 75

stopShdTerminates the CLI Local Server (VnmShd daemon).

Syntax: stopShd [-n]

Options: -n If the -n (no prompt) option is specified with the stopShd command, then the system does not prompt for confirmation.

Parameters: None

Description: The stopShd command disconnects all SPECTRUM CLI users from the currently connected SpectroSERVER and terminates the CLI Local Server. This command prompts the user for confirmation before disconnecting users and shutting down the CLI Local Server. (You can also shut down the daemon by using the kill -2 command.)

Output: Unless the -n option is specified, the following message is always displayed:

stopShd: n users are connected, are you sure?

where n is the number of users connected, including your-self. Valid responses are y, yes, Y, Yes, n, no, N, No.

If the command is successful, the following message is displayed:

stopShd: successful

When stopShd terminates the CLI Local Server, the follow-ing message is displayed on the system console:

VnmShd: stopShd executed. Exiting...

Command Descriptions stopShd

Command Line Interface Page 76

Example: $ stopShdstopShd: 2 users are connected, are you sure? ystopShd: successful

See Also: See the disconnect command for information about disconnecting individual CLI users.

Command Descriptions update

Command Line Interface Page 77

updateUpdate model and model type attributes.

Syntax: update [mh=<model_handle>]attr=<attribute_id>[,iid=<instance_id>],val=<value>[attr=<attribute_id>[,iid=<instance_id>],val=<value...>]|

update [-n] mth=<model_type_handle> attr=<attribute_id>,val=<value>[attr=<attribute_id>,val=<value...>]lh=<landscape_handle>]|

update alarm [-r] aid=<alarm_id>assign=<troubleshooter>|status=<status_text>|[lh=<landscape_handle>]

update action=<action_code> [watch=<watch_id>] [mh=<model_handle>]

Options: -n If the -n (no prompt) option is specified with the update command, then the system does not prompt for confirmation. This option is useful in CLI scripts.

-r If the -r (replace status text) option is specified with the update alarm command, then the alarm status text is replaced with that specified by the status com-mand line argument.

Parameters: attribute_id hex numberinstance_id positive integer or sequence of

dot-separated, positive integerslandscape_handle hex numbermodel_handle hex numbermodel_type_handle hex numbervalue hex or decimal number, character

string, or other attribute type,depending on the attribute

action_code reconfig, 0x1000e, or 65550 toreconfigure a model, activate or 0x00480003 to activatea watch deactivate or 0x00480004 todeactivate a watch

watch_id hex number

Command Descriptions

Command Line Interface Page 78

Description: The update command updates the attribute specified by attribute_id with value for either the model with model_handle or for all models with the model type model_type_handle in the landscape specified by landscape_handle.

Multiple attributes can be updated with one update com-mand by specifying multiple attribute_id,value pairs, each pair separated from adjacent pairs by a space.

If landscape_handle is not specified when updating model type attributes, the current landscape is used. If model_handle is not specified, then the specified attribute(s) of the current model is updated.

When you are updating model type attributes, remember that only shared attributes can be updated. Shared attributes are attributes that have the shared flag set. Use the show attributes command to see if an attribute is shared.

Security-sensitive attributes, such as User_Community_String and Model_Security_String, can be updated through CLI. However, the current user model cannot update its own User_Security_String or Security_String, but it can update those of other mod-els.

The update command also allows the user to specify an instance ID when changing a single attribute value. When updating a list of attribute values, an instance ID can be specified for each attribute on the list. instance_id is the

Note:Note:

The [watch_id] argument is applicable only for the following actions:

• activate (or the hexadecimal equivalent 0x00480003)• deactivate (or the hexadecimal equivalent 0x00480004)

Command Descriptions

Command Line Interface Page 79

instance ID for the corresponding attribute. instance_id must be a positive integer, or sequence of dot-separated positive integers.

The update alarm command updates an alarm specified by alarm_id with assignment troubleshooter or status_text in the landscape landscape_handle.

The update action command performs an action speci-fied by action_code on a device specified by model_handle. With action_code reconfig, any device of model type GnSNMPDev, or of any model type that inherits from GnSNMPDev, can be reconfigured. The activate or deactivate action_code will update a SpectroWATCH status on a device of a specified model_handle. When the activate action object is sent, there may be a short delay between the time the watch status changes from Initial to ACTIVE, depending upon the intelligence built into the selected model. The watch_id of the watch slated to have its status updated can be obtained by using the show watch command.

Output: If update is entered with a valid model_handle or valid model_type_handle, valid attribute_id(s), and valid value(s), the modified attributes and their values are displayed in the following format:

Caution:Caution:

Exercise caution when using the update action command. As with any CLI command, it is possible to corrupt the SpectroSERVER database if used incorrectly. For example, inadvertently reconfiguring a critical router can cause unpredictable results on your network.

Id Name ValueId Name Value

Command Descriptions

Command Line Interface Page 80

If you do not use the -n option when updating models of a specified model type, the following confirmation message is displayed:

update: all models of this type will be updated, are you sure?Valid responses are y, yes, Y, Yes, n, no, N, No.

If the update alarm command is successful, the following message is displayed:

update:successful

If the update action command is successful, the follow-ing message is displayed:

update action: successful

Examples: In the following example, the update command with an instance_id is used to disable port 7 on board 5 of the Hub represented by model handle 0x4001f6:

In the following example, the update command is used to update the attribute called AutoPlaceStartX on all models

$ update mh=0x4001f6 attr=0x10ee0,iid=5.7,val=1

Id Name Value

0x10ee0 CsPortAdminState 1

Command Descriptions

Command Line Interface Page 81

of the model type represented by model type handle 0x10059.

In the following example, the update alarm command is used to update alarm troubleshooter assignment.

In the following example, the update alarm command is used to update alarm status.

In the following example, the update command is used to restrict updating of the User_Community_String.

$ update mth=0x10059 attr=0x118f2,val=100 lh=0x400000

update: all models of this type will be updated, are you sure? y

Id Name Value

0x118f2 AutoPlaceStartX 100

$ update alarm aid=928 assign=dmcdonald

update: successful

$ update alarm aid=928 status=‘Working on it’

update: successful

$ update mh=0x9a000ff attr=0x1007a,val=AA,11

update: successful

Command Descriptions

Command Line Interface Page 82

In the following example, the update action command is used to reconfigure a Cisco router.

See Also: See the SPECTRUM SpectroWATCH Operator’s Reference for more information about using SpectroWATCH.

$ update action=reconfig mh=0xc600030

update action: successful

$ update action action=activate watch=0xffff0001 mh=0xc600015

Watch_Id MHandle Watch_Status

0xffff0001 0xc600015 Initial

$ update action action=0x480004 watch=0xffff0001 mh=0xc600015

Watch_Id MHandle Watch_Status

0xffff0001 0xc600015 INACTIVE

Command Line Interface Page 83

Sample Scripts

This section describes the sample scripts included with CLI. You can access these scripts in the sample_scripts directory, which is in the $SPECROOT/vnmsh directory.

The sample scripts are included with CLI to show you how to incorporate CLI commands into UNIX shell scripts so you can automate your CLI sessions. You may find some of these scripts — or some of the functions within them —useful in your own work. Note, however, that the scripts are only intended as examples and should not be considered the complete or ideal implementation.

CLI includes the following scripts in the $SPECROOT/vnmsh/sample_scripts directory:

Remember the following points when you work with CLI scripts:

• All of the scripts have an internal variable called CLIPATH. When you use a script, you have to set the CLIPATH variable to the pathname of the directory where CLI executables are located.

The CLIPATH variable and the other environment variables that are pathnames can be full or relative pathnames depending on how the script will be run. You must use full pathnames for the CLIPATH and other environment variables when you run a sample script as a cron script. Otherwise, you can use relative pathnames for these variables. See the section on the connect command for additional information on running CLI scripts as cron scripts.

• You can run all the CLI scripts — with the exception of update_mtype — as cron scripts. (You would not want to run update_mtype as a cron script because it prompts the user for input.)

active_ports app_if_securityÊÊ cli_script

database_tallyÊÊ update_mtype

Sample Scripts act ive_ports

Command Line Interface Page 84

• When you run CLI scripts, be sure to specify the correct names for the vnm_hostname variable in the .vnmshrc file.

active_portsSyntax: active_ports <hub_name> <output_file>

Description: This script identifies all ports for each board of an IRM2 hub. It also identifies the active ports on each board.

The script places a report for the hub with the name hub_name in a file with the name output_file. This report lists all the ports for each board. An asterisk (*) in the ON column of the report shows you which ports are active.

app_if_securitySyntax: app_if_security

Description: This script updates the Security_String attribute value in all the interface and application models in the SPECTRUM database. It does this by copying the attribute value from the parent model. The script does not update any models if the recipient model (child) already has a value for the Security_String attribute or if the parent does not have a Security_String attribute value. After updating a model’s security string, administrators may want to use a script like this to update the security string of the model’s children.

Sample Scripts c l i_scr ipt

Command Line Interface Page 85

cli_scriptSyntax: cli_script datafile

Description: This script enables you to execute most of the CLI commands in batch mode when you provide a data file as input. The CLI sample data file, called datafile, contains switches that indicate the command to execute and also the necessary parameters to pass to the command. The script verifies that each command is executed successfully and also maintains a runtime log.

One advantage of this script is that you can create batch files using names instead of handles. For example, you can use a model type name, rather than the hexadecimal model type handle. While this makes the files easier to create and read, the real advantage comes when you want to perform subsequent actions on a model that you have just created. Instead of assigning hexadecimal model handles to the model, you just refer to the model by name.

The cli_script uses two files—datafile and clean.awk—that are also located in the sample_scripts directory.

•datafile — This is the batch file that contains the input for cli_script. It contains each CLI command currently implemented in cli_script. Refer to the cli_script header information for instructions about the format and syntax of this file.

•clean.awk — This is a utility needed by cli_script during execution.

Remember the following points when working with cli_script:

•Be sure to change the dummy Network_Address (255.255.255.255) in the sample datafile to a real address.

Sample Scripts database_tal ly

Command Line Interface Page 86

•If you move the cli_script to another directory, be sure to update the environment variable SPECROOT to the SpectroGRAPH Support root directory (SG-SUPPORT). For example, if the SG-SUPPORT files are in /usr/Spectrum/SG-Support, set SPECROOT to /usr/Spectrum.

database_tallySyntax: database_tally <vnm-name>

Description: This script determines how many models of each type are currently in the database. Administrators may find this script useful when evaluating system performance.

The script displays a list of all the model types and the number of models of each model type in the database.

update_mtypeSyntax: update_mtype <model_name>

[<attribute_name> | <attribute_id> <value>]

Description: This script updates a specific attribute for all models of a model type. If the attribute is a shared attribute of the model type, the script does not update the model’s attribute. One advantage of this script is that you can use the model and attribute names rather than their hexadecimal ID handles.

The argument model_name is a model name — or part of a model name — for a model of the model type for which the updating of the attribute is to take place. You can enter any model of the model type in the command. The script then displays a listing of all model types that have models with names containing the model name argument that you entered. The script asks the user to choose a model type from the list.

Sample Scripts update_mtype

Command Line Interface Page 87

The arguments for attribute_name and value or attribute_id and value are optional. If you do not enter these arguments initially, the script prompts you for them when it is running. At this point, you must enter either the attribute name or part of the attribute name. The script then asks you to choose from a list of attributes contain-ing the text you just entered. You can run the entire script, therefore, without prior knowledge of the hexadeci-mal model type handles or attribute handles.

Command Line Interface Page 88

How to Suppress Headers

This section explains how to suppress headers in CLI output.

If you need to suppress the headers in CLI output, create a file that includes the functions provided in this appendix and then reference this file at the top of each script. These functions call CLI commands and strip the header information from the output of the commands.

1 Create a file called StripHeaders in your scripts directory.

2 Include the following functions in the StripHeaders file:

3 Include the name StripHeaders at the top of your CLI script as follows:

. StripHeaders

4 Whenever you need to strip the headers from CLI output, call the tcreate(), tseek(), tshow(), and tupdate() functions instead of

tcreate() # only needed for the createalarm{# and create event commands $CLIPATH/create $@ | tail +2}

tseek(){$CLIPATH/seek $@ | tail +2}

tshow(){$CLIPATH/show $@ | tail +2}

tupdate(){$CLIPATH/update $@ | tail +2}

How to Suppress Headers update_mtype

Command Line Interface Page 89

the corresponding CLI command. For example, the following line would generate the output of the show models command without the CLI header information:

tshow models

Command Line Interface Page 90

Error Messages

This section alphabetically lists CLI error messages, with the solutions to and/or reasons for the errors.

Error Locations and ConventionsOn a UNIX workstation, error messages reported by the CLI Local Server are displayed in the Console window. On an NT workstation, these errors are displayed in the user’s bash shell window.

Each error message begins with the name of the command issuing the error. See Command Descriptions for detailed explanations of these commands.

That part of the message displayed here with angular brackets and printed in italics is a variable whose value, indicated by the variable name, changes, depending on the message. In the actual message, you would see the variable value rather than the variable name. For example, an alarm_id might be 42. In this case, the first message listed here would be displayed on your screen as:

ack alarm: 42: invalid alarm id

Messages<pathname>/VnmShd: not found

connect: failed

where pathname represents the path to the directory in which CLI attempted to execute VnmShd.

The connect command cannot find the CLI Local Server. Make sure VnmShd and connect are in the same directory.

ack alarm: <alarm_id>: invalid alarm id

Error Messages Messages

Command Line Interface Page 91

Re-enter the ack alarm command with a valid alarm_id.

ack alarm: <landscape_handle>: invalid landscape handle

Re-enter the ack alarm command with a valid landscape_handle.

command: failed to connect with VnmShd, please run connect first

An attempt was made to run other commands before run-ning connect. Begin a CLI session with the connect com-mand.

connect: already connected to <hostname> since <date/time>

No need to connect since you are already connected to a SpectroSERVER host.

connect: cannot open resource file <pathname>/.vnmshrc

The connect command cannot find the CLI resource file .vnmshrc. The .vnmshrc resource file must be in the same directory as the connect command itself.

connect: can only connect to SpectroSERVERs in <hostname>landscape map - other user(s) already connected

The connect command has already been used to connect to a particular SpectroSERVER. You can connect only to a SpectroSERVER that is in the landscape map of the origi-nal SpectroSERVER.

connect: ERROR: No such SPECTRUM user as <username>

The first user of the connect command is not defined as a SPECTRUM user. Reconnect to the SpectroSERVER as a SPECTRUM user.

connect: <hostname> not responding or not permitting access

The connect command cannot connect to SpectroSERVER because the hostname is incorrect, or the

Error Messages Messages

Command Line Interface Page 92

SpectroSERVER is not running, or the user has no user model. Make sure that the hostname is correct, that Spec-troSERVER is running, and that the user has a user model.

connect: <landscape_handle>: invalid landscape handle

The landscape_handle specified by the user is not valid for the specified hostname or cannot be accessed by your VNM. Make sure the landscape_handle is valid for the specified hostname and can be accessed by your VNM.

connect: incompatible SpectroSERVER <version>

The user is attempting to connect to a SpectroSERVER host whose version is incompatible with the CLI version. Get a version of CLI compatible with the SpectroSERVER.

connect: invalid <value> for CLISESSID

The connect command is used within a cron script or the windowing system returns 0 for ttyslot and the environ-ment variable CLISESSID is set to a non-numeric value. Use the connect command outside of a cron script and set CLISESSID to a numeric value.

connect: variable <CLISESSID> not set

When using connect within a cron script, set the environ-ment variable CLISESSID.

create: user not permitted to create alarm

The user is not permitted to create an alarm.

create: user not permitted to create association

The user is not permitted to create an association.

create: user not permitted to create event

The user is not permitted to create an event.

create: user not permitted to create model

The user is not permitted to create a model.

Error Messages Messages

Command Line Interface Page 93

create alarm: <probable_cause_id>: invalid alarm cause

The create alarm command is entered with an invalid probable_cause_id.

create alarm: <alarm_severity>: invalid alarm severity

The create alarm command is entered with an invalid alarm_severity.

create alarm: <model_handle>: invalid model handle

The create alarm command is entered with an invalid model_handle.

create association: <left_model_handle>: invalid model handle

The create association command is entered with an invalid left_model_handle.

create association: models belong to different landscapes

The create association command is entered with a left_model_handle and a right_model_handle in differ-ent landscapes. Use the same landscape for both handles.

create association: rel=<relation>: invalid relation

The create association command is entered with an invalid relation.

create association: <right_model_handle>: invalid modelhandle

The create association command is entered with an invalid right_model_handle.

create event: <event_type>: invalid event type

The create event command is entered with an invalid event_type.

Error Messages Messages

Command Line Interface Page 94

create event: <landscape_handle>: invalid landscape handle

The create event command is entered with an invalid landscape_handle.

create event: <model_handle>: invalid model handle

The create event command is entered with an invalid model_handle.

create model: <attribute_id>: invalid attribute id

No model is created since the create model command is entered with an invalid attribute_id(s).

create model: DCM device unreachable

No model is created since the create model command is entered with an invalid ip_address. The DCM (the SPEC-TRUM Device Communication Manager) issues the error message.

create model: <landscape_handle>: invalid landscape handle

No model is created since the create model command is entered with an invalid landscape_handle.

create model: <model_type_handle>: invalid model type handle

No model is created since the create model command is entered with an invalid model_type_handle.

create model: <value>: invalid value

No model is created since the create model command is entered with an invalid value(s).

current: <model_handle>: invalid model handlecurrent model is <current_model_handle>

Since an invalid model_handle was specified, the current model and the current landscape are unchanged.

Error Messages Messages

Command Line Interface Page 95

current: <landscape_handle>: invalid landscape handlecurrent landscape is <current_landscape_handle>

Since an invalid landscape_handle was specified, the current model and the current landscape are unchanged.

current: <landscape_handle>: not responding or not permitting access current model is<current_model_handle>

A landscape_handle was specified and the SpectroSERVER for the landscape was down or the user did not have a user model on that landscape.

current: <landscape_handle>: not responding or not permitting access current landscape is<current_landscape_handle>

A model_handle was specified and the SpectroSERVER for the landscape containing that model was down or the user did not have a user model on that landscape.

destroy: user not permitted to destroy alarm

The user is not permitted to destroy an alarm.

destroy: user not permitted to destroy association

The user is not permitted to destroy an association.

destroy: user not permitted to destroy model

The user is not permitted to destroy a model.

destroy alarm: aid=<alarm_id>: invalid alarm id

The destroy alarm command was entered with an invalid alarm_id.

destroy alarm: <landscape_handle>: invalid landscape handle

The destroy alarm command was entered with an invalid landscape_handle.

Error Messages Messages

Command Line Interface Page 96

destroy association: rel=<relation>: invalid relation

The destroy association command was entered with an invalid relation.

destroy association: <left_model_handle>: invalid model handle

The destroy association command was entered with an invalid left_model_handle.

destroy association: <right_model_handle>: invalid model handle

The destroy association command was entered with an invalid right_model_handle.

destroy association: association does not exist betweengiven models

An attempt was made to destroy an association between two models that do not exist.

destroy association: models belong to different landscapes

The destroy association command was entered with a left_model_handle and a right_model_handle in differ-ent landscapes.

destroy model: <model_handle>: invalid model handle

The destroy model command was entered with an invalid model_handle.

disconnect: failed

The disconnect command failed.

disconnect: failed to connect with VnmShd, please runconnect first

An attempt was made to run disconnect when the CLI Local Server was not running.

Error Messages Messages

Command Line Interface Page 97

disconnect: not connected

The disconnect command failed since the user was not connected to the SpectroSERVER.

jump:<text_string>: text string not defined<text_string1><text_string2> . . .

where text_string1, text_string2... are the currently defined text strings.

The jump command was entered with an undefined text_string.

Please connect first

After connect has executed, you ran disconnect or stopShd and then attempted to run another command. Reissue the connect command first.

seek: <attribute_id>: invalid attribute id

The seek command was entered with an invalid attribute_id.

seek: <error>: attribute not keyed

The seek command was entered with the attribute_id of an attribute that was not keyed.

seek: <value>: invalid value

The seek command was entered with an invalid value.

show attributes: <attribute_id>: non list attribute

The show attributes command was entered with an instance_id for a non list attribute_id.

Error Messages Messages

Command Line Interface Page 98

show attributes: <attribute_id>: invalid attribute id

The show attributes command was entered with an invalid attribute_id(s).

show attributes: <instance_id>: invalid instance id

The show attributes command was entered with an invalid instance_id.

An instance_id is invalid if it does not consist of a sequence of non-negative integers or if it does not exist for the specified attribute.

show attributes: <model_type_handle>: invalid model type handle

The show attributes command was entered with an invalid model_type_handle.

show: <landscape_handle>: invalid landscape handle

A show command that uses an optional landscape_handle was entered with an invalid landscape_handle.

show: <model_handle>: invalid model handle

A show command that uses an optional model_handle was entered with an invalid model_handle.

show: no current model defined

A show associations command that uses an optional model_handle was entered but no model_handle was specified and no current model was defined.

show alarms: no cause information available

The show alarms command was used with the -x option, and the SpectroGRAPH alarm files containing the proba-ble cause text messages are not available.

Error Messages Messages

Command Line Interface Page 99

For the show alarms command to work with the -x option, which displays probable cause messages for alarms and expanded event messages, SpectroGRAPH must be installed on the local server, and the environment variable SPECROOT must be set to the path of the Spec-troGRAPH Support root directory (SG-Support). For exam-ple, if the SG-Support files are in /usr/Spectrum/SG-Support, set SPECROOT to /usr/Spectrum.

show children: <relation>: invalid relation

The show children command was entered with an invalid relation.

show events: no event format information available

The show events command was entered with the -x option, and the SpectroGRAPH event files containing the event format text messages are not available.

For the show events command to work with the -x option, which displays probable cause messages for alarms and expanded event messages, SpectroGRAPH must be installed on the local server, and the environment variable SPECROOT must be set to the path of the Spec-troGRAPH Support root directory (SG-Support). For exam-ple, if the SG-Support files are in /usr/Spectrum/SG-Support, set SPECROOT to /usr/Spectrum.

show parents: <relation>: invalid relation

The show parents command was entered with an invalid relation.

show rules: <relation>: invalid relation

The show rules command was entered with an invalid relation.

Error Messages Messages

Command Line Interface Page 100

show inheritance: <model_type_handle>: invalid model type handle

The show inheritance command was entered with an invalid model_type_handle.

stopShd: VnmShd not running

An attempt was made to run stopShd when the CLI Local Server was not running.

stopShd: failed

The stopShd command failed.

update: <attribute_id>: Attribute not writable

No update occurred since an attempt was made to update model attributes that are non-writable.

update: <attribute_id>: invalid attribute id

No update occurred since the update command was entered with an invalid attribute_id(s).

update: <attribute_id>: non shared attribute

The update command was used for a model type and an attribute_id of a non-shared attribute was entered.

update: <instance_id>: invalid instance id

No update occurred since the update command was entered with an invalid any invalid instance_id.

update: <landscape_handle>: invalid landscape handle

No update occurred since the update command was entered with an invalid landscape_handle.

update: <model_handle>: invalid model handle

No update occurred since the update command was entered with an invalid model_handle.

Error Messages Messages

Command Line Interface Page 101

update: <model_type_handle>: invalid model type handle

No update occurred since the update command was entered with an invalid model_type_handle.

update: <value>: invalid value

No update occurred since the update command was entered with an invalid value(s).

update: <action_code>: invalid action code

No update occurred since the update action command was entered with an invalid action_code.

VnmShd: Error: Failed to connect to SpectroSERVER. Exiting...

The CLI Local Server failed to connect to the SpectroSERVER.

VnmShd: Error: Lost connection with SpectroSERVER.Exiting...

The CLI Local Server, detecting that the SpectroSERVER to which it was connected has terminated, terminates.

Command Line Interface Page 102

CLI Command Format Summary

This section provides a quick reference guide to CLI commands.

The CLI commands are summarized in the following table. The italicized part of the command format is information you enter to complete the command. Any part of the format in [brackets] is optional and not required for the command to function. These commands are described in detail in Command Descriptions.

Command Description, Format, and Example

ack alarm Acknowledges an alarm.Format: ack alarm aid=<alarm_id> [lh=<landscape_handle>]

Example: ack alarm aid=42 lh=0x400000

connect Connects to SpectroSERVER.

Format: connect[<hostname>][lh=<landscape_handle>][vnmsocket=<vnmsocket>]

Example: connect coffee lh=0x54000 vnmsocket=0xbeef

create Creates a new alarm, association, event, or model in a specified landscape.

Format:

create alarm [-nr] sev=<alarm_severity>cause=<probable_cause_id> mh=<model_handle>|

create association rel=<relation>lmh=<left_model_handle> rmh=<right_model_handle>|

create event [type=event_type text=event_text [mh=model_handle|lh=landscape_handle]|-a]

create model ip=<IP Address|Low_IP-High_IP>[comm=Community_Name][to=Time_Out][tc=Try_Count] [lh=landscape_handle]|

create model mth=model_type_handle[attr=attribute_id,val=value ...]lh=landscape_handle]

Example:create model mth=0x10004 attr=ox1006f, val=edmund$lh=0x540000

CLI Command Format Summary Messages

Command Line Interface Page 103

current Sets a model as the “current” model or a landscape as the “current” landscape to be acted on by other CLI commands, or display the current model and current landscape.

Format: current [mh=<model_handle>|lh=<landscape_handle>]

Example: current mh=0x10004

destroy Destroys an alarm, association, or model in a specified landscape.

Format:

destroy alarm [-n] aid=<alarm_id> [lh=<landscape_handle>]destroy association [-n] rel=<relation>

lmh=<left_model_handle> rmh=<right_model_handle>destroy model [-n] mh=<model_handle>

Example: destroy alarm aid=300 lh=0x400000

disconnect Disconnects from SpectroSERVER.

Format: disconnect

Example: disconnect

jump Returns to a model and landscape saved with the setjump command.

Format: jump [<text_string>]

Example:jump first_floor

seek Finds a model in a specified landscape.Format: seek [-i] [-s] attr=<attribute_id>,val=<value>

[lh=<landscape_handle>]

Example: seek attr=0x1006e,val=12.84 lh=0x400000

Command Description, Format, and Example

CLI Command Format Summary Messages

Command Line Interface Page 104

setjump Saves the current model and the current landscape under a user-defined text string label, so that the jump command can be used to subsequently return to this model and landscape. Format: setjump [-n] <text_string>

Example: setjump -n tutorial

show Displays information about objects in a specified landscape.

Format:

show models [mhr=low_model_handle-high_model_handle][mth=model_type_handle] [mname=model_name]

[lh=landscape_handle] | show landscapes | show types [mthr=low_mth-high_mth] [mtname=mt_name] [flags=V|I|D|N|U|R] [lh=landscape_handle] | show relations [lh=landscape_handle] | show associations [mh=model_handle] | show parents [rel=relation] [mh=model_handle] | show children [rel=relation] [mh=model_handle] | show attributes [-e] [attr=attribute_id[,iid=instance_id][,next]...|

[attrr=low_attr-high_attr] [attrname=attr_name]][mh=model_handle] |

show attributes mth=model_type_handle [attrr=low_attr-high_attr]

[attrname=attr_name] [flags=E|R|W|S|T|G|O|M|D|P|L][lh=landscape_handle] |

show alarms [-a] [-x] [mh=model_handle|lh=landscape_handle] | show events [-x] [-a | -n no_events]

[mh=model_handle|lh=landscape_handle] | show inheritance mth=model_type_handle [lh=landscape_handle] | show rules rel=relation [lh=landscape_handle] | show enumerations [attr=attribute_id] [mth=model_type_handle]

[lh=landscape_handle] show watch [mh=model_handle] [lh=landscape_handle]

Example: show alarms lh=0x400000

Command Description, Format, and Example

CLI Command Format Summary Messages

Command Line Interface Page 105

stopShd Disconnects all users from SpectroSERVER and terminate the CLI Local Server (VnmShd daemon).Format: stopShd [-n]

Example: stopShd

update Updates the attributes of a model or model type.

Format:

update[<mh=model_handle>]attr=<attribute_id>[,iid=<instance_id>],val=<value>

[attr=<attribute_id>[,iid=<instance_id>],val=<value...>]|update [-n] mth=<model_type_handle>

attr=<attribute_id>,val=<value>[attr=<attribute_id>,val=<value...>]lh=<landscape_handle>]|

updatealarm [-r] aid=<alarm_id>assign=<troubleshooter>|status=<status_text>|[lh=<landscape_handle>]

updateaction=<action_code> [watch=<watch_id>] [mh=<model_handle>]

Example: update mh=0x4001f6 attr=0x10ee0,iid=5,val=1

Command Description, Format, and Example

Command Line Interface Page 106

UNIX to DOS Conversion

This section provides a quick reference guide for UNIX-to-DOS command conversions.

On the UNIX platform, CLI commands are typically used in conjunction with UNIX commands in a terminal window. On the Windows NT platform, it is possible to use CLI commands in conjunction with DOS commands in a native DOS window. Commonly used UNIX commands and their DOS equivalents are listed in Table 1 below.

This appendix is not intended to be an exhaustive listing of UNIX and DOS commands — merely to be a quick reference guide. See your UNIX, DOS, or Windows NT documentation for more information on commands and their functions.

Table 1: UNIX to DOS Conversion Chart

UNIX DOS

# rem

cat type

cd cd

chdir chdir

clear cls

cmp, diff comp, fc

cp copy

cp -r xcopy

cpio, dump, tar, ufsdump

backup, msbackup

UNIX to DOS Conversion Messages

Command Line Interface Page 107

cpio, restore, tar, ufsrestore

restore

csh, sh command

date date, time

echo echo

ed edlin

exit exit

exportfs, share share

fdformat, format format

format fdisk

format->analyze scandisk

fsck chkdsk

goto (csh) goto

grep find

if if

ln -s subst

lp, lpr print

ls dir

ls -l attrib

man help

mkdir md, mkdir

more more

Table 1: UNIX to DOS Conversion Chart

UNIX DOS

UNIX to DOS Conversion Messages

Command Line Interface Page 108

mv move, ren, rename

print (sh) echo

rm del, erase

rm -r deltree

rmdir rd, rmdir

set path= (csh), PATH= (sh)

path

set prompt= (csh), PS1= (sh)

prompt

set var= (csh), var= (sh)

set

shift shift

showrev ver

sort sort

stty mode

textedit, vi edit

uncompress, unpack expand

Table 1: UNIX to DOS Conversion Chart

UNIX DOS

Command Line Interface Page 109

Index

Symbols,next 56.profile file 30.vnmshrc 16.vnmshrc 15, 28

A-a option 33, 54ack alarm 27Alarms

probable causes 54

Bbash shell

invoking from a DOS prompt 11running under Windows NT 23

CCLI

and UNIX commands 12architecture 15command summary 17environment variables 13error checking 16example script file 24example uses 25Local Server 15, 16, 28outline of a CLI session 18

resource file 15scripts 12, 83

running under NT using bash 23

sessions, running more than one at once 31

tutorial 19using to reconfigure devices 79

CLIPATH 14, 83CLISESSID

and bash shell on NT 29using within a shell script 29

Commands 17, 102ack alarm 27connect 28

rules for 29create 33

warnings about 18current 39destroy 41

warnings about 18disconnect 44format summary 102jump 45seek 47

using wildcard with 47setjump 52show 54stopShd 75update 77

warnings about 18connect 28create 33cron script 29current 39

Index Index

Command Line Interface Page 110

DDefaults 60destroy 41disconnect 44Document

conventions 8how to use 8intended audience 7

DOS shell, invoking on NT 11DOS/UNIX command

conversions 106

E-e option 54Enumerated text strings, displaying

mappings with show command 57

Error checking 16Errors 90

conventions 90locations 90messages 90

Event codes 35Event types 35Example uses of CLI 25

FFlags

attribute flags 57model type flags 59

HHeaders

suppressing 88Hostname

when not specified 28

I-i option 47Installation 13Instance IDs 56Internet socket connection 16

Jjump 45

LLandscape handle

when not specified 28, 60List attributes 56

MModel handle

when not specified 60

N-n option 41, 52, 75, 77-nr option 33

Index Index

Command Line Interface Page 111

OOutput

suppressing headers in 88

PPrerequisites 7

developers 7users 7

R-r option 77Reconfiguring devices with CLI 79Restricted Rights Notice 4Return codes (zero, non-zero) 13

S-s option 47Scripts

active_ports 84app_if_security 84cli_script 85database_tally 86running under NT using bash 23update_mtype 86

seek 47seek, using wildcard with 47setjump 52show 54SPECROOT 61, 74, 86, 99SpectroWATCHes

listing applicable data with CLI 60starting and stopping with CLI 79

State information 16stopShd 75

Ttrademarks 3ttyslot function 29

UUNIX/DOS command

conversions 106update 77

VVirus Disclaimer 3VnmShd 15

WWindows NT

accessing CLI from 16running shell scripts under 23

X-x option 54, 61, 63