Set monitored directory deployment values
Before using the monitored directory application deployment service, enable it. We 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.
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.
- The monitored directory application deployment service is not supported on nodes with an administrative agent.
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...
app_server_profile/monitoredDeployableApps/servers/server
For deployment managers, the default monitored directories are...
dmgr_profile/monitoredDeployableApps/servers/server
dmgr_profile/monitoredDeployableApps/nodes/node/servers/server
dmgr_profile/monitoredDeployableApps/clusters/cluster_name...
- 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.
Set monitored directory deployment values
- Use the Global deployment settings page of an administrative console to set monitored directory values.
- Enable monitored directory deployment, click...
Applications > Global deployment settings > 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 that the directory specified for Monitored directory exists. The product does not create the directory for you.
- To change the polling interval, specify the number of seconds for Polling interval.
- Click Apply.
- If we are using an administrative console for a base (stand-alone) application server to change monitored directory values, restart the application server.
If we 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.
- Start wsadmin at a command prompt for the bin directory of the profile.
- Set the cell context for the profile to a variable.
Set a variable for the cell name of the profile. For example, to set the c1 variable to the myNode01Cell cell name,:
Use Jython:
c1 = AdminConfig.getid('/Cell:myNode01Cell/')
Use Jacl:
set c1 [$AdminConfig getid /Cell:myNode01Cell/]
- Set the monitoredDirectoryDeployment attribute of the cell to a variable.
Set a variable for the monitored directory deployment attribute of the cell. For example, to set the md variable to the monitoredDirectoryDeployment attribute...
Use Jython:
md = AdminConfig.showAttribute(c1, "monitoredDirectoryDeployment")
Use 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.
Use Jython:
AdminConfig.modify(md, [['enabled', "true"]])
Use 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.
Use Jython:
AdminConfig.modify(md, [['enabled', "false"]])
Use 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.
Use Jython:
AdminConfig.modify(md, [['pollingInterval', "10"]])
Use 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.
Use Jython:
(Linux)
AdminConfig.modify(md, [['monitoredDirectory', "/newPath"]])
(Windows)
AdminConfig.modify(md, [['monitoredDirectory', "C:/newPath"]])
Use 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.
Use Jython:
AdminConfig.unsetAttributes(md, 'enabled')
AdminConfig.unsetAttributes(md, 'pollingInterval')
AdminConfig.unsetAttributes(md, 'monitoredDirectory')
Use Jacl:
$AdminConfig unsetAttributes $md {enabled}
$AdminConfig unsetAttributes $md {pollingInterval}
$AdminConfig unsetAttributes $md {monitoredDirectory}
- To view monitored directory values, run the AdminConfig show command.
Use Jython:
print AdminConfig.show(md)
Use 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.
Use Jython:
AdminConfig.save()
Use Jacl:
$AdminConfig save
- If we are changing monitored directory values for a base (stand-alone) application server, restart the application server.
If we are changing monitored directory values for a deployment manager, restart the deployment manager.
The product sets monitored directory deployment attributes to the values specified.
What to do next
If we enabled monitored directory deployment, deploy the applications by adding files to a monitored directory.
Subtopics
- Global deployment settings
Manage settings that apply to all applications or to a subset of application types.
Related:
Ways to install enterprise applications or modules 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 Directory conventions