Name
view_exportimport — The view_exportimport script is used to import, export, alias, or merge your CSV, TSV, or XML files. You can create CSV, TSV, or XML files that describe the views that you want to create. You can then import the CSV, TSV, or XML file into OpsCenter by using this utility.
SYNOPSIS
view_exportimport {-i|-e|-m|-a} {-f <file name>} {-type <xml|csv|tsv} {-host <host name>} {-port <port number>} {-usr <user name>} {-pass <password>} {-domain <domain>} {-domaintype <type>} [-l <logfile name>] [-v <Level #>]
DESCRIPTION
You can use the OpsCenter console to create views, but you may find it faster and more convenient to create CSV, TSV, or XML files that describe the views that you want to create. You can then import the CSV, TSV, or XML file into the OpsCenter database. This script lets you import, export, alias, or merge a CSV, TSV, or XML file.
Note:
You can also use the View Builder GUI to import, export, merge, or alias a CSV, TSV, or XML file. See the View Builder help for more information.
See the Appendix titled Creating views using CSV, TSV, and XML files for detailed information on how to create CSV, TSV, or XML files.
OPTIONS
- -i
Imports the view structure as defined in the XML, CSV, or TSV file into the OpsCenter database. It can import multiple views at a time.
- -e
Exports the entire view structure existing in the OpsCenter database into XML, CSV, or TSV files. You can update these XML, CSV, or TSV files according to the business needs and then import these files in the OpsCenter database.
This option exports all the views that are present in the OpsCenter database.
- -m
Merge multiple objects simultaneously that are saved in XML, CSV, or TSV file. Note that the source hosts and destination hosts that you merge must be of the same type (masterservers/mediaservers/clients).
A merge objects file (XML, CSV, or TSV) contains the following object details:
First column
DB ID of the resultant object
Second column
Primary display name of the resultant object
Third column
DB ID of the object that is merged
Fourth column
Primary display name of the object that is merged
Here is a typical example of a file that contains details of objects to be merged:
First Column
Second Column
Third Column
Fourth Column
1500
host1
1000
host1.veritas.com
2100
host2.abc.com
2355
host2
4000
host3
3000
10.209.19.10
Note:
After successfully merging the two objects, the object being merged (second object in a record) is deleted and the resultant object is retained. However all aliases that are designated for both objects - object being merged and resultant object - are retained and assigned to the resultant object.
- -a
Using the -a option, you can give an alternate name to a host. You can alias multiple hosts simultaneously that are saved in XML, CSV, or TSV file.
Caution:
The alias names should be compatible with your hosts' DNS names. Alternatively, they should be compatible with the names by which they are known to applications such as NetBackup and Backup Exec. For example: If you use an alias that is unknown to NetBackup, the explorer stops collecting information from the NetBackup host. It attempts to collect data from a host with the alias name.
A host alias file (XML, CSV, or TSV) typically contains the following details:
First column
DB ID of the object
Second column
Primary display name of the resultant object
Third column
Alias to be created for the host.
You can create multiple aliases for a host, which you can add in the subsequent columns.
Here is a typical example of a file that contains aliases to be created for hosts:
First Column
Second Column
Third Column
Fourth Column
Fifth Column
1500
host1
host1.diablo.com
host1.veritas.com
2100
host2
host2.river.com
10.100.22.55
host2.veritas.com
4000
host3
host3.tunnel.com
- -f <file name and path>
Path of the XML, CSV, or TSV file to be used for import, export, merge, alias. Note that the file name is case-sensitive.
In case of export, information from the OpsCenter database is exported. Hence, you need to specify the name or path of the file that gets exported in <file name and path>.
- --type <xml | csv | tsv>
Type of file format (Default: xml)
- --host <host name>
Host name of the OpsCenter server to connect to (default: localhost)
- --port <port number>
OpsCenter Server port number (default: 1556)
- --usr <user name>
The username for connecting to the OpsCenter server (default: admin)
- --pass <password>
The password for connecting to the OpsCenter server (default: password)
- --domain <domain>
The domain to which the user belongs (default: OpsCenterUsers)
- --domaintype <type>
Domain type. For example: vx/nt/nis etc. (default: vx)
- -l <logfile name>
Specify name of the log file that is generated.
- -v [Level #]
Specify the logging level [0:Off, 1:Severe, 2:Warning, 3:Info, 4:Config, 5:Fine, 6:Finer, 7:Finest, 8:All]
- --h|-?|--help
Shows the CLI usage statement and exits.
EXAMPLES
EXAMPLE1
Run the following command on Windows to import the import-add-object.xml file in the OpsCenter database:
INSTALL_PATH\OpsCenter\server\bin>view_exportimport.bat -i -f "C:\Users\Administrator\Desktop\import-add-object.xml" --type xml --host win2k8r2.abc.veritas.com --port 1556 --usr admin --pass password --domain OpsCenterUsers --domaintype vx
Run the following command on UNIX to import the import-add-object.xml file in the OpsCenter database:
<INSTALL_PATH>/SYMCOpsCenterServer/bin/view_exportimport.sh -i -f "C:\Users\Administrator\Desktop\import-add-object.xml" --type xml --host win2k8r2.abc.veritas.com --port 1556 --usr admin --pass password --domain OpsCenterUsers --domaintype vx
EXAMPLE2
Run the following command on Windows to export all the OpsCenter views as importviews.xml file in C::
INSTALL_PATH\OpsCenter\server\bin>view_exportimport.bat -e -f "C:\importviews.xml" --type xml --host win2k8r2.abc.veritas.com --port 1556 --usr admin --pass password --domain OpsCenterUsers --domaintype vx
Run the following command on UNIX to export all the OpsCenter views as importviews.xml file in opt directory:
/opt/SYMCOpsCenterServer/bin/view_exportimport.sh -e -f "/opt/importviews.xml" --type xml --host win2k8r2.abc.veritas.com --port 1556 --usr admin --pass password --domain OpsCenterUsers --domaintype vx