Adding or modifying local actions in the operator console

You can add or modify local actions by using the LocalActions.xml file, which is a part of the localactions.jar file.

To add or modify local actions

  1. Back up the contents of the pw\tomcat\webapps directory.
  2. Copy the \pw\tomcat\webapps\localaction\localactions.jar file to a temporary location in a system that has JDK version 1.7.x installed.
    The temporary location does not have to be the computer where the TrueSight Infrastructure Management server is installed.

  3. Access the temporary directory where you copied the localactions.jar file.
  4. Extract localactions.jar into the temporary directory by running the following command:
    jar -xvf localactions.jar
  5. From the extracted directory structure, delete the META-INFdirectory and its contents by entering the appropriate command for your operating system:
    • (Microsoft Windows): rmdir /S /Q META-INF
    • (Solaris or Linux): rm -rf META-INF
  6. From the temporary directory, delete the original localactions.jar file.
  7. To add or edit local actions, edit the following files in the temp\etc\event_op directory:
    • LocalActions.xml
    • mc_actions.xml

      Note

      The scripts (.cmd for Windows or without an extension for UNIX) that contain the code of the new local actions that are going to be added must be located in the same directory as LocalActions.xml and mc_actions.xml files.


      For example, if you want to add a new local action that executes a ping command to the value from the %mc_host_address% slot rather than the %mc_host% slot and make this new local action available for all kinds of events for which EventClass is different than ALARM or ABNORMALITY, you would complete the following steps:

    1. In the LocalActions.xml file, insert the following lines:

      <Action location="mc_actions.xml" id="mc_ping_host_address">
      <EventClass>!ALARM</EventClass>
      <EventClass>!ABNORMALITY</EventClass>
      </Action>
    2. In the mc_actions.xmlfile, insert the following lines:

      <ActionDef id="mc_ping_host_address" label="Ping Host Address" type="executable"
      target="mc_ping_host_address">
      Ping the Host Address of the event.
      </ActionDef>
    3. Create a new file in the same directory named mc_ping_host_address (Solaris or Linux) or mc_ping_host_address.cmd that includes the lines appropriate for your operating system:
      • (Solaris or Linux):

        #!/bin/sh
        \\ \\
        if [ `uname` = "HP-UX" ]
        then
        echo "ping $mc_host_address -n 5"
        ping $mc_host_address -n 5
        else
        echo "ping -c 5 $mc_host_address"
        ping -c 5 $mc_host_address
        fi
        
      • (Microsoft Windows):

        @ECHO off
        ECHO ping -n 5 %mc_host_address%
        ping -n 5 %mc_host_address%
  8. In the temporary directory, create another localactions.jar file by executing the following command:
    jar -cvf localactions.jar *
  9. Sign the jar file you created by executing the following commands:

    Note

    To sign the jar file, you must have a JDK 1.7 keytool and jarsigner (located in the JSSE SDK bin directory) in your environment path.

    1. keytool -genkey -keystore localaction -alias lca to generate a new key or certificate.
    2. jarsigner -keystore localaction localactions.jar lca to sign the new jar file using the new key or certificate.
    3. jarsigner -verify localactions.jar to verify the signed jar file.
  10. Replace the localactions.jar file in the \pw\tomcat\webapps\localaction directory with the localactions.jar file that you created.

    1. Restart the TrueSight Infrastructure Management server.
    2. Verify whether the newly created or updated local action is visible in the event list.
  11. You can modify the properties file to display the name of the local actions and labels in the Execute Local Action and Local Action windows by performing the following steps:
    1. To view the name of the newly created local action in the Event List menu, perform the following steps:
      1. Get the ID from LocalAction.xml for the newly created Local Action.
      2. Open the allViews.properties file located at \pw\pronto\conf\resources\i18nData\en_US\java\ folder, where en_US is for English. To add or modify local actions for other locales, access the specified locales.
      3. Provide the name of this local action in key=value format, where key is the ID of the local action and value is the name of the local action. For example, if the local action ID is mc_launch_ie, the local action is mc_laucnh_ie=Launch Internet Explorer. For more information about naming local actions, you can refer other local actions in the allViews.properties file.
    2. To view all input and output messages displayed in the Execute Local Action and Local Action windows, perform the following steps:
      1. Extract kbresource.jar file by running the following command:
        jar -xvf kbresource.jar
      2. From the extracted directory structure, delete the META-INF directory and its contents by entering the appropriate command for your operating system:
        • (Microsoft Windows): rmdir /S /Q META-INF
        • (Solaris or Linux): rm -rf META-INF
      3. From the temporary directory, delete the original kbresource.jar file.
      4. Open kb_core_resource.properties file.
      5. Add all the key-value pairs for all the keywords that you used while creating the local action. You can refer to other key-value pairs for an existing local action to see all the messages that need to be added.
        For other locales, modify the corresponding kb_core_resource.properties file.
      6. After you have added all the keys and values, create kbresource.jar by running the following command:
        jar -cvf kbresource.jar *
      7. Sign the jar file that you created by executing the following commands:

        Note

        To sign the jar file, you must have a JDK 1.7 keytool and jarsigner (located in the JSSE SDK bin directory) in your environment path.

        1. keytool -genkey -keystore kbresource -alias lca to generate a new key or certificate.
        2. jarsigner -keystore kbresource kbresource.jar lca to sign the new jar file using the new key or certificate.
        3. jarsigner -verify kbresource.jar to verify the signed jar file.
  12. Clean up the Java cache in the browsers used to log on to the Operations Console. From the command prompt of each computer connecting to the Operations Console, including the TrueSight Infrastructure Management server, execute the javaws -viewer command and delete the jar and jnlp files from both the Applications and Resources tab. 

