Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update for script version 2.8

...

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

Div
classpagebreak


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. This parameter must contain the full path to the software used to connect to the console. In case putty is going to be used, it is possible to set it to 'putty' without any path. Doing so, the script will look for the latest version available in the Charon installation folder.

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

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

Example 2:
openconsolecmd=putty

Div
classpagebreak


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

...

...

classpagebreak

Enabling remote connection on OpenVMS

...


Div
classcommandline

VMS084> @sys$manager:tcpip$config

        Checking TCP/IP Services for OpenVMS configuration database files.

        HP TCP/IP Services for OpenVMS Configuration Menu

        Configuration options:

                 1  -  Core environment
                 2  -  Client components
                 3  -  Server components
                 4  -  Optional components
                 5  -  Shutdown HP TCP/IP Services for OpenVMS
                 6  -  Startup HP TCP/IP Services for OpenVMS
                 7  -  Run tests
                 A  -  Configure options 1 - 4
                [E] -  Exit configuration procedure

Enter configuration option: 2

        HP TCP/IP Services for OpenVMS Client Components Configuration Menu

        Configuration options:

                 1  -  DHCP Client      Disabled Stopped
                 2  -  FTP Client       Disabled Stopped
                 3  -  NFS Client       Disabled Stopped
                 4  -  REXEC and RSH    Disabled Stopped
                 5  -  RLOGIN           Disabled Stopped
                 6  -  SMTP             Disabled Stopped
                 7  -  SSH Client       Disabled Stopped
                 8  -  TELNET           Enabled  Started
                 9  -  TELNETSYM        Disabled Stopped
                 A  -  Configure options 1 - 9
                [E] -  Exit menu

Enter configuration option: 4

RSH Configuration

Service is defined in the SYSUAF.
Service is defined in the TCPIP$SERVICE database.
Service is not enabled.
Service is stopped.

        RSH configuration options:

                 1 - Enable service on this node
                 2 - Enable & Start service on this node
                [E] - Exit RSH configuration

Enter configuration option: 2

%TCPIP-I-INFO, image SYS$SYSTEM:TCPIP$RSH.EXE installed
%TCPIP-I-INFO, image SYS$SYSTEM:TCPIP$RCP.EXE installed
%TCPIP-I-INFO, logical names created
%%%%%%%%%%%  OPCOM   8-JUL-2016 01:28:23.22  %%%%%%%%%%%
Message from user INTERnet on VMS084
INTERnet ACP Activate RSH Server

%TCPIP-I-INFO, service enabled
%TCPIP-S-STARTDONE, TCPIP$RSH startup completed
Press <ENTER> key to continue ...

REXEC Configuration
Service is not defined in the SYSUAF.
Service is not defined in the TCPIP$SERVICE database.
Service is not enabled.
Service is stopped.

        REXEC configuration options:

                 1 - Enable service on this node
                 2 - Enable & Start service on this node
                [E] - Exit REXEC configuration

Enter configuration option: 2

...

        HP TCP/IP Services for OpenVMS Client Components Configuration Menu

        Configuration options:

                 1  -  DHCP Client      Disabled Stopped
                 2  -  FTP Client       Disabled Stopped
                 3  -  NFS Client       Disabled Stopped
                 4  -  REXEC and RSH    Enabled  Started
                 5  -  RLOGIN           Disabled Stopped
                 6  -  SMTP             Disabled Stopped
                 7  -  SSH Client       Disabled Stopped
                 8  -  TELNET           Enabled  Started
                 9  -  TELNETSYM        Disabled Stopped
                 A  -  Configure options 1 - 9
                 
               [E] -  Exit menu

Enter configuration option: E


...


Div
classcommandline

VMS084> tcpip show service

Service             Port  Proto    Process          Address            State
RSH                  514  TCP      TCPIP$RSH        0.0.0.0             Enabled
SSH                   22  TCP      TCPIP$SSH        0.0.0.0             Enabled
TELNET                23  TCP      not defined      0.0.0.0             Enabled


