Explains how to use the resmgr command to import and export objects
The export syntax
This section explains the syntax used for the export option of the resmgr command.
You must include the mandatory options with the resmgr -export command and add other options for additional
resmgr -export <object type> <mandatory options>
<additional options>
Mandatory options
You must use the following options when issuing a resmgr export command.
Option Description
<object type>
name(is null) name(not null) -colNames
a list of colNames. If no value is used with the CLI and a default value exists, the default value is used.
If you do not want to use the -colName option because you want to format the columns, use -rule.
-rule a string using the colNames with the
syntax%(colname). Use to format the columns (need to use if you do not use -colNames.)
Example
The following example shows the use of the -rule option with a mix of text and variable to specify the format for the columns. This modifies the construction of the subelement labels for import.
resmgr -export elt -rule "the name of the element is : %(elt.name)"
the name of the element is : bulk100-boston_1000,19|_|
the name of the element is : 192.168.69.245|_|
the name of the element is : 192.168.69.243|_|
Refer to the chapters containing specific commands for additional examples of mandatory options.
Additional options
You can use the following additional options with the export option.
Option Description
-filter Filter the results of the export command
-filterRule
Broaden your filtering capabilities by entering a string against which results are compared to find matches.
The syntax of the filter string is similar to the syntax of an SQL WHERE clause, so that you can filter on common SQL keywords such as OR, AND, LIKE, IN, and so forth.
-order List columns in order
-distinct Eliminate duplicate lines
-ListForced Force columns to display values
Using -filter
The following option lets filter the results of the export command.
-filter
List of filtered values "colname(value) ..", same syntax as -colNames. Lets you filter the results of a command.
The following table lists available -filter values:
Values Examples
is null, not null
name(is null) name(not null) any character with * (like operator is used) name(*ddd*) any character (= operator is used) name(ddddd) relational operator (in,between,!=,>,<,..) 'any
character'
AND is made between filters
name(!='ddd') number(<='10')
name(in'ddd','aaa','bbb') between('0 and 3')
Example
resmgr -export elt -colNames "name profil state missing" -filter
"missing(between’0 and 3’) name_UPPER(*BOST*)"
bulk100-boston_1000,18|_|bulk_100|_|on|_|0|_|
bulk100-boston_100,11|_|bulk_100|_|on|_|0|_|
bulk100-boston_1000,19|_|bulk_100|_|on|_|0|_|
Using -filterRule About this task
You can use the following filter option if you need to broaden your filtering capabilities; for example if -filter is too restricted. You can enter a string against which results are compared to find matches.
-filterRule "string"
Note: The syntax of the filter string is similar to the syntax of an SQL WHERE clause, so that you can filter on common SQL keywords such as OR, AND, LIKE, IN, and so forth.
Example 1
resmgr -export elt -colNames "name profil state" -filterRule
"%(elt.profil) LIKE ’%T%’ OR %(elt.state) = ’on’" -file
$DIR/filterRule1.dat
marketing.quallaby.com|_|QuallabyNetwork|_|on|_|
acacia.quallaby.com|_|QuallabyNetwork|_|on|_|
eng1.quallaby.com|_|QuallabyNetwork|_|on|_|
u440.quallaby.com|_|QuallabyNetwork|_|on|_|
tadpole.quallaby.com|_|QuallabyNetwork|_|on|_|
dhcp195.quallaby.com|_|QuallabyNetwork|_|on|_|
192.168.127.254|_|Cisco_SAA|_|on|_|
Example 2
The percentage sign (%) is considered as any 0-n character and _ (underscore) is considered one character. If you need to use the underscore in your filter, you must include an escape character for it.
resmgr -export elt -colNames "name profil state" -filterRule
"%(elt.profil) LIKE ’%T%’ OR %(elt.state) = ’on’" -file
$DIR/filterRule1.dat
marketing.quallaby.com|_|QuallabyNetwork|_|on|_|
acacia.quallaby.com|_|QuallabyNetwork|_|on|_|
eng1.quallaby.com|_|QuallabyNetwork|_|on|_|
u440.quallaby.com|_|QuallabyNetwork|_|on|_|
tadpole.quallaby.com|_|QuallabyNetwork|_|on|_|
dhcp195.quallaby.com|_|QuallabyNetwork|_|on|_|
192.168.127.254|_|Cisco_SAA|_|on|_|
Example 3
In the following example the string %(xxx) LIKE '%@_%' ESCAPE '@' tells ORACLE that the escape character is @. If you need to use @ in your condition, you can choose another character.
resmgr -export se -colNames "name profil" -filterRule
"%(elt.profil) LIKE’%@_protocol%’ ESCAPE ’@’" -file
$DIR/filterRule2.dat
NF-iphost-site-flow-CoffeeBucks|_|NF_protocol|_|
NF-site-Silver-CoffeeBucks|_|NF_protocol|_|
NF-iphost-site-flow-Gold-CoffeeBucks|_|NF_protocol|_|
NF-site-iphost-flow-Gold-CoffeeBucks|_|NF_protocol|_|
NF-as-site-flow-CoffeeBucks|_|NF_protocol|_|
NF-site-site-flow-CoffeeBucks|_|NF_protocol|_|
NF-site-site-flow-Gold-CoffeeBucks|_|NF_protocol|_|
NF-site-iphost-flow-Silver-CoffeeBucks|_|NF_protocol|_|
NF-iphost-site-flow-Silver-CoffeeBucks|_|NF_protocol|_|
The name is filter in "*_protocol*"
Using -order
You can use the following command to list columns in order.
-order "colNames"
You use the same syntax used for all -colNames, except for those that are logical entities (npath, nName.)
resmgr -export elt -colNames "name profil state" -order "profil"
# type = elt
# col = name profil state
# filter =
# order = profil
# sep = |_|
# sepRec =
# rule =
# filterRule =
#
# cmdLine = -export elt -colNames "name profil state"
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|_|
bulk100-boston_1000,10|_|bulk_100|_|on|_|
bulk100-boston_1000,11|_|bulk_100|_|on|_|
bulk100-boston_1000,12|_|bulk_100|_|on|_|
bulk100-boston_1000,13|_|bulk_100|_|on|_|
bulk100-boston_1000,15|_|bulk_100|_|on|_|
bulk100-boston_1000,19|_|bulk_100|_|on|_|
bulk100-boston_100,11|_|bulk_100|_|on|_|
bulk100-boston_1000,18|_|bulk_100|_|on|_|
bulk100-boston_100,10|_|bulk_100|_|on|_|
bulk100-boston_1000,17|_|bulk_100|_|on|_|
bulk100-boston_1000,16|_|bulk_100|_|on|_|
bulk100-boston_1000,14|_|bulk_100|_|on|_|
bulk100-boston|_|bulk_100|_|on|_|
bulk100-boston_100,19|_|bulk_100|_|on|_|
bulk100-boston_100,18|_|bulk_100|_|on|_|
bulk100-boston_100,17|_|bulk_100|_|on|_|
bulk100-boston_100,16|_|bulk_100|_|on|_|
bulk100-boston_100,15|_|bulk_100|_|on|_|
add_elt2|_|profil1|_|on|_|
add_elt3|_|profil1|_|on|_|
add_elt1|_|profil1|_|on|_|
add_elt4|_|profil1|_|on|_|
dber|_|test1|_|on|_|
Using -distinct
You can use the following command to eliminate duplicate result lines.
-distinct 1 (by default : 0)
resmgr -export elt -colNames "profil" -distinct 1 bulk_100|_|
test2|_|
testInv1|_|
testNoReload|_|
|_|
Using -ListForced
You can use the following option to force columns to display values.
-ListForced "column1 value1 [column2 value2] ... [columnN valueN]"
Use this option with the following Tivoli Netcool Performance Manager object types:
v eprp v seprp v ruprp v encl.name v fam.name Example
resmgr -ListForced "seprp.Customer:value \"\" seprp.Cos:value \"\""
-export se -colNames "elt.name name label seprp.Customer:value seprp.Cos:value"
router1|_|router1_interface<1>|_|Ethernet[1]|_|Coca Cola|_|Gold|_|
router1|_|router1_interface<2>|_|Ethernet[3]|_||_||_|
router2|_|router2_interface<1>|_|Ethernet[1]|_|Air France|_||_|
router2|_|router2_interface<2>|_|Ethernet[2]|_||_|Silver|_|
router2|_|router2_interface<3>|_|Ethernet[3]|_||_||_|
resmgr -export elt -colNames "name eprp.Contact:value" -ListForced
"eprp.Contact:value \"\""
192.168.69.245|_||_|
Delete_200000092_192.168.127.1|_||_|
Delete_200000098_192.168.127.7|_||_|
192.168.69.243|_||_|
Using mandatory links with elements
About this task
You can use the following option to force a link to be mandatory (or not). Use for elt: scf,encl,eprp.