Troubleshooting

The following information can help you troubleshoot issues that you might encounter when you use local actions.

How do you see changes made to local actions after modifying the localactions.jar file?

Ensure that you execute the command javaws -viewer.

Delete all occurrences of local actions from the Applications tab and delete the related local action files from the Resources tab.

How do you view the output logs to provide the file to BMC Customer Support?

To view the output logs, enable the Java Console at http://www.java.com/en/download/help/javaconsole.xml.

How do you ensure that support for local actions is available in Infrastructure Management and is properly installed?

  • Ensure that the localaction folder is available under <installationDirectory>\pw\tomcat\webapps and contains 16 jar files and 15 jnlp files List them.
  • All jnlp files where Infrastructure Management Performance Management is installed must have a host name value.

How do you run local actions (running on one Infrastructure Management server) after you copy them to another Infrastructure Management server?

  • If you have copied jnlp files change the host name and port number.
  • Run javaws -viewer and delete the related jar and jnlp local action files from the Applications and Resources tab.

How do you restrict local actions from executing on the basis of a slot (of type CLASS) of an event?

  • Follow the procedure of adding and modifying local actions under To add or modify local actions.
  • To restrict a particular local action from executing, the LocalActions.xml file must contain <EventClass> as a child element of <Action> element. In the following example, local actions will be executed only for alarm and abnormality event class types.

     <Action location="mc_actions.xml" id="mc_ping_host">
                  <EventClass>ALARM</EventClass>
                  <EventClass>ABNORMALITY</EventClass>
    </Action>

How do you copy jar files that are required to execute local actions?

  • Follow the procedure of adding and modifying local actions under To add or modify local actions.
  • Include jar files that are required for the newly added local actions along with other cmd and XML files.

How do I migrate local actions from Service Impact Event Management to Infrastructure Management?

  1. Extract the localactions.jar for Service Impact Event Management and Infrastructure Management.
  2. Follow the procedure of adding and modifying local actions under To add or modify local actions.

How to make local actions work if you are using a custom HTTP port for Infrastructure Management?

  1. Open the LAC.jnlp file located under <installationDirectory>\pw\tomcat\webapps\localaction folder.
  2. Change valueoftheproperty ixshost to include the port name next to the host name. For example, for a host which is on pngp4745 the line in the file will be <property name="ixshost" value="pngp4745" />. Change the line to <property name="ixshost" value="pngp4745:<NEW_PORT>" />.
  3. For every jnlp file located under <installationDirectory>\pw\tomcat\webapps\localaction folder, change the code to include the port name next to the host name. For example, for a host which is on pngp4745 the line in the file will be <jnlp spec="1.0+" codebase="http://pngp4745/localaction/">. Change the line to <jnlp spec="1.0+" codebase="http://pngp4745:<NEW_PORT>/localaction/">.
  4. Execute the javaws -viewer command at the dos prompt and delete all the older jar files.
  5. Open the Operations Console and execute local actions.

How do local actions work on HTTPS protocol?

For local actions to work on HTTPS protocol, follow these steps:

  1. Edit the code in all jnlp files and change the value of http to https to change the port number.
    JNLP files location: <TSIMInstallationDirectory>\pw\tomcat\webapps\localaction
  2. Ensure that the ixshost value is blank in the JNLP file, as follows.
    <property name="ixshost" value="" /> 
  3. In the httpd-ssl.conf file locate the line starting with <IfModule mod_headers.c> and ending with </IfModule> and enclose these lines with the LocationMatch tag as follows:
    File location: <TSIMInstallationDirectory>\pw\apache\conf\extra\httpd-ssl.conf

    <LocationMatch "^(?!/localaction).*/">
      <IfModule mod_headers.c>
         Header set Cache-Control no-cache
         Header merge Cache-Control no-store
         Header set Pragma no-cache
         Header set Expires 0
      </IfModule>
    </LocationMatch>
  4. Restart the httpd service by running the following command:
    pw p r httpd

Where to go from here

For information about using the local actions, see version 7.3.0.1 of the BMC Impact Solutions Event Management Guide. This guide is available at http://webapps.bmc.com/support/faces/prodversion.jsp?prodverseqid=173588.
You must be a member of the BMC Support website to access this document.

Was this page helpful? Yes No Submitting... Thank you

Comments

  1. Mathieu Sauvinet

    Hi,

    I think you must replace all kbresources.jar by kbresource.jar for these lines :

    Extract kbresources.jar file by running the following command: jar -xvf kbresources.jar

    After you have added all the keys and values, create the kbresources.jar by running the following command: jar -cvf kbresources.jar *

    jarsigner -keystore kbresource kbresources.jar lca to sign the new jar file using the new key or certificate. jarsigner -verify kbresources.jar to verify the signed jar file.

    Feb 02, 2018 07:47
    1. Harihara Subramanian

      Hi Mathieu Sauvinet

      I am following up with the SMEs w.r.t your clarification. Will update the doc based on the outcome of the verification.

      Thanks,

      Hari

      Feb 12, 2018 11:57