Post Actions Config (post-actions.ncconf)
The post-actions.ncconf file contains configuration settings for NCache Event Hooks. This configuration enables NCache to asynchronously trigger external PowerShell scripts when specific lifecycle events such as cache startup, shutdown, node additions, or client connections occur.
Note
This file is installed with NCache and is located at %NCHOME%\config in Windows and /opt/ncache/config in Linux.
Post Actions Config Syntax
The post actions config syntax is explained below:
<post-event-actions>
<action name="start-service" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="stop-service" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="start-cache" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="stop-cache" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="create-cache" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="remove-cache" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="add-node" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="remove-node" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="add-client-node" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
<action name="remove-client-node" enabled="false">
<process type="ps1" path=""/>
<arguments value=""/>
</action>
</post-event-actions>
Understanding the Post Actions Config Syntax
The following section explains the tags mentioned in the file syntax.
<action>
Defines the mapping between a unique NCache operational event and its executable hook.
<action name="start-service" enabled="false">
name: Defines the specific NCache lifecycle event that triggers your custom PowerShell script, e.g., cache-start, cache-stop, service-start, service-stop, etc.
enabled: A boolean flag (true or false). When set to true, NCache automatically invokes the underlying PowerShell process when the event fires. When set to false, the event is ignored.
<process>
Specifies the environment configuration for the script to run.
<process type="ps1" path="C:\Scripts\MyScript.ps1"/>
type: Specifies the script type (currently only 'ps1' is supported).
path: Specifies the complete path to the script file.
<arguments>
Specifies optional, static arguments that are appended to the process execution.
<arguments value="-Force -LogLevel Verbose"/>
- value: Any additional user-defined arguments (e.g.
-Force) appended after NCache's own JSON argument.
See Also
NCache Event Hooks
Server Side Configurations
Client Side Configurations