6.4 Setting Up the Notification Script

This section provides the steps required to configure HP Service Manager to call the notification script.

To configure HP Service Manager to call the notification script:

  1. Log into the HP Service Manager client with an account that has Administrative permissions.

  2. Create a Script Library that generates the parameters for the EM CLI call by performing the following sub-steps:

    1. Expand Menu Navigation, then Tailoring in the System Navigator pane.

    2. Double-click on Script Library.

      The Script Library panel appears.

    3. Enter a Name of OracleServices and a Package of OracleScripts.

    4. Copy the contents of the OracleOMSPost.js file from Exporting the Notification Script Files into the script panel. Figure 6-6 shows the Script Library panel after the fields have been specified.

    5. Change the value of the username on line 6 from oms_user to the username that Enterprise Manager will use to access the Service Manager web service. See Service Manager Username in Connection Settings for more information.

    6. Click Add.

      Figure 6-6 Script Library Panel


      script library

  3. Create a Script Panel that calls the Script Library by performing the following sub-steps:

    1. Double-click on Scripts in the System Navigator panel.

      The Script Panel Definition panel appears.

    2. Enter a script name of OracleScript.

    3. Click on the Pre RAD Statements tab.

    4. Click on the first line and enter the following text, where <emcli_dir> is the path where the EM CLI tool was installed:

      $L.command="<emcli_dir>\\emcli.bat;"+jscall("OracleServices.OracleOMSPost", $script)
      

      Note:

      Backslashes in the path must be entered as double backslashes. For example, C:\tools\em\emcli.bat would be entered as C:\\tools\\em\\emcli.bat.

      Figure 6-7 shows the Script Library panel after the fields have been specified.

    5. Click on the RAD tab and set Application to us.launch.external.

    6. Click on the first line in the Names column and enter name.

    7. Click on the first line in the Values column and enter $L.command.

    8. Click Add to create the Script Panel.

      Figure 6-7 Script Panel Definition


      script panel

  4. Perform the following sub-steps to update the Format Control to invoke the script upon creating or updating a ticket:

    1. Double-click on Format Control in the System Navigator panel.

      The Search Format Control Records panel appears.

    2. Enter probsummary in the Name field and click Search.

      The Format Control: probsummary panel appears.

    3. Click on the line where the Name is probsummary.

    4. Click Subroutines to open the Subroutines tab.

      One or more subroutines may already be defined.

    5. Scroll down the screen to the last empty entry and enter the following data:

      • Set Add to true.

      • Set Upd to true.

      • Set Names to file on line 1, and name on line 2.

      • Set Values to $file on line 1, and OracleScript on line 2.

      Figure 6-8 shows the Format Control panel after you have specified the fields.

    6. Click Save.

    Figure 6-8 Format Control Panel


    format control