[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

762.0. "Some useful procedures for PCM on OpenVMS" by HLSM04::GERRIT (Gerrit Woertman, UTO, 838-2535) Wed May 24 1995 22:18

Hi,

with all the info in the PCM-world it takes time to find out certain
things, for instance if a console line hangs, what terminalserver is it
on, and what is the associated LTA-device?

To make life easier I made three commandprocedures
find.com, find_pid.com, and find_lat.com

$ @find                   ! what's the status of the PCM-processes?
0000012B Console Notify  [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
0000012C Console Daemon  [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
0000012D Console Ctrl 01 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
0000012E Console Ctrl 02 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
0000012F Console Ctrl 03 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
00000130 Console Ctrl 04 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
00000131 Console Ctrl 05 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
00000132 Console Ctrl 06 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
00000133 Console Ctrl 07 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     
00000134 Console Ctrl 08 [GHS,SYSTEM]    SYSTEM          HLCC00  HIB     

$ @find_pid.com hlsw01    ! on which controller is this system?
HLSW01  00000130  Console Ctrl 04

$ @find_lat hlsw01        ! on which LTA-port is this consoleline?
_LTA6235:  Appl (NonQ)  Active         PCM006/PORT_3/

regards,

Gerrit
##########################################################################
$! Find.com
$! Purpose : find out the status of the PCM processes
$! Optional parameter P1, indicating a specific node
$!
$! Created by Marc Janssen, Digital Equipment, Nijmegen, Holland
$! Modified for use in PCM-environment, 
$! Gerrit Woertman
$! Digital Equipment bv
$! Utrecht, Holland
$! 24-may-1995
$!
$! set term/width=132
$ CTX = ""
$ if "''p1'" .eqs. "" 
$   then nodenaam = "*"
$   else nodenaam = "''p1'"
$ endif
$ X = f$context("process",CTX,"nodename","''nodenaam'","EQL")
$ X = f$context("process",CTX,"prcnam","*Console*","EQL")
$top:
$ pid = f$pid(ctx)
$ if pid .eqs. "" then goto end_find
$ prcnam = f$getjpi(pid,"prcnam")
$ uic = f$getjpi(pid,"uic")
$ username = f$getjpi(pid,"username")
$ nodename = f$getjpi(pid,"nodename")
$ state = f$getjpi (pid,"state")
$ write sys$output -
F$FAO("!(9AS)!3(16AS)!2(8AS)",pid,prcnam,uic,username,nodename,state) 
$ goto top
$end_find:
$ if f$type(ctx) .eqs. "process context" then - 
     x = f$context("process",ctx,"cancel")
$!
$exit
############################################################################
$!	find_pid.com
$!
$!      this procedure finds the pid of the Console Controller
$!	process associated with a certain system
$!	
$!	Gerrit Woertman,
$!	Digital Equipment bv
$!	Utrecht, Holland
$!	24-may-1995
$!
$!	
$	on control_y then goto EXIT
$	IF p1 .eqs. "" 
$	THEN
$	  read sys$command/prompt="System: "/end=EXIT p1
$	ENDIF
$	if p1 .eqs. "" then exit
$	ass/user fp.tmp sys$output
$	cons stat/all
$	search fp.tmp 'p1'/out=fp.out
$	open/read/error=EXIT in fp.out
$	read/end=EXIT in line
$	close in
$	pid = f$extract (23, 8, line)
$	prcnam = f$getjpi(pid,"prcnam")
$	write sys$output "''p1'  ''pid'  ''prcnam'"                     
$EXIT:
$	if f$search("fp.tmp") .nes. "" then del/nolog fp.tmp.*
$	if f$search("fp.out") .nes. "" then del/nolog fp.out.*
$	if f$trnlnm ("in") .nes. "" then close in
$	exit
########################################################################
$!	find_lat.com
$!
$!      This procedure finds out of a PCM export-file (symbol exp)
$!	the LATport associated with a certain system
$!	With this info you might logout a hanging terminalserverport via TSM
$!	
$!	Gerrit Woertman,
$!	Digital Equipment bv
$!	Utrecht, Holland
$!	24-may-1995
$!	
$	exp = "is:[cluster_manager.pcm_manager]console_cfg.port"
$
$	on control_y then goto EXIT
$	IF p1 .eqs. "" 
$	THEN
$	  read sys$command/prompt="System: "/end=EXIT p1
$	ENDIF
$	if p1 .eqs. "" then exit
$	search 'exp' 'p1'/win=(0,7) /out=fl.tmp
$	open/read/error=EXIT in fl.tmp
$	count = 0
$LOOP:
$	read in dummy
$	count = count + 1
$	if count .lt. 11 then goto LOOP
$	read/error=EXIT in serv
$	read/error=EXIT in port
$	serv = f$extract(21, 6, serv)
$	port = f$extract(17, 7, port)  
$	servport = serv+ "/" + port + "/"
$	ass/user latcp.out sys$output
$	mcr latcp sh port
$	search latcp.out "''servport'" 
$EXIT:
$	if f$search("fl.tmp") .nes. "" then del/nolog fl.tmp.*
$	if f$search("latcp.out") .nes. "" then del/nolog latcp.out.*
$	if f$trnlnm ("in") .nes. "" then close in
$	exit
    
T.RTitleUserPersonal
Name
DateLines
762.1pcm_save.comHLSM04::GERRITGerrit Woertman, UTO, 838-2535Thu May 25 1995 07:4845
$!	PCM_SAVE.COM
$!	Gerrit Woertman
$!	Digital Equipment bv
$!	Utrecht, Holland
$!	02-jan-1995
$!	
$!	this procedure makes a backup-copy of 3 important PCM-files:
$!	console$data:console_cfg.dat
$!	sys$login:console$c3.dat
$!	sys$login:console_cfg.port
$!
$!	The files are written in a subdirectory [.save], and
$!	appended to the filetype is the creationdate of the file
$!$ dir [.save]
$!
$!Directory IS:[CLUSTER_MANAGER.PCM_MANAGER.SAVE]
$!CONSOLE$C3.DAT_199412301443;1           CONSOLE$C3.DAT_199501091305;3
$!CONSOLE$C3.DAT_199505170025;1           CONSOLE$C3.DAT_199505170305;2
$!CONSOLE_CFG.DAT_199501021533;2          CONSOLE_CFG.DAT_199501022303;2
$!CONSOLE_CFG.DAT_199505240846;1          CONSOLE_CFG.PORT_199501021533;2
$!CONSOLE_CFG.PORT_199501022303;3         CONSOLE_CFG.PORT_199501041256;1
$!CONSOLE_CFG.PORT_199505240846;1         
$!Total of 123 files.
$!
$!	By running this procedure after each change you get a overview
$!	of your PCM-history.
$!	You might also run this procedure from Polycenter Scheduler
$!	each night to be sure not to miss anything.
$!
$cdt = f$file("console$data:console_cfg.dat", "cdt")
$gosub convert
$copy/log console$data:console_cfg.dat [.save]console_cfg.dat_'dat'
$
$cdt = f$file("console$c3.dat", "cdt")
$gosub convert
$copy/log console$c3.dat [.save]console$c3.dat_'dat'
$
$cdt = f$file("console_cfg.port", "cdt")
$gosub convert
$copy/log console_cfg.port [.save]console_cfg.port_'dat'
$exit
$CONVERT:
$	dat = f$cvtime (cdt)
$	dat = f$extract (0, 12, (dat - "-" - "-" - " " - ":"))
$	RETURN
762.2Create console_cfg.port before the copy.JGODCL::SYS_MJANSSENMarc Janssen (889-9594)Mon May 29 1995 14:377
    gerrit,
    
    The file sys$specific:[sysmgr]console_cfg.port does not necessarily
    need to be present (right?). It could be created automatically on a 
    regular basis in this procedure as well, before the copy-cammand.
    
    Marc