Anchor | ||||
---|---|---|---|---|
|
Include Page | ||||
---|---|---|---|---|
|
...
Contents
Table of Contents | ||||
---|---|---|---|---|
|
Required parameters
...
Parameters
logfile
...
Optional full path to the logfile that will be used to log the script output
...
CHARON instance service name.
When using expect, the service is stopped by the expect script either with 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.
...
For OpenVMS:
username=system
For Tru64:
username=root
...
Defines the password in clear text that will be used to connect to the console.
The password can be also stored in an encrypted clixml file as described below.
...
Defines the full path of the clixml file that contains the encrypted password (password parameter must then not be set).
To create this file, open a "cmd.exe
" window and then run :
C:\Users\Administrator> cd C:\Charon
C:\Charon> powershell
PS C:\Charon> "<password>" | export-clixml <file> |
Example:
PS C:\Charon> "12345" | export-clixml C:\Charon\myds20pwd.clixml |
...
prompt=myds20>
...
Example
Configuration file
Div | ||
---|---|---|
| ||
|
...
Script execution
Check mode
When check mode is enabled, a pop-up window will be displayed to check the expect operations performed on the CHARON instance console.
...
class | commandline |
---|
c:\Charon>powershell -file charon_cleanshutdown.ps1 -config myds20tru64.ini -check
Name Value
---- -----
mode expect
servicename myds20
username root
expectbin C:\Tcl\bin\tclsh86.exe
plinkbin C:\Charon\plink.exe
os Tru64
port 10003
clixml C:\Charon\myds20pwd.clixml
prompt #
logfile C:\Charon\myds20_shutdown.log
20160808:122235:INFO :0: Using 'C:\Charon\myds20_shutdown.log' as log file / append
20160808:122235:INFO :0: Check mode enabled.
20160808:122235:INFO :0: 'expect' will be used
20160808:122235:INFO :0: Service 'myds20' is Running (Display name: myds20)
20160808:122235:INFO :0: The 'clixml' file 'C:\Charon\myds20pwd.clixml' will be used to gather password for 'expect' mode.
20160808:122235:INFO :0: Killing all putty sessions...
20160808:122235:INFO :0: Invoking the expect script...
20160808:122235:INFO :0: Connecting to localhost port 10003 ...
20160808:122244:INFO :0: %EXPECT-I-BEGIN, Starting / UNIX... [2016-08-08 12:22:36]
20160808:122244:INFO :0: %EXPECT-I-SNDRET, Sending carriage return... [2016-08-08 12:22:37]
20160808:122245:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650) (pluto.localdomain) console
20160808:122245:INFO :0: login:
20160808:122245:INFO :0: %EXPECT-I-FOUND, Found UNIX login [2016-08-08 12:22:38]
20160808:122245:INFO :0: %EXPECT-I-LOGIN, Sending UNIX user: root ... [2016-08-08 12:22:38]
20160808:122245:INFO :0: root
20160808:122245:INFO :0: Password:
20160808:122245:INFO :0: %EXPECT-I-PASSW, Sending root password... [2016-08-08 12:22:39]
20160808:122245:INFO :0: Can't find an OSF-BASE, UNIX-WORKSTATION, or UNIX-SERVER license PAK
20160808:122245:INFO :0: Last login: Fri Aug 5 11:55:48 CEST 2016 on console
20160808:122245:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650); Fri Jun 24 17:08:56 CEST 2016
20160808:122245:INFO :0: The installation software has successfully installed your system.
20160808:122245:INFO :0: There are logfiles that contain a record of your installation. These are:
20160808:122245:INFO :0: /var/adm/smlogs/install.cdf - configuration description file
20160808:122245:INFO :0: /var/adm/smlogs/install.log - general log file
20160808:122245:INFO :0: /var/adm/smlogs/install.FS.log - file system creation logs
20160808:122245:INFO :0: /var/adm/smlogs/setld.log - log for the setld(8) utility
20160808:122245:INFO :0: /var/adm/smlogs/fverify.log - verification log file
20160808:122245:INFO :0: #
20160808:122245:INFO :0: %EXPECT-S-LOGIN, login successful. [2016-08-08 12:22:39]
20160808:122245:INFO :0: %EXPECT-S-CHECK, Sending UNIX check command... [2016-08-08 12:22:39]
20160808:122245:INFO :0: # date;uname -a
20160808:122245:INFO :0: Fri Aug 5 11:56:31 CEST 2016
20160808:122245:INFO :0: OSF1 pluto.localdomain V5.1 2650 alpha
20160808:122245:INFO :0: # exit
20160808:122245:INFO :0:
20160808:122245:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650) (pluto.localdomain) console
20160808:122245:INFO :0:
20160808:122245:INFO :0: login:
20160808:122245:INFO :0: %EXPECT-S-CHECK, Check completed. [2016-08-08 12:22:42]
20160808:122245:INFO :0:
20160808:122245:INFO :0: %EXPECT-I-END, Exited with code 0. [2016-08-08 12:22:44]
20160808:122245:INFO :0: Check mode, no connection test to be performed.
20160808:122245:INFO :0: Check mode, the service myds20 will not be stopped
20160808:122245:INFO :0: Service is Running
20160808:122245:INFO :0: Done.
...
Shutdown execution
...
class | commandline |
---|
c:\Charon>powershell -file charon_cleanshutdown.ps1 -config myds20tru64.ini
Name Value
---- -----
mode expect
servicename myds20
username root
expectbin C:\Tcl\bin\tclsh86.exe
plinkbin C:\Charon\plink.exe
os Tru64
port 10003
clixml C:\Charon\myds20pwd.clixml
prompt #
logfile C:\Charon\myds20_shutdown.log
20160808:122546:INFO :0: Using 'C:\Charon\myds20_shutdown.log' as log file / append
20160808:122546:INFO :0: 'expect' will be used
20160808:122546:INFO :0: Service 'myds20' is Running (Display name: myds20)
20160808:122546:INFO :0: The 'clixml' file 'C:\Charon\myds20pwd.clixml' will be used to gather password for 'expect' mode.
20160808:122546:INFO :0: Killing all putty sessions...
20160808:122546:INFO :0: Invoking the expect script...
20160808:122546:INFO :0: Connecting to localhost port 10003 ...
20160808:122642:INFO :0: %EXPECT-I-BEGIN, Starting / UNIX... [2016-08-08 12:25:46]
20160808:122642:INFO :0: %EXPECT-I-SNDRET, Sending carriage return... [2016-08-08 12:25:47]
20160808:122642:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650) (pluto.localdomain) console
20160808:122642:INFO :0: login:
20160808:122642:INFO :0: %EXPECT-I-FOUND, Found UNIX login [2016-08-08 12:25:48]
20160808:122642:INFO :0: %EXPECT-I-LOGIN, Sending UNIX user: root ... [2016-08-08 12:25:48]
20160808:122642:INFO :0: root
20160808:122642:INFO :0: Password:
20160808:122642:INFO :0: %EXPECT-I-PASSW, Sending root password... [2016-08-08 12:25:49]
20160808:122642:INFO :0: Can't find an OSF-BASE, UNIX-WORKSTATION, or UNIX-SERVER license PAK
20160808:122642:INFO :0: Last login: Fri Aug 5 11:56:28 CEST 2016 on console
20160808:122642:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650); Fri Jun 24 17:08:56 CEST 2016
20160808:122642:INFO :0: The installation software has successfully installed your system.
20160808:122642:INFO :0: There are logfiles that contain a record of your installation. These are:
20160808:122642:INFO :0:
20160808:122642:INFO :0: /var/adm/smlogs/install.cdf - configuration description file
20160808:122642:INFO :0: /var/adm/smlogs/install.log - general log file
20160808:122642:INFO :0: /var/adm/smlogs/install.FS.log - file system creation logs
20160808:122642:INFO :0: /var/adm/smlogs/setld.log - log for the setld(8) utility
20160808:122642:INFO :0: /var/adm/smlogs/fverify.log - verification log file
20160808:122642:INFO :0: #
20160808:122642:INFO :0: %EXPECT-S-LOGIN, login successful. [2016-08-08 12:25:49]
20160808:122642:INFO :0: %EXPECT-S-SHUTDWN, Sending UNIX shutdown... [2016-08-08 12:25:49]
20160808:122642:INFO :0: # init 0
20160808:122642:INFO :0: #
20160808:122642:INFO :0: INIT: New run level: 0
20160808:122642:INFO :0: The system is coming down. Please wait...
20160808:122642:INFO :0: Logins disabled
20160808:122642:INFO :0: LAT stopped.
20160808:122642:INFO :0: Unmounting NFS filesystems
20160808:122642:INFO :0: Halting processes ...
20160808:122642:INFO :0: The system is down.
20160808:122642:INFO :0: /proc: Invalid argument
20160808:122642:INFO :0: ....Halt completed....
20160808:122642:INFO :0: syncing disks... done
20160808:122642:INFO :0: CPU 0: Halting... (transferring to monitor)
20160808:122642:INFO :0: halted CPU 0
20160808:122642:INFO :0: halt code = 5
20160808:122642:INFO :0: HALT instruction executed
20160808:122642:INFO :0: PC = fffffc0000697b30
20160808:122642:INFO :0: P00>>>
20160808:122642:INFO :0: %EXPECT-S-SHUTDWN, Shutdown completed. [2016-08-08 12:26:38]
20160808:122642:INFO :0: %EXPECT-I-POWEROFF, Sending power off... [2016-08-08 12:26:38]
20160808:122642:INFO :0: power offFATAL ERROR: Network error: Software caused connection abort
20160808:122642:INFO :0: %EXPECT-S-POWEROFF, power off completed. [2016-08-08 12:26:40]
20160808:122642:INFO :0: %EXPECT-I-END, Exited with code 0. [2016-08-08 12:26:42]
20160808:122642:INFO :0: Service myds20 is already stopped
...
. 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
Div | ||
---|---|---|
| ||
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:
|
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
Div | ||
---|---|---|
| ||
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:
|
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 | ||||
---|---|---|---|---|
|
Div | ||
---|---|---|
| ||
Examples
Configuration file
|
Include Page | ||||
---|---|---|---|---|
|
Script execution
Check mode
When check mode is enabled, a pop-up window will be displayed to check the operations performed on the CHARON instance console.
RCVD messages correspond to the received data from the OPA0 console. |
Include Page | ||||
---|---|---|---|---|
|
Div | ||
---|---|---|
| ||
Shutdown execution - Tru64 example
RCVD messages correspond to the received data from the OPA0 console. |
Shutdown execution - VMS example
|
RCVD messages correspond to the received data from the OPA0 console.
Include Page | ||||
---|---|---|---|---|
|