Creating Provider Script Registered with Host Agent
SAP Host Agent executes user-defined scripts within SAP Landscape Management on all managed hosts with a registered configuration file. This configuration file specifies the operations available on the given host in a specific location.
Prerequisites
-
You have configured SAP Host Agent Registered Scripts.
For more information, see Configuring SAP Host Agent Registered Scripts.
-
Optional: You have created custom properties.
For more information, see Creating Custom Properties.
Procedure
- Choose Automation Studio Provider Definitions.
- Choose Create Script Registered with Host Agent.
- Enter the name for the provider definition.
-
Enter the name of the script that you defined in the .conf
file located in the operations directory.
- Optional:
To use custom notifications on activities or to execute the operation on the central host
only, select the Execute on Central Host Only checkbox
and choose the central execution type:
- Custom Property
- System
- Host
- Instance Type in Same System
- Custom Parameter
- Passed parameter (set at runtime)
- Transformation String
- Virtual Host/IP Address
Instead of a fixed host, you can also specify a variable host or a valid instance ID using the following format:
<variable name>
The variable name must have the following format:- virtual host name
- PROP-<custom property name>
- PARAM-<custom parameter name>
Only applicable if the operation is executed for instances and not for hosts:- CONFIG-DB
Operation will be executed for the system database.
- CONFIG-SCS
Operation will be executed for the central services instance.
- CONFIG-ERS
Operation will be executed for the enqueue replication server instance.
- CONFIG-CI
Operation will be executed for the central instance.
- CONFIG-WD
Operation will be executed for the Web dispatcher.
- CONFIG-GW
Operation will be executed for the gateway server.
- Optional:
To create or update a local XML file with the mount data of the corresponding
instance for your custom operation, custom hook or custom provisioning
replacement, select the Use Mount Data XML
checkbox.
-
Create Mount DATA XML
For all custom provisioning replacements, the mount data is automatically created. You can use the Use Mount Data XML option, if you need this mount data in other operations as well.
SAP Landscape Management creates a local file and passes the path to this file as the parameter MOUNT_XML_PATH.
For a post unprepare hook, the mounts which are actually unmounted during the corresponding unprepare operation are stored in a temporary file. The path to this temporary file is passed as the UMOUNT_XML_PATH parameter. On UNIX, these files are only readable by the root user and will be removed after the operation is in status cancelled, failed, or completed.
-
Update Mound DATA XML
You can update the mount data of the instance, if it is a custom cloning replacement, or if your select the Use Mount Data XML checkbox.
To update the mount data in the configuration of the instance, print to standard out:MountDataBegin <Actual mount data in the same XML format> MountDataEnd
The mount data is updated in the instance configuration and does not affect the current process. You cannot update System Wide Mounts.
DTD of the XML Format<?xml version="1.0" ?> <!DOCTYPE mountconfig[ <!ELEMENT mountconfig (mount*)> <!ELEMENT mount (mountpoint,exportpath,options?)> <!ATTLIST mount fstype CDATA #IMPLIED partnerid CDATA #IMPLIED storagetype CDATA #IMPLIED > <!ELEMENT mountpoint ( #PCDATA ) > <!ELEMENT exportpath ( #PCDATA )> <!ELEMENT options ( #PCDATA )> ]>
-
- Optional:
To create a temporary parameter file containing all non-secure parameters on
the host where the operation is executed, select the Use Parameter
File checkbox.
SAP Landscape Management passes the path to this temporary file in the PARAMETER_FILE parameter. After execution, SAP Landscape Management deletes the file.
The parameters are stored in the following format:
<parameter name> = <parameter value>param1=value1 param2=multi line value nextline value (must not contain any = characters)
- Optional:
To modify the script for updating custom properties of the current host,
instance, or its parent system, select the Update the Custom
Properties checkbox.
The script returns the following line:
- [RESULT]:Property:<property name>=<property value>
-
For system properties:
[RESULT]:SystemProperty:<property name>=<property value>
-
For secure properties:
[RESULT]:PropertySecure:<property name>=<property value> or [RESULT]:SystemPropertySecure:<property name>=<property value>
- Optional:
To allow the HTML output of custom scripts, select the Allow HTML
Output checkbox.
You use HTML output for example, to display operation results with different colors or in table format. To use HTML output, use the following format:
HtmlSectionBegin <HTML markup> HtmlSectionEnd
Within a HTML section, you can use HTML markup, javascript will be filtered out.
-
Define what your provider definition can be used for:
- To use your provider definition for custom operations, select required entities in the Operation Uses section.
- To use your provider definition for custom hooks, select the required entities in the Hook Uses section.
- To use your provider definition for custom provisioning processes,
select the Provisioning Replacement checkbox.
The following additional parameters are also available:
- SAP_LVM_TARGET_SID
SAPSYSTEMNAME of the target system
- SAP_LVM_TARGET_SYSTEM_ID
SAP Landscape Management system ID of the target system
- SAP_LVM_SRC_SID
SAPSYSTEMNAME of the source system
- SAP_LVM_SRC_SYSTEM_ID
SAP Landscape Management system ID of the source system
If you execute the operation on a source instance, you can access the parameters of the corresponding target instance, including custom properties, with the LVM_TARGET_ prefix.
If you execute the operation on a target instance, you can access the parameters of the corresponding source instance, including custom properties, with the LVM_SRC_ prefix.
- SAP_LVM_TARGET_SID
- To use your provider definition for a custom notification, select the Notification checkbox.
- To execute your provider definition to retrieve all possible values for a custom
parameter, select the Parameter Supplier
checkbox.
The following output format is expected, each value in a new line:
[ID]: <Value ID> [DESC]: <Description of the preceding ID>
Only the ID of the selected value is passed as a custom parameter.
For an example, see SAP Note 1936615 Dynamic Values for custom operations in SAP Landscape Management.
- To execute your provider definition to receive all possible values for a custom
parameter, select the Default Value Supplier
checkbox.
The following output format is expected, each value in a new line:
[DEFAULT_ID]: <ID of the value as used in the custom operation default replacement> [DEFAULT_VALUE]: <Default value that should be used>
For an example, see SAP Note 1936615 Dynamic Values for custom operations in SAP Landscape Management.
- Choose Create Provider.
Results
You can now configure custom operations, hooks, and notifications.