Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Deploy applications > Install enterprise application files by adding them to a monitored directory
Set monitored directory deployment values
Before you can use monitored directory deployment, you must 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 WAS_HOME/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 admin 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 dmgrs, 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 dmgr 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 admin 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 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 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 admin console for a dmgr to change monitored directory values, restart the dmgr.
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 node1Cell cell name...
### Jython
c1 = AdminConfig.getid('/Cell:helyarNode01Cell/')### Jacl
set c1 [$AdminConfig getid /Cell:node1Cell/]
- 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. The product 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"]])(Windows)AdminConfig.modify(md, [['monitoredDirectory', "C:/newPath"]])### Jacl
$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.
### 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 $mdRun 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
- 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 dmgr, restart the dmgr.
Results
The product sets monitored directory deployment attributes to the values specified.
What to do next
If you enabled monitored directory deployment, deploy the applications by adding files to a monitored directory.
Related
Global deployment settings
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 using wsadmin.sh
Related
Directory conventions