[AIX Solaris HP-UX Linux Windows][z/OS]

Setting monitored directory deployment values

Before you can use the monitored directory application deployment service, you must enable it. You can optionally change the default monitored directory and polling interval values. By default, the monitored directory application deployment service is not enabled, the monitored directory is app_server_root/monitoredDeployableApps, and the polling interval is 5 seconds.

Before you begin

See topics on monitored directory deployment to determine whether monitored directory deployment offers a suitable way to deploy your enterprise application files:

Restriction:
  • Installing an enterprise application file by adding a file to a monitored directory is available only on distributed and z/OS® operating systems. It is not supported on IBM i operating systems.]
  • The monitored directory application deployment service is not supported on nodes that are registered with an administrative agent.

About this task

You can use an administrative console or wsadmin scripting to enable or disable monitored directory deployment and change the monitored directory and polling interval.

A monitoredDirectoryDeployment object has the following attributes:

enabled
Default is false. Set to true to enable monitored directory deployment.
monitoredDirectory
Default is USER_INSTALL_ROOT}/monitoredDeployableApps. Optionally set to a different file system directory. To change the default monitored directory, specify a different directory path for this setting. List the entire value for the directory, including the environment variable.

For base (stand-alone) application servers, the default monitored directory is the monitoredDeployableApps/servers/server_name directory of the application server profile.

For deployment managers, the default monitored directories are the monitoredDeployableApps/servers/server_name, monitoredDeployableApps/nodes/node_name/servers/server_name, and monitoredDeployableApps/clusters/cluster_name directories of the deployment manager profile.

pollingInterval
Default is 5 seconds. Optionally set to a different number of seconds. Valid values are 5 or higher. The product changes 0 (zero) or negative values to 5 when the server starts.

Procedure

  • Use the Global deployment settings page of an administrative console to set monitored directory values.
    1. Click Applications > Global deployment settings.
    2. To enable monitored directory deployment, select Monitor directory to automatically deploy applications.

      To disable monitored directory deployment, clear Monitor directory to automatically deploy applications.

    3. To change the monitored directory path, specify a new value for Monitored directory.

      Ensure that the directory that you specified for Monitored directory exists. The product does not create the directory for you.

    4. To change the polling interval, specify the number of seconds for Polling interval.
    5. Click Apply.
    6. If you are using an administrative console for a base (stand-alone) application server to change monitored directory values, restart the application server.

      If you are using an administrative console for a deployment manager to change monitored directory values, restart the deployment manager.

    To view a default value, after a non-default value is set, clear the field.

  • Use wsadmin scripting to set monitored directory values.
    1. Start wsadmin at a command prompt for the bin directory of the profile.
    2. Set the cell context for the profile to a variable.

      Run the AdminConfig getid command and set a variable for the cell name of the profile. For example, to set the c1 variable to the myNode01Cell cell name, run the following command:

      Using Jython:
      c1 = AdminConfig.getid('/Cell:helyarNode01Cell/')
      Using Jacl:
      set c1 [$AdminConfig getid /Cell:myNode01Cell/]
    3. Set the monitoredDirectoryDeployment attribute of the cell to a variable.

      Run the AdminConfig showAttribute command and set a variable for the monitored directory deployment attribute of the cell. For example, to set the md variable to the monitoredDirectoryDeployment attribute, run the following command:

      Using Jython:
      md = AdminConfig.showAttribute(c1, "monitoredDirectoryDeployment")
      Using Jacl:
      set md [$AdminConfig showAttribute $c1 monitoredDirectoryDeployment]
    4. Set monitored directory values.
      • To enable monitored directory deployment, run the AdminConfig modify command and set the enabled attribute to true.
        Using Jython:
        AdminConfig.modify(md, [['enabled', "true"]])
        Using Jacl:
        $AdminConfig modify $md {{enabled true}}

        To disable monitored directory deployment, run the modify command and set the enabled attribute to false. The product converts values other than true or false to a boolean value of false.

        Using Jython:
        AdminConfig.modify(md, [['enabled', "false"]])
        Using Jacl:
        $AdminConfig modify $md {{enabled false}}
      • To change the polling interval, run the modify command and set the pollingInterval attribute to a positive integer. Values other than integers result in a com.ibm.ws.scripting.ScriptingException error.
        Using Jython:
        AdminConfig.modify(md, [['pollingInterval', "10"]])
        Using Jacl:
        $AdminConfig modify $md {{pollingInterval 10}}
      • To change the monitored directory, run the modify command and set the monitoredDirectory attribute to a directory on the computer.

        Using Jython:

        [Linux]
        AdminConfig.modify(md, [['monitoredDirectory', "/newPath"]])
        [Windows]
        AdminConfig.modify(md, [['monitoredDirectory', "C:/newPath"]])

        Using Jacl:

        [Linux]
        $AdminConfig modify $md {{monitoredDirectory /newPath}}
        [Windows]
        $AdminConfig modify $md {{monitoredDirectory C:/newPath}}

        Ensure that the specified monitored directory exists. The product does not create the newPath directory for you.

      • To clear an attribute value and reset it to the default value, run the unsetAttributes command.
        Using Jython:
        AdminConfig.unsetAttributes(md, 'enabled')
        
        AdminConfig.unsetAttributes(md, 'pollingInterval')
        
        AdminConfig.unsetAttributes(md, 'monitoredDirectory')
        Using Jacl:
        $AdminConfig unsetAttributes $md {enabled}
        
        $AdminConfig unsetAttributes $md {pollingInterval}
        
        $AdminConfig unsetAttributes $md {monitoredDirectory}
    5. To view monitored directory values, run the AdminConfig show command.
      Using Jython:
      print AdminConfig.show(md)
      Using Jacl:
      $AdminConfig show $md

      Running the show command displays attribute values such as the following:

      [enabled false]
      [monitoredDirectory ${USER_INSTALL_ROOT}/monitoredDeployableApps]
      [pollingInterval 5]
    6. Save configuration changes.
      Using Jython:
      AdminConfig.save()
      Using Jacl:
      $AdminConfig save
    7. If you are changing monitored directory values for a base (stand-alone) application server, restart the application server.

      If you are changing monitored directory values for a deployment manager, restart the deployment manager.

Results

The product sets monitored directory deployment attributes to the values that you specified.

What to do next

If you enabled monitored directory deployment, deploy your applications by adding files to a monitored directory.