• No results found

Dividing results into multiple lines

About this task

You can divide results into multiple lines using the following option:

-split

use only with eprp, seprp, ruprp Divide results into multiple lines

resmgr -export elt -colNames "name eprp.name eprp.value" -split -file $DIR/split_elt.dat

172.31.0.31|_|ipAddress|_|172.31.0.31|_|

172.31.0.31|_|ipName|_|172.31.0.31|_|

172.31.0.31|_|physAddress|_|6.0.3.227.233.33.160|_|

172.31.0.31|_|Cisco Internetwork Operating System Software \nIOS (tm) C2600 Software (C2600-T|_|

172.31.0.31|_|sysName|_|"c2610-31-LER"|_|

172.31.0.41|_|ipAddress|_|172.31.0.41|_|

172.31.0.41|_|ipName|_|172.31.0.41|_|

Display results on a single line

resmgr -export elt -colNames "name eprp.name eprp.value" -file

$DIR/splitno_elt.dat

172.31.0.31|_|ipAddress|_|172.31.0.31|_|ipName|_|172.31.0.31|_|physAddress|_|

6.0.3.227.233.33.160|_|sysDescr|_|Cisco Internetwork Operat

ing System Software \nIOS (tm) C2600 Software (C2600-T|_|sysName|_|"c2610-31-LER"|_|

172.31.0.41|_|ipAddress|_|172.31.0.41|_|ipName|_|172.31.0.41|_|physAddress|_|

6.0.48.25.95.152.192|_|sysDescr|_|Cisco Internetwork Operat

ing System Software \nIOS (tm) C2600 Software (C2600-T|_|sysName|_|"c2610-41-LSR"|_|

Including field separators

About this task

You can include field separators between fields when you export data (and import as well.) The default separator value is an underscore (|_|.) When you use a field separator from the command line, you need to enclose it in single (' ') or double quotes (" ").

-sep

resmgr -export elt -colNames "name profil state" -sep ","

# type = elt

# col = name profil state

# filter =

# order =

# sep = ,

# sepRec =

# rule =

# filterRule =

#

# cmdLine = -export elt -colNames "name profil state"

default,,on,

bulk100-boston_100,12,bulk_100,on, bulk100-boston_0,bulk_100,on, bulk100-boston_100,13,bulk_100,on, bulk100-boston_100,14,bulk_100,on,

Including record separators

About this task

You can include record separators when you export data. The default record separator value is "end of line." You can also use the is Mandatory value when colNames such as app or frm could potentially include the end of line in their field.

-sepRec

resmgr -export elt -colNames "name profil state" -sep "," -sepRec

";"

# type = elt

# col = name profil state

# filter =

# order =

# sep = ,

# sepRec = ;

# rule =

# filterRule =

#

# cmdLine = -export elt -colNames "name profil state"

default,,on,;

bulk100-boston_100,12,bulk_100,on,;

bulk100-boston_0,bulk_100,on,;

bulk100-boston_100,13,bulk_100,on,;

bulk100-boston_100,14,bulk_100,on,;

Specifying a file name

About this task

You can specify a filename for exporting tasks. If you do not use the -file option (the default is that -file is not used) the output will be UNIX standard output. If you need to include a path, you can use the -dirPath option or set the entire path enclosed in double quotes (" ".) You can also enter the entire path for a file together with the filename.

-file

resmgr -export elt -colNames "name profil state" -file test1

Specifying path locations

About this task

You can specify a path location for exported (as well as imported) data files.

Because this option specifies only the path, you need to use the "-file" option if you also want to specify the name of the file. Remember to enclose the path in single (' ') or double quotes (" ".)

-dirPath

resmgr -export elt -colNames "name profil state" -file test1 -dirPath "/tmp"

Create the file : /tmp/test1.

Removing the header

About this task

useful when scripting and pipe to other tools -noHead

Remove the header for export

resmgr -export elt -colNames "name" -noHead -file $DIR/noHead.dat 172.31.0.31|_|

172.31.0.41|_|

172.31.0.51|_|

172.31.1.2|_|

192.168.1.3|_|

192.168.127.1|_|

192.168.127.2|_|

192.168.127.254|_|

192.168.127.3|_|

192.168.127.4|_|

192.168.127.5|_|

192.168.127.6|_|

192.168.127.7|_|

192.168.127.8|_|

192.168.127.9|_|

192.168.64.253|_|

192.168.66.2|_|

192.168.68.162|_|

APRouterforprobe|_|

Burned_100008089_192.168.1.3|_|

CoffeeBucks-192.168.1.1|_|

Delete_100000165_192.168.3.238|_|

Delete_100000174_192.168.2.2|_|

Display with headers

resmgr -export elt -colNames "name" -file $DIR/withHead.dat

# type = elt

# col = name

# filter =

# order =

# sep = |_|

# sepRec =

# cmdLine = -export elt -colNames "name"

172.31.0.31|_|

172.31.0.41|_|

172.31.0.51|_|

172.31.1.2|_|

192.168.1.3|_|

192.168.127.1|_|

192.168.127.2|_|

192.168.127.254|_|

192.168.127.3|_|

192.168.127.4|_|

192.168.127.5|_|

192.168.127.6|_|

192.168.127.7|_|

192.168.127.8|_|

192.168.127.9|_|

192.168.64.253|_|

192.168.66.2|_|

192.168.68.162|_|

APRouterforprobe|_|

Burned_100008089_192.168.1.3|_|

CoffeeBucks-192.168.1.1|_|

Delete_100000165_192.168.3.238|_|

Delete_100000174_192.168.2.2|_|

Display the number of columns without headers resmgr -export elt -colNames "name" -noHead | wc -l 23

The import syntax

Import (insert or update) metadata. This option lets you specify the type (object type) of data for importing.

resmgr -import <object type> -mode [insert|update|Ifirst]

Mandatory options

You must use the following options when issuing a resmgr import command.

Option Description

<object type>

name(is null) name(not null) -colNames

a list of colNames is mandatory. If -file or -line is omitted, UNIX standard input (stdin) is used to let you pipe the standard import.

-mode v insert - insert only. Use this value if you

are importing a large amount of new data into the database. If the resource already has a value for this column, it is not updated.

v update - update only. If the resource does not have a value for this column, data is not inserted.

v Ifirst - insert first (default). First attempt to insert. If the resource already has a value for this column, the value is updated.

Using -colNames

About this task

Use to display a list of colName or colName(value).

Example 1

The value is taken from the file or line and the nop option is used to skip columns.

resmgr -import elt -colNames "name nop type state profil(prof1) collector(3)" -file Test1.rgr

ImporBulk|_|aaaa|_|import_|_|on|_|

...

Example 2

The value of the colNames can be concatenation of multiple values taken in the file (the value given is take for all lines.)

resmgr -import elt -colNames "name col1 col2 type state profil(myProf%(col1)_%(col2)) collector(3)" -file Test1.rgr ImporBulk|_|val1|_|val2|_|import_|_|on|_|

...

Example 3

You can use the option OLD_colname when updating the colname used as an index for finding the record.

resmgr -import elt -colNames "OLD_name name" -line

"NameNow|_|NewName"

Including field separators

About this task

You can include field separators between fields when you import data (and export as well.) The default separator value is an underscore (|_|.) When you use a field separator from the command line, you need to enclose it in single (' ') or double quotes (" ").

-sep

Including record separators

About this task

You can include record separators when you export data. The default record separator value is "end of line." You can also use the isMandatory value when colNames such as app or frm could potentially include the end of line in their field. (You must also use the same for the export.)

-sepRec

Specifying file names

About this task

You can specify a filename for exporting tasks. If you do not use the -file option (the default is that neither -file nor -line option is used,) the output will be UNIX standard output. If you need to include a path, you can use the "-dirPath"

option or set the entire path enclosed in double quotes (" ".) You can also enter the entire path for a file together with the filename.

-file

Specifying path locations

About this task

You can specify a path location for imported (as well as exported) data files.

Because this option specifies only the path, you need to use the -file option if you also want to specify the name of the file. Remember to enclose the path in single (' ') or double quotes (" ".)

-dirPath

Specifying input data

About this task

You can specify input data from the command line.

-line

resmgr -delete elt -colNames "name" -line "bulk100-boston_0"

info : === delete : DELETE ON Element ( bulk100-boston_0 ) (exists) Title : === CHANGES : {1 Deleted of elt}

Info : === Inform Collector On hebus:3002

Forcing the creation date

About this task

You can force the creation date stamped.

-histoDate

v 0: current date (not forced default value) v 1: force the date to the value defined Example

resmgr -import se -colNames "name elt.name instance date(1057015945)" -histoDate 1

Import the se at : 07/01/2003 01:32

Reloading collectors

About this task

You can reload the Collectors.

-reloadCol val

Reload Collectors = on|off|forced (default = on ).

Available values are as follows:

v on (default) - reload collectors to reread the database for changes or updates v off - do not reload collectors

v forced - always reload collectors Examples

resmgr -import ... -reloadCol off resmgr -import ... -reloadCol on resmgr -import ... -reloadCol forced

You are only allowed to reload only the last time even if there were no changes in the last import.

The resyncronization messages you see after entering this command will vary according to the exact metadata change that are made by the command.

Analyzing Tivoli Netcool Performance Manager object

About this task

You can generate an analysis of the resource tables for the following Tivoli Netcool Performance Manager objects:

v elt v se v egp v segp

-analyze <object type>

Example

resmgr -analyze se

Info : === ANALYZE : ON se (Synchro)

Using a configuration file

About this task

You can create a configuration file with sets of commands and options that you want to execute more than once. Many of the options in Resource Manager can be used in a configuration file.

You can specify different combination of commands and options in a configuration file. You can specify multiple configurations by using keywords.

Note: If you specify an option both in a configuration file and from the command line, the command line overrides the configuration file.

An example of a configuration file:

To run a configuration file, enter:

Line-by-Line explanation

*exportAll_List: exportE exportSEL

This line specifies a list of configurations. When you specify exportAll on the command line for the -config option, the configurations are executed

Item Description Syntax Requirements

* Indicates the beginning of an

operative line.

Should be the first character on the line. Spaces before are not allowed and spaces after are optional.

exportAll The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed.

Spaces are not allowed.

Using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword.

Spaces are not allowed before or after.

List A keyword to indicate that a

list of other configurations in the file follows.

"L" must be capitalized.

: Separates the keyword from

the list of configuration names.

Spaces before and after are optional.

exportE The name of another

configuration in the file.

Multiple names are allowed and spaces between each name are required.

exportSEL The name of another

configuration in the file.

Multiple names are allowed and spaces between each name are required.

!---! export all elements with attributes

!---Lines beginning with an exclamation point (!) are comments.

*exportE_operation: export elt

This line specifies that the operation for the exportE configuration is export elements. The equivalent command line is as follows:

-export elt

Since the exportE configuration is part of the list for the exportAll configuration on the previous line, this configuration is run by specifying either exportAll or

exportE for the -config option on the command line.

Item Description Syntax Requirements

* Indicates the beginning of an

operative line. Should be the first character on the line.

Spaces before are not allowed.

Spaces after are optional.

exportE The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed.

Spaces are not allowed.

Using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword

Spaces are not allowed before or after.

operation A keyword to indicate that what follows is an operation.

Should be all lower case.

: Separates the keyword from

the operation

Spaces before and after are optional.

export The operation, in this case

export. Valid values are import, export, and delete.

Spaces are required between the operation and the type of resource should be all lowercase.

elt The type of resource, in this

case elements. Any values that are valid on the command line are also valid in a configuration file.

Spaces are required between the operation and the type of resource.

Capitalization must be the same as on the command line.

*exportE_colNames: name comment

This line specifies that the column names to be exported are "name" and

"comment." The command line equivalent is:

-colNames "name comment"

Item Description Syntax Requirements

* Indicates the beginning of an

operative line. Should be the first character on the line.

Spaces before are not allowed.

Spaces after are optional.

exportE The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed.

Spaces are not allowed.

Using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword.

Spaces are not allowed before or after.

colNames A command line option. In

this case, -colNames.

Command line options are listed under “Displaying resource manager options”

on page 22.

No hyphen before the option.

Capitalization needs to be the same as on the command line.

: Separates the command line

option from its value.

Spaces before and after are optional.

name A column name

Can be any valid column name. See “Using column names” on page 24 for the list of possible column names.

Multiple column names are allowed.

Spaces are required between each of the column names in the list.

comment A column name

Can be any valid column name. See “Using column names” on page 24 for the list of possible column names.

Multiple column names are allowed.

Spaces are required between each of the column names in the list.

*exportE_file: elements

This line specifies that the name of the output file is "elements." The command line equivalent is:

-file elements

Item Description Syntax Requirements

* Indicates the beginning of an

operative line. Should be the first character on the line.

Spaces before are not allowed.

Spaces after are optional.

exportE The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed.

Spaces are not allowed using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword.

Spaces are not allowed before or after.

file A command line option. In

this case, -file. No hyphen before the option.

Capitalization must be the same as on the command line.

: Separates the command line

option from its value.

Spaces before and after are optional.

elements The name of the file in

which to place the exported data.

Should be only the file name.

If a path is required use the dirPath option,

*exportE_dirPath:

./output.

*exportE_dirPath: ./output

This line specifies that the path for the output file is "./output" The equivalent command line is:

-dirPath "./output"

Item Description Syntax Requirements

* Indicates the beginning of an

operative line.

Should be the first character on the line. Spaces before are not allowed and spaces after are optional.

exportE The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed. Spaces are not allowed.

Using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword

Spaces are not allowed before or after.

dirPath A command line option. In this case, -dirPath. Command line options are listed under

“Working with resmgr” on page 22.

No hyphen before the option.

Capitalization needs to be the same as on the command line.

: Separates the command line

option from its value.

Spaces before and after are optional.

./output The path for the file in which

to place the exported data. Specify only the path.

Specify the name of the file with the file option.

The directory needs to exist before executing the command. If the directory does not exist, the command fails.

!---! export all sub-elements with attributes

!---Lines beginning with an exclamation point (!) are comments.

*exportSEL_List: exportSE exportSEM

This line specifies a list of configurations. When exportSEL is specified on the command line for the -config option, all of the configurations listed on the right are executed together.

Because the exportSEL configuration is part of the list for the exportAll configuration on the first line, this configuration is run by specifying either exportAll or exportSEL for the -config option on the command line.

Item Description Syntax Requirements

* Indicates the beginning of an

operative line. Should be the first character on the line.

Spaces before are not allowed.

Spaces after are optional.

exportSEL

The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed.

Spaces are not allowed.

Using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword.

Spaces are not allowed before or after.

List A keyword to indicate that what follows is a list of other configurations in the file.

"L" must be capitalized.

: Separates the keyword from

the list of configuration names.

Spaces before and after are optional.

exportSE The name of another

configuration in the file. Multiple names are allowed.

Spaces between each name are required.

exportSEM The name of another

configuration in the file. Multiple names are allowed.

Spaces between each name are required.

*exportSE_operation: export se

This line specifies that the operation for the exportSE configuration is export sub-elements. The equivalent command line is:

-export se

Item Description Syntax Requirements

* Indicates the beginning of an

operative line. Should be the first character on the line.

Spaces before are not allowed.

Spaces after are optional.

exportSE The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed.

Spaces are not allowed.

Using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword.

Spaces are not allowed before or after.

operation A keyword to indicate that what follows is an operation.

Should be all lower case.

: Separates the keyword from

the operation.

Spaces before and after are optional.

export The operation, in the case

export. Valid values are import, export, and delete.

Spaces are required between the operation and the type of resource must be all

lowercase.

se The type of resource, in this case sub-elements. Any values that are valid on the command line are also valid in a configuration file.

Spaces are required between the operation and the type of resource.

Capitalization needs to be the same as on the command line.

*exportSE_colNames: name date

This line specifies that the column names to be exported are "name" and "date."

The equivalent command line is:

-colNames "name date"

Item Description Syntax Requirements

* Indicates the beginning of an

operative line. Should be the first character on the line.

Spaces before are not allowed.

Spaces after are optional.

exportSE The name of the

configuration. This is the name that should be specified on the command line with the -config option.

All the lines that begin with this configuration name are run at the same time.

Letters and numbers are allowed.

Spaces are not allowed.

Using a meaningful name is recommended.

_ Separates the configuration

name from the command line option or keyword.

Spaces are not allowed

Spaces are not allowed

Related documents