[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference csc32::consolemanager

Title:POLYCENTER Console Manager
Notice:Kits, Scans, Docs on CSC32:: as PCM$KITS:,PCM$DOCS:, PCM$SCANS:
Moderator:CSC32::BUTTERWORTH
Created:Thu Aug 06 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1541
Total number of notes:6564

442.0. "CONSOLE DIALOG - timing out" by EASEW2::BARRELL (Steve Barrell, Dublin.) Wed Oct 19 1994 16:17

OpenmVMS VAX V6.1 and PCM V1.5 ECO1

I am trying to shutdown a system using CONSOLE DIALOG:

$ cons dial/file=sb_shut.cm ease1
Dialog error: WAIT timed out
At line 51

line 51 contains:

WAIT 10 "How many minutes until final shutdown [0]: "

When I watch the results of CONSOLE DIALOG with the monitor interface,
I see: 

14:59:06 �$
15:00:31 �$ @SYS$SYSTEM:SHUTDOWNN
15:00:32
15:00:32
15:00:32 �SHUTDOWN -- Perform an Orderly System Shutdownn
15:00:33 �            on node EASE11
15:00:34
15:00:34 How many minutes until final shutdown [0]:

Could it be that the text match is done also on the timestamp?


SB_SHUT.CM contains:

!
! This is an example dialog file. It may be be invoked from the
! monitor interface using the command:
!
! DIALOG filename [system]
!
!
!
! The command connects to the console of the specified system or
! systems then sends the specified strings and awaits the specified
! responses as though it were a user typing on the connected console.
!
! Valid commands within a dialog file are UNLOCK, SEND and WAIT.
! They are described in the example below. Lines with a ! or # in
! the first character position are treated as comments.
!
! This example dialog logs a user into a OpenVMS system.
!
! The RATE command sets the interval the DIALOG waits between SEND
! commands.  This allows systems that are not able to do flow
! control properly to work.
! Set the interval in this example to 5 seconds.
RATE 5
! The UNLOCK command forces the console upon which the dialog is
! being executed to be unlocked i.e. any other connected users
! are placed into read-only mode. This command should be executed
! before the first SEND command. Otherwise the SEND command will
! fail if another user is connected to the console.
!
UNLOCK
!
! The SEND command sends the characters in quotes to the
! connected console as though a connected user had typed them. The
! send command always appends a carriage return to the quoted
! string. The command below is, therefore sending a carriage return
! to the OpenVMS console to get a username prompt up.
!
SEND ""
!
! The WAIT command causes the dialog to wait until a specified
! regular expression is seen on the connected console line.
! The first argument is a timeout in seconds after which the WAIT
! will terminate with an error causing the whole dialog sequence
! to terminate as well. A timeout value of zero causes an
! indefinite wait.
!
! The quoted string is the awaited regular expression. 
! 
!
SEND "@SYS$SYSTEM:SHUTDOWN"
WAIT 10 "How many minutes until final shutdown [0]: "
SEND ""
WAIT 5 "Reason for shutdown [Standalone]: "
SEND ""
WAIT 5 "Do you want to spin down the disk volumes [NO]? "
SEND ""
WAIT 5 "Do you want to invoke the site-specific shutdown procedure [YES]? "
SEND ""
WAIT 5 "Should an automatic system reboot be performed [NO]? "
SEND ""
WAIT 5 "When will the system be rebooted [later]: "
SEND ""
WAIT 5 "Shutdown options [NONE]: "
SEND ""


T.RTitleUserPersonal
Name
DateLines
442.1EASEW2::BARRELLSteve Barrell, Dublin.Wed Oct 19 1994 16:195
Following on with CONSOLE DIALOG, I would eventually like to shutdown a system,
issue a break to get the ">>>" prompt,  change the boot device, and then reboot.

Has anyone tried this already before I re-invent a wheel ?

442.2CSC32::BUTTERWORTHGun Control is a steady hand.Wed Oct 19 1994 18:3924
    >Could it be that the text match is done also on the timestamp?
    
    Nope. The time stamp is not part of the record and is thus not scanned.
    
    What I think is happening here is that the "["'s are messing things up
    as "[" is a meta-character and has a special meaning. In these cases
    it really isn't necesary to look for the whole line any way as your
    just simply acknowledging the prompts with a null string which 
    really amounts to nothing more than a CR. Sending the character 
    early won't cause a problem at all. Change your file and get rid of
    all characters after and including the "[" character and let us 
    know how it goes.
    
    >Following on with CONSOLE DIALOG, I would eventually like to shutdown a
    >system, issue a break to get the ">>>" prompt,  change the boot device, and
    >then reboot.
    
    These kinds of operations are what DIALOG was intended for. If it
    doesn't work it needs to be reported and fixed.
    
    Regs,
      Dan
    
    
442.3How About #?CSOA1::MANNBob MannWed Oct 19 1994 18:4410
    Dan,
    
    I've had this problem also waiting for my Cisco prompt:
    
    NOJOB#
    
    Other waits seem OK, any know problems with "#"?
    
    Thanks,
    Bob
442.4OPG::PHILIPAnd through the square window...Wed Oct 19 1994 18:5621
  You are getting problems because we scan for a regular expression,
  and as Dan pointed out [ and ] are regular expression metacharacters,
  you will find on Page 8-2 of the user guide a list of the metacharacters
  # shows up as one too.

  Now, its not documented that the WAIT string is a regular expression,
  I will get the documentation fixed for the next release, but, you should
  be able to "escape" the metacharacter using the \ character, so in the
  two examples here the following should work...


WAIT 10 "How many minutes until final shutdown \[0\] :" 

WAIT 10 "NOJOB\#"

  Try and let us know if it works, if it doesnt, as Dan said we should
  fix it.

Cheers,
Phil
442.5EASEW2::BARRELLSteve Barrell, Dublin.Thu Oct 20 1994 12:2116
I used the \ to bypass the [ and ] metacharacters and my dialog
script now works ok.

Now for the next bit, can dialog send a control-p to halt
the system, or do I need to specify an event, scan, action routine, etc.,
to check for the "use console to halt system" string?

Perhaps I need a .COM file to do something like this:

	$ define/user sys$command sys$input
	$ console connect system/break=ctrl_B
	^B

I have not tried this yet - I was hoping someone would have already
tried this and got it to work ?

442.6OPG::PHILIPAnd through the square window...Thu Oct 20 1994 14:1715
Steve,

  Events, Scans and action routines are not going to help you here!!

  Unfortunately, DIALOG will only send what you place on the SEND
  line, the next release will allow you to perform a HALT of a system
  (either via a control key or the break signal).

  Now, it should work if you can get the ascii code for Control-P
  embedded in your SEND string, but I have never tried it.

Cheers,
Phil


442.7"NOJOB\#" Works CSOA1::MANNBob MannThu Oct 20 1994 15:101
    
442.8EASEW2::BARRELLSteve Barrell, Dublin.Fri Oct 21 1994 11:3513
Re: .6

How does Console Manager send ^P when you answer YES
to the transmit a break prompt?

Is there some magical escape sequence or something that is issued
before the break-signal is sent?

I have tried using ascii codes, but to no avail.  I can't even send
the code for Control-Z when the console is logged in and at the DCL prompt.

It just takes the value literally.

442.9OPG::PHILIPAnd through the square window...Fri Oct 21 1994 12:0025
Steve,

  PCM DOESNT send a Control-P when you transmit a break, it
  transmits an RS232 BREAK-SIGNAL. For a further description
  of the differences between BREAK and Control-P, please see
  the other notes in this conference and RTFM.

  If your console wants Control-P, then try this...

  Edit your dialog with EDT (EDT 'cos I know what to do with
  it) now, in your empty dialog file type the following...

SEND 10 "^P"

          ^
          |
          +- You get this by typing <PF1>16<PF1><Keypad-3>
             The 16 is entered using the numbers along the
             top of the keyboard.

  Now try executing the dialog, I hope it works, but, as I
  said, I have never tried it.

Cheers,
Phil