...


Div
classcommandline

VMS084> tcpip
TCPIP> add proxy system /remote=administrator /host=10.0.0.1
TCPIP> show proxy 
VMS User_name     Type      User_ID    Group_ID   Host_name 
SYSTEM            CD     ADMINISTRATOR            10.0.0.1


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

...

Div

...

class

...

pagebreak

...


Examples

...

Configuration file

#-----------------------------------------
# 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

servicename=myds20vms


os=VMS

mode=rsh

rshbin=C:\

bin

charon\rsh.exe

username=system

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

Div
classpagebreak


Script execution

Check mode

...

c:

\Charon>powershell -file

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

Name                          

Charon clean shutdown

Name              Value
----

                          

              -----

mode                           rsh

servicename                    myds20vms

guestsystem                   

windowheight      50
openconsolecmd    C:\Program Files\CHARON\Build_20203\x64\putty
servicename       ds20vms
username          system
waitbeforestop    10
guestsystem       10.0.0.3

waitbeforestop                 10

os                             VMS

username                       system

rshbin                        


os                VMS
openconsolearg    -load OPA0 -P 10003
mode              rsh
windowwidth       132
rshbin            C:\

bin

charon\rsh.exe

logfile                       

logfile           C:\Charon\myds20vms_shutdown.log

20160808

17:

132716

26:44 [INFO

:0:

] Using 'C:\Charon\myds20vms_shutdown.log' as log file / append

20160808:132716:INFO :0:

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.

20160808

17:

132716

26:44 [INFO

:0:

] 'rsh' will be used

20160808

17:

132716

26:44 [INFO

:0:

] Service '

myds20vms

ds20vms' is Running (Display name:

myds20vms

ds20vms)

20160808

17:

132716

26:44 [INFO

:0:

] Testing guest system '10.0.0.3' response

20160808

17:

132719

26:47 [INFO

:0:

] Opening console.
17:26:47 [INFO ] Invoking 'rsh' command and executing check command...

20160808

17:

132719

26:47 [INFO ] C:\charon\rsh.exe -l system 10.0.0.3 '@SYS$MANAGER:CHARON_SHUTDOWN.COM CHECK RSH'
17:26:47 [INFO ] Output results:

20160808

17:

132719

26:47 [INFO

:0:

] RSH was successful

20160808

17:

132719

26:47 [INFO

:0:

]

20160808

17:

132719

26:47 [INFO

:0:

]

20160808

17:

132719

26:47 [INFO

:0:

] Command successfully completed.

20160808

17:

132719

26:47 [INFO

:0:

] Check mode

,

enabled: no connection test to be performed.

20160808

17:

132719

26:47 [INFO

:0:

] Check mode

,

enabled: no wait / stop service.

20160808

17:

132719

26:47 [INFO

:0:

] Check mode

,

enabled: the service

myds20vms

ds20vms will not be stopped

20160808

17:

132719

26:47 [INFO

:0:

] Service ds20vms is Running

20160808

17:

132719

26:

INFO :0: Done

47 [INFO ] Script ended.

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

Div
classpagebreak


Shutdown execution


Div
classcommandline

c:

\Charon>powershell -file

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

Name                          

-check


Charon clean shutdown


Name              Value
----                                         -----

mode                           rsh

servicename                    myds20vms

guestsystem                   
windowheight      50
openconsolecmd    C:\Program Files\CHARON\Build_20203\x64\putty
servicename       ds20vms
username          system
waitbeforestop    10
guestsystem       10.0.0.3

waitbeforestop                 10

os                             VMS

username                       system

rshbin                         os                VMS
openconsolearg    -load OPA0 -P 10003
mode              rsh
windowwidth       132
rshbin            C:\bincharon\rsh.exe
logfile                        logfile           C:\Charon\myds20vms_shutdown.log

