Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

smcregister(1m) [xfree86 man page]

smcregister(1M) 					  System Administration Commands					   smcregister(1M)

NAME
smcregister - configure the Solaris Management Console SYNOPSIS
/usr/sadm/bin/smcregister [-h] tool [-n altjarname] jarfile classlistfile xmlfile /usr/sadm/bin/smcregister [-h] service [-n altjarname] jarfile classlistfile xmlfile [native_lib_list] /usr/sadm/bin/smcregister [-h] library [-n altjarname] jarfile classlistfile | none ALLTOOL | ALLSERVICE | ALL | Attachedbeanname /usr/sadm/bin/smcregister [-h] tool | service -u jarfile /usr/sadm/bin/smcregister [-h] library -u jarfile ALL | ALLTOOL | ALLSERVICE | Attachedbeanname /usr/sadm/bin/smcregister [-h] toolbox [-D] [action] [-f] [target] [parameters] [options] /usr/sadm/bin/smcregister [-h] property key value ALL | ALLTOOL | ALLSERVICE | Attachedbeanname /usr/sadm/bin/smcregister [-h] property -u key ALL | ALLTOOL | ALLSERVICE | Attachedbeanname /usr/sadm/bin/smcregister [-h] repository list /usr/sadm/bin/smcregister [-h] scripts regscript unregscript DESCRIPTION
The smcregister command configures the Solaris Management Console. For information regarding the Solaris Management Console, see smc(1M). This command enables you to add to, remove from, and list the contents of toolboxes and the Solaris Management Console repository. smcregister also allows you to register scripts to perform registrations and unregistrations. Typically, a package containing one or more tools or services posts tool and service registrations immediately after installation. On Solaris, this is by way of invocations of smcreg- ister from within a package post-install script. Similarly, unregistrations would be posted from within a package pre-remove script. These are per-machine registrations - that is, registration requests must be posted on each machine on which the Solaris Management Console server will be running. However, due to the way that diskless clients are installed, registration requests cannot be made at install time. Therefore, packages should include and install registration and unregistration scripts, and then register these scripts during installation by way of the scripts subcommand. These scripts should contain tool, toolbox, service, library or property configurations in any of its forms as listed in this man page. While these scripts function very much like package post-install and pre-remove scripts, do not assume the normal package environment is available. However, PATH can assumed to be /usr/sbin:/usr/bin Using smcregister to edit toolboxes is not as feature-rich as using the Solaris Management Console's graphical editor. The command line interface is intended for use in packaging scripts that do not require user interaction. To edit all the properties of a toolbox or to mod- ify the hierarchy of folders in a toolbox, you must use the specialized graphical editor, that is, smc edit. See smc(1M). smcregister is intended to replace the smcconf command as the preferred interface for managing the Solaris Management Console repository as well as toolboxes from within scripts, due to significant performance enhancements over smcconf. OPTIONS
The following options are supported: -h Prints out a usage summary for the command. Scripts Configuration regscript The full path of a script containing registration commands. The script is executed upon the next restart of the Solaris Management Con- sole server after the package containing the script is installed. unregscript The full path of a script containing unregistration commands. The script is executed upon the next restart of the Solaris Management Console server after the package containing the script is removed. Toolbox Configuration action Legal values are: add Adds a target to the toolbox. Specify the path to the toolbox using the -B toolboxpath option and, optionally, provide locale information with the -L locale option. create Creates a new toolbox with no tools in it. The only target recognized is toolbox. list Lists the contents of the toolbox. No target is recognized. If you specify a parameter, it is taken as the path to a toolbox and the contents of that toolbox are listed. If you do not specify a parameter, the contents of the default toolbox are listed. remove Removes a target from the toolbox. Specify the path to the toolbox using the -B toolboxpath option and, optionally, provide locale information with the -L locale option. -D Defers execution of the toolbox command until the Solaris Management Console server is restarted. This is a convenient option for use in packaging scripts during install and un-install. Additionally, the command runs much faster than if run interactively (without -D). target Legal values are: folder If the action is specified as add, this target adds a folder to the toolbox. There are four required parameters: the folder name, description, and small and large icon paths. If the action is specified as remove, this target removes a folder from the toolbox. If the folder to be removed is itself inside a folder, the containing folder must be specified with the -F option. legacy If the action is specified as add or remove, this target adds or removes legacy applications (command line, X-windows, and web- based) to or from the toolbox. The -N, -T, -E, and -B options are required, and the -A option is optional. Placement in the toolbox with the -F option follows the same rules as for the tool and tbxURL targets.See NOTES for more information about legacy applica- tions. tbxURL If the action is specified as add or remove, this target adds to or removes from the toolbox a link to another toolbox. The required parameter is the URL to the other toolbox. The properties of addition and removal are the same as for the tool target. tool If the action is specified as add, this target adds a native Solaris Management Console tool from the toolbox. The required parame- ter is the full Java classname of the tool you are adding. If you specify a folder name with the -F option, the tool is placed inside that folder (the folder will not be created if it does not already exist). Otherwise, the tool is appended to the end of the toolbox and not placed inside any folder. If the action is specified as remove, this target removes a native Solaris Management Console tool from the toolbox. The required parameter is the full Java classname of the tool you wish to remove. If you specify a folder name with the -F option, any tool with the given name in that folder will be removed. If no folder name is specified, all tools with the given name in the toolbox will be removed. For the tool to show up in the console, the tool must also be registered in the repository. See the repository configuration section below for more information. If a tool is referenced in a toolbox but is not registered, it will not appear in the console when the toolbox is loaded. Removing a tool from a toolbox does not remove the tool from the server repository. toolbox If the action is specified as create, this target creates a skeleton toolbox with no tools. There are four required parameters: the toolbox name, description, and small and large icon paths. These must be followed by the -B toolboxpath and -D scope options. parameters Specifies values that may be required depending on the combination of action and target. options Supported options for various action and target combinations for the toolbox configuration are: -A Specifies the parameters to pass to the legacy application. This option is available only for the legacy target. -B Specifies the path of the toolbox that is being modified. If this option is not given, the modifications will be performed on the default toolbox, This Computer. -D Specifies the scope (domain) in which the tool should be run. The legal values for scope are file, nis, nisplus, dns, and ldap. This may also be specified for a folder or a toolbox. In the former case, all tools in that folder and its subfolders will be run in that scope; in the latter, all tools in the toolbox will be run in that scope. -E Specifies the absolute executable path of the legacy application. This option is available only for the legacy target. -f If the -f option is given to add, the information will overwrite any information of the same name already in the toolbox. If the -f option is not given, an error may be returned if the information is already in the toolbox. -F folder Specifies the full path of the container folder. If this option is not given, the default folder is the root folder of the toolbox. -H [host_name][:port] Specifies the host and port from which a tool should be loaded. If host_name is not given, the default host (localhost, if the toolbox is loaded from the local filesystem, or the host from which the toolbox is loaded if loaded from a remote Solaris Manage- ment Console server) will be used. If :port is not given, the default port will be used. If this option is not given at all, both the default host and the default port will be used. -L locale Specifies the locale of the toolbox which is being modified. The default is the C locale. -N appName Specifies the name of the legacy application being registered. This is the name that will appear in the console. This option is available only for the legacy target. -P key:value Specifies the key/value pairs that define parameters to a tool. Multiple key/value pairs can be specified at a time. -T appType Specifies the legacy application type. Legal values are CLI, XAPP, or HTML. This option is available only for the legacy target. Tool, Service, and Library Configuration See NOTES for more information about registration and unregistration of tools, services, and libraries. ALL Specify that the library being registered to or unregistered from the repository is for use by all tools and services. ALLSERVICE Specify that the library being registered to or unregistered from the repository is for use by all services. ALLTOOL Specify that the library being registered to or unregistered from the repository is for use by all tools. attachedBeanname The name of a registered jar to which the library jarfile should be attached to (or detached from). This is typically the same as alt- jarname (if provided) or jarfile used to register the jar to which this library is being attached or detached. An attached library means the library is only available for use by the tool or service to which it is being attached. classlistfile The classlist text file generated from the smccompile(1M) command. Library registration does not require that a classlist file be specified. Instead, you can substitute the keyword none in place of the classlist path argument to smcregister, in which case one will be generated automatically. Generating the classlist automatically dur- ing server startup will cause the next server restart to take longer, so it is strongly suggested that developers always provide a classlist file with their libraries. Auto-generation is more appropriately used to register 3rd-party library jars. jarfile The full path to the jar file to be registered/unregistered. The name must be in the form beanname.jar, where beanname is the package path to the bean. If it is not, an alternate name must be given in that form using the -n option. -n altjarname Rename the jarfile in the repository to altjarname. This would typically be the full bean name. For example, if the jarfile was MyTool.jar, then altjarname might be com.mycompany.myproduct.MyTool.jar. It is recommended that an altjarname containing the full pack- age path be used. native_lib_list List of up to 4 native libraries that can be associated with a service bean. -u The operation will be to un-register the jar with the Solaris Management Console repository. The jarfile argument must be identical to the altjarname used to register the jar (if provided), or jarfile. xmlfile The xml descriptor file that describes this jarfile. Every tool or services must have one. See the Solaris Management Console SDK Guide located at /usr/sadm/lib/smc/docs/sdkguide/index.html. Repository Configuration The Solaris Management Console repository stores information about the registered tools and services, as well as libraries (for instance, resource jars) and properties attached to tools or services. list Lists the contents of the repository: o All registered tools o All registered services o All libraries attached to all tools o All libraries attached to all services o All libraries attached to all tools and services Property Configuration See NOTES for more information about registration and unregistration of properties. If registering a property, this defines a property on a tool or service. Only one key value pair at a time can be registered. beanname The name of a registered jar on which the properties will be defined. Optionally, a library name may follow the bean name, in which case the properties are defined on the library that is attached to the named bean. If unregistering a property, this undefines a property from a tool or service. Only one key value pair at a time can be registered. The key, beanname, and optional library are specified as for registering a property. EXAMPLES
Example 1: Adding Legacy Applications to a Toolbox The following command adds to the default toolbox the Command Line Interface (CLI) application, /usr/bin/ls with arguments -al -R, giving it the name, Directory Listing: /usr/sadm/bin/smcregister toolbox add legacy -N "Directory Listing" -T CLI -E /usr/bin/ls -A "-al -R" Use this variation to defer execution of this command until the Solaris Management Console server is restarted: /usr/sadm/bin/smcregister toolbox -D add legacy -N "Directory Listing" -T CLI -E /usr/bin/ls -A "-al -R" Example 2: Adding a Folder to a Toolbox The following command adds to the standard Management Tools toolbox a folder with the name, New Folder, the description, This is a new folder, and the small and large icons, folder_s.gif and folder_l.gif: /usr/sadm/bin/smcregister toolbox add folder "New Folder" "This is a new folder" folder_s.gif folder _l.gif -B /var/sadm/smc/toolboxes/smc/smc.tbx Example 3: Adding a Native Solaris Management Console Tool to a Toolbox The following command adds a native Solaris Management Console tool to the default toolbox. The Java classname of the tool is com.mycompany.myproject.client.MyTool (the name, description, and icons visible in the console are provided by the tool itself). When loaded, it will be run in the NIS domain, syrinx, which is hosted by the machine, temple, and will be retrieved from port 2112 on the machine from which the toolbox was loaded. /usr/sadm/bin/smcregister toolbox add tool com.mycompany.myproject.client.MyTool -D nis:/temple/syrinx -H :2112 Example 4: Adding an Solaris Management Console Tool to the Repository The following command adds the Java bean found in MyTool.jar to the repository. The xml file contains information about the tool. The classlist file would have been generated by smccompile -j: /usr/sadm/bin/smcregister tool -n com.mycompany.myproject.client.MyTool.jar ${HOME}/workarea/MyTool.jar ${HOME}/workarea/MyTool_classlist.txt ${HOME}/workarea/MyTool.xml Use this variation to add an Solaris Management Console tool to the repository without specifying an alternate name: /usr/sadm/bin/smcregister tool ${HOME}/workarea/com.mycompany.myproject.client.MyTool.jar ${HOME}/workarea/MyTool_classlist.txt ${HOME}/workarea/MyTool.xml Example 5: Adding an Solaris Management Console Service to the Repository The following command adds the Java bean found in MyServiceImpl.jar to the repository. The xml file contains information about the service. The classlist file would have been generated by smccompile -j. The extra proxy and stub classes included in the jar would have been gener- ated by smccompile -c: /usr/sadm/bin/smcregister service -n com.mycompany.myproject.server.MyServiceImpl.jar ${HOME}/workarea/MyServiceImpl.jar ${HOME}/workarea/MyServiceImpl_classlist.txt ${HOME}/workarea/MyServiceImpl.xml Use this variation to add a Solaris Management Console service to the repository without specifying an alternate name: /usr/sadm/bin/smcregister service ${HOME}/workarea/com.mycompany.myproject.server.MyServiceImpl.jar ${HOME}/workarea/MyServiceImpl_classlist.txt ${HOME}/workarea/MyServiceImpl.xml Example 6: Removing an Solaris Management Console Tool From the Repository The following command removes a Java tool bean from the repository: /usr/sadm/bin/smcregister tool -u com.mycompany.myproject.client.MyTool.jar Example 7: Removing an Solaris Management Console Service From the Repository The following command removes a Java service bean from the repository: /usr/sadm/bin/smcregister service -u com.mycompany.myproject.server.MyServiceImpl.jar Example 8: Attaching a Library to a Specific Tool The following command adds the library jar file, MyTool_fr.jar (probably a French localized version of the MyTool's resources) to the bean, com.mycompany.myproject.client.MyTool: /usr/sadm/bin/smcregister library -n MyTool_fr.jar ${HOME}/workarea/MyTool_fr.jar ${HOME}/workarea/MyTool_fr_classlist.txt com.mycompany.myproject.client.MyTool Example 9: Attaching a Library to All Tools The following command adds the library jar file, widgets.jar, to all tools in the repository. The library probably contains a widget set which might be useful to any registered tools. The classlist file would have been generated by smccompile -j. /usr/sadm/bin/smcregister library ${HOME}/workarea/lib/widgets.jar ${HOME}/workarea/lib/widgets_classlist.txt ALLTOOL Alternatively, to add a 3rd-party library jar to all tools, replace the classlist file with none: /usr/sadm/bin/smcregister library /opt/lib/XYZwidgets.jar none ALLTOOL Example 10: Detaching a Library from All Tools The following command removes the Java library bean from the repository: /usr/sadm/bin/smcregister library -u MyTool_fr.jar ALLTOOL Example 11: Detaching a Library from a Specific Tool The following command detaches the library jar file, MyTool_fr.jar (probably a French localized version of the MyTool's resources) from the bean com.mycompany.myproject.client.MyTool, and removes it from the repository: /usr/sadm/bin/smcregister library -u MyTool_fr.jar com.mycompany.myproject.client.MyTool Example 12: Registering Scripts The following command registers the following scripts containing registration and unregistration commands. MyProduct_reg.sh will be exe- cuted upon the next server restart after the file is installed by the owning package. MyProduct_unreg.sh will be executed upon the next server restart after the file is removed by the owning package: /usr/sadm/bin/smcregister scripts /usr/sadm/lib/myProduct/MyProduct_reg.sh /usr/sadm/lib/myProduct/MyProduct_unreg.sh ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of smcregister: JAVA_HOME If you do not specify this environment variable, your PATH is searched for a suitable java. Otherwise, the /usr/j2se location is used. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWmc | +-----------------------------+-----------------------------+ SEE ALSO
smc(1M), smcconf(1M), smccompile(1M), attributes(5), environ(5) NOTES
All standard shell quoting rules apply. Legacy applications (X-windows, command-line, and web-based applications) are handled differently from native Solaris Management Console tools. Legacy tools are handled by an instantiation of a native Solaris Management Console tool, LegacyAppLauncher, which, through the toolbox, is given the necessary information to run the legacy application: path, options, and so forth. Thus, you do not register a legacy application into the repository as you would a native Solaris Management Console tool. Instead, legacy applications appear only in tool- boxes. Registration and unregistration of tools, services, libraries, and properties do not take effect until the Solaris Management Console server is restarted. Run /etc/init.d/init.wbem stop followed by /etc/init.d/init.wbem start SunOS 5.10 6 Jun 2001 smcregister(1M)
Man Page