VM management - Create/Edit guest check/run script

Description

It is possible to display a line that is the result of a command sent to the legacy operating system running on the guest or a result of a "ping" done locally that can give information on the guest system. For example, the uptime can be returned (rsh or ssh needed) and added to the displayed guests list.

Display output example from the "vmlist" command:

If the script has been initialized and a new virtual machine is added, it must be edited for the case related to the new configuration file to be added otherwise the "Invalid parameter" case will be displayed (this does not prevent the script from running).

Usage

Select option 1 to edit the script and option 2 to verify the commands entered work correctly:

Script example

(lightbulb) In this example, "ssh" is used to display the guest "uptime" for a Tru64 UNIX guest and "rsh" is used to write the boot time of an OpenVMS guest.

(warning) The last 2 lines containing the RETVAL variable are mandatory.

Example:


#!/bin/sh
#
case "$1"
in
  
/charon/pluto.cfg)
    
ssh -o ConnectTimeout=2 pluto5 "uptime|cut -f1 -d','" 2>/dev/null
    
RETVAL=$?
    
;;
  
/charon/myds20vms.cfg)
    
rsh -l system ds20vms 'write sys$output "Booted ",f$getsyi("boottime")' 2>/dev/null
    
RETVAL=$?
    
;;
  
*)
    
echo "Invalid parameter '$1'"
    
RETVAL=1
    
;;
esac
echo "==RETVAL=${RETVAL}=="
exit ${RETVAL}

Note: when the script is initialized, example are provided and need to be uncommented depending on your needs. It is of course possible to add your own commands.



© Stromasys, 1999-2024  - All the information is provided on the best effort basis, and might be changed anytime without notice. Information provided does not mean Stromasys commitment to any features described.