PingDirectory

Changing the timeout for an exec alert handler

Exec alert handlers automatically terminate their associated commands after the default duration. You can change this duration or disable the timeout if needed.

About this task

The command-timeout property for an exec alert handler has a default value of 1 hour, after which the handler terminates any commands or scripts it initiated and logs an error. This timeout helps mitigate the effects of a command or script running longer than expected.

Depending on your configuration for a given exec alert handler, you might want to adjust this value up or down. You can disable the timeout by setting the property’s value to 0 s.

Steps

  • Set the value for the command-timeout property of an exec alert handler.

    Choose from:

    • Create an exec alert handler with the desired timeout value. For example:

      $ bin/dsconfig create-alert-handler \
        --handler-name TestAlertHandler \
        --type exec \
        --set enabled:true \
        --set command:testScript.sh \
        --set "command-timeout:2 h"
    • Modify the command-timeout property of an existing exec alert handler. For example:

      $ bin/dsconfig set-alert-handler-prop \
        --handler-name TestAlertHandler \
        --set "command-timeout:15 m"
    • Disable the command-timeout property of an existing or new exec alert handler by setting the value to 0. This allows any initiated commands or scripts to run indefinitely. For example:

      $ bin/dsconfig set-alert-handler-prop \
        --handler-name TestAlertHandler \
        --set "command-timeout:0 s"