Monday, 30 July 2012

HP OMU 9.10 ovdeploy -- transfere, remove or execute files on remote hosts

Ovdeploy


ovdeploy - performs tasks related to software installation on local and remote hosts.



DESCRIPTION


ovdeploy manages objects on local and remote hosts. An object can be a file, a directory, or a package. A package can be a file, a group of files, a directory or group of directories or a combination of all.


You use ovdeploy to install, remove, up or download, and register or unregister objects on the local and remote hosts you are managing. You can also use the ovdeploy command to list package inventories and execute commands on specified files.




  1. It can transfer three types of objects to remote hosts
    • files. For example
      ovdeploy -upload -file /root/.ssh/id_rsa.pub -targetdir /.ssh -node ux08
    • directories
    • packages. A package can be a file, a group of files, a directory or group of directories or a combination of all. ovdeploy command can be used to distribute both files and packages.
  2. It also can execute commands on remote host so it can be used instead of SSH on hosts where SSH is not available by default such as Windows. For example:
    ovdeploy -exec -file /usr/bin/bdf -node ux1572
For packages additional operations are available which make it pretty good "poor man configuration management system". You can use ovdeploy to install, remove, up or download, and register or unregister objects on the local and remote hosts you are managing. You can also use the ovdeploy command to list package inventories and execute commands on specified files.
Note: ovdeploy man page and help produced if you enter command without parameters differs in substantial way.






Usage

