Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 42 update

...

  1. Check if there's an active connection to the console on the local host, kill if any.
    Reminder: (warning) If the console is locked from an external connection or if the prompt is not detected after sending a carriage return, the expect script will fail.
  2. Execute the "expect" script (1) and report all output to /opt/charon/<guest name>.expect.log. No need to kill the emulator process here as the "power off" command is executed.
  3. Append the output of this file to (2) the /opt/charon/console.<guest name>.log file for history
  4. Search for the "expect" script messages and displays them in stdout (3), they will be logged in the service status and will be displayed when stopping the service interactively.
    Example:
Div
classpagebreak

 

Example with Expect tool, AXP VMS guest

...

This status line is the result of the command you executed for that guest, for example a ping, an ssh command displaying uptime (Tru64) or boottime (OpenVMS).

 

Display output example:

Script example:

(lightbulb) In this example, we'll use "ssh" to display the guest "uptime" and the result of the "uname -nr" command (name of the node + release number of the operating system)

Div
classcommandline

# touch /opt/charon/utils/charon_gstart.chkrun

# chmod 744 /opt/charon/utils/charon_gstart.chkrun

# vim /opt/charon/utils/charon_gstart.chkrun

#!/bin/sh

#

# Parameter $1: contains full path to cfg file

#

case "$1"

in

  /charon/myds20.cfg)

    ssh -o ConnectTimeout=2 myds20 "uptime|cut -f1 -d',';uname -nr" 2>/dev/null

    RETVAL=$?

    ;;

  *)

    echo "Invalid parameter '$1'"

    RETVAL=1

    ;;

esac

echo "==RETVAL=${RETVAL}=="

exit ${RETVAL}


Example file provided (contains example for Tru64 and OpenVMS):

 

Include Page
KBCOMMON:DOC-GoToToc
KBCOMMON:DOC-GoToToc