Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
excludeContents
stylesquare

Required parameters

...

Parameters

logfile

Full path to the

...

log file that will be used to log the script output.

Example:

logfile=C:\Charon\myds20vms_shutdown.log

windowsevent

Defines which message levels will create a new entry in the Windows Application Events (Source="CHARON")

Can be either "none" or any combination of S, W and E. 'S' for Success, 'W' for Warning and 'E' for Error. Default is 'SE' so Success and Error only.

Example:

windowsevent=SWE

waitbeforestop

Number of seconds to wait before stopping the service once the guest operating system no longer responds to 'ping'. If not set, default value = 60.

Example:

waitbeforestop=10

servicename

CHARON instance service name

Example:

servicename=myds20vms

guestsystem

Server name or IP address

Example:

guestsystem=10.0.0.3

os

VMS or Tru64

Example:

os=VMS

mode

...

rsh

...

Example:

mode=rsh

rshbin

Defines the location of the "rsh.exe" program.

Example:

rshbin=C:\

...

charon\rsh.exe

username

Defines the remote username that will be used to connect to the guest operating system via rsh.

Example:

username=system

openconsolecmd

Optional parameter used to open the console program while executing the script.

(question) It is recommended to define this parameter in case of integration with Windows shutdown

Example:

openconsolecmd=C:\Program Files\CHARON\Build_20203\x64\putty

openconsolearg

Optional parameter defining the parameters of the openconsolecmd parameter above.

Example:

openconsolearg=-load OPA0 -P 10003

windowwidth and windowheight

Optional parameters used to resize the window when running with service user ("system" account).

Useful during Windows shutdown to check operations executed.

Width = 132 and Height = 32 by default. BufferHeight set 2000 lines by default.

Example:

windowwidth=120

...

windowheight=50

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

...

Enabling remote connection on Tru64

...

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

...

...

Enabling remote connection on OpenVMS

...

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

...


Examples

Configuration file


Div
classcommandline

#-----------------------------------------

# myds20 OpenVMS 8.4 machine

#-----------------------------------------

windowwidth=132

windowheight=50

logfile=C:\Charon\myds20vms_shutdown.log

servicename=ds20vms

os=VMS

username=system

waitbeforestop=10

mode=rsh

guestsystem=10.0.0.3

rshbin=C:\bincharon\rsh.exe


Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

...

c:\Windows\system32>C:\charon\charon_cleanshutdown.ps1 -config C:\charon\myds20vms.ini -check

Charon clean shutdown

Name              Value
----              -----
windowheight      50
openconsolecmd    C:\Program Files\CHARON\Build_20203\x64\putty
servicename       ds20vms
username          system
waitbeforestop    10
guestsystem       10.0.0.3
os                VMS
openconsolearg    -load OPA0 -P 10003
mode              rsh
windowwidth       132
rshbin            C:\bincharon\rsh.exe
logfile           C:\Charon\myds20vms_shutdown.log

17:26:44 [INFO ] Using 'C:\Charon\myds20vms_shutdown.log' as log file / append
17:26:44 [INFO ] Execution date : 27-avr.-2020 17:26:44
17:26:44 [INFO ] Script version : 27-Apr-20 V2.0 (MD5: 4BA97792A105C9E0E484850B88B866F8 )
17:26:44 [INFO ] Powershell version : 5.1.14409.1018
17:26:44 [INFO ] Computer name : WIN2008BM
17:26:44 [INFO ] Username : Administrateur
17:26:44 [INFO ] Windows version : Microsoft Windows Server 2008 R2 Standard
17:26:44 [INFO ] Administrator mode : True
17:26:44 [INFO ]
17:26:44 [INFO ] Check mode enabled.
17:26:44 [INFO ] 'rsh' will be used
17:26:44 [INFO ] Service 'ds20vms' is Running (Display name: ds20vms)
17:26:44 [INFO ] Testing guest system '10.0.0.3' response
17:26:47 [INFO ] Opening console.
17:26:47 [INFO ] Invoking 'rsh' command and executing check command...
17:26:47 [INFO ] C:\bincharon\rsh.exe -l system 10.0.0.3 '@SYS$MANAGER:CHARON_SHUTDOWN.COM CHECK RSH'
17:26:47 [INFO ] Output results:
17:26:47 [INFO ] RSH was successful
17:26:47 [INFO ]
17:26:47 [INFO ]
17:26:47 [INFO ] Command successfully completed.
17:26:47 [INFO ] Check mode enabled: no connection test to be performed.
17:26:47 [INFO ] Check mode enabled: no wait / stop service.
17:26:47 [INFO ] Check mode enabled: the service ds20vms will not be stopped
17:26:47 [INFO ] Service ds20vms is Running
17:26:47 [INFO ] Script ended.

