InfoScale™ 9.0 Cluster Server Generic Application Agent Configuration Guide - AIX, Linux, Solaris

Last Published:
Product(s): InfoScale & Storage Foundation (9.0)
Platform: AIX,Linux,Solaris

Sample scripts to start, stop, and monitor a generic application

You can write your own scripts for the VCS Application agent to bring a generic application online, take the application offline, and monitor the status of the application.

You can also modify the following sample scripts and use them to start, stop, and monitor the application.

  • Sample script to start a generic application:

    #!/bin/sh
    touch /tmp/sampleapp # add any steps, if required
    exit 0

    You can modify the sample start script to suit the application requirements. If you save the start script with the name startsampleapp, then to bring the application online, the agent function runs the following command:

    su - user -c startsampleapp

  • Sample script to stop a generic application:

    #!/bin/sh
    rm -f /tmp/sampleapp # add any steps, if required
    exit 0

    You can modify the sample stop script to suit the application requirements. If you save the stop script with the name stopsampleapp, then to bring down the application, the agent function runs the following command:

    su - user -c stopsampleapp

    Note:

    The value of the return code for the start and stop scripts must be 0. No other return codes are supported.

  • Sample script to monitor a generic application:

    #!/bin/sh
    APPLICATION_IS_ONLINE=110
    APPLICATION_IS_OFFLINE=100
    if [ -f /tmp/sampleapp ] ; then # add any steps, if required
    exit $APPLICATION_IS_ONLINE
    else
    exit $APPLICATION_IS_OFFLINE
    fi

    If you save the monitor script with the name monitorsampleapp, then to monitor the application, the agent function runs the following command:

    su - user -c monitorsampleapp