Skip to main content
Version: 3.8.x.x LTS

Shell Integration

When nevisAgent changes a state, a shell script is executed. By default this script is located at: /opt/nevisagent/bin/ha.sh.

Customization

You can customize the commands that nevisAgent executes by replacing the ha.sh script. Proceed as follows:

  1. Copy the script:

    cp /opt/nevisagent/bin/ha.sh /var/opt/nevisagent/bin/ha.sh
  2. Remove the following block from /var/opt/nevisagent/bin/ha.sh:

    if [ -x /var/opt/nevisagent/default/bin/ha.sh ]; then
    /var/opt/nevisagent/default/bin/ha.sh $@
    exit $?
    fi
    Important

    This last step is important. If you do not perform this step, you get an endless loop when nevisAgent runs the script.

Examples

nevisAppliance boot

In a failover scenario, some instances are managed by nevisAgent. However, nevisAppliance starts all Nevis instances during boot. This leads to an error on the passive server in case systemd is used to control nevisProxy instances, because the shared IP is not available. Subsequently, the default systemd template unit file of nevisProxy will try to restart nevisProxy, leading to a lot of follow-up errors.

You can create a workaround for this issue by customizing the ha.sh script. See the previous section Customization on how to set up nevisAgent. In the ha.sh script, replace the function is_passive:

is_passive() {
nohup nevisproxy all stop 2>/dev/null 1>/dev/null &
}