...


Div
classcommandline


c:\Windows\system32>C:\charon\charon_cleanshutdown.ps1 -config C:\charon\myds20vms.ini -check


Charon clean shutdown


Name              Value
----              -----
windowheight      50
openconsolecmd    C:\Program Files\CHARON\Build_20203\x64\putty
servicename       ds20vms
username          system
waitbeforestop    10
guestsystem       10.0.0.3
os                VMS
openconsolearg    -load OPA0 -P 10003
mode              rsh
windowwidth       132
rshbin            C:\bincharon\rsh.exe
logfile           C:\Charon\myds20vms_shutdown.log

17:29:13 [INFO ] Using 'C:\Charon\myds20vms_shutdown.log' as log file / append

17:29:13 [INFO ] Execution date : 27-avr.-2020 17:29:13

17:29:13 [INFO ] Script version : 27-Apr-20 V2.0 (MD5: 4BA97792A105C9E0E484850B88B866F8 )

17:29:13 [INFO ] Powershell version : 5.1.14409.1018

17:29:13 [INFO ] Computer name : WIN2008BM

17:29:13 [INFO ] Username : Administrateur

17:29:14 [INFO ] Windows version : Microsoft Windows Server 2008 R2 Standard

17:29:14 [INFO ] Administrator mode : True

17:29:14 [INFO ]

17:29:14 [INFO ] 'rsh' will be used

17:29:14 [INFO ] Service 'ds20vms' is Running (Display name: ds20vms)

17:29:14 [INFO ] Testing guest system '10.0.0.3' response

17:29:17 [INFO ] Opening console.

17:29:17 [INFO ] Invoking 'rsh' command and executing shutdown...

17:29:17 [INFO ] C:\bincharon\rsh.exe -l system 10.0.0.3 '@SYS$MANAGER:CHARON_SHUTDOWN.COM'

17:29:17 [INFO ] Output results:

17:29:17 [INFO ] $ PURGE /KEEP=20 SYS$MANAGER:CHARON_SHUTDOWN.LOG

17:29:17 [INFO ] $ RUN /DETACH SYS$SYSTEM:LOGINOUT.EXE /INPUT=SYS$MANAGER:CHARON_SHUTDOWN -

17:29:17 [INFO ] /OUTPUT=SYS$MANAGER:CHARON_SHUTDOWN.LOG /UIC=[1,4]

17:29:17 [INFO ] %RUN-S-PROC_ID, identification of created process is 00000122

17:29:17 [INFO ] $ ENDIF

17:29:17 [INFO ] $ ENDIF

17:29:17 [INFO ] $ EXIT

17:29:17 [INFO ] $

17:29:17 [INFO ] $ !

17:29:17 [INFO ] $ ! Force any output to the standard output socket.

17:29:17 [INFO ] $ ! Most useful when client is Un*x.

17:29:17 [INFO ] $ !

17:29:17 [INFO ] $ WRITE SYS$OUTPUT ""

17:29:17 [INFO ] $

17:29:17 [INFO ] $ IF (RSHD$ERROR .NES. RSHD$INPUT_OUTPUT)

17:29:17 [INFO ] $ ENDIF

17:29:17 [INFO ] $

17:29:17 [INFO ] $ ! SS_NORMAL, RSH was succcessful, command should send its error over net.

17:29:17 [INFO ] $ EXIT 1

17:29:18 [INFO ] Command successfully completed.

17:29:20 [INFO ] Testing connection to '10.0.0.3' = True

17:29:43 [INFO ] Testing connection to '10.0.0.3' = False

17:29:53 [INFO ] Sleeping for 10 seconds...

17:30:03 [INFO ] Stopping service ds20vms

17:30:04 [INFO ] Service ds20vms is Stopped

17:30:04 [INFO ] Script ended.


...