2016080817:13425629:13 [INFO :0: ] Using 'C:\Charon\myds20vms_shutdown.log' as log file / append
20160808:134256:INFO :0:
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
2016080817:13425629:14 [INFO :0: ] Service 'myds20vmsds20vms' is Running (Display name: myds20vmsds20vms)
2016080817:13425629:14 [INFO :0: ] Testing guest system '10.0.0.3' response
20160808
17:13425929:17 [INFO :0: ] Opening console.
17:29:17 [INFO ] Invoking 'rsh' command and executing shutdown...
2016080817:13425929:17 [INFO ] C:\charon\rsh.exe -l system 10.0.0.3 '@SYS$MANAGER:CHARON_SHUTDOWN.COM'
17:29:17 [INFO ] Output results:
2016080817:13425929:INFO :0: $   17 [INFO ] $ PURGE /KEEP=20 SYS$MANAGER:CHARON_SHUTDOWN.LOG
20160808
17:13425929:INFO :0:20160808:134259:INFO :0: $   17 [INFO ] $ RUN /DETACH SYS$SYSTEM:LOGINOUT.EXE /INPUT=SYS$MANAGER:CHARON_SHUTDOWN -
20160808
17:13425929:INFO :0:20160808:134259:INFO :0:         17 [INFO ] /OUTPUT=SYS$MANAGER:CHARON_SHUTDOWN.LOG /UIC=[1,4]
20160808
17:13425929:INFO :0:20160808:134259:INFO :0: 17 [INFO ] %RUN-S-PROC_ID, identification of created process is 0000014A00000122
20160808
17:13425929:INFO :0:20160808:134259:INFO :0: 17 [INFO ] $ ENDIF
17:29:17 [INFO ] $ ENDIF
2016080817:13425929:INFO :0:20160808:134259:INFO :0: 17 [INFO ] $ EXIT
20160808
17:13425929:INFO :0:

20160808:134259:INFO :0: $

20160808:134259:INFO :0:

20160808:134259:INFO :0: $ !

20160808:134259:INFO :0:

20160808:134259:INFO :0: 17 [INFO ] $
17:29:17 [INFO ] $ !
17:29:17 [INFO ] $ ! Force any output to the standard output socket.
2016080817:13425929:INFO :0:20160808:134259:INFO :0: 17 [INFO ] $ ! Most useful when client is Un*x.
20160808
17:13425929:INFO :0:20160808:134259:INFO :0: 17 [INFO ] $ !
20160808
17:13425929:INFO :0:20160808:134259:INFO :0: $    17 [INFO ] $ WRITE SYS$OUTPUT ""
20160808
17:13425929:INFO :0:

20160808:134259:INFO :0:

20160808:134259:INFO :0:

20160808:134259:INFO :0: $

20160808:134259:INFO :0:

20160808:134259:INFO :0: $    17 [INFO ] $
17:29:17 [INFO ] $ IF (RSHD$ERROR .NES. RSHD$INPUT_OUTPUT)
2016080817:13425929:INFO :0:

20160808:134259:INFO :0: $    ENDIF

20160808:134259:INFO :0:

20160808:134259:INFO :0: $

20160808:134259:INFO :0:

20160808:134259:INFO :0: 17 [INFO ] $ ENDIF
17:29:17 [INFO ] $
17:29:17 [INFO ] $ ! SS_NORMAL, RSH was succcessful, command should send its error over net.
2016080817:13425929:INFO :0:20160808:134259:INFO :0: $    17 [INFO ] $ EXIT 1
20160808
17:13425929:18 [INFO :0: ] Command successfully completed.
2016080817:13430229:20 [INFO :0: ] Testing connection to '10.0.0.3' = True
20160808
17:13432529:43 [INFO :0: ] Testing connection to '10.0.0.3' = False
2016080817:13433529:53 [INFO :0: ] Sleeping for 10 seconds...
20160808
17:13434530:03 [INFO :0: ] Stopping service myds20vmsds20vms
20160808
17:13434530:04 [INFO :0: ] Service ds20vms is Stopped
2016080817:13434530:INFO :0: Done04 [INFO ] Script ended.


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

...