Include Page |
---|
| KBCOMMON:KB-CSSstyle |
---|
| KBCOMMON:KB-CSSstyle |
---|
|
...
...
UNDER CONSTRUCTION
TO DO:
- update log output in other modes and here too
- specify parameters and values are case sensitive (in all other modes too)
Contents
Table of Contents |
---|
exclude | Contents |
---|
style | square |
---|
|
Required parameters
...
Parameters
logfile
...
Optional full path to the logfile that will be used to log the script output. If not specified a file name and path will be chosen based on session log file (one file per script execution). The file name is usually based on the configuration_name followed by "-SHUTDOWN-" and date/time.
Example:
logfile=C:\Charon\myds20_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
mode
...
opa0
...
Example:
mode=opa0
os
Either Tru64 or VMS
Example:
os=Tru64
servicename
CHARON instance service name.
When using
...
"opa0" mode, the service is stopped by
...
a "power off
" or the "F6
" key.
...
If this operation does not succeed (cannot connect to console or "F6" key not enabled for example), it is then stopped using a Windows service command.
Example:
servicename=myds20
username
Defines the remote username that will be used to connect to the console of the CHARON instance (if not already logged in)
...
Example / OpenVMS:
username=system
...
Example / Tru64:
username=root
password
Defines the password in clear text that will be used to connect to the console.
The password can be also stored in an encrypted
...
file as described below.
If password is
...
used then
...
cryptedpass
(below) value must be set to "none
" or left empty.
Example:
password=12345
...
cryptedpass
...
Full path
...
to the
...
text file
...
containing the encrypted
...
password
...
.
...
To create this file, open a command window "cmd.exe
"
...
and enter the following command:
C:\Users\
| Administrator> cd C:\CharonC:\Charon> Spock> powershell
PS C:
| \Charon> "<password>" | export-clixml <file>Example:
PS C:\Charon> "12345" | export-clixml C:\Charon\myds20pwd.clixml |
clixml\Users\Spock> ConvertTo-SecureString -String '<password>' -AsPlainText -Force
| ConvertFrom-SecureString | Out-File '<file full path>'
|
Please note the password encryption is based on current user credentials
The parameter can be set to "none
" or simply commented if not used.
Example:
cryptedpass
=C:\Charon\myds20pwd.txt
cryptedpsys
Full path to the text file containing the encrypted password that will be used as "system" user (during Windows server shutdown). To create this file, open a command window "cmd.exe
", run "psexec -i -s cmd.exe
" ( psexec is provided in the kit) and run "powershell
" from the newly opened window. At the PowerShell prompt, enter the following command:
C:\Users\Spock> powershell
PS C:\Users\Spock> ConvertTo-SecureString -String '<password>' -AsPlainText -Force | ConvertFrom-SecureString | Out-File '<file full path>'
|
Use a different name for the output file as the one user for "cryptedpass
"
The parameter can be set to "none
" or simply commented if not used.
Example:
cryptedpsys
=C:\Charon\myds20pwd_sys.
...
txt
port
Defines the port to access the console (same as the one defined in the configuration file).
Example:
port=10003
prompt
Defines the prompt at the shell level of the guest operating system. Used
...
to check the user is connected.
Notes:
- If the prompt contain spaces, it is necessary to add them in the configuration file
- The prompt must not contain any escape character.
Example:
prompt=myds20>
timelimitsec
Defines the maximum number of seconds the script can run (default = 180 seconds). This value depends on the time needed to shutdown properly the operating system.
Example:
timelimitsec=600
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 |
---|
|
...
...
...
...
Examples
...
Configuration file
#-----------------------------------------
# myds20 Tru64 V5.1 machine
#-----------------------------------------
logfile=C:\Charon\myds20_shutdown.log
servicename=myds20
mode=opa0 windowwidth=132
windowheight=50
servicename=pluto
os=Tru64
username=root
mode=opa0
clixmlcryptedpass=C:\Charon\ myds20pwdpluto_pwd. clixmltxt
port= 1000310005
prompt= # pluto5#
timelimitsec=180
|
Include Page |
---|
| KBCOMMON:KB-GoToTop |
---|
| KBCOMMON:KB-GoToTop |
---|
|
...
When check mode is enabled, a pop-up window will be displayed to check the expect operations performed on the CHARON instance console.
Div |
---|
| c:\Charon>powershell -file PS C:\Windows\system32>C:\charon\charon_cleanshutdown.ps1 -config myds20tru64C:\charon\pluto_tru64.ini -check
Charon clean shutdown
Name Value
---- -----
cryptedpass C:\Charon\pluto_pwd.txt
guestsystem 192.168.152.147
mode opa0
os Tru64
port 10005
prompt pluto5#
servicename pluto
timelimitsec 180
username root
18:14:03 [INFO ] Using 'C:\Program Files\CHARON\Virtual Machines\pluto\pluto-SHUTDOWN-2020-06-02-18-14-03-000000000.log' as log
file / one log file per script execution
18:14:03 [INFO ] Defined symbolic link 'C:\Program Files\CHARON\Virtual Machines\pluto\pluto-SHUTDOWN.log'
18:14:03 [INFO ] Using 'C:\charon\pluto_tru64.ini' as configuration file
18:14:03 [INFO ] Execution date : 02- ->To updateJun-2020 18:14:03
18:14:03 [INFO ] Script version : 02-Jun-20 V2.1 (MD5: ED6D76E7CCC3F0016C34D88BADE4EC1A )
18:14:03 [INFO ] Powershell version : 5.1.18362.752
18:14:03 [INFO ] Computer name : WIN10-MAIN
18:14:03 [INFO ] Username : bruno
18:14:03 [INFO ] Windows version : Microsoft Windows 10 Pro
18:14:03 [INFO ] Administrator mode : True
18:14:03 [INFO ] Windows shutdown scripts:
18:14:03 [INFO ] - Hide execution : False
18:14:03 [INFO ] - Maximum duration : 7 minutes 30 seconds
18:14:03 [INFO ] - Exec position#1 : c:\charon\myds20vms.ini
18:14:03 [INFO ] - Exec position#2 : c:\charon\pluto_tru64.ini (!)
18:14:03 [INFO ]
18:14:03 [INFO ] Check mode enabled.
18:14:03 [INFO ] 'opa0' will be used
18:14:03 [INFO ] Service 'pluto' is Running (Display name: pluto)
18:14:03 [INFO ] Using crypted password stored in 'C:\Charon\pluto_pwd.txt'.
18:14:03 [INFO ] No putty session active.
18:14:03 [INFO ] Connecting to OPA0 console, port 10005
18:14:03 [INFO ] Sending CRLF...
18:14:03 [INFO ] Time limit: 18:17:03. Seconds remaining: 180
18:14:06 [RCVD ]
18:14:06 [RCVD ] pluto5#
18:14:06 [RCVD ] pluto5#
18:14:06 [INFO ] Got: [pluto5# ]
18:14:06 [INFO ] Found prompt.
18:14:06 [INFO ] Check mode enabled: sending test command...
18:14:06 [INFO ] Command sent
18:14:11 [INFO ] Time limit: 18:17:03. Seconds remaining: 171
18:14:15 [RCVD ] /usr/bin/uname -a;echo RESULT=$?
18:14:15 [RCVD ] OSF1 pluto5 V5.1 2650 alpha
18:14:15 [RCVD ] RESULT=0
18:14:15 [INFO ] Remote command succeeded
18:14:15 [RCVD ] pluto5# pluto5#
18:14:15 [RCVD ] pluto5#
18:14:15 [INFO ] Got: [pluto5# ]
18:14:15 [INFO ] Check mode enabled: prompt found, disconnecting...
18:14:15 [INFO ] Check mode enabled: the service pluto will not be stopped
18:14:15 [INFO ] Service pluto is Running
18:14:15 [INFO ] Script ended.
|
RCVD messages correspond to the received data from the OPA0 console. |
Include Page |
---|
| KBCOMMON:KB-GoToTop |
---|
| KBCOMMON:KB-GoToTop |
---|
|
Shutdown execution - Tru64 example
Div |
---|
| PS C:\Windows\system32> C:\charon\charon_cleanshutdown.ps1 -config C:\charon\pluto_tru64.ini
Charon clean shutdown
Name Value
---- -----
cryptedpass C:\Charon\pluto_pwd.txt
guestsystem 192.168.152.147
mode opa0
os Tru64
port 10005
prompt pluto5#
servicename pluto
timelimitsec 180
username root
18:19:17 [INFO ] Using 'C:\Program Files\CHARON\Virtual Machines\pluto\pluto-SHUTDOWN-2020-06-02-18-19-17-000000000.log' as log file / one log file per script execution
18:19:17 [INFO ] Defined symbolic link 'C:\Program Files\CHARON\Virtual Machines\pluto\pluto-SHUTDOWN.log'
18:19:17 [INFO ] Using 'C:\charon\pluto_tru64.ini' as configuration file
18:19:17 [INFO ] Execution date : 02-Jun-2020 18:19:17
18:19:17 [INFO ] Script version : 02-Jun-20 V2.1 (MD5: ED6D76E7CCC3F0016C34D88BADE4EC1A )
18:19:17 [INFO ] Powershell version : 5.1.18362.752
18:19:17 [INFO ] Computer name : WIN10-MAIN
18:19:17 [INFO ] Username : bruno
18:19:17 [INFO ] Windows version : Microsoft Windows 10 Pro
18:19:17 [INFO ] Administrator mode : True
18:19:17 [INFO ] Windows shutdown scripts:
18:19:17 [INFO ] - Hide execution : False
18:19:17 [INFO ] - Maximum duration : 7 minutes 30 seconds
18:19:17 [INFO ] - Exec position#1 : c:\charon\myds20vms.ini
18:19:17 [INFO ] - Exec position#2 : c:\charon\pluto_tru64.ini (!)
18:19:17 [INFO ]
18:19:17 [INFO ] 'opa0' will be used
18:19:17 [INFO ] Service 'pluto' is Running (Display name: pluto)
18:\Charon>powershell -file charon_cleanshutdown.ps1 -config myds20tru64.ini -->To update19:17 [INFO ] Using crypted password stored in 'C:\Charon\pluto_pwd.txt'.
18:19:17 [INFO ] No putty session active.
18:19:17 [INFO ] Connecting to OPA0 console, port 10005
18:19:17 [INFO ] Sending CRLF...
18:19:17 [INFO ] Time limit: 18:22:17. Seconds remaining: 180
18:19:21 [RCVD ]
18:19:21 [RCVD ] pluto5#
18:19:21 [RCVD ] pluto5#
18:19:21 [INFO ] Got: [pluto5# ]
18:19:21 [INFO ] Found prompt.
18:19:21 [INFO ] Send Tru64 shutdown...
18:19:21 [INFO ] Command sent
18:19:26 [INFO ] Time limit: 18:22:17. Seconds remaining: 171
18:19:29 [RCVD ] /sbin/init 0;echo RESULT=$?
18:19:29 [RCVD ] RESULT=0
18:19:29 [INFO ] Remote command succeeded
18:19:29 [RCVD ] pluto5# pluto5#
18:19:29 [RCVD ] pluto5#
18:19:29 [INFO ] Got: [pluto5# ]
18:19:29 [INFO ] Found prompt, waiting for shutdown to start or complete...
18:19:34 [INFO ] Time limit: 18:22:17. Seconds remaining: 163
18:19:38 [RCVD ]
18:19:38 [RCVD ] INIT: New run level: 0
18:19:38 [RCVD ] The system is coming down. Please wait...
18:19:38 [RCVD ] Logins disabled
18:19:38 [RCVD ] Stopping Zabbix agent...
18:19:38 [RCVD ]
18:19:38 [INFO ] Got: [Stopping Zabbix agent...]
18:19:38 [INFO ] Case unknown: [Stopping Zabbix agent...]. Retrying...
18:19:40 [INFO ] Time limit: 18:22:17. Seconds remaining: 157
18:19:43 [RCVD ] Zabbix agent stopped.
18:19:43 [RCVD ]
18:19:43 [INFO ] Got: [Zabbix agent stopped.]
18:19:43 [INFO ] Case unknown: [Zabbix agent stopped.]. Retrying...
18:19:45 [INFO ] Time limit: 18:22:17. Seconds remaining: 152
18:19:49 [RCVD ] LAT stopped.
18:19:49 [RCVD ] Unmounting NFS filesystems
18:19:49 [RCVD ] The interface tu0, does not exist.
18:19:49 [RCVD ]
18:19:49 [RCVD ] Halting processes ...
18:19:49 [RCVD ]
18:19:49 [INFO ] Got: [Halting processes ...]
18:19:49 [INFO ] Halting processes ...
18:19:49 [INFO ] Time limit: 18:22:17. Seconds remaining: 148
18:19:52 [INFO ] Timeout #1...
18:19:54 [INFO ] Time limit: 18:22:17. Seconds remaining: 143
18:19:58 [RCVD ] The system is down.
18:19:58 [RCVD ]
18:19:58 [INFO ] Got: [The system is down.]
18:19:58 [INFO ] The system is down.
18:19:58 [INFO ] Time limit: 18:22:17. Seconds remaining: 139
18:20:01 [INFO ] Timeout #1...
18:20:03 [INFO ] Time limit: 18:22:17. Seconds remaining: 134
18:20:07 [RCVD ] /proc: Invalid argument
18:20:07 [RCVD ] ....Halt completed....
18:20:07 [RCVD ] syncing disks... done
18:20:07 [RCVD ] CPU 0: Halting... (transferring to monitor)
18:20:07 [RCVD ]
18:20:07 [RCVD ] halted CPU 1
18:20:07 [RCVD ]
18:20:07 [RCVD ]
18:20:07 [RCVD ] halted CPU 0
18:20:07 [RCVD ]
18:20:07 [RCVD ] halt code = 5
18:20:07 [RCVD ] HALT instruction executed
18:20:07 [RCVD ] PC = fffffc00006bde70
18:20:07 [RCVD ] P00>>>
18:20:07 [INFO ] Got: [P00>>>]
18:20:07 [INFO ] Sending 'power off'...
18:20:08 [INFO ] Service pluto is stopped
18:20:08 [INFO ] Script ended.
|
RCVD messages correspond to the received data from the OPA0 console. |
Shutdown execution - VMS example
Div |
---|
| PS C:\Windows\system32> C:\charon\charon_cleanshutdown.ps1 -config C:\charon\myds20vms.ini
Charon clean shutdown
Name Value
---- -----
cryptedpass C:\Charon\myds20vms_cryptpass.txt
mode opa0
os VMS
port 10007
prompt VMS084>
servicename ds20vms
timelimitsec 180
username system
waitbeforestop 10
windowheight 50
windowwidth 132
18:24:38 [INFO ] Using 'C:\Program Files\CHARON\Virtual Machines\ds20vms\ds20vms-SHUTDOWN-2020-06-02-18-24-38-000000000.log' as
log file / one log file per script execution
18:24:38 [INFO ] Defined symbolic link 'C:\Program Files\CHARON\Virtual Machines\ds20vms\ds20vms-SHUTDOWN.log'
18:24:38 [INFO ] Using 'C:\charon\myds20vms.ini' as configuration file
18:24:38 [INFO ] Execution date : 02-Jun-2020 18:24:38
18:24:38 [INFO ] Script version : 02-Jun-20 V2.1 (MD5: ED6D76E7CCC3F0016C34D88BADE4EC1A )
18:24:38 [INFO ] Powershell version : 5.1.18362.752
18:24:38 [INFO ] Computer name : WIN10-MAIN
18:24:38 [INFO ] Username : bruno
18:24:38 [INFO ] Windows version : Microsoft Windows 10 Pro
18:24:38 [INFO ] Administrator mode : True
18:24:38 [INFO ] Windows shutdown scripts:
18:24:38 [INFO ] - Hide execution : False
18:24:38 [INFO ] - Maximum duration : 7 minutes 30 seconds
18:24:38 [INFO ] - Exec position#1 : c:\charon\myds20vms.ini (!)
18:24:38 [INFO ] - Exec position#2 : c:\charon\pluto_tru64.ini
18:24:38 [INFO ]
18:24:38 [INFO ] 'opa0' will be used
18:24:38 [INFO ] Service 'ds20vms' is Running (Display name: ds20vms)
18:24:38 [INFO ] Using crypted password stored in 'C:\Charon\myds20vms_cryptpass.txt'.
18:24:38 [INFO ] No putty session active.
18:24:38 [INFO ] Connecting to OPA0 console, port 10007
18:24:38 [INFO ] Sending CRLF...
18:24:38 [INFO ] Time limit: 18:27:38. Seconds remaining: 180
18:24:42 [RCVD ]
18:24:42 [RCVD ]
18:24:42 [RCVD ] Welcome to OpenVMS (TM) Alpha Operating System, Version V8.4
18:24:42 [RCVD ]
18:24:42 [RCVD ] Username:
18:24:42 [INFO ] Got: [Username: ]
18:24:42 [INFO ] Sending VMS username...
18:24:42 [INFO ] Username sent
18:24:42 [INFO ] Time limit: 18:27:38. Seconds remaining: 176
18:24:45 [RCVD ] system
18:24:45 [RCVD ] Password:
18:24:45 [INFO ] Got: [Password: ]
18:24:45 [INFO ] Sending password, try #1 of 3
18:24:45 [INFO ] Password sent
18:24:47 [INFO ] Time limit: 18:27:38. Seconds remaining: 171
18:24:51 [RCVD ]
18:24:51 [RCVD ] Welcome to OpenVMS (TM) Alpha Operating System, Version V8.4
18:24:51 [RCVD ] Last interactive login on Tuesday, 2-JUN-2020 17:23:59.38
18:24:51 [RCVD ] Last non-interactive login on Friday, 15-MAY-2020 11:34:51.97[c\Z
18:24:51 [INFO ] Got: [ Last non-interactive login on Friday, 15-MAY-2020 11:34:51.97[c\Z]
18:24:51 [INFO ] Case unknown: [ Last non-interactive login on Friday, 15-MAY-2020 11:34:51.97[c\Z]. Retrying...
18:24:53 [INFO ] Time limit: 18:27:38. Seconds remaining: 165
18:24:56 [RCVD ] [0c
18:24:56 [INFO ] Got: [[0c]
18:24:56 [INFO ] Case unknown: [[0c]. Retrying...
18:24:58 [INFO ] Time limit: 18:27:38. Seconds remaining: 160
18:25:02 [RCVD ]
18:25:02 [RCVD ] %SET-W-NOTSET, error modifying OPA0:
18:25:02 [RCVD ] -SET-I-UNKTERM, unknown terminal type[c\Z
18:25:02 [INFO ] Got: [-SET-I-UNKTERM, unknown terminal type[c\Z]
18:25:02 [INFO ] Case unknown: [-SET-I-UNKTERM, unknown terminal type[c\Z]. Retrying...
18:25:04 [INFO ] Time limit: 18:27:38. Seconds remaining: 154
18:25:07 [RCVD ] [0c
18:25:07 [INFO ] Got: [[0c]
18:25:07 [INFO ] Case unknown: [[0c]. Retrying...
18:25:09 [INFO ] Time limit: 18:27:38. Seconds remaining: 149
18:25:13 [RCVD ]
18:25:13 [RCVD ] %SET-W-NOTSET, error modifying OPA0:
18:25:13 [RCVD ] -SET-I-UNKTERM, unknown terminal type
18:25:13 [RCVD ] VMS084>
18:25:13 [INFO ] Got: [ VMS084> ]
18:25:13 [INFO ] Found prompt.
18:25:13 [INFO ] Sending VMS shutdown...
18:25:13 [INFO ] Command sent
18:25:18 [INFO ] Time limit: 18:27:38. Seconds remaining: 140
18:25:21 [RCVD ] @SYS$MANAGER:CHARON_SHUTDOWN.COM
18:25:21 [RCVD ] $ PURGE /KEEP=20 SYS$MANAGER:CHARON_SHUTDOWN.LOG
18:25:21 [RCVD ] $ RUN /DETACH SYS$SYSTEM:LOGINOUT.EXE /INPUT=SYS$MANAGER:CHARON_SHUTDOWN -
18:25:21 [RCVD ] /OUTPUT=SYS$MANAGER:CHARON_SHUTDOWN.LOG /UIC=[1,4]
18:25:21 [RCVD ] %RUN-S-PROC_ID, identification of created process is 00000125
18:25:21 [RCVD ] $ ENDIF
18:25:21 [RCVD ] $ ENDIF
18:25:21 [RCVD ] $ EXIT
18:25:21 [RCVD ] VMS084>
18:25:21 [RCVD ]
18:25:21 [RCVD ]
18:25:21 [RCVD ] SHUTDOWN -- Perform an Orderly System Shutdown
18:25:21 [RCVD ] on node VMS084
18:25:21 [RCVD ]
18:25:21 [RCVD ]
18:25:21 [RCVD ] %SHUTDOWN-I-OPERATOR, this terminal is now an operator's console
18:25:21 [RCVD ] %SHUTDOWN-I-DISLOGINS, interactive logins will now be disabled
18:25:21 [RCVD ] %SET-I-INTSET, login interactive limit = 0, current interactive value = 1
18:25:21 [RCVD ] %SHUTDOWN-I-STOPQUEUES, the queues on this node will now be stopped
18:25:21 [RCVD ]
18:25:21 [RCVD ] SHUTDOWN message on VMS084 from user SYSTEM at VMS084 Batch 17:25:30
18:25:21 [RCVD ] VMS084 will shut down in 0 minutes; back up LATER. Please log off node VMS084.
18:25:21 [RCVD ] SHUTDOWN
18:25:21 [RCVD ]
... (truncated)
18:25:22 [RCVD ] %%%%%%%%%%% OPCOM 2-JUN-2020 17:25:33.68 %%%%%%%%%%%
18:25:22 [RCVD ] Message from user SYSTEM on VMS084
18:25:22 [RCVD ] %SECSRV-I-SERVERSHUTDOWN, security server shutting down
18:25:22 [RCVD ]
18:25:22 [RCVD ] VMS084>
18:25:22 [INFO ] Got: [ VMS084> ]
18:25:22 [INFO ] Found prompt, waiting for shutdown to start or complete...
18:25:27 [INFO ] Time limit: 18:27:38. Seconds remaining: 131
18:25:30 [RCVD ]
18:25:30 [RCVD ] SYSTEM SHUTDOWN COMPLETE
18:25:30 [RCVD ]
18:25:30 [RCVD ]
18:25:30 [RCVD ]
18:25:30 [RCVD ] halted CPU 0
18:25:30 [RCVD ]
18:25:30 [RCVD ] halt code = 5
18:25:30 [RCVD ] HALT instruction executed
18:25:30 [RCVD ] PC = ffffffff8008fa84
18:25:30 [RCVD ] P00>>>
18:25:30 [INFO ] Got: [P00>>>]
18:25:30 [INFO ] Sending 'power off'...
18:25:31 [INFO ] Service ds20vms is stopped
18:25:31 [INFO ] Script ended. |
|
RCVD messages correspond to the received data from the OPA0 console.
Include Page |
---|
| KBCOMMON:KB-GoToTop |
---|
| KBCOMMON:KB-GoToTop |
---|
|