WAS v8.5 > Deploy applications > Deploy enterprise applications > Install enterprise application files by adding them to a monitored directorySet monitored directory deployment values
Before we can use monitored directory deployment, enable it. We can optionally change the default monitored directory and polling interval values. By default, monitored directory deployment is not enabled, the monitored directory is app_server_root/monitoredDeployableApps, and the polling interval is 5 seconds.
See topics on monitored directory deployment to determine whether monitored directory deployment offers a suitable way to deploy your enterprise application files:
- Install enterprise application files by adding them to a monitored directory
- Install enterprise application files by adding properties files to a monitored directory
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. We can use an dmgr 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.
- pollingInterval
- Default is 5 seconds. Optionally set to a different number of seconds. Valid values are 5 or higher. WAS v8.5 changes 0 (zero) or negative values to 5 when the server starts.
- Use the Global deployment settings page of an dmgr console to set monitored directory values.
- Click Applications > Global deployment settings.
- To enable monitored directory deployment, select Monitor directory to automatically deploy applications.
To disable monitored directory deployment, clear Monitor directory to automatically deploy applications.
- To change the monitored directory path, specify a new value for Monitored directory.
Ensure the directory that you specified for Monitored directory exists. WAS v8.5 does not create the directory for you.
- To change the polling interval, specify the number of seconds for Polling interval.
- Click Apply.
- Restart the application server.
To view a default value, after a non-default value is set, clear the field.
- Use wsadmin scripting to set monitored directory values.
- Start wsadmin at a command prompt for the bin directory of the profile.
- 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:
Jython:
c1 = AdminConfig.getid('/Cell:helyarNode01Cell/')
Jacl:
set c1 [$AdminConfig getid /Cell:myNode01Cell/]
- 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:
Jython:
md = AdminConfig.showAttribute(c1, "monitoredDirectoryDeployment")
Jacl:
set md [$AdminConfig showAttribute $c1 monitoredDirectoryDeployment]
- Set monitored directory values.
- To enable monitored directory deployment, run the AdminConfig modify command and set the enabled attribute to true.
Jython:
AdminConfig.modify(md, [['enabled', "true"]])
Jacl:
$AdminConfig modify $md {{enabled true}}
To disable monitored directory deployment, run the modify command and set the enabled attribute to false. WAS v8.5 converts values other than true or false to a boolean value of false.
Jython:
AdminConfig.modify(md, [['enabled', "false"]])
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.
Jython:
AdminConfig.modify(md, [['pollingInterval', "10"]])
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.
Jython:
![]()
AdminConfig.modify(md, [['monitoredDirectory', "/newPath"]])
![]()
AdminConfig.modify(md, [['monitoredDirectory', "C:/newPath"]])
Jacl:
![]()
$AdminConfig modify $md {{monitoredDirectory /newPath}}
![]()
$AdminConfig modify $md {{monitoredDirectory C:/newPath}}
Ensure the specified monitored directory exists. WAS v8.5 does not create the newPath directory for you.
- To clear an attribute value and reset it to the default value, run the unsetAttributes command.
Jython:
AdminConfig.unsetAttributes(md, 'enabled') AdminConfig.unsetAttributes(md, 'pollingInterval') AdminConfig.unsetAttributes(md, 'monitoredDirectory')Jacl:
$AdminConfig unsetAttributes $md {enabled} $AdminConfig unsetAttributes $md {pollingInterval} $AdminConfig unsetAttributes $md {monitoredDirectory}
- To view monitored directory values, run the AdminConfig show command.
Jython:
print AdminConfig.show(md)
Jacl:
$AdminConfig show $md
Running the show command displays attribute values such as the following:
[enabled false] [monitoredDirectory ${USER_INSTALL_ROOT}/monitoredDeployableApps] [pollingInterval 5]
- Save configuration changes.
Jython:
AdminConfig.save()
Jacl:
$AdminConfig save
- Restart the application server.
Results
WAS v8.5 sets monitored directory deployment attributes to the values that you specified.
If you enabled monitored directory deployment, deploy the applications by adding files to a monitored directory.
Subtopics
- Global deployment settings
Use this page to manage settings that apply to all applications or to a subset of application types.- Global deployment settings
Use this page to manage settings that apply to all applications or to a subset of application types.
Related concepts:
Ways to install enterprise applications or modules
Related
Install enterprise application files by adding them to a monitored directory
Install enterprise application files by adding properties files to a monitored directory
Start the wsadmin scripting client using wsadmin.sh
Reference:
Directory conventions