No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

OceanStor BCManager 6.5.0 eReplication User Guide 02

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Editing the Script for Consistency of LUN Protected Groups

Editing the Script for Consistency of LUN Protected Groups

Edit the LUN protected group consistency script by referring to this chapter and the default script.

Linux

  1. Log in to the production application server as an administrator and go to the directory where the customized script is stored.
  2. Edit the customized script.

    When editing the customized script, you are advised to run the . "$2/bin/agent_thirdpartyfunc.sh" command to initialize the script to ensure that the variables and functions in the script are available.

    Table 9-4 and Table 9-5 show the available variables and functions after the script is initialized.

    Table 9-4  Variable list

    Name

    Description

    PID

    Unique ID

    AGENTROOT

    Root directory of the eReplication Agent

    BINPATH

    bin directory of the eReplication Agent

    TMPPATH

    Temporary file directory of the eReplication Agent

    LOGPATH

    Log directory of the eReplication Agent

    LOG_FILE_NAME

    Name of a log file

    RSTFILE

    Temporary file that stores the error message returned by the script to the eReplication Agent

    INPUT_PARA_TEMP_FILE

    Temporary file that stores variables

    INPUT_PARAMETER_LIST

    Stores all variables transferred from the eReplication Agent to the script.

    Table 9-5  Function list

    Name

    Description

    Example

    GetValue

    Obtains the value of input parameter key.

    • Input parameter

      key indicates the name of the variable to be obtained, for example, MysqlUser.

    • Output parameter

      ArgValue indicates the value of key.

    GetValue "${INPUT_PARAMETER_LIST}" key

    username=$ArgValue

    Log

    Displays logs.

    • Input parameter

      message indicates the information of logs to be displayed.

    • Output parameter

      None

    Log "message"

    Exit

    Exits the script execution and displays logs.

    • Input parameter
      • 0 or 1 indicates the return code for exiting the script execution.

        0 indicates that the script is executed successfully, and 1 indicates that the script fails to be executed.

      • loginfo indicates the information of logs to be displayed.
      • result info indicates the information returned to the eReplication Agent.

        When the return code for exiting the script execution is 0, this parameter can be left blank. This parameter is mandatory when the return code for exiting the script execution is 1. Error message returned to the eReplication Agent is displayed.

    • Output parameter

      None

    Exit 1 -log "loginfo" -ret "result info"

  3. Save the edited script in directory /home/rdadmin/Agent/bin/thirdparty/.
    NOTE:
    • The preset scripts are stored in directory /Decompression path of the eReplication Agent software package /bin/thirdparty/rd_user/.
    • The customized scripts are stored in directory /Decompression path of the eReplication Agent software package /bin/thirdparty/.
    • The template scripts are stored in directory /Decompression path of the eReplication Agent software package /bin/thirdparty/sample/.

Windows

  1. Log in to the production application server as an administrator and go to the directory where the customized script is stored.
  2. Edit the customized script.

    When editing the customized script, you are advised to run the call %~1\bin\agent_thirdpartyfunc.bat -init %~1 %~2 command to initialize the script to ensure that the variables and functions in the script are available.

    After the script is initialized, the available variables and functions are shown in Table 9-6 and Table 9-7.

    Table 9-6  Variable list

    Name

    Description

    PID

    Unique ID

    AGENT_ROOT

    Root directory of the eReplication Agent

    AGENT_BIN_PATH

    bin directory of the eReplication Agent

    AGENT_LOG_PATH

    Log directory of the eReplication Agent

    AGENT_TMP_PATH

    Temporary file directory of the eReplication Agent

    COMMONFUNC

    Script path of the public function

    PARAM_FILE

    Temporary file that stores variables

    RSTFILE

    Temporary file that stores the error message returned by the script to the eReplication Agent

    LOGFILE

    Log file name

    LOGFILEPATH

    Full log path

    INPUTINFO

    Stores all variables transferred from the eReplication Agent to the script.

    Table 9-7  Function list

    Name

    Description

    Example

    Init

    Initializes the script.

    • Input parameter

      None

    • Output parameter

      None

    call %~1\bin\agent_thirdpartyfunc.bat -init %~1 %~2

    GainValue

    Obtains the value of input parameter key.

    • Input parameter

      key indicates obtaining key of a variable, such as InstanceName.

    • Output parameter

      None

    call %COMMONFUNC% "%AGENT_ROOT%" %CMD_GETVALUE% %PID% %LOGFILE% "!INPUTINFO!" "key" DBINSTANCE

    Log

    Displays logs.

    • Input parameter

      message indicates the information of logs to be displayed.

    • Output parameter

      None

    call %~1 \bin\agent_thirdpartyfunc.bat -log "message"

    Exit

    Exits the script and displays logs.

    • Input parameter

      message indicates the information of logs to be displayed.

    • Output parameter

      None

    call %~1 \bin\agent_thirdpartyfunc.bat -exit -log "message" -ret %RSTCODE% 1

  3. Run the call %COMMONFUNC% "%AGENT_ROOT%" %CMD_GETVALUE% %PID% %LOGFILE% "!INPUTINFO!" "key" var command to obtain the value of a variable.
    NOTE:
    key is the keyword, and var is the variable that stores the variable value.
  4. Save the edited script in directory /home/rdadmin/Agent/bin/thirdparty/.
    NOTE:
    • The preset scripts are stored in directory /home/rdadmin/Agent/bin/thirdparty/rd_user/.
    • The customized scripts are stored in directory /home/rdadmin/Agent/bin/thirdparty/.
    • The template scripts are stored in directory /home/rdadmin/Agent/bin/thirdparty/sample/.
Translation
Download
Updated: 2019-05-21

Document ID: EDOC1100075861

Views: 10834

Downloads: 55

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next