ovdeploy -install -pkg <package_descriptor> |-file <filename>... |-dir <dirname> [[-sourcerootdir <symbolic_name>] [-sourcedir <dirname>] [-targetrootdir <symbolic_name>] [-targetdir <dirname>] [-force] [-perm <file_permissions>] [-host <name_or_ip>] [-instserv <name_or_ip>] [-targetid <id>] [-cmd_timeout <time_in_milli_sec>]]
ovdeploy -remove -pkg <package_name> |-file <filename> |-dir <dirname> [[-targetrootdir <symbolic_name>] [-targetdir <dirname>] [-force] [-host <name_or_ip>] [-instserv <name_or_ip>] [targetid <id>] [-ovrg <id>] [-cmd_timeout <time_in_milli_sec>]]
ovdeploy -upload -pkg <package_descriptor> |-file <filename> |-dir <dirname> [[-sourcerootdir <symbolic_name>] [-sourcedir <dirname>] [-targetrootdir <symbolic_name>] [-targetdir <dirname>] [-force] [-perm <file_permissions>] [-host <name_or_ip>] [-instserv <name_or_ip>] [-targetid <id>] [-cmd_timeout <time_in_milli_sec>]]
ovdeploy -download -pkg <package_descriptor> |-file <filename> |-dir <dirname> [[-sourcerootdir <symbolic_name>] [-sourcedir <dirname>] [-targetrootdir <symbolic_name>] [-targetdir <dirname>] [-force] [-perm <file_permissions>] [-host <name_or_ip>] [-instserv <name_or_ip>] [-targetid <id>] [-ovrg <id>][-cmd_timeout <time_in_milli_sec>]]
ovdeploy -inv [-host <name_or_ip>] [-invtype <inventory_type>] [-all]
ovdeploy -reg -pkg <package_descriptor>[ [-sourcerootdir <symbolic_name>] [-sourcedir <dirname>] [-force] [-host <name_or_ip>] [-targetid <id>] [-ovrg <id>]]
ovdeploy -unreg -pkgname <package_name> [[-force] [-host <name_or_ip>] [-targetid <id>] [-ovrg <id>]]
ovdeploy -exec -file <filename> [[-targetrootdir <symbolic_name>] [-targetdir <dirname>] [-shell] [-host <name_or_ip>] [-targetid <id>] [-ovrg <id>] [-cmd_timeout <time_in_milli_sec>]]
ovdeploy -cmd -file <filename> [-host <name_or_ip>] [-par <params>] [-cmd_timeout <time_in_milli_sec>][-targetrootdir <symbolic_name>] [-targetdir <dirname>]]
ovdeploy -get <node_attribute> [-node <name_or_ip>]
ovdeploy -env <environment_var> [-node <name_or_ip>

Parameters
ovdeploy recognizes the following options:
-install <options>
Installs the specified object.
-remove <options>
Removes one or more objects.
-upload <options>
Uploads one or more objects from a target node.
-download <options>
Downloads one or more objects from a target node.
-inv <options>
Returns a list of installed objects on a target node either to stdout or in the form of an XML file written to the local directory.
-reg <options>
Adds a specified package name to the list of registered package names on a target node.
-unreg <options>
Removes a specified package name from the list of registered package names on a target node.
-exec <options>
Executes a specified file on a specified host and returns the result of the action to stdout.
-cmd <options>
Executes a specified command or file on a different shell on the specified host and returns the results of the action on stdout.
-get <options>
Displays the value of an environment variable on a specified node. The environment variable can be, for example, PATH or OvInstallDir. The value of the environment variable can be obtained only if that variable is set on the specified node.
-env <options>
The -list option displays all requests in a store-and-forward buffer for the specified target or the entire buffer if no target is specified.


Options


The following options may be used in conjunction with the command parameters indicated in the Parameters section:

-all
Returns the complete inventory in XML format. The complete inventory comprises the package descriptors of all packages that have been installed on the node. If not used, only the name and version of each registered package is returned.
-dir <dirname>
The name of a directory to be installed, removed, up or downloaded, registered or unregistered. The contents of the directory will also be installed, removed, up/downloaded.
-file <filename>...
The name of a file to be installed, removed, up or downloaded, registered or unregistered, or executed.
With the -install parameter, multiple files can be specified.
-force
With the -install parameter, it installs the specified object even if an object already exists on the target node with the same or higher version. With the -remove parameter, it must be used with -dir, and removes all subdirectories.
-host <target_host>
The name or IP address of the target host. If not used, the local host is assumed.
-instserv <name_or_ip>
Name or IP address of an installation server. If an installation server is specified, the specified file is not copied from the local host to the target host. Instead, it is copied from the installation server to the target host.
-invtype [depl|native]
depl returns to stdout the inventory of objects installed using the deploy command. native returns to stdout the inventory of objects installed using the operating system's native installation program.
-ovrg <id>
The ID of an HP resource group, if applicable.
-perm <nnn>
Sets file permissions of an installed, up/downloaded, un/registered file. This parameter takes three digits. The first digit specifies the owner permission, the second digit specifies the group permission, and the third digit specifies public permissions. The allowable digits are:
0
No permissions.
1
Execute.
2
Write.
3
Execute and write.
4
Read.
5
Execute and read.
6
Read and write.
7
Read, write, and execute.
-pkg <package_descriptor>
The full path and name of the package descriptor file. The package descriptor file contains a list of all the files that are to be installed, removed, up or downloaded, registered or unregistered and their locations.
-shell
Used with the -exec parameter to execute in a shell the file specified by <file>. For UNIX systems, /bin/sh -c is used. For a Microsoft Windows system %ComSpec/cmd.exe /c is used.
-sourcerootdir <symbolic_name>
The symbolic path name used to create an absolute file path for the source file.
-sourcedir <dirname>
Used to create an absolute file path for the source file. If a source root directory is specified, the source directory is appended to it. If no source root directory is specified, the source directory is appended to the default directory, $OvDataDir/installation/incoming/files/.
-cmd_timeout <time_in_milli_sec>
Sets the timeout (in milliseconds) for individual commands executed from ovdeploy command. If this option is not set, the value specified for COMMAND_TIMEOUT under depl namespace of configuration settings of the target system will be used for individual commands (which has a default value of 10 minutes). This option applies to package install and remove commands, -exec, and -cmd commands.
-targetrootdir <symbolic_name>
A symbolic path name used to create an absolute file path for the target root directory.
-targetdir <dirname>
The name of the directory on the target node where the object is to be installed, removed, up or downloaded, registered or unregistered.
-targetid <id>
The target ID of the target node.




EXAMPLES
The following examples show how to use the ovdeploy command:
  • To install the package testpackage.xml, located in the /tmp directory, to the node test.com.
ovdeploy -install -pkg /tmp/testpackage.xml -node test.com
  • To install the file testfile, located in the /tmp directory, to the node test.com.
ovdeploy -install -file /tmp/testfile -node test.com
  • To deploy the file testfile, located in the /tmp directory, to the /opt/OV/bin directory on the node test.com.
ovdeploy deploy -file /tmp/testfile -targetdir /opt/OV/bin -node test.com
  • To delete the file /opt/OV/bin/testfile from the host test.com.
ovdeploy -remove -file testfile -targetdir /opt/OV/bin -node test.com
  • To delete the file $OvDataDir/installation/incoming/files/test/testfile from the host test.com. The absolute path of the file is created from the specified target directory. No target root directory was specified, so the default target root directory is used.
ovdeploy -remove -file testfile -targetdir test -host test.com
  • To delete the package testpkg1 from the host test.com.
ovdeploy -remove -pkg testpkg1 -host test.com
  • To copy the file testfile to the default target directory on the local host. The default target directory is $OvDataDir/installation/incoming/files/.
ovdeploy -upload -file /tmp/testfile
  • To copy all files that are specified in the package descriptor package1.xml to the default package upload directory on the host test.com. The directory containing the specified package descriptor file and all files specified in it is the bin directory.
ovdeploy -upload -pkg package1.xml -sourcerootdir bin -host test.com
  • To copy the files in the /tmp/testdir directory on the host test.com to the directory /opt/OV/bin on the local host.
ovdeploy -download -dir /tmp/testdir -targetdir /opt/OV/bin -node test.com
  • If testpackage1 and testpackage2 have been installed on the local machine, the following is returned:
ovdeploy -inv
NAME VERSION TYPE ARCHITECTURE
testpackage1 05.00.050 package windows 4.0
testpackage2 01.00.050 package windows 4.0

  • To display the native package inventory of the local host. For example:
ovdeploy -inv -invtype native
HP OpenView BBC Package 5.0.50
HP OpenView Performance Access Package 10.00.123

  • To register the package package1.xml by copying the package descriptor to the inventory directory. If the package descriptor already exists, an error is returned to stdout.
ovdeploy -reg -pkg /tmp/package1.xml
  • To unegister the package testpack2 from the host test.com.
ovdeploy -unreg -pkgname testpack2 -host test.com
  • To execute the file run on the local host and returns the output to stdout.
ovdeploy -exec -file /tmp/run
  • To execute the file run.sh with the shell on the host test.com.
ovdeploy -exec -shell -file run.sh -targetrootdir bin -node test.com
  • To set the timeout value for the -exec command for my_exe.exe file on host node1.
ovdeploy -exec -file C:\my_exe.exe -node node1 -cmd_timeout 9000000
  • To find out which operating system is running on the host node1.
ovdeploy -get ostype -node node1
  • To find the value set for the environment variable OvInstallDir on host node1.
ovdeploy -env OvInstallDir -node node1


Symbolic Pathnames

ovdeploy supports symbolic names that can be used with the sourcerootdir and targetrootdir options. You can use symbolic names to specify a directory without needing to know where the directory is located on a particular node platform, for example; the OpenView installation directory is: ovinstall. It is defined for all supported node platforms but the actual location might be different on each platform.
Supported symbolic path names are:
  • Bin <InstallDir>/bin
  • Contrib <InstallDir>/contrib
  • current <CurrentDir>
  • Data <DataDir>
  • dataarchive <DataDir>/datafiles/archive
  • datacertificates <DataDir>/certificates
  • dataconf <DataDir>/conf
  • datafiles <DataDir>/datafiles
  • dataimages <DataDir>/images
  • datainstallation <DataDir>/installation
  • datainstrumentation <DataDir>/bin/instrumentation
  • datalog <DataDir>/log
  • datapackages <DataDir>/packages
  • datapolicies <DataDir>/datafiles/policies
  • datatemp <DataDir>/tmp
  • datatmp <DataDir>/tmp
  • datawww <DataDir>/www
  • depl <DataDir>/installation
  • deplincoming <DataDir>/installation/incoming>
  • deplincomingfiles <DataDir>/installation/incoming/files
  • deplincomingpackages <DataDir>/installation/incoming/packages
  • deplinventory <DataDir>/installation/inventory
  • deplpackages <DataDir>/installation/packages
  • Depltemp <DataDir>/installation/temp
  • deplbbcfxupload <DataDir>/installation/temp/bbc/fx/upload
  • deplupload <DataDir>/installation/temp/bbc/fx/upload
  • examples <DataDir>/examples
  • Help <DataDir>/help
  • include <DataDir>/include
  • install <InstallDir>
  • Java <InstallDir>/java
  • Lbin <InstallDir>/lbin
  • Lib <InstallDir>/lib
  • licenseagreements <InstallDir>/license-agreements
  • Man <InstallDir>/man
  • Misc <InstallDir>/misc
  • Msg <InstallDir>/msg
  • newconfig <InstallDir>/newconfig
  • nonov <InstallDir>/nonOV
  • ovdata <DataDir>
  • ovinstall <InstallDir>
  • packages <InstallDir>/packages
  • paperdocs <InstallDir>/paperdocs
  • releasenotes <InstallDir>/ReleaseNotes
  • resources <InstallDir>/resources
  • Root <RootDir>
  • support <InstallDir>/support>
  • systemp <SystemTempDir>
  • systmp <SystemTempDir>
  • systemtmp <SystemTempDir>
  • wwhtdocs <InstallDir>/www/htdocs
  • wwwimages <Installdir>/www/images
Configure the agent use ovdeploy.


From the management server, run the following command:
For Windows 64-bit nodes
ovdeploy -cmd "%ovinstalldir%bin\win64\OpC\install\oasetup -configure -management_server <management_server> -certificate_server <certificate_server>" -node <node_name> -fem winservice -ostype Windows -user <node_user> -pw <node_passwd>
For other Windows nodes
ovdeploy -cmd "%ovinstalldir%bin\OpC\install\oasetup -configure -management_server <management_server> -certificate_server <certificate_server>" -node <node_name> -fem winservice -ostype Windows -user <node_user> -pw <node_passwd>
For an HP-UX, Linux, or Solaris node
ovdeploy -cmd "/opt/OV/bin/OpC/install/oainstall.sh -a -configure -srv <management_server> -cs <certificate_server>" -node <node_name> -fem ssh -ostype UNIX -user <node_user> -pw <node_passwd>
For an AIX node
ovdeploy -cmd "/usr/lpp/OV/bin/OpC/install/oainstall.sh -a -configure -srv <management_server> -cs <certificate_server>" -node <node_name> -fem ssh -ostype UNIX -user <node_user> -pw <node_passwd>
In this instance:
  • <management_server>: Fully-qualified domain name of the management server.
  • <certificate_server>: Fully-qualified domain name of the certificate server. This parameter is optional. If you do not specify the -cs option, the management server becomes the certificate server for the node.
  • <node_name>: Fully-qualified domain name of the node.
  • <node_user>: User with which you can configure the agent on the node; the user that was created in step 2 on page 50.
  • <node_passwd>: Password of the above user.  

No comments:

Post a Comment