Exit codes

When you use custom or manual scripts, your script must exit with a valid exit code. Generally, exit codes are a way to notify an administrator whether or not the script ran successfully.

The section on each failure type contains the exit codes specific to using custom or manual scripts with that type of failure.

See “CMON_FAIL_ACTION”, “CMP_FAIL_ACTION”, “NET_FAIL_ACTION”, and “SVR_FAIL_ACTION” for details.

When you create a script for execution with CUSTOM, MANUAL, or CUSTOM_MANUAL actions, the script must use the exit command to complete, not use any exit command switches, and provide a valid exit code:

exit Any valid exit code

The exit code you provide dictates what OpenSwitch should do after the script executes. The following sample input would be allowed in a custom or manual-invoked script. The sample uses the exit command, does not use any exit command switches, and uses a valid exit code.

@echo off
...
...
exit 3

However, this sample input would not be allowed because it uses the “/B” exit command switch:

@echo off
...
...
exit/B 3

WARNING! Never use an exit code of -1. OpenSwitch uses this value internally to determine the reason for a failure. If a script returns -1, it may interfere with this diagnosis and cause the wrong error to be logged.

The remainder of this document describes each failure type parameter in detail, including the behavior invoked by each action for that parameter, and the reason and exit codes specific to that failure type and action.