$   save_verify = 'f$verify(0)'
$   completion_code = 1
$!  Copyright (c) 2006 Karl Rohwedder, free to use but WITHOUT ANY WARRANTY.
$!++
$!. Facility:
$!.  SYSTEM_REPORT.COM
$!.
$!. Abstract:
$!.  SYSTEM_REPORTS generates a configuration report.
$!.  It is started on one member of the cluster or on a single node. 
$!.  The targetdirectory is customizable (see below, search for #CUST).
$!.
$!.  It works for every voting clustermember, plus any satellite, if a logical
$!.  name called SYSTEM_REPORT_START_ON_nodname exists.
$!.
$!.  The reports consists of the following files:
$!.  cluname_CONFIGURATION.TXT		- report as ASCII text
$!.  cluname_CONFIGURATION_ADDINFO.TXT	- additional infos as ASCII text
$!.  cluname_CONFIGURATION.HTML		- main HTML report
$!.  cluname_CONFIGURATION_ADDINFO.HTML	- additional infos as HTML report
$!.  cluname_CONFIGURATION_TOP.HTML	- contents of top frame
$!.  cluname_CONFIGURATION_LEFT.HTML	- contents of left navigation frame
$!.  cluname_CONFIGURATION_RIGHT.HTML	- contents of right frame (the real data!)
$!.  cluname_CONFIGURATION_SW_VERSIONS_nodename.TXT - list of installed software with its version
$!.
$!.  The report contains:
$!.  - Systemdisks, CNC_DISK, location of systemfiles (CNC_SF) (the logical names are customizable)
$!.  - name and type of clustermember, OS type and version
$!.  - Firmware and PALcode versions 
$!.  - bootdisk and systemroot of every clustermember
$!.  - configuration logicals
$!.  - GETSYI information and console variables
$!.  - network information (DECnet/TCPIP, currently onle HP TCPIP is supported)
$!.  - queue information
$!.  - BAX configuration
$!.  - current disk config, fill level, fragmentation, RAID- and volumesets
$!.  - installed software
$!.  - crash history
$!.  - current SAM*/BO/SAS* user accounts
$!.
$!.  Parameter:
$!.  P1	Function control, if defined, controls which functions to call ("QUEUES,NODES,xxx,...).
$!.	The default is hardcoded in the customization section bolow.
$!.	A ? gives a list functions.
$!.
$!. P2  modifies meaning of P1:
$!.	INCLUDED    - defaults all functions to FALSE (do not call) and calls only P1 functions (default)
$!.	EXCLUDE	    - defaults all functions to TRUE (do call them) and skips only P1 functions
$!.
$!. P3	special internal parameter:
$!.	    CALLBACK=func - calls a specific function from SYSTEM_REPORT
$!.		GETVER - produces 'CLUNAME'_CONFIGURATION_SW_VERSIONS_'NODENAME'.TXT on 'TARGET_DIR'
$!.
$!. Author:
$!. Cluster-Karl Rohwedder
$!
$! Creation Date: 19-NOV-1999
$!
$! Modification History:
$!  V1.1-1  Roh  22-MAY-2000  - support DECnet Osi
$!  V1.1-2  Roh   7-AUG-2000  - fix some bugs in DECnet Osi detection
$!  V1.1-4  Roh  17-OCT-2001  - device queue report was > 80 chars; fixed
$!			      - add node specific LAT infos
$!  V1.1-5  Roh   9-JAN-2003  - add firmware and PALcode
$!  V1.1-6  Roh  14-APR-2003  - add installed software, VMS Patchkits and install history
$!  V1.1-7  Roh   9-MAY-2003  - include GETVER Call
$!  V1.2-1  Roh  27-NOV-2003  - create an additional report in HTML-format
$!  V1.2-2  Roh   7-JAN-2004  - convert HTML report to StreamLF format
$!  V1.2-3  Roh  10-JUN-2005  - network: check for multiple interfaces/adresses
$!  V1.2-4  Roh   8-JUL-2005  - add recovery information: (Systemdisk, BAX-disks, SAVE-disks)
$!  V1.2-5  Roh  24-AUG-2005  - fix recovery output format
$!  V1.2-6  Roh  20-JAN-2006  - add some colors to make display nicer
$!  V1.2-7  Roh  23-JAN-2006  - added: SHOW CLUSTER display, GETSYI Infos, console variables, fragmentation report
$!  V1.2-8  Roh  24-JAN-2006  - added: BO accounts; fix some display errors
$!  V1.2-9  Roh  25-JAN-2006  - added: SAS* accounts, BAX_LOG disk, RAID disks (DP)
$!  V1.3-1  Roh  26-JAN-2006  - rewrite: use frames top enhance navigation, split output into several files
$!  V1.3-2  Roh  30-JAN-2006  - allow scrolling in navigation frame
$!  V1.3-3  Roh  31-JAN-2006  - skip software version on cluster nodes with the same systemdisk
$!  V1.3-4  Roh   8-FEB-2006  - skip NET_WATCHDOG_* and UPDNOD_SERVER (no longer used)
$!  V1.3-5  Roh  10-FEB-2006  - rearrange some data
$!  V1.3-6  Roh  13-FEB-2006  - add 'description' to queue info
$!  V1.3-7  Roh  15-FEB-2006  - cleanup raid info (no full display)
$!  V1.4-1  Roh  17-FEB-2006  - allow for deeper information via anchorered appendices (e.g. RAID info)
$!  V1.4-2  Roh  20-FEB-2006  - replace DBL display with F$GETDVI loop
$!  V1.4-3  Roh  21-FEB-2006  - slight mods in display                      
$!  V1.4-4  Roh  22-FEB-2006  - add cluster- and extendsize to disk overview
$!  V1.4-5  Roh  23-FEB-2006  - add connected diskfile to LD-disks, use DEVICE_TYPE_NAME item
$!  V1.4-6  Roh  24-FEB-2006  - add some more software packages
$!  V1.4-7  Roh  25-FEB-2006  - add some more software packages, inform user about target/scratch directory
$!	   	 	      - check for correct RAID device DPxx
$!  V1.4-8  Roh  27-FEB-2006  - add some more software packages, extract GETVER-SW-defs into separate file
$!  V1.4-9  Roh  28-FEB-2006  - add LNM mode for SW detection, check for HP TCPIP stack and warn user
$!			      - output DECnet data even without TCPIP (was erreanously omitted)
$!  V1.4-10 Roh   3-MAR-2006  - support for multiple TCPIP interface was erreanously omitted; fixed
$!--
$!
$!
$!__error handlers
$   On  Error              Then $ Goto Execution_Error
$   On  Control_Y          Then $ Goto Control_Y
$!
$!__verification
$   If "''Dcl_Debug'"		Then $ Set Verify
$   If "''SYSTEM_REPORT_Debug'" Then $ Set Verify
$   If F$Integer("''Max_Verify_Level'") .Ge. F$Environment("Depth") Then $ Tmp = F$Verify(Save_Verify)
$   If "''DCL_Dlines'"
$   Then DclDbg = " "
$   Else DclDbg = " !"
$   Endif
$!
$   Set Symbol /Scope=(NoLocal)			! prevent problems of predefined symbols...
$   Set Symbol /Scope=(NoLocal,NoGlobal)/Verb   ! prevent problems of predefined symbols...
$!
$!  ===============================================
$!__D E C L A R A T I O N S 
$!  ===============================================
$!
$   Ws = "Write Sys$Output"
$!
$!__PossFunc:	define possible functions
$   PossFunc	= "NODES,CLUSTER,CONFLOG,RECOVERY,GETSYI,CONSVARS,CRASH,SAM,NETWORK,LAT,DISKS,QUEUES,SOFTWARE"
$!
$!__help
$   Version = "V1.4-10"
$   Params  = "[Function1,Function2,...]  [INCLUDE|EXCLUDE]"
$   Facility= F$Parse(F$Environment("Procedure"),,,"Name")
$   If F$Locate("?",P1) .Ne. F$Length(P1)
$   Then
$	Type/Page=Save Sys$Input:
$ DECK
    
SYSTEM_REPORT V1.4-10

Usage: @SYSTEM_REPORT [Func1[,Func2,...]] [INCLUDE|EXCLUDE]

SYSTEM_REPORT analyzes the local node/cluster and creates two
configuration reports (.TXT,.HTML).

The amount of data collected, location of report files ... can
by customized at the top of the procedure (search for #CUST)
and via parameter P1.

  P1: list of functions to call (default: call all functions)

    Possible functions are:
    NODES    list nodes with OS-Version, Boottime...
    CLUSTER  display cluster infos including SCACP...
    CONFLOG  display some logicals
    RECOVERY display recovery information
    GETSYI   display F$GETSYI data
    SAM      display administrator accounts
    NETWORK  display network info
    CONSVARS display console variables
    DISKS    display disk infos
    QUEUES   display queue infos
    LAT      display LAT infos
    CRASH    display crash infos
    SOFTWARE display software infos

  P2: modify P1 meaning

    INCLUDE - defaults all functions to FALSE (do not call) 
              and calls only P1 functions (default if P1 defined)
    EXCLUDE - defaults all functions to TRUE (do call them) 
              and skips only P1 functions (default if P1 undefined)

The only external utility needed is DFU (from HP engineering) to create
fragmentation reports (see customization section). If DFU is not
available, the fragmentation report is skipped.

SYSTEM_REPORT works on all voting clusternodes. Non-voting nodes are
treated, if a logical name SYSTEM_REPORT_START_ON_node is defined.

$ EOD
$       Goto Exit
$   Endif
$!
$   P1	= F$Edit("''P1'","Trim,Upcase,Collapse,UnComment")
$   P2	= F$Edit("''P2'","Trim,Upcase,Collapse,UnComment")
$   P3	= F$Edit("''P3'","Trim,Upcase,Collapse,UnComment")
$!
$!__get procedure directory
$   MySelf  = F$Environment("Procedure")
$   MYDir   = F$Parse(MySelf,,,"Device") + F$Parse(MySelf,,,"Directory")
$!
$!.
$!.#CUSTOMIZATIONS
$!.  ===============================================
$!.__C U S T O M I Z A T I O N S  start here
$!.  ===============================================
$!.
$!._CONF_DIR: defines location of configuration file SYSTEM_REPORT.CONF, defaults to same location as myself
$   CONF_DIR = MyDir
$!.
$!.  ===============================================
$!.__C U S T O M I Z A T I O N S  end here
$!.  ===============================================
$!.
$!.  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
$!.  N O   E D I T S   A F T E R   T H I S   P O I N T ! ! 
$!.  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$!.
$!._Function GETVER (tries to detect software versions)
$!. GETVER_n: specifies a software to look for, format: SW-Name|Mode|File,Cmd|Special1|Special2|Special3
$!.		SW-Name:    name of software, e.g. RDB
$!.		Mode:	    how to determine SW version (ANALYZE,DCL)
$!.		File|Cmd:   file to analyze (SYS$SYSTEM:*.EXE), DCL command to execute
$!.		Special1:   ANALYZE: string to subtract from image ident (defaults to SW-Name)
$!.			    DCL:     string searched for in output (/Match=AND)
$!.		Special2:   DCL:     elementnumber to extract/delimiter (defaults to SPACE)
$!.		Special3:   DCL:     string to subtract from image version (defaults to nothing)
$!.
$   GETVER_File	= "''Mydir'SYSTEM_REPORT.SOFTWARE"
$!.
$!  ===============================================
$!__E X E C U T I O N
$!  ===============================================
$!
$!__check for minimum VMS version (V7.3)
$   MyVersion	= F$Edit(F$Getsyi("Version"),"Trim,Upcase,Collapse")
$   MyVersion	= F$Integer(F$Extract(1,999,MyVersion)-"."-"-")
$   If (MyVersion.lt.100)   Then MyVersion  = MyVersion * 10
$   If (MyVersion.lt.730)
$   Then
$	Ws  "?''Facility'-E-BADVERS, VMS version too old, required at least V7.3!"
$	Goto Exit_Now
$   Endif
$!
$!__check for privileges
$!  SYSLCK: PRODUCT
$!  OPER:   SYSMAN
$!  CMKRNL: SCACP
$!  SYSPRV: misc.
$!  BYPASS: NCL (may be subst. with NET$MANAGE identifier)
$   Req_Privs	= "SYSLCK,SYSPRV,OPER,CMKRNL,BYPASS"
$   Old_Privs	= F$Setprv("''Req_Privs'")
$   If (.not.F$Privilege("''Req_Privs'"))
$   Then
$	Ws  "?''Facility'-E-NOPRIVS, required privileges not available,"
$	Ws  "                          need: ''Req_Privs'"
$	Goto Exit_Now
$   Endif
$!
$!__set dedault action
$   FDefault = "T"
$   GoSub Preset$
$!
$!__read configuration file
$   Conf_File	= "''Conf_Dir'SYSTEM_REPORT.CONF"
$   If (F$Search("''Conf_File'").eqs."")
$   Then
$	Call Message$ NOCONF E "''Conf_File' not found, aborting..."
$	Goto Exit_Now
$   Else
$	Call Message$ CONFIG I "Reading ''Conf_File'..."
$	@'Conf_File'
$   Endif
$!
$!__check for CALLBACK
$   If  (F$Extract(0,9,P3).eqs."CALLBACK=")
$   Then
$	TmpFunc	= F$Element(1,"=",P3)
$	NFunc	= "SHIT"
$	If (TmpFunc.eqs."GETVER")	Then $ NFunc = "GETVER$"
$	If (NFunc.eqs."SHIT")
$	Then
$	    Ws	"?''Facility'-E-ILLFUNC, illegal callback function \''TmpFunc'\."
$	Else
$	    Special_Function	= "T"
$	    GoSub   Init$	! initialize all variables...
$	    Call    'NFunc'	! call function
$	Endif
$	Exit
$   Endif
$!
$   Special_Function	= "F"	! normal run
$!
$   If ("''DFU_DIR'".eqs."")			Then $ Call Message$ NODFU E "DFU not available"
$   If (F$Search("''DFU_DIR'DFU.EXE").eqs."")	Then $ Call Message$ NODFU E "DFU not available"
$!
$   GoSub   Flist$ 	! create a functionlist
$   GoSub   Init$	! initialize all variables...
$   GoSub   Get_Nodes$	! get list of nodes to treat
$!
$   GoSub   Close$	! close report file
$   GoSub   Open$	! opens the report file and writes header
$!
$!__now call functions
$   IFunc   = -1
$ FuncLoop:
$   IFunc = IFunc + 1
$   NFunc = F$Element(IFunc,",",SelFunc)
$   If (NFunc.nes."") .and. (NFunc.nes.",")
$   Then
$	    GoSub   'NFunc'$
$	    Goto FuncLoop
$   Endif
$!
$!__last info done, write rest of navigation frame
$   Wo_left "<tr><td bgcolor=grey align=center><b>Addons"
$   Wo_Left "<tr><td bgcolor=lightgrey align=center><a target=_blank href=""''Cluname'_CONFIGURATION.TXT"">Textreport</a>"
$   Wo_Left "<tr><td bgcolor=lightgrey align=center><a target=_blank href=""''Cluname'_CONFIGURATION_ADDINFO.HTML"">Add.info (html)</a>"
$   Wo_Left "<tr><td bgcolor=lightgrey align=center><a target=_blank href=""''Cluname'_CONFIGURATION_ADDINFO.TXT"">Add.info (text)</a>"
$   Wo_Left "</table></body></html>"
$   Close/NoLog 'Outlun_Left'
$!
$!__write footer on reports
$   Wo 	    " "
$   Wo	    "------------------------------------------------------------"
$   Wo	    "SYSTEM_REPORT ''Version' finished at ''F$Time()'"
$!
$   Wo1	    "<hr>SYSTEM_REPORT ''Version' finished at ''F$Time()'"
$   Wo1	    "</body></html>"	! finish HTML file
$!
$!__cerate addinfo files
$   Call    Addapp$
$!
$   GoSub   Close$ ! close report file
$!
$   Gosub   Convert_Stmlf$  ! convert to STMLF for better web serving
$!
$   Goto    Exit
$!
$!  ===============================================
$!__E X I T
$!  ===============================================
$!
$ Error_Target:
$   Ws "?''Facility'-E-TARGET, Error accessing target directory ''TARGET_DIR'"
$   Goto Exit
$!
$ Error_Tmp:
$   Ws "?''Facility'-E-TMP, Error accessing temp. directory ''TMPDIR'"
$   Goto Exit
$!   
$ Execution_Error:
$   ___Status = $Status
$   Ws "?''Facility', Execution error: ''___Status'"
$   Ws "-''F$message(___Status)'"
$ Control_Y:
$   Set Noon
$   GoSub   Close$	! close report file
$ Exit:
$   Set Noon
$!
$   If ("''Tmpfile'".nes."")	Then $ Call Cleantmp$
$   If ("''Appfile'".nes."")	Then $ Call CleanApp$
$!
$!__restore privs
$   If ("''Old_Privs'".nes."")	Then $ Old_Privs = F$Setprv("''Old_Privs'")
$!
$   Call Message$ FOOTER I "''Version'  --  finished at ''F$Time()'" 
$!
$ Exit_Now:
$   Set Noverify
$   Tmp = "! " + F$Parse(F$Environment("Procedure"),,,"NAME")
$   If "''Save_Verify'"	Then $ Set Verify
$   Exit 'Completion_Code' 'Tmp'
$!
$!  ===============================================
$!__C O N V E R T _ S T M L F
$!  Converts outputfile to StreamLF
$!  ===============================================
$!
$ Convert_Stmlf$:
$   Call    Message$    CONVSTMLF I "Converting to STMLF"
$!
$!__loop all files
$ Convert_Stmlf$1:
$   Nx	= F$Search("''Outfile_Start'*.*")
$   If (Nx.nes."")
$   Then
$	FType	= F$Parse("''Nx'",,,"Type")
$!	If (Ftype.nes.".HTML") .and. (FType.nes.".TXT")	Then $ Goto Convert_Stmlf$1
$	If (Ftype.nes.".HTML")                         	Then $ Goto Convert_Stmlf$1
$	Convert/FDL=SYS$INPUT: 'Nx' 'Nx'
$ DECK
	RECORD
	  BLOCK_SPAN               yes
	  CARRIAGE_CONTROL         carriage_return
	  FORMAT                   stream_lf
	  SIZE                     0
$ EOD
$	Goto Convert_Stmlf$1
$   Endif
$	Purge/Keep=3	'Outfile_Start'*.TXT,'Outfile_Start'*.HTML
$!
$   Return
$!
$!  ===============================================
$!__I N I T
$!  Initialize all variables...
$!  ===============================================
$!
$ Init$:
$!
$!__CLUNAME - name of cluster, use SCSNODE if undefined
$   Tmp	= "CNC_CLUSTER_NAME"	 ! name of logical to get the clustername from
$   If ("''Cluster_Name_Logical'".nes."") Then Tmp = Cluster_Name_Logical
$!
$   CluName = F$Trnlnm("''Tmp'","Lnm$System",0,"Executive")
$   If (CluName.eqs."")
$   Then
$	Call	Message$    NOCLU I	"Logical with name of cluster not defined, using SCSNODE instead"
$	CluName	= F$Getsyi("SCSNODE")
$   Endif
$   CluName = F$Edit("''CluName'","Trim,Upcase,Collapse,UnComment")-"_"-"::"
$!
$   NodeName= F$Edit(F$Getsyi("SCSNODE"),"Trim,Upcase,Collapse,UnComment")-"_"-"::"
$!   
$!__define names of report files
$   Outfile_Start   = "''Target_Dir'''CluName'_CONFIGURATION"
$   OutFile	    = "''Outfile_Start'.TXT"
$   OutFile_AI	    = "''Outfile_Start'_ADDINFO.TXT"
$   OutFile1	    = "''Outfile_Start'.HTML"
$   OutFile1_AI	    = "''Outfile_Start'_ADDINFO.HTML"
$   Outfile_Top	    = "''Outfile_Start'_TOP.HTML"
$   Outfile_Left    = "''Outfile_Start'_LEFT.HTML"
$   Outfile_Right   = "''Outfile_Start'_RIGHT.HTML"
$!
$!__luns for temporary files
$   TmpFile	= "''TmpDir'SYSTEM_REPORT.TMP_" +F$Getjpi("","PID")
$   TmpFile1	= TmpFile + "_1"
$   TmpFile2	= TmpFile + "_2"
$   TmpFile3	= TmpFile + "_3"
$   TmpFile4	= TmpFile + "_4"
$   TmpFile5	= TmpFile + "_5"
$   TmpFileC	= TmpFile + "_C"	! special tmpfile for callbacks
$   TmpFileC1	= TmpFileC + "1"	! special tmpfile for callbacks
$   TmpFileC2	= TmpFileC + "2"	! special tmpfile for callbacks
$   TmpFileC3	= TmpFileC + "3"	! special tmpfile for callbacks
$   Tmplun  = "SYSTEM_REPORT_TMPLUN"
$   Tmplun1 = "SYSTEM_REPORT_TMPLUN1"
$   Tmplun2 = "SYSTEM_REPORT_TMPLUN2"
$   Tmplun3 = "SYSTEM_REPORT_TMPLUN3"
$   Tmplun4 = "SYSTEM_REPORT_TMPLUN4"
$   Tmplun5 = "SYSTEM_REPORT_TMPLUN5"
$   TmplunC1= "SYSTEM_REPORT_TMPLUNC1"
$   TmplunC2= "SYSTEM_REPORT_TMPLUNC2"
$   TmplunC3= "SYSTEM_REPORT_TMPLUNC3"
$   TmplunC4= "SYSTEM_REPORT_TMPLUNC4"
$!
$!__check accessability of TARGET_DIR and TMPDIR
$   CheckFile	= "SYSTEM_REPORT.TMP_" +F$Getjpi("","PID")
$!
$   Close/NoLog 'TmpLun'
$   Open/Write/Error=Error_Target 'TmpLun' 'Target_dir''CheckFile'
$   Write/Error=Error_Target 'TmpLun' "TEST"
$   Close/NoLog 'TmpLun'
$   Delete 'Target_dir''CheckFile';*
$!
$   Close/NoLog 'TmpLun'
$   Open/Write/Error=Error_Tmp 'TmpLun' 'Tmpdir''CheckFile'
$   Write/Error=Error_Tmp 'TmpLun' "TEST"
$   Close/NoLog 'TmpLun'
$   Delete 'Tmpdir''CheckFile';*
$!
$!__appendix files
$   AppLun  = "SYSTEM_REPORT_APPLUN"					! use this lUN to work with appendices
$   AppFile = "''TmpDir'SYSTEM_REPORT.APP_" + F$Getjpi("","PID") + "_"	! and this filename template (+APPNUM)
$   Appnum  = 0								! count appendices
$!
$   Outlun	= "SYSTEM_REPORT_OUTLUN"	! LUN to textreport
$   Outlun1	= "SYSTEM_REPORT_OUTLUN1"	! LUN to HTML report (TOP, and main are written 1st)
$   Outlun_AI	= "SYSTEM_REPORT_OUTLUN_AI"	! LUN to addinfo textreport
$   Outlun1_AI	= "SYSTEM_REPORT_OUTLUN1_AI"	! LUN to addinfo HTML report
$   Outlun_left	= "SYSTEM_REPORT_OUTLUN_LEFT"	! LUN to left frame
$!
$!__SW version file
$   SW_File = "''Outfile_Start'_SW_VERSIONS"	! _'NODENAME'.TXT is appended later on
$!
$!__some html shortcuts
$   TR_Head	= "<tr bgcolor=lightseagreen>"
$   TR_Line	= "<tr bgcolor=blanchedalmond>"
$   Pre_Start	= "<pre style={background-color:blanchedalmond;font-weight:normal;}>"
$!
$!__output a little header info
$   Systype = "cluster"
$   If .not. F$Getsyi("Cluster_Member") Then $ Systype = "system"
$!
$!__check special function -> skip header
$   If (Special_Function)   Then $ Return
$!
$   Ws ""
$   Call Message$ HEADER I "''Version'  --  started at ''F$Time()'" "on ''Systype' ''CluName'" "   "
$   Call Message$ FUNCTIONS I "''F$Extract(0,40,SelFunc)'" "''F$Extract(40,40,SelFunc)'" "''F$Extract(80,40,SelFunc)'" 
$   Call Message$ TARGET I "Reports are created on ''Target_Dir'"
$   Call Message$ TMPDIR I "Scratchfiles are created on ''TMPDIR'"
$   Ws ""
$!
$   Return
$!
$!  ===============================================
$!__M E S S A G E
$!  Output a message text
$!  P1:	message code 
$!  P2: severity code
$!  P3: message text
$!  P4: optional 2nd message line
$!  P5: optional 3rd message line
$!  ===============================================
$!
$ Message$: Subroutine
$!
$   If (P1.eqs."")  Then $ P1 = "UNDEF"
$   If (P2.eqs."")  Then $ P2 = "?"
$   If (P3.eqs."")  Then $ P3 = "unknown message"
$!
$   Ws	"?''Facility'-''P2'-''P1', ''P3'"
$!
$   If (P4.nes."")
$   Then
$	TmpLen	= 5+F$Length(Facility)+F$Length(P1)+F$Length(P2)
$	Ws  F$Fao("!#* !AS",F$Integer(TmpLen),P4)
$   Endif
$!
$   If (P5.nes."")
$   Then
$	TmpLen	= 5+F$Length(Facility)+F$Length(P1)+F$Length(P2)
$	Ws  F$Fao("!#* !AS",F$Integer(TmpLen),P5)
$   Endif
$!
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__O P E N
$!  Open report file and write a little header
$!  ===============================================
$!
$ Open$:
$!
$   Cluster = " node"
$   If F$Getsyi("Cluster_Member")  Then $ Cluster = " cluster"
$!
$!__create text report file
$   Create 'OutFile'
$   Open/Append/Error=Open$1 'OutLun' 'OutFile'
$   Wo	= "Write /Error=Execution_Error ''Outlun'"
$   Wo	""
$   Wo	"   SYSTEM_REPORT ''Version' on''Cluster' ''CluName' from ''F$Time()'"
$   Wo	""
$!
$!__create TOP frame
$   Create 'OutFile_Top'
$   Open/Append/Error=Open$2 'OutLun1' 'OutFile_Top'
$   Wo1	= "Write /Error=Execution_Error ''Outlun1'"
$   Wo1	"<html><head><title>SYSTEM_REPORT ''Cluname'</title>"
$   Wo1 "<body bgcolor=lightseagreen><h1><center>SYSTEM_REPORT ''Version' on''cluster' ''Cluname' "
$   Wo1 "<font size=-1>[''F$time()']</center></h1></body></html>"
$   Close/NoLog 'Outlun1'
$!
$!__create LEFT frame
$   Create 'OutFile_Left'
$   Open/Append/Error=Open$2 'OutLun_left' 'OutFile_Left'
$   Wo_left = "Write /Error=Execution_Error ''Outlun_Left'"
$   Wo_left "<html><head><style>"
$   Wo_left "body {font-family:sans-serif; background-color:#FFFFFF;}"
$   Wo_left "a:link    {color:black; text-decoration:none;font-weight:bold;}"
$   Wo_left "a:visited {color:black; text-decoration:none;font-weight:bold;}"
$   Wo_left "a:hover   {color:black; text-decoration:none;font-weight:bold; background:grey;}"
$   Wo_left "a:active  {color:black; text-decoration:none;font-weight:bold;}"
$   Wo_left "a:focus   {color:black; text-decoration:none;font-weight:bold; background:yellow;}"
$   Wo_left "</style></head><body style=""background-color:lightseagreen"">"
$   Wo_left "<table border=0>"
$   Wo_left "<tr><td bgcolor=grey align=center><b>Systemdata"
$   If (DO_Nodes)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Node-Information"">Node(s)</a>"
$   If (DO_Cluster)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Show-Cluster-Information"">Cluster</a>"
$   If (DO_Conflog)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#ConfLog-Information"">Configuration Logicals</a>"
$   If (DO_Recovery)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Recovery-Information"">Recovery</a>"
$   If (DO_Getsyi)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#GETSYI-Information"">GETSYI-Information</a>"
$   If (DO_Consvars)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Console-Variables"">Console-Variables</a>"
$   If (DO_Crash)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Crash-Information"">Crash-Information</a>"
$   If (DO_Sam)		Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#ADMIN-Information"">ADMIN(s)</a>"
$!
$   If (DO_Network .or. DO_Lat)	Then $ Wo_left "<tr><td bgcolor=grey align=center><b>Networks"
$   If (DO_Network)	Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Network-Information"">Network</a>"
$   If (DO_Lat)		Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#LAT-Information"">LAT</a>"
$!
$   If (DO_Disks)   Then $ Wo_left "<tr><td bgcolor=grey align=center><b>Disks"
$   If (DO_Disks)   Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Disk-Information"">Overview</a>"
$   If (DO_Disks)   Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Disk-Information1"">Fragmentation</a>"
$   If (DO_Disks)   Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Disk-Information2"">Shadowsets</a>"
$   If (DO_disks)   Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Disk-Information3"">Raidsets</a>"
$   If (DO_Disks)   Then $ Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Disk-Information4"">Volumesets</a>"
$!
$   If (DO_Queues)  Then $   Wo_left "<tr><td bgcolor=grey align=center><b>Queues"
$   If (DO_Queues.and.DO_QUEUES_Defs) Then $   Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Queue-Definition"">Definitions</a>"
$   If (DO_Queues)  Then $   Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Queue-Generic"">Generic</a>"
$   If (DO_Queues)  Then $   Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Queue-Batch"">Batch</a>"
$   If (DO_Queues)  Then $   Wo_left "<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Queue-Symbiont"">Symbiont</a>"
$!
$   Wo_left "<tr><td align=center bgcolor=grey><b>Software"
$!
$!__create master file
$   Create 'OutFile1'
$   Open/Append/Error=Open$2 'OutLun1' 'OutFile1'
$   Wo1	"<html><head><title>''Cluname' Systemreport</title>"
$   Wo1	"<meta http-equiv=""content-type"" content=""text/html; charset=iso-8859-1"">"
$   Wo1 "<meta name=""author"" content=""Karl Rohwedder"">"
$   Wo1 "<meta name=""generator"" content=""OpenVMS/DCL/TPU"">"
$   Wo1 "</head>"
$   Wo1 "<frameset rows=""8%,*"" frameborder=""NO"" border=""0"" framespacing=""0"" cols=""*"">"
$   Wo1 "  <frame name=""top"" scrolling=""NO"" src=""''Cluname'_CONFIGURATION_TOP.HTML"">"
$   Wo1 "    <frameset cols=""15%,*"" rows=""*"">"
$   Wo1 "      <frame name=""left""   src=""''Cluname'_CONFIGURATION_LEFT.HTML"" >"
$   Wo1 "      <frame name=""right""  src=""''Cluname'_CONFIGURATION_RIGHT.HTML"">"
$   Wo1 "    </frameset>"
$   Wo1 "</frameset><noframes><body bgcolor=""#FFFFFF"">"
$   Wo1 "<p>Sorry, we need frames!"
$   Wo1 "</body></noframes></html>"
$   Close/NoLog 'Outlun1'
$!
$!__create RIGHT frame
$   Create 'OutFile_Right'
$   Open/Append/Error=Open$2 'OutLun1' 'OutFile_Right'
$   Wo1	"<html><head><style>"
$   Wo1 "body {font-family:sans-serif; background-color:#FFFFFF;}"
$   Wo1 "a:link    {color:black; text-decoration:underline;font-weight:bold;}"
$   Wo1 "a:visited {color:black; text-decoration:underline;font-weight:bold;}"
$   Wo1 "a:hover   {color:black; text-decoration:underline;font-weight:bold; background:grey;}"
$   Wo1 "a:active  {color:black; text-decoration:underline;font-weight:bold;}"
$   Wo1 "a:focus   {color:black; text-decoration:underline;font-weight:bold; background:grey;}"
$   Wo1  "</style></head><body>"	    ! this one will be kept open, it receives the data!
$!
$   Return
$!
$ Open$1:
$   Call Message$   OPENERROR E "Error opening report text file (''$Status')"
$   Goto Execution_Error
$!
$ Open$2:
$   Call Message$   OPENERROR E "Error opening report HTML file (''$Status')"
$   Goto Execution_Error
$!
$!  ===============================================
$!__C L O S E
$!  Closes report file
$!  ===============================================
$!
$ Close$:
$   Close/NoLog 'Outlun'
$   Close/NoLog 'Outlun1'
$   Close/NoLog 'Outlun_AI'
$   Close/NoLog 'Outlun1_AI'
$   Close/NoLog 'Outlun_left'
$   Return
$!
$!  ===============================================
$!__C O N S V A R S
$!  get console variables information
$!  ===============================================
$!
$ ConsVars$:
$!
$   Call Message$   CONSVARSINFO I "Getting console variables information"
$   Call PutHeader$ "Console Variables" "Console-Variables"
$!
$   Wo1	"<table border=""2"">"
$   Tmp  = F$Fao("!20AS ", "Typ")
$   Tmp1 = "''TR_Head'<td align=center><b>Typ"
$!
$!
$   Ic	= 0
$ ConsVars$_1:
$   Ic	= Ic + 1
$   If (Ic.le.Node_Num)
$   Then
$	Nam  = Node_'Ic'
$	Tmp  = Tmp  + F$Fao("!32AS", "''Nam'")
$	Tmp1 = Tmp1 + "<td align=center><b>''Nam'"
$	Goto ConsVars$_1
$   Endif
$   Wo	"''Tmp'"
$   Wo1	"''Tmp1'</tr>"
$!
$   call ConVar "auto_action"
$   call ConVar "boot_dev"
$   call ConVar "bootdef_dev"
$   call ConVar "booted_dev"
$   call ConVar "boot_file"
$   call ConVar "booted_file"
$   call ConVar "boot_osflags"
$   call ConVar "booted_osflags"
$   call ConVar "boot_reset"
$   call ConVar "dump_dev"
$   call ConVar "enable_audit"
$   call ConVar "license"
$   call ConVar "tty_dev" 
$!
$   Wo1	"</table>"
$!
$   Return
$!
$ ConVar:
$ SUBROUTINE
$   c = "''p1'"
$   Ic	= 0
$   Wo1 "''Tr_Line'<td><b>''P1'"
$   TmpTxt  = F$Fao("!20AS",P1)
$   MySelf  = F$Edit(F$Getsyi("SCSNODE"),"Trim,Upcase,Collapse")-"_"-"::"
$!
$ Convar_1:
$   Ic	= Ic + 1
$   If (Ic.le.Node_Num)
$   Then
$	Nam = Node_'Ic'
$	If (Nam.eqs.Myself)
$	Then
$	    Tmp	= F$GetSyi("ARCH_NAME","''Nam'")
$	    If (Tmp.eqs."VAX")
$	    Then
$		Tmp = "*undefined*"
$	    Else
$		Tmp = F$getenv("''c'")
$		If ("''Tmp'".eqs."")	Then $ Tmp = "undefined"
$	    Endif
$	Else
$	    Tmp	= F$GetSyi("ARCH_NAME","''Nam'")
$	    If (Tmp.eqs."VAX")
$	    Then
$		Tmp = "undefined"
$	    Else
$!
$!______________create SYSMAN job do get the data, since F$GETENV doesn't support a nodename as argument
$		Call    CleanTmp$
$		Open/Write/Error=Convar_1 'TmpLun' 'TmpFile'	! SYSMAN commandfile
$		Write 'TmpLun'  "$ Set Noon"
$		Write 'TmpLun'  "$ Assign/NoLog/User_Mode NL: Sysmanini"
$		Write 'TmpLun'  "$ Mcr Sysman"
$		Write 'TmpLun'  "Set Environment /Node=''Nam'"
$		Write 'TmpLun'  "Do Write Sys$Output F$Getenv(""''C'"")"
$		Close/NoLog 'TmpLun'
$!
$		Set Noon
$		@'TmpFile'/Output='TmpFile1'
$		Set On
$!
$!______________scan output file
$		Open/Read/Error=Convar_1 'TmpLun1' 'Tmpfile1'
$ Convar_2:
$		Read/End=Convar_5/Error=Convar_5 'TmpLun1' Rec
$		Rec = F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$		If (F$Extract(0,17,Rec).eqs."%SYSMAN-I-OUTPUT,")
$		Then
$		    Read/End=Convar_5/Error=Convar_5 'TmpLun1' Rec
$		    Tmp	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$		Else
$		    Goto Convar_2
$		Endif
$		If ("''Tmp'".eqs."")	Then $ Tmp = "undefined"
$	    Endif
$	Endif
$!
$ Convar_5:
$	Wo1 "<td>''tmp'</td>"
$	TmpTxt = Tmptxt + F$Fao("!32AS ","''tmp'")
$	Goto Convar_1
$   Endif
$!
$   Wo	TmpTxt
$   Wo1	"</tr>"
$!
$   Call Cleantmp$
$!
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__G E T S Y I
$!  get system information
$!  ===============================================
$!
$ Getsyi$:
$!
$   Call Message$   GETSYIINFO I "Getting system information"
$   Call PutHeader$ "System Information" "GETSYI-Information"
$!
$   Wo1	"<table border=""2"">"
$   Tmp  = F$Fao("!20AS ", "Typ")
$   Tmp1 = "''TR_Head'<td align=center><b>Typ"
$!
$   Ic	= 0
$ Getsyi$_1:
$   Ic	= Ic + 1
$   If (Ic.le.Node_Num)
$   Then
$	Nam  = Node_'Ic'
$	Tmp  = Tmp  + F$Fao("!32AS", "''Nam'")
$	Tmp1 = Tmp1 + "<td align=center><b>''Nam'"
$	Goto Getsyi$_1
$   Endif
$   Wo	"''Tmp'"
$   Wo1	"''Tmp1'</tr>"
$!
$   call SayDoSYI "ACTIVECPU_CNT" 
$   call SayDoSYI "AVAILCPU_CNT" 
$   call SayDoSYI "ARCHFLAG" 
$   call SayDoSYI "ARCH_NAME" 
$   call SayDoSYI "ARCH_TYPE" 
$   call SayDoSYI "BOOTTIME" 
$   call SayDoSYI "CHARACTER_EMULATED" 
$   call SayDoSYI "CLUSTER_EVOTES" 
$   call SayDoSYI "CLUSTER_FSYSID" 
$   call SayDoSYI "CLUSTER_FTIME" 
$   call SayDoSYI "CLUSTER_MEMBER" 
$   call SayDoSYI "CLUSTER_NODES" 
$   call SayDoSYI "CLUSTER_QUORUM" 
$   call SayDoSYI "CLUSTER_VOTES" 
$   call SayDoSYI "CONSOLE_VERSION" "Alpha" 
$   call SayDoSYI "CONTIG_GBLPAGES" 
$   call SayDoSYI "CPU" 
$   call SayDoSYI "CPUTYPE" "Alpha"
$   call SayDoSYI "D_FLOAT_EMULATED" 
$   call SayDoSYI "DECIMAL_EMULATED" 
$   call SayDoSYI "DEF_PRIO_MAX" "Alpha"
$   call SayDoSYI "DEF_PRIO_MIN" "Alpha"
$   call SayDoSYI "DECNET_FULLNAME" 
$   call SayDoSYI "ERLBUFFERPAGES" 
$   call SayDoSYI "ERRORLOGBUFFERS" 
$   call SayDoSYI "F_FLOAT_EMULATED" 
$   call SayDoSYI "FREE_GBLPAGES" 
$   call SayDoSYI "FREE_GBLSECTS" 
$   call SayDoSYI "GALAXY_SHMEMSIZE" "Alpha"
$   call SayDoSYI "G_FLOAT_EMULATED" 
$   call SayDoSYI "GH_RSRVPGCNT" "Alpha"
$   call SayDoSYI "H_FLOAT_EMULATED" 
$   call SayDoSYI "HP_CONFIG_SBB_CNT" "" "WILDFIRE"
$   call SayDoSYI "HP_CONFIG_SP_CNT"  "" "WILDFIRE"
$   call SayDoSYI "HP_ACTIVE_SP_CNT"  "" "WILDFIRE"
$   call SayDoSYI "HP_ACTIVE_CPU_CNT" "" "WILDFIRE"
$   call SayDoSYI "HW_MODEL" 
$   call SayDoSYI "HW_NAME" 
$   call SayDoSYI "ITB_ENTRIES" "Alpha"
$   call SayDoSYI "MEMSIZE" 
$   call SayDoSYI "NODE_AREA" 
$   call SayDoSYI "NODE_CSID" 
$   call SayDoSYI "NODE_EVOTES" 
$   call SayDoSYI "NODE_HWTYPE" 
$   call SayDoSYI "NODE_HWVERS" 
$   call SayDoSYI "NODE_NUMBER" 
$   call SayDoSYI "NODE_QUORUM" 
$   call SayDoSYI "NODE_SWINCARN" 
$   call SayDoSYI "NODE_SWTYPE" 
$   call SayDoSYI "NODE_SWVERS" 
$   call SayDoSYI "NODE_SYSTEMID" 
$   call SayDoSYI "NODE_VOTES" 
$   call SayDoSYI "NODENAME" 
$   call SayDoSYI "PAGEFILE_FREE" 
$   call SayDoSYI "PAGEFILE_PAGE" 
$   call SayDoSYI "PAGE_SIZE" 
$   call SayDoSYI "PSXFIFO_PRIO_MAX" "Alpha"
$   call SayDoSYI "PSXFIFO_PRIO_MIN" "Alpha"
$   call SayDoSYI "PSXRR_PRIO_MAX"   "Alpha"
$   call SayDoSYI "PSXRR_PRIO_MIN"   "Alpha"
$   call SayDoSYI "PALCODE_VERSION"  "Alpha"
$   call SayDoSYI "QUANTUM" 
$   call SayDoSYI "RAD_CPUS"	   "Alpha"
$   call SayDoSYI "RAD_MAX_RADS"     "Alpha"
$   call SayDoSYI "RAD_MEMSIZE"      "Alpha"
$   call SayDoSYI "RAD_SHMEMSIZE"    "Alpha"
$   call SayDoSYI "REAL_CPUTYPE"     "Alpha"
$   call SayDoSYI "SID" 
$   call SayDoSYI "SWAPFILE_FREE" 
$   call SayDoSYI "SWAPFILE_PAGE" 
$   call SayDoSYI "USED_GBLPAGCNT" 
$   call SayDoSYI "USED_GBLPAGMAX" 
$   call SayDoSYI "VERSION" 
$   call SayDoSYI "SCS_EXISTS" 
$   call SayDoSYI "SYSTEM_RIGHTS" 
$   call SayDoSYI "VECTOR_EMULATOR" 
$   call SayDoSYI "VP_MASK" 
$   call SayDoSYI "VP_NUMBER" 
$!
$   Wo1	"</table>"
$!
$   Return
$!
$ SayDoSyi:
$   Subroutine
$   a = "''p1'"
$   Ic	= 0
$   Wo1 "''Tr_Line'<td><b>''P1'"
$   Tmp	= F$Fao("!20AS",P1)
$!
$ SayDoSyi_1:
$   Ic	= Ic + 1
$   If (Ic.le.Node_Num)
$   Then
$	Nam = Node_'Ic'
$	If (P2.nes."")	! architecture specified?
$	Then
$	    If (F$Getsyi("Arch_Name","''Nam'").eqs."''P2'")
$	    Then
$		T = F$getsyi("''a'","''Nam'")
$		Wo1 "<td>''T'</td>"
$		Tmp = Tmp + F$Fao("!32AS ","''T'")
$	    Else
$		Wo1 "<td>&nbsp;</td>"
$		Tmp = Tmp + F$Fao("!32AS "," ")
$	    Endif
$	    Goto SayDoSyi_1
$	Endif
$	If (P3.nes."WILDFIRE")
$	Then  
$	    T = F$getsyi("''a'","''Nam'")
$	    Wo1 "<td>''T'</td>"
$	    Tmp = Tmp + F$Fao("!32AS","''T'")
$	Else
$	    Hwname  = F$Getsyi("HW_NAME","''Nam'")
$	    If (F$Extract(0,2,Hwname).eqs."GS")
$	    Then
$		T = F$getsyi("''a'","''Nam'")
$		Wo1 "<td>''T'</td>"
$		Tmp = Tmp + F$Fao("!32AS","''T'")
$	    Else
$		Wo1 "<td>&nbsp;</td>"
$		Tmp = Tmp + F$Fao("!32AS"," ")
$	    Endif
$	Endif   
$       Goto SayDoSyi_1
$   Endif
$!
$   Wo	Tmp
$   Wo1	"</tr>"
$!
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__C L U S T E R
$!  display cluster information
$!  ===============================================
$!
$ Cluster$:
$!
$   Call Message$   CLUSTERINFO I "Getting cluster display"
$   Call PutHeader$ "Show Cluster" "Show-Cluster-Information"
$!
$   If (.not.F$Getsyi("Cluster_Member"))
$   Then
$	Wo  "  This node is no clustermember!"
$	Wo1 "<b>This node is no clustermember!</b><br>"
$	Return
$   Endif
$!
$   Close/NoLog 'Tmplun1'
$   Open/Write/Error=Cluster$_1 'TmpLun1' 'TmpFile1'
$   Write/Error=Cluster$_1 'TmpLun1' "ADD VOTES,QUORUM,HW_TYPE,TRANSITION_TIME,EXPECTED_VOTES,CLUSTER,NODE"
$   Write/Error=Cluster$_1 'TmpLun1' "SET SCREEN = 132"
$   Write/Error=Cluster$_1 'TmpLun1' "SET HW_Type /Width=26"
$   Close/NoLog 'Tmplun1'
$!
$   Assign/NoLog/User	'TmpFile1'  SHOW_CLUSTER$INIT
$ Cluster$_1:
$   Show Cluster /Output='TmpFile'
$!
$!__strip empty lines at end and 1st line containing the <FF>
$   Assign/User/NoLog NL: Sys$Output
$   Assign/User/NoLog NL: Sys$Error
$   Edit/Edt/NoCommand 'TmpFile'
$ DECK
d 1
t end
-'+--
d .+1:end
exit
$ EOD
$!   
$   Wo	F$Fao("!/Show Cluster")
$   Wo1	"<h2>Show Cluster</h2>"
$   Wo1 "''Pre_Start'"
$   Call    Transfer$ 'TmpFile'
$   Wo1	"</pre>"
$!
$   Wo	F$Fao("!/SCACP Channels")
$   Wo1	"<h2>SCACP Channels</h2>"
$   Assign/User/NoLog 'TmpFile' Sys$Output
$   Assign/User/NoLog 'Tmpfile' Sys$Error
$   MCR SCACP SHOW CHANNEL
$   Wo1 "''Pre_Start'"
$   Call    Transfer$ 'TmpFile'
$   Wo1	"</pre>"
$!
$   Wo	F$Fao("!/SCACP VC")
$   Wo1	"<h2>SCACP VC</h2>"
$   Assign/User/NoLog 'TmpFile' Sys$Output
$   Assign/User/NoLog 'Tmpfile' Sys$Error
$   MCR SCACP SHOW VC
$   Wo1 "''Pre_Start'"
$   Call    Transfer$ 'TmpFile'
$   Wo1	"</pre>"
$!
$   Wo	F$Fao("!/SCACP Circuits")
$   Wo1	"<h2>SCACP Circuits</h2>"
$   Assign/User/NoLog 'TmpFile' Sys$Output
$   Assign/User/NoLog 'Tmpfile' Sys$Error
$   MCR SCACP SHOW CIRCUIT
$   Wo1 "''Pre_Start'"
$   Call    Transfer$ 'TmpFile'
$   Wo1	"</pre>"
$!
$   Wo	F$Fao("!/SCACP LAN_DEVICE")
$   Wo1	"<h2>SCACP LAN_DEVICE</h2>"
$   Assign/User/NoLog 'TmpFile' Sys$Output
$   Assign/User/NoLog 'Tmpfile' Sys$Error
$   MCR SCACP SHOW LAN_DEVICE
$   Wo1 "''Pre_Start'"
$   Call    Transfer$ 'TmpFile'
$   Wo1	"</pre>"
$!
$   Call    Cleantmp$
$   Return
$!
$!  ===============================================
$!__N O D E S
$!  Gets node infos
$!  ===============================================
$!
$ Nodes$:
$!
$   Call Message$   NODEINFO I "Getting node infos"
$   Call PutHeader$ "Node Information" "Node-Information"
$!
$   Header1  = "Nodename HW-Name                  OS-Type   OS-Vers.   Systemdisk    Systemroot"
$   Header2  = "-------------------------------------------------------------------------------"
$   Header11 = "         CPU  Memory   Boottime         Console  PALcode"
$   OSType   = "VMS"
$!
$   Wo  ""
$   Wo	Header1
$   Wo	Header11
$   Wo	Header2
$   Wo1	"<p><table border=2>''TR_Head'<td align=center><b>Nodename<td align=center><b>HW-Name"
$   Wo1 "<td align=center><b>OS-Type<td align=center><b>OS-Vers.<td align=center><b>Systemdisk"
$   Wo1 "<td align=center><b>Systemroot<td align=center><b>CPU<td align=center><b>Memory"
$   Wo1	"<td align=center><b>Boottime<td align=center><b>Console<td align=center><b>PALcode"
$!
$!__create commandfile for SYSMAN
$   Call    CleanTmp$
$   Open/Write/Error=Execution_Error 'TmpLun' 'TmpFile'	! SYSMAN commandfile
$   Write 'TmpLun'  "$ Set Noon"
$   Write 'TmpLun'  "$ Assign/NoLog/User_Mode NL: Sysmanini"
$   Write 'TmpLun'  "$ Mcr Sysman"
$   Write 'TmpLun'  "Set Environment /Cluster"
$   Write 'TmpLun'  "Do @''Tmpfile2'"
$   Close/NoLog 'TmpLun'
$!
$   Open/Write/Error=Execution_Error 'TmpLun2' 'TmpFile2'	! SYSMAN commandfile
$   Write 'TmpLun2'  "$Write Sys$Output F$Getsyi(""Hw_Name"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Getsyi(""Version"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Getsyi(""Arch_Name"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Trnlnm(""Sys$Sysdevice"",""Lnm$System"",0,""Executive"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Trnlnm(""Sys$TopSys"",""Lnm$System"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Getsyi(""memsize"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Getsyi(""page_size"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Getsyi(""Availcpu_Cnt"")"
$   Write 'TmpLun2'  "$Write Sys$Output F$Getsyi(""Boottime"")"
$   Write 'TmpLun2'  "$If F$Getsyi(""Arch_Name"").nes.""VAX"""
$   Write 'TmpLun2'  "$Then"
$   Write 'TmpLun2'  "$ Write Sys$Output F$Getsyi(""Console_Version"")"
$   Write 'TmpLun2'  "$ Write Sys$Output F$Getsyi(""Palcode_Version"")"
$   Write 'TmpLun2'  "$ Else"
$   Write 'TmpLun2'  "$ Write Sys$Output ""none"""
$   Write 'TmpLun2'  "$ Write Sys$Output ""none"""
$   Write 'TmpLun2'  "$Endif"
$   Close/NoLog 'TmpLun2'
$!
$   Set Noon
$   @'TmpFile'/Output='TmpFile1'
$   Set On
$!
$!__scan output file
$   Open/Read 'TmpLun1' 'Tmpfile1'
$ Nodes$1:
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$!
$!__new node?
$   If (F$Extract(0,17,Rec).eqs."%SYSMAN-I-OUTPUT,")
$   Then
$	NodeName    = F$Element(5," ",Rec)
$   Else
$	Goto Nodes$1
$   Endif
$!
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' HWName
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' OSVers
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' HWType
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' Sysdisk
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' Sysroot
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' memsize
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' page_size
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' cpucnt
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' boottime
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' console
$   Read/End=Nodes$10/Error=Execution_Error 'TmpLun1' palcode
$   memsize = memsize/1024*page_Size/1024
$   Wo	F$Fao("!6AS   !24AS !10AS !8AS !16AS !8AS", Nodename, HWName, "''OSType'/''HWType'", OSVers, Sysdisk, "[''Sysroot'.]")
$   Wo	F$Fao("!6AS   !3AS !6SLMB !17AS !8AS !8AS", " ", Cpucnt, Memsize, boottime, console, Palcode)
$   Wo1	"''TR_Line'<td  align=""center""><b>''Nodename'<td>''HWName'<td>''OSType'/''HWType'<td>''OSVers'<td>''Sysdisk'<td>[''Sysroot'.]"
$   Wo1 "<td align=""right"">''cpucnt'<td align=""right"">''Memsize'MB<td align=right>''boottime'<td>''console'<td>''Palcode'"
$!
$!__store systenmdisk for each node for later reference
$   NODE_SYSDISK_'NodeName' = "''Sysdisk'"
$   Goto Nodes$1
$!  
$ Nodes$10:
$   Wo1	"</table><p>"
$   Close/NoLog 'Tmplun1'
$!
$ Nodes$End:
$   Return
$!
$!  ===============================================
$!__R E C O V E R Y
$!  get recovery information
$!  ===============================================
$!
$ Recovery$:
$!
$   Call Message$   RECOVERYINFO I "Getting recovery infos"
$   Call PutHeader$ "Recovery Information" "Recovery-Information"
$!
$   Wo1	"<table border=""2"">"
$   Wo1	"''TR_Head'<td align=center><b>Funktion<td align=center><b>Disk<td align=center><b>Label<td align=center><b>Shadow Members"
$!
$!__systemdisk info
$   If (.not.F$Getsyi("Cluster_Member"))
$   Then
$	Diskspec	= "SYS$SYSDEVICE"
$	Gosub   Get_DiskInfo
$	Wo	F$Fao("!22AS !16AS !16AS !AS","Systemdisk","''DiskName'","''VolName'","''Shadowmembers'")
$	Wo1	"''TR_Line'<td><b>Systemdisk<td>''DiskName'<td>''VolName'<td>''Shadowmembers'"
$   Else
$!______create commandfile for SYSMAN
$	Call    CleanTmp$
$	Open/Write/Error=Execution_Error 'TmpLun' 'TmpFile'	! SYSMAN commandfile
$	Write 'TmpLun'  "$ Set Noon"
$	Write 'TmpLun'  "$ Assign/NoLog/User_Mode NL: Sysmanini"
$	Write 'TmpLun'  "$ Mcr Sysman"
$	Write 'TmpLun'  "Set Environment /Node=(''Node_List')"
$	Write 'TmpLun'  "Do SHOW LOGICAL/SYSTEM SYS$SYSDEVICE"
$	Close/NoLog 'TmpLun'
$!
$	Set NoOn
$	@'TmpFile'/Output='TmpFile1'
$	Set On
$!
$!______scan output file
$	Open/Read/Error=Execution_Error 'TmpLun1' 'Tmpfile1'
$!
$!______look for execution start on next node
$ Recovery$5:
$	Read/End=Recovery$9/Error=Execution_Error 'TmpLun1' Rec
$	Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$!
$!______new node?
$	If (F$Extract(0,17,Rec).eqs."%SYSMAN-I-OUTPUT,")
$	Then
$	    Nxx	= F$Element(5," ",Rec)
$	Else
$	    Goto Recovery$5
$	Endif
$!
$!______read data line
$	Read/End=Recovery$9/Error=Execution_Error 'TmpLun1' Rec
$	DiskSpec	= F$Edit(Rec,"Upcase,Collapse,UnComment")
$	DiskSpec	= F$Element(0,"(",F$Element(1,"=",DiskSpec))-""""-""""
$	Gosub   Get_DiskInfo
$	Wo	F$Fao("!22AS !16AS !16AS !AS","Systemdisk ''Nxx'","''DiskName'","''VolName'","''Shadowmembers'")
$	Wo1	"''TR_Line'<td><b>Systemdisk ''Nxx'<td>''DiskName'<td>''VolName'<td>''Shadowmembers'"
$	Goto Recovery$5
$   Endif
$!
$ Recovery$9:
$   Call    CleanTmp$
$!
$!__VAX: Standalone Backups
$ Recovery$10:
$   Nx  = F$Device("*","DISK")
$   If (Nx.nes."")
$   Then
$	If (.not.F$GetDvi("''Nx'","MNT"))		Then $ Goto Recovery$10
$	If (     F$GetDvi("''Nx'","SHDW_MEMBER"))	Then $ Goto Recovery$10
$	If (     F$GetDvi("''Nx'","SWL"))		Then $ Goto Recovery$10
$	If (F$Search("''Nx'[000000]SYSE.DIR").nes."")
$	Then
$	    Diskspec	= "''NX'"
$	    Gosub   Get_DiskInfo
$	    Wo	F$Fao("!22AS !16AS !16AS !AS","Stabackit","''DiskName'", "''VolName'", "''Shadowmembers'")
$	    Wo1	"''TR_Line'<td><b>Stabackit<td>''DiskName'<td>''VolName'<td>''Shadowmembers'"
$	Endif
$	Goto Recovery$10
$   Endif
$!
$!__display special disks (defined in Recovery_Logs)
$   If ("''Recovery_Logs'".eqs."")  Then $ Goto Recovery$18
$!
$   Ix	= -1
$ Recovery$15:
$   Ix	= Ix + 1
$   Nx	= F$Element(Ix,",",Recovery_logs)
$   If (Nx.nes."") .and. (Nx.nes.",")
$   Then
$	DiskSpec    = Nx-":"
$	DiskTxt	    = F$Trnlnm("''DiskSpec'")
$	GoSub   Get_DiskInfo
$	If (DiskTxt-":"-"_".nes.DiskName)
$	Then
$	    Wo	F$Fao("!22AS !AS", Diskspec, Disktxt)
$	    Wo1	"''TR_Line'<td rowspan=""2""><b>''Diskspec'<td colspan=""3"">''Disktxt'"
$	    Wo	F$Fao("!22AS !16AS !16AS !AS","''Diskspec'","''DiskName'","''VolName'","''Shadowmembers'")
$	    Wo1	"''TR_Line'<td>''DiskName'<td>''VolName'<td>''Shadowmembers'"
$	Else
$	    Wo	F$Fao("!22AS !16AS !16AS !AS","''Diskspec'","''DiskName'","''VolName'","''Shadowmembers'")
$	    Wo1	"''TR_Line'<td><b>''DiskSpec'<td>''DiskName'<td>''VolName'<td>''Shadowmembers'"
$	Endif
$	Goto Recovery$15
$   Endif
$!
$!__SAVE disks?
$!  This is highly sitespecific (SAVE_SYSTEMDIS.DAT defines which disks are Image-backuped
$!  regularly to a nopther disk for the purpose of crash recovery)
$   If (F$search("CNC_CLUMGR:SAVE_SYSTEMDISK.DAT").eqs."")  Then $ Goto Recovery$End
$!
$!__check for SAVE_SYSTEMDISK.DAT
$ Recovery$18:
$   Set NoOn
$   @CNC_CLUMGR:SAVE_SYSTEMDISK.DAT
$   Set On
$   If ("''SaveDisks'".eqs."")	Then $ Savedisks    == ""
$!
$   Ix	= -1
$ Recovery$20:
$   Ix	= Ix + 1
$   Nxx	= F$Element(Ix,"+",SaveDisks)
$   If (Nxx.nes."") .and. (Nxx.nes."+")
$   Then
$	DiskSpec    = "Save_''Nxx'"
$	If (F$Type('DiskSpec').eqs."")	Then $ Goto Recovery$20
$	DiskSpec    = Save_'Nxx'
$	Wo	F$Fao("!22AS !AS","Save ''Nxx'","''DiskSpec'")
$	Wo1	"''TR_Line'<td rowspan=3><b>Save ''Nxx'<td colspan=3>''DiskSpec'"
$	GoSub	GET_DiskInfo
$	Wo	F$Fao("!22AS !16AS !16AS !AS","", "''DiskName'", "''Volname'", "''Shadowmembers'")
$	Wo1	"''TR_Line'<td>''DiskName'<td>''VolName'<td>''Shadowmembers'"
$!
$!______display stored files
$	IFlag	= "F"
$ Recovery$25:
$	Tmp1	= F$Search("''DiskSpec'''Nxx'*.BCK",1212)
$	If (Tmp1.nes."")
$	Then
$	    Wo	F$Fao("!22AS !AS","","''Tmp1'")
$	    If (.not. IFlag)
$	    Then
$		Wo1	"''TR_Line'<td colspan=""3"">''Tmp1'"
$		IFlag	= "T"
$	    Else
$		Wo1	"''TR_Line'<td>&nbsp;<td colspan=""3"">''Tmp1'"
$	    Endif
$	    Goto Recovery$25
$	Endif
$!
$	Goto Recovery$20
$   Endif
$!
$ Recovery$End:
$   Wo1	"</table>"
$   Return
$!
$!  ===============================================
$!__C O N F L O G
$!  Display some configuration logicals
$!  ===============================================
$!
$ ConfLog$:
$!
$   If ("''CONFLOG_List'".eqs."")   Then $ Return
$!
$   Call Message$   CONFLOGINFO I "Getting configuration logicals"
$   Call PutHeader$ "Configuration Logicals" "Conflog-Information"
$!
$   Header1  = "Function                Nodename"
$   Header2  = "--------------------------------"
$   Wo1	"<table border=""2"">''TR_Head'<td align=center><b>Logical Name<td align=center><b>Value"
$!
$   Ic	= -1
$ CONFLOG$_1:
$   Ic	= Ic + 1
$   Nx	= F$Element(Ic, ",", CONFLOG_List)
$   If (Nx.nes."") .and. (Nx.nes.",")
$   Then
$	Tmp = F$Trnlnm("''NX'","Lnm$System",0,"Executive")
$	If (Tmp.eqs."")	Then $ Tmp = "undefined"
$	Wo	F$Fao("!16AS : !AS", Nx, Tmp)
$	Wo1	"''TR_Line'<td><b>''Nx'<td>&nbsp;''Tmp'"
$	Goto CONFLOG$_1
$   Endif
$!
$   Wo1 "</table>"
$!
$   Return
$!
$!  ===============================================
$!__C L E A N T M P
$!  Cleanup tmpfiles
$!  ===============================================
$!
$ Cleantmp$: Subroutine
$   Close/NoLog 'TmpLun'
$   Close/NoLog 'TmpLun1'
$   Close/NoLog 'TmpLun2'
$   Close/NoLog 'TmpLun3'
$   Close/NoLog 'TmpLun4'
$   Close/NoLog 'TmpLun5'
$   Close/NoLog 'TmpLunC1'
$   Close/NoLog 'TmpLunC2'
$   Close/NoLog 'TmpLunC3'
$   Close/NoLog 'TmpLunC4'
$   If (F$Search("''TmpFile'*").nes."")    Then $ Delete/NoLog/NoConfirm 'TmpFile'*;*
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__C L E A N A P P 
$!  Cleanup appendix files
$!  ===============================================
$!
$ Cleanapp$: Subroutine
$   Close/NoLog 'Applun'
$   If (F$Search("''AppFile'*").nes."")	Then $ Delete/NoLog/NoConfirm 'AppFile'*;*
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__D I S K S
$!  Get disk infos (use F$GETDVI and DFU)
$!  ===============================================
$!
$ Disks$:
$   Call Message$   DISKINFO I "Getting disk infos"
$   Call PutHeader$ "Disk Information" "Disk-Information"
$   Call Cleantmp$
$!
$!__disk info
$   Wo	""
$   Wo	"  --- Usage ---"
$   Wo	""
$   Wo1 "<h2>Usage</h2>"
$!
$!__check of any LD devices are present, if not, skip add info section in html report
$   Addinfo_Header  = ""
$!
$ Disks$_5:
$   NxDev   = F$Device("*LDA*","DISK")
$   If (NxDev.nes."")
$   Then
$	If (.not. F$Getdvi("''NxDev'","EXISTS"))	Then $ Goto Disks$_5
$	If (.not. F$Getdvi("''NxDev'","AVL"))		Then $ Goto Disks$_5
$	If (.not. F$Getdvi("''NxDev'","MNT"))		Then $ Goto Disks$_5
$	Addinfo_Header	= "<td align=center rowspan=2><b>Additional Information"
$   Endif	   
$!
$!__loop over all disk devices
$   Wo  F$Fao("  Disk       Label                   Type         Str. RO  C.size   E.size  Capacity     Used       Free        IO          Additional Information")
$   Wo  F$Fao("                                                         [blocks] [blocks]   [MB]       [MB]       [MB]       [1000]")
$   Wo  F$Fao("-----------------------------------------------------------------------------------------------------------------------------------------------------")
$   Wo1 "<table border=""2"">"
$   Wo1 "''TR_Head'<td align=center rowspan=2><b>Disk<td align=center rowspan=2><b>L a b e l<td align=center rowspan=2><b>Type"
$   Wo1 "<td align=center rowspan=2><b>Str.<td align=center rowspan=2><b>RO<td align=center><b>C.size<td align=center><b>E.size"
$   Wo1	"<td align=center><b>Capacity<td align=center colspan=2><b>U s e d"
$   Wo1 "<td align=center colspan=2><b>F r e e<td align=center><b>I O''Addinfo_Header'</tr>"
$   Wo1 "''TR_Head'<td align=center><b>[blocks]<td align=center><b>[blocks]<td align=center><b>MB<td align=center><b>MB"
$   Wo1	"<td align=center><b>%<td align=center><b>MB<td align=center><b>%<td align=center><b>1000"
$!
$   TmpNum   = 0	! count disks
$   TmpTMax  = 0	! count capacity (MB]
$   TmpTFree = 0	! count free MB
$   TmpTUsed = 0	! count used MB
$   TmpTIO   = 0	! count IO
$!
$ Disk$_10:
$   NxDev   = F$Device("*","DISK")
$   If (NxDev.nes."")
$   Then
$	If (.not. F$Getdvi("''NxDev'","EXISTS"))	Then $ Goto Disk$_10
$	If (.not. F$Getdvi("''NxDev'","AVL"))		Then $ Goto Disk$_10
$	If (.not. F$Getdvi("''NxDev'","MNT"))		Then $ Goto Disk$_10
$	If (      F$Getdvi("''NxDev'","SHDW_MEMBER"))	Then $ Goto Disk$_10
$!
$	TmpDev	= NxDev - "_" -":"
$!
$!______If shadowset, skip units above SHADOW_MAX_UNIT, they belong to Raid devices
$	If (F$Extract(0,3,TmpDev).eqs."DSA")
$	Then
$	    If (F$Integer(TmpDev-"DSA").ge.Shadow_Max_Unit) Then  $ Goto Disk$_10
$	Endif
$!
$!______store full info for ADDINFO file
$	AppNum  = AppNum + 1
$	AppTxt_'AppNum' = "SHOW DEVICE /FULL ''NxDev'"
$	Set Noon
$	SHOW DEVICE /FULL 'NxDev' /Output='AppFile''AppNum'
$	Set On
$!
$	TmpIO	= F$Getdvi("''NxDev'","OPCNT")
$	If (TmpIO.le.0)
$	Then 
$	    TmpIO = 0
$	Else
$	    If (TmpIO.lt.1000)
$	    Then
$		TmpIO = 1
$	    Else
$		TmpIO	= TmpIO / 1000
$	    Endif
$	Endif
$	TmpAdd	= ""
$!
$	TmpRo	= "RW"
$	If (F$Getdvi("''NxDev'","SWL"))	Then $ TmpRo = "RO"
$!
$	TmpLab	= F$Getdvi("''NxDev'","VOLNAM")
$	Tmp1	= F$Getdvi("''NxDev'","DEVTYPE")
$	TmpTyp	= F$Getdvi("''NxDev'","DEVICE_TYPE_NAME")
$	If (Tmp1.eqs."175") Then $ TmpTyp = "RAID0"
$	If (Tmp1.eqs."176") Then $ TmpTyp = "RAID5"
$	If (Tmp1.eqs."129") .and. (F$Locate("LDA",TmpDev).ne.F$Length(TmpDev)) 
$	Then 
$	    TmpTyp = "LDdisk"
$	    PIPE LD SHOW 'NxDev' | (Read Sys$Pipe rec ; define/nolog/job System_Report_Ext &rec)
$           TmpAdd = F$Trnlnm("System_Report_Ext")
$           TmpAdd = F$Element(0,";",F$Extract(F$Locate("to",TmpAdd)+3,9999,TmpAdd))
$           Deassign/Job System_Report_Ext
$	Endif
$!
$	TmpStr	= F$Getdvi("''NxDev'","ACPTYPE")-"F11V"
$	TmpMax	= F$Getdvi("''NxDev'","MAXBLOCK")    / 2048 
$	TmpFree	= F$Getdvi("''NxDev'","FREEBLOCKS")  / 2048 
$	TmpUsed = TmpMax-TmpFree
$	If (TmpMax.gt.0)
$	Then
$	    TmpFreePc   = TmpFree*100/TmpMax
$	    TmpUsedPc   = 100-TmpFreePc
$	Else
$	    TmpFreePc	= 0
$	    TmpUSedPc	= 0
$	Endif
$!
$	Tmpcs	= F$Getdvi("''NxDev'","CLUSTER")
$       If (F$Getsyi("Arch_name").eqs."VAX") .or. (MyVersion.lt.820)
$       Then
$               PIPE Search 'Appfile''Appnum' "extend quantity" | -
                (Read Sys$Pipe rec ; rec = F$element(2," ",F$Edit(Rec,"Compress,Trim")) ; define/nolog/job System_Report_Ext &rec)
$               Tmpes = F$Trnlnm("System_Report_Ext")
$               Deassign/Job System_Report_Ext
$       Else
$               Tmpes = f$getdvi("''NxDev'","volume_extend_quantity")
$       Endif
$!
$	TmpNum	 = TmpNum   + 1
$	TmpTMax  = TmpTMax  + TmpMax
$	TmpTFree = TmpTFree + TmpFree
$	TmpTUsed = TmpTUsed + TmpUsed
$	TmpTIO   = TmpTIO   + TmpIO
$!
$	Call	Fix1000 "''TmpMax'"  8 TmpMaxX
$	Call	Fix1000 "''TmpUsed'" 8 TmpUsedX
$	Call	Fix1000 "''TmpFree'" 8 TmpFreeX
$	Call	Fix1000 "''TmpIO'"   8 TmpIOX
$!
$	Wo	F$Fao("!12AS !16AS !20AS !3AS  !2AS !5SL  !7SL  !10AS !10AS !10AS !12AS !AS",  -
	    TmpDev, TmpLab, TmpTyp, TmpStr, TmpRo, Tmpcs, Tmpes, TmpMaxX, TmpUsedX, TmpFreeX, TmpIoX, TmpAdd)
$!
$	If (TmpAdd.eqs."")  Then $ TmpAdd = "&nbsp;"
$	Wo1 "''TR_Line'<td align=right><b><a title=""SHOW DEVICE/FULL ''TmpDev'"" href=""''Cluname'_CONFIGURATION_ADDINFO.HTML#APP_''AppNum'"">''Tmpdev'</a>"
$	Wo1 "<td>''Tmplab'<td align=right>&nbsp;''TmpTyp'"
$	Wo1 "<td align=right>&nbsp;''TmpStr'<td align=right>''TmpRo'<td align=right>''Tmpcs'<td align=right>''Tmpes'"
$	Wo1 "<td align=right>''TmpMaxX'<td align=right>''TmpUsedX'"
$	Wo1 "<td align=right>''TmpUsedPc'<td align=right>''TmpfreeX'<td align=right>''TmpfreePc'"
$	Wo1 "<td align=right>''TmpIOX'"
$	If (Addinfo_Header.nes."")  Then $ Wo1 "<td align=left>''TmpAdd'"
$	Goto Disk$_10
$   Else
$	TmpTFreePc   = TmpTFree*100/TmpTMax
$	TmpTUsedPc   = 100-TmpTFreePc
$	Call	Fix1000 "''TmpTMax'"  8 TmpTMaxX
$	Call	Fix1000 "''TmpTUsed'" 8 TmpTUsedX
$	Call	Fix1000 "''TmpTFree'" 8 TmpTFreeX
$	Call	Fix1000 "''TmpTIO'"   8 TmpTIOX
$	Wo1 "''TR_Line'<td>&nbsp;<td align=right><b>Totals:  # ''TmpNum'<td>&nbsp;<td>&nbsp;<td>&nbsp;<td>&nbsp;<td>&nbsp;"
$	Wo1 "<td align=right><b>''TmpTMaxX'<td align=right><b>''TmpTUsedX'<td align=right><b>''TmpTUsedPc'"
$	Wo1 "<td align=right><b>''TmpTfreeX'<td align=right><b>''TmpTfreePc'<td align=right><b>''TmpTIOX'"
$	If (Addinfo_Header.nes."")  Then $ Wo1 "<td>&nbsp;"
$	Wo  F$Fao("-----------------------------------------------------------------------------------------------------------------------------------------------------")
$	Wo  F$Fao("        Totals: #!3SL                                     !10AS !10AS !10AS !12AS",  -
			TmpNum, TmpTMaxX, TmpTUsedX, TmpTFreeX, TmpTIoX)
$   Endif
$   Wo1 "</table>"
$!
$   If ("''DFU_DIR'".eqs."")   Then $ Goto Fragmentation_End   ! DFU available?
$!
$   Wo	""
$   Wo	"  --- Fragmentation ---"
$   Wo	""
$   wo	"  Disk         Filefrag.   Spacefrag.  Most fragmented file"
$   Wo1	"<a name=""Disk-Information1""></a>"
$   Wo1	"<h2>Fragmentation</h2>"
$   wo1	"<table border=""2"">"
$   wo1	"''TR_Head'<td align=center><b>Disk<td align=center><b>Free<br>[%]<td align=center><b>File<br>Fragmentation<td align=center><b>Space<br>Fragmentation<td align=center><b>Most fragmented file</tr>"
$!   
$   Assign/NoLog 1 DFU$NOSMG    ! prevent DFU SMG mode
$!
$!__fragmentation report
$ GetVol:
$   Nx	= F$device("*","DISK",,17) - "_"
$   If (Nx.nes."")
$   Then
$	If .not. F$Getdvi("''Nx'","EXISTS")	    Then $ Goto GetVol
$	If .not. F$Getdvi("''Nx'","AVL")	    Then $ Goto GetVol
$	If .not. F$Getdvi("''Nx'","MNT")	    Then $ Goto GetVol
$	If	 F$Getdvi("''Nx'","SWL")	    Then $ Goto GetVol
$	If	 F$Getdvi("''Nx'","SHDW_MEMBER")    Then $ Goto GetVol
$	If	 F$Getdvi("''Nx'","VOLSETMEM")
$	Then
$	    If   (F$Getdvi("''Nx'","VOLNUMBER").ne.1) Then $ Goto GetVol
$	Endif
$!
$!______SW-Raid shadowsets are typically 6000 and higher, skip them
$	If (F$Extract(0,3,NX).eqs."DSA")
$	Then
$	    TmpNum  = Nx-"DSA"
$	    TmpNum  = F$Integer(TmpNum-":")
$	    If (TmpNum.ge.Shadow_Max_Unit)			    Then $ Goto GetVol
$	Endif
$!
$!______next disk found get data
$	Call Cleantmp$
$	Set Noon
$	Assign/User/NoLog 'TmpFile' SYS$OUTPUT
$	Assign/User/NoLog 'TmpFile' SYS$ERROR
$	MCR 'DFU_DIR'DFU REPORT 'Nx'
$	Set On
$!
$	Close/NoLog 'TmpLun'
$	Open/Read/Error=GetVol 'TmpLun' 'TmpFile'
$!
$	FileFrag    = "0"
$	SpaceFrag   = "0"
$	MostFile    = ""
$	PerFree	    = "0"
$!
$ GetVol_1:
$	Read/Error=GetVol/End=GetVol 'TmpLun' Record
$	Record	= F$Edit(Record,"Trim,Upcase,Compress")
$	If (Record.eqs."")  Then Goto Getvol_1
$!
$	Tmp = "FILE FRAGMENTATION INDEX"
$	If (F$Extract(0,F$Length(Tmp),Record).eqs.Tmp)
$	Then
$	    FileFrag	= F$Edit(F$Element(1,":",Record),"Trim,Compress")
$	    FileFragColor   = ""
$	    If (F$Locate("(EXCELLENT)",FileFrag).ne.F$Length(FileFrag))	Then $ Goto GetVol_1
$	    FileFragColor   = "bgcolor=yellow"
$	    If (F$Locate("(GOOD)",FileFrag).ne.F$Length(FileFrag))	Then $ Goto GetVol_1
$	    FileFragColor   = "bgcolor=orange"
$	    If (F$Locate("(FAIR)",FileFrag).ne.F$Length(FileFrag))	Then $ Goto GetVol_1
$	    FileFragColor   = "bgcolor=red"
$	    Goto GetVol_1
$	Endif
$!
$	Tmp = "MOST FRAGMENTED FILE"
$	If (F$Extract(0,F$Length(Tmp),Record).eqs.Tmp)
$	Then
$	    Read/End=GetVol/Error=GetVol 'TmpLun' Record
$	    MostFile	= F$Edit(Record,"Trim,Compress")-Nx ! skip disk
$	    Goto GetVol_1
$	Endif
$!
$	Tmp = "PERCENTAGE FREE"
$	If (F$Extract(0,F$Length(Tmp),Record).eqs.Tmp)
$	Then
$	    PerFree	= F$Edit(F$Element(1,":",Record),"Trim,Compress")
$	    PerFreeColor= ""
$	    If (PerFree.lt.10)	Then $ PerFreeColor = "bgcolor=yellow"
$	    If (PerFree.lt.5)	Then $ PerFreeColor = "bgcolor=orange"
$	    If (PerFree.lt.2)	Then $ PerFreeColor = "bgcolor=red"
$	    Goto GetVol_1
$	Endif
$!
$	Tmp = "FREE SPACE FRAGMENTATION INDEX"
$	If (F$Extract(0,F$Length(Tmp),Record).eqs.Tmp)
$	Then
$	    SpaceFrag	= F$Edit(F$Element(1,":",Record),"Trim,Compress")
$	    SpaceFragColor   = ""
$	    If (F$Locate("(EXCELLENT)",SpaceFrag).ne.F$Length(SpaceFrag)) Then $ Goto GetVol_10
$	    SpaceFragColor   = "bgcolor=yellow"
$	    If (F$Locate("(GOOD)",SpaceFrag).ne.F$Length(SpaceFrag))	Then $ Goto GetVol_10
$	    SpaceFragColor   = "bgcolor=orange"
$	    If (F$Locate("(FAIR)",SpaceFrag).ne.F$Length(SpaceFrag))	Then $ Goto GetVol_10
$	    SpaceFragColor   = "bgcolor=red"
$ GetVol_10:
$	    Wo  F$Fao("!12AS !12AS !12AS !64AS", Nx, FileFrag, SpaceFrag, MostFile)
$	    Wo1 "''Tr_Line'<td align=right><b>''Nx'<td ''PerFreeColor' align=right>''PerFree'<td ''FileFragColor'>''FileFrag'<td ''SpaceFragColor'>''SpaceFrag'<td>''MostFile'</tr>"
$	    Goto GetVol
$	Endif
$!
$	Goto GetVol_1
$!
$   Endif
$!
$   Wo1 "</table>"
$!
$ Fragmentation_End:
$   Call Cleantmp$
$!
$!__shadowset info, if shadowing activated
$   Wo  ""
$   Wo  "  --- Shadowsets ---"
$   Wo  ""
$   Wo1	"<a name=""Disk-Information2""></a>"
$   Wo1 "<h2>Shadowsets</h2>"
$!
$   If F$Getsyi("SHADOWING") .gt. 0
$   Then
$	Set Noon
$!
$	Wo  F$Fao ("   Shadwowset     Label    Members")
$	Wo1 "<table border=2>''TR_Head'<td align=center><b>Shadowset<td align=center><b>Label<td align=center><b>Members</tr>"
$ Disks$_Shad1:
$	Nx  = F$Device("_DSA*","DISK")
$	If (Nx.nes."")
$	Then
$	    If .not. F$Getdvi("''Nx'","EXISTS")	Then $ Goto Disks$_Shad1
$	    If .not. F$Getdvi("''Nx'","AVL")	Then $ Goto Disks$_Shad1
$	    If .not. F$Getdvi("''Nx'","MNT")	Then $ Goto Disks$_Shad1
$!
$	    Diskspec	= "''NX'"
$	    Gosub   Get_DiskInfo
$	    Wo	F$Fao("!16AS !16AS !AS","''DiskName'","''VolName'","''Shadowmembers_Plus'")
$	    Wo1	"''TR_Line'<td align=right><b>''DiskName'<td>''VolName'<td>''Shadowmembers_Plus_Html'"
$!
$	    Goto Disks$_Shad1
$	Endif
$	Wo1 "</table>"
$!
$	Assign/User/NoLog 'TmpFile' Sys$Output
$	Assign/User/NoLog 'TmpFile' Sys$Error
$	Show Shadow /By
$	If ($Severity.eqs."1")	! older version do not support this qualifier
$	Then
$	    Wo ""
$	    Wo1 "<p>"	    
$	    Wo1 "''Pre_Start'"
$	    Call    Transfer$ 'TmpFile'
$	    Wo1 "</pre>"
$	    Call Cleantmp$
$	Endif
$!
$   Else
$	Wo  F$Fao("!_No Shadowsets defined!!!/")
$	Wo1 "<table border=2>''TR_Head'<td align=center><b>Shadowset<td align=center><b>Label<td align=center><b>Members</tr>"
$	Wo1 "''TR_Line'<td colspan=3><b>No Shadowsets defined!</b><br>"
$	Wo1 "</table>"
$   Endif
$!
$   Set On
$!
$!__RAID sets, if available
$   Wo	F$Fao("!/ --- Raidsets ---!/")
$   Wo1	"<a name=""Disk-Information3""></a>"
$   Wo1 "<h2>Raidsets</h2>"
$!   
$   FoundRaid	= "F"
$   If (F$GetDvi("DPA0:","EXISTS"))
$   Then
$ Disks$_Raid1:
$	Nx  = F$Device("_DPA*","DISK")
$	If (Nx.nes."")
$	Then
$	    If (Nx.eqs."_DPA0:")	Then $ Goto Disks$_Raid1
$!
$	    VolNam  = F$Getdvi("''NX'","VOLNAM")
$	    VolnamL = F$Length(Volnam)
$	    Voltype = F$Getdvi("''NX'","DEVICE_TYPE_NAME")
$	    If ("''Volnam'".eqs."")	Then $ Goto Disks$_Raid1	! something wrong with raid device?
$!
$	    If (.not. FoundRaid)
$	    Then
$		Wo  "  Raidset       Type     Label             State   Members"	    
$		Wo  "-----------------------------------------------------------------------------------"
$		Wo1 "<table border=2>''TR_Head'<td align=center><b>Raidset<td align=center><b>Type<td align=center><b>Label<td align=center><b>State<td align=center><b>Members"
$		FoundRaid   = "T"
$	    Endif
$!
$!__________get RAID data, brief for HTML report
$	    Set Noon
$	    RAID SHOW 'Volnam' /Brief /Output='TmpFile'
$	    Set On
$!__________and FULL for appendix
$	    AppNum  = AppNum + 1
$	    AppTxt_'AppNum' = "RAID SHOW ''Volnam' (''Nx')"
$	    Set Noon
$	    RAID SHOW 'Volnam' /FULL /Output='AppFile''AppNum'
$	    Set On
$!
$	    Close/NoLog 'TmpLun'
$	    Open/Read/Error=Disks$_Raid1 'TmpLun' 'TmpFile'
$ Disks$_Raid5:
$	    Read/Error=Disks$_Raid1/End=Disks$_Raid1 'Tmplun' Record
$	    Record  = F$Edit(Record,"Trim,Upcase,Compress,UnComment")
$	    If (F$Extract(0,VolnamL,Record).nes.Volnam)	Then $ Goto Disks$_Raid5
$	    Close/NoLog 'TmpLun'
$!
$	    VolState = F$ELement(1," ",Record)
$	    Volmem   = F$ELement(2," ",Record)
$!
$!__________split Volmem in multiple lines
$	    Volmem1	= ""
$	    Ic1 = -1    ! element index
$	    Ic2 = 0	    ! tmp. string length
$ Disks$_Raid8:
$	    Ic1 = Ic1 + 1
$	    Nxx = F$Element(Ic1,",",Volmem)
$	    If (Nxx.nes."").and.(Nxx.nes.",")
$	    Then
$		If (F$Extract(0,3,Nxx).eqs."DSA") 
$		Then 
$		    Volmem1 = Volmem1 + "<b>''Nxx'</b>:"
$		Else
$		    Volmem1 = Volmem1 + Nxx + ","
$		Endif
$		Ic2	= Ic2 + F$Length(Nxx) + 1
$		If (Ic2.gt.65)
$		Then
$		    Ic2 = 0
$		    Volmem1	= Volmem1 + "<br>"
$		Endif
$		Goto Disks$_Raid8
$	    Endif
$	    If (F$extract(F$Length(Volmem1)-4,4,Volmem1).eqs."<br>")	Then $ Volmem1 = F$Extract(0,F$Length(Volmem1)-4,Volmem1)
$	    If (F$extract(F$Length(Volmem1)-1,1,Volmem1).eqs.",")	Then $ Volmem1 = F$Extract(0,F$Length(Volmem1)-1,Volmem1)
$!	    
$	    Wo	F$Fao("!15AS !8AS !16AS !8AS !AS", Nx, Voltype, Volnam, VolState, Volmem)
$	    Wo1 "''TR_Line'<td align=right><a title=""SHOW/FULL"" href=""''Cluname'_CONFIGURATION_ADDINFO.HTML#APP_''AppNum'"">''NX'</a>"
$	    Wo1 "<td>''VolType'<td>''Volnam'<td>''VolState'"
$	    Wo1 "<td>''Volmem1'"
$	    Goto Disks$_Raid1
$	Endif
$	If (.not. FoundRaid)
$	Then
$	    Wo  F$Fao("!_No Raidsets defined!!!/")
$	    Wo1 "<table border=2>''TR_Head'<td align=center><b>Raidset<td align=center><b>Type<td align=center><b>Label<td align=center><b>State<td align=center><b>Members"
$	    Wo1 "''TR_Line'<td colspan=5><b>No Raidsets defined!</b></br>"
$	Endif
$   Else
$	Wo  F$Fao("!_No Raidsets defined!!!/")
$	Wo1 "<table border=2>''TR_Head'<td align=center><b>Raidset<td align=center><b>Type<td align=center><b>Label<td align=center><b>State<td align=center><b>Members"
$	Wo1 "''TR_Line'<td colspan=5><b>No Raidsets defined!</b></br>"
$   Endif
$   Wo	""
$   Wo1 "</table>"
$!
$!__VOLUME sets, if available
$   Wo	F$Fao("!/ --- Volumesets ---!/")
$   Wo1	"<a name=""Disk-Information4""></a>"
$   Wo1 "<h2>Volumesets</h2>"
$   FoundVol	= "F"
$!
$ Disks$_Vol1:
$   Nx	= F$device("*","DISK",,17) - "_"
$   If (Nx.nes."")
$   Then
$	If .not. F$Getdvi("''Nx'","EXISTS")	    Then $ Goto Disks$_Vol1
$	If .not. F$Getdvi("''Nx'","AVL")	    Then $ Goto Disks$_Vol1
$	If .not. F$Getdvi("''Nx'","MNT")	    Then $ Goto Disks$_Vol1
$	If	 F$Getdvi("''Nx'","SWL")	    Then $ Goto Disks$_Vol1
$	If	 F$Getdvi("''Nx'","SHDW_MEMBER")    Then $ Goto Disks$_Vol1
$	If .not. F$Getdvi("''Nx'","VOLSETMEM")	    Then $ Goto Disks$_Vol1
$	If (F$Getdvi("''Nx'","VOLNUMBER").ne.1)	    Then $ Goto Disks$_Vol1
$!
$!______found member #1 of a volume set, get other members
$	Call Cleantmp$
$	Show Device 'Nx' /Full /Output='TmpFile'
$	Open/Read/Error=Disks$_Vol1 'Tmplun' 'Tmpfile'
$ Disks$_Vol5:
$	Read/End=Disks$_Vol1/Error=Disks$_Vol1 'TmpLun' Record
$	Record	= F$Edit(Record,"Trim,Upcase,Compress,UnComment")
$	If (F$Locate("MEMBERS OF THIS VOLUME SET ARE",Record).ne.F$Length(Record))
$	Then
$	    If (.not.FoundVol)	! output header?
$	    Then
$		Wo  "  Master Volume     Label     Additional Members"
$		Wo1 "<table border=2>''TR_Head'<td align=center><b>Master Volume<td align=center><b>Label<td align=center colspan=2><b>Additional Members</tr>"
$		FoundVol    = "T"
$	    Endif
$	    Ic	= 0
$	    FirstLine	= "T"
$ Disks$_Vol9:
$	    Ic	= Ic + 1
$	    Tmp	= F$Element(Ic,",",Record)
$	    If (Tmp.nes."") .and. (Tmp.nes.",")
$	    Then
$		Tmp = F$Edit(F$Element(0,"(",Tmp),"Trim,Collapse")
$		If (Ic.eq.1) .and. (Firstline)
$		Then
$		    MasVol  = F$Getdvi("''Nx'","VOLNAM")
$		    MemVol  = F$Getdvi("''Tmp'","VOLNAM")
$		    Wo	F$Fao("!16AS !16AS !16AS !16AS", Nx, Masvol, Tmp, MemVol)
$		    Wo1	"''TR_Line'<td align=right><b>''Nx'<td>''Masvol'<td align=right><b>''Tmp'<td>''MemVol'"
$		Else
$		    MemVol  = F$Getdvi("''Tmp'","VOLNAM")
$		    Wo	F$Fao("!16AS !16AS !16AS !16AS", "", "", Tmp, MemVol)
$		    Wo1	"''TR_Line'<td>&nbsp;<td>&nbsp;<td align=right><b>''Tmp'<td>''MemVol'"
$		Endif
$		Goto Disks$_Vol9
$	    Else
$		Read/End=Disks$_Vol1/Error=Disks$_Vol1 'TmpLun' Record	! read follow on lines
$		Record	= F$Edit(Record,"Trim,Upcase,Compress,UnComment")
$		If (Record.eqs."")  Then $ Goto	Disks$_Vol1
$		Ic  = -1
$		FirstLine   = "F"
$		Goto Disks$_Vol9
$	    Endif
$	Else
$	    Goto Disks$_Vol5
$	Endif
$!
$   Endif
$!
$   If (.not.FoundVol)
$   Then
$	Wo  "  No Volumesets defined!"
$	Wo1 "<table border=2>''TR_Head'<td align=center><b>Master Volume<td align=center><b>Label<td align=center colspan=2><b>Additional Members</tr>"
$	Wo1 "''TR_Line'<td colspan=3><b>No Volumesets defined!</b></br>"
$   Endif
$   Wo1 "</table><br>"
$!
$   Call Cleantmp$
$   Return   
$!
$!  ===============================================
$!__T R A N S F E R
$!  Add a tmpfile to report using APPEND (needs the same file org.!)
$!  P1: File to use
$!  ===============================================
$!
$ Transfer$: Subroutine
$!
$   Append 'P1' 'Outlun'
$   Append 'P1' 'Outlun1'
$   Exit 
$   EndSubroutine
$!
$!  ===============================================
$!__N E T W O R K
$!  Gets network infos
$!  ===============================================
$!
$ Network$:
$!
$   Call Message$   NETWORKINFO I "Getting network infos"
$   Call PutHeader$ "Network Information" "Network-Information"
$!
$   Header1  = "Nodename DECnet-Version   -Address    IP-Version      -Address      -Netmask         -Gateway"
$   Header2  = "----------------------------------------------------------------------------------------------"
$!
$   Wo	Header1
$   Wo	Header2
$!
$   Wo1 "<table border=""2"">"
$   Wo1 "''TR_Head'<td align=center><b>Nodename<td align=center><b>DECnet-Vers.<td align=center><b>DECnet-Address<td align=center><b>IP-Version<td align=center><b>IP-Address<td align=center><b>IP-Netmask<td align=center><b>IP-Gateway"
$!
$   Line_Written    = "F"   ! flag dataline written in case of another TCPIP stack
$   If (F$Search("SYS$SYSTEM:TCPIP$UCP.EXE").eqs."")	Then $ Call Message$ NOTCPIP W "Currently only HP TCPIP Services are supported"
$!   
$!__create commandfile for SYSMAN
$   Call    CleanTmp$
$   Open/Write/Error=Execution_Error 'TmpLun' 'TmpFile'	! SYSMAN commandfile
$   Write 'TmpLun'  "$ Set Noon"
$   Write 'TmpLun'  "$ Assign/NoLog/User_Mode NL: Sysmanini"
$   Write 'TmpLun'  "$ Mcr Sysman"
$   Write 'TmpLun'  "Set Environment /Cluster"
$   Write 'TmpLun'  "Do @''Tmpfile2'"
$   Close/NoLog 'TmpLun'
$!
$   Open/Write/Error=Execution_Error 'TmpLun2' 'TmpFile2'	! SYSMAN commandfile
$   Write 'TmpLun2'  "$Set Noon"
$   Write 'TmpLun2'  "$Mcr Ncp Show Executor"
$   Write 'TmpLun2'  "$If (F$Search(""SYS$SYSTEM:NCL.EXE"").nes."""") Then $ Mcr Ncl Show Implementation"
$   Write 'TmpLun2'  "$If (F$Search(""SYS$SYSTEM:TCPIP$UCP.EXE"").nes."""")"
$   Write 'TmpLun2'  "$Then
$   Write 'TmpLun2'  "$ Ucx Show Version"
$   Write 'TmpLun2'  "$ If (F$Search(""TCPIP$ROUTE"").nes."""")		Then $ Ucx Show Route/Default"
$   Write 'TmpLun2'  "$ If (F$Search(""TCPIP$CONFIGURATION"").nes."""") Then $ Ucx Show Interface"
$   Write 'TmpLun2'  "$ If (F$Search(""TCPIP$SERVICE"").nes."""")	Then $ Ucx Show Service"
$   Write 'TmpLun2'  "$Endif
$   Close/NoLog 'TmpLun2'
$!
$   Set Noon
$   @'TmpFile'/Output='TmpFile1'
$   Set On
$!
$!__scan output file
$   Open/Read 'TmpLun1' 'Tmpfile1'
$!
$!__look for execution start on next node
$ Network$1:
$   Read/End=Network$End/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$!
$!__new node?
$   If (F$Extract(0,17,Rec).eqs."%SYSMAN-I-OUTPUT,")
$   Then
$	NodeName    = F$Element(5," ",Rec)
$   Else
$	Goto Network$1
$   Endif
$!
$!__look for decnet executor line, presume Phase IV
$   Phase   = "IV:"
$ Network$2:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Collapse,Upcase,UnComment")
$   If (F$Extract(0,12,Rec).nes."EXECUTORNODE")	Then $ Goto Network$2
$   DECnet_Address  = F$Element(0,"(",F$Element(1,"=",Rec))
$!
$!__look for decnet version
$ Network$3:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$   If (F$Extract(0,14,Rec).nes."IDENTIFICATION")	Then $ Goto Network$3
$   If (F$Element(2," ",Rec).nes."DECNET-OSI")
$   Then
$	DECnet_Version  = F$Element(3," ",Rec)
$   Endif
$!
$!__look for DECNet V version
$ Network$31:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= Rec -""""-""""_""""_""""_""""_""""_""""_""""	! contains some "
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$   If (F$Locate("TCP/IP",Rec).ne.F$Length(Rec))				Then $ Goto Network$41	! found IP -> no Phase V
$   If (F$Locate("DECNET-PLUS FOR OPENVMS",Rec).eq.F$Length(Rec))		Then $ Goto Network$31
$!__since to 7.2 the version string has changed
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= Rec -""""-""""_""""_""""_""""_""""_""""_""""	! contains some "
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$   If (F$Locate("DECNET",Rec).ne. F$Length(Rec))
$   Then
$	DECnet_Version  = F$Element(6," ",Rec)
$   Else
$	DECnet_Version  = F$Element(2," ",Rec)
$	DECnet_Eco	= F$Element(3," ",Rec)
$	If (F$Locate("ECO",DECnet_Eco).ne.F$Length(DECnet_Eco))	Then $ DECnet_Version = DECnet_Version + " " + DECnet_Eco
$   Endif
$   Phase   = " V:"
$!
$!__look for TCPIP version
$ Network$4:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$   If (F$Locate("TCP/IP",Rec).eq.F$Length(Rec))	Then $ Goto Network$4
$ Network$41:
$   IP_Version  = F$Extract(F$Locate("VERSION",Rec)+8,12,Rec)
$!
$!__look for gateway 1st
$ Network$8:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$   If (F$Locate("0.0.0.0",Rec).eq.F$Length(Rec))	Then $ Goto Network$8
$   IP_Gateway	= f$Element(2, " ", Rec)
$!
$!__look for TCPIP interfaces
$ Network$5:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$   If (F$Locate("INTERFACE IP",Rec).eq.F$Length(Rec))	Then $ Goto Network$5
$!
$!__headerline found, now read interfaces
$   O_Flag  = "F"   ! flag 1st outputline for multiple TCPIP interfaces
$ Network$6:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   Rec	= F$Edit(Rec,"Trim,Compress,Upcase,UnComment")
$   If (Rec.eqs."") Then $ Goto Network$6
$   If (F$Locate("SERVICE PORT PROTO",Rec).ne.F$Length(Rec))	Then $ Goto Network$9
$   IP_Interface    = F$element(0," ",Rec)  
$   If (F$Extract(0,2,IP_Interface).eqs."LO")	Then $ Goto Network$6	! no local interfaces
$!
$   IP_Address = F$Edit(F$Element(1," ",Rec), "Collapse")
$   IP_Netmask = F$Edit(F$Element(2," ",Rec), "Collapse")
$   If (IP_Address.eqs."") .or. (IP_Netmask.eqs."") Then $ Goto Network$6
$!
$   If (O_Flag)
$   Then
$	Wo  F$Fao("!6AS   !17AS !8AS !12AS !15AS !15AS !15AS", "", "", "", "", IP_Address, IP_Netmask, IP_Gateway)
$	Wo1 "''TR_Line'<td> <td> <td> <td> <td align=""right"">''IP_Address'<td align=""right"">''IP_Netmask'<td align=""right"">''IP_Gateway'"
$   Else
$	Appnum  = Appnum + 1
$	AppTxt_'Appnum' = "''Nodename' $ TCPIP SHOW SERVICE"
$	Wo  F$Fao("!6AS   !17AS !8AS !12AS !15AS !15AS !15AS", Nodename, Phase+DECnet_Version, DECnet_Address, IP_Version, IP_Address, IP_Netmask, IP_Gateway)
$	Wo1 "''TR_Line'<td align=""center""><b><a title=""TCPIP SHOW SERVICE"" href=""''Cluname'_CONFIGURATION_ADDINFO.HTML#APP_''AppNum'"">''Nodename'</a>"
$	Wo1 "<td>''Phase'''DECnet_Version'<td align=""right"">''DECnet_Address'<td align=""right"">''IP_Version'<td align=""right"">''IP_Address'<td align=""right"">''IP_Netmask'<td align=""right"">''IP_Gateway'"
$	O_Flag	= "T"
$   Endif
$   Line_Written    = "T"
$   Goto Network$6  ! more interfaces?
$!
$!__get service and create addinfo file
$ Network$9:
$!__transfer data
$   Close/NoLog 'Tmplun2'
$   Open/Write/Error=Network$10 'Tmplun2' 'Appfile''Appnum'
$ Network$91:
$   Read/End=Network$10/Error=Execution_Error 'TmpLun1' Rec
$   If (F$Extract(0,17,Rec).eqs."%SYSMAN-I-OUTPUT,")	! next node coming?
$   Then
$	Close/NoLog 'Tmplun2'
$	NodeName    = F$Element(5," ",Rec)
$	Phase   = "IV:"
$	If (.not. Line_Written)
$	Then
$	    Wo  F$Fao("!6AS   !17AS !8AS !12AS !15AS !15AS !15AS", Nodename, "''Phase'"+"''DECnet_Version'", "''DECnet_Address'", "''IP_Version'", "''IP_Address'", "''IP_Netmask'", "''IP_Gateway'")
$	    Wo1 "''TR_Line'<td align=""center""><b><a title=""TCPIP SHOW SERVICE"" href=""''Cluname'_CONFIGURATION_ADDINFO.HTML#APP_''AppNum'"">''Nodename'</a>"
$	    Wo1 "<td>''Phase'''DECnet_Version'<td align=""right"">''DECnet_Address'<td align=""right"">''IP_Version'<td align=""right"">''IP_Address'<td align=""right"">''IP_Netmask'<td align=""right"">''IP_Gateway'"
$	Endif
$	Line_Written	= "F"
$	Goto Network$2
$   Endif
$   Write/Error=Network$10 'Tmplun2' Rec
$   Goto Network$91
$!
$ Network$10:
$   If (.not. Line_Written)
$   Then
$	Wo  F$Fao("!6AS   !17AS !8AS !12AS !15AS !15AS !15AS", Nodename, "''Phase'"+"''DECnet_Version'", "''DECnet_Address'", "''IP_Version'", "''IP_Address'", "''IP_Netmask'", "''IP_Gateway'")
$	Wo1 "''TR_Line'<td align=""center""><b><a title=""TCPIP SHOW SERVICE"" href=""''Cluname'_CONFIGURATION_ADDINFO.HTML#APP_''AppNum'"">''Nodename'</a>"
$	Wo1 "<td>''Phase'''DECnet_Version'<td align=""right"">''DECnet_Address'<td align=""right"">''IP_Version'<td align=""right"">''IP_Address'<td align=""right"">''IP_Netmask'<td align=""right"">''IP_Gateway'"
$   Endif
$   Line_Written    = "F"
$   Close/NoLog 'Tmplun2'
$   Goto Network$1
$!
$ Network$End:
$   Wo1 "</table>"
$   Return
$!
$!  ===============================================
$!__Q U E U E S
$!  Gets network infos
$!  ===============================================
$!
$ Queues$:
$!
$   Call Message$   QUEUEINFO I "Getting queue infos"
$   Call PutHeader$ "Queue Information" "Queue-Definiton"
$!
$!__1st display all queue definitions
$   If (.not.DO_QUEUES_Defs)	Then $ Goto Queues$_10
$!
$   Wo  ""
$   Wo  "  --- Batch Definitions ---"
$   Wo  ""
$   Wo	"  No. Description                     Nodes                  State Mode Flags"
$   Wo	"-----------------------------------------------------------------------------"
$   Wo1	"<h2>Batch Definitions</h2>"
$   Wo1 "<table border=""2"">"
$   Wo1	"''TR_Head'<td align=center><b>No.<td align=center><b>Description<td align=center><b>Nodes<td align=center><b>State<td align=center><b>Mode<td align=center><b>Flags"
$   Call    QueueInfo$ BAT_BAT_ No
$   Wo1	"</table>"
$!
$   Wo  ""
$   Wo  "  --- Printer Definitions ---"
$   Wo  ""
$   Wo	"  No. Description                     Device  Nodes            State Mode Flags"
$   Wo	"-------------------------------------------------------------------------------"
$   Wo1	"<h2>Printer Definitions</h2>"
$   Wo1 "<table border=""2"">"
$   Wo1	"''TR_Head'<td align=center><b>No.<td align=center><b>Description<td align=center><b>Device<td align=center><b>Nodes<td align=center><b>State<td align=center><b>Mode<td align=center><b>Flags"
$   Call    QueueInfo$ PRT_PRT_ Yes
$   Wo1	"</table>"
$!
$   Wo  ""
$   Wo  "  --- Punch Definitions ---"
$   Wo  ""
$   Wo	"  No. Description                     Device  Nodes            State Mode Flags"
$   Wo	"-------------------------------------------------------------------------------"
$   Wo1	"<h2>Punch Definitions</h2>"
$   Wo1 "<table border=""2"">"
$   Wo1	"''TR_head'<td align=center><b>No.<td align=center><b>Description<td align=center><b>Device<td align=center><b>Nodes<td align=center><b>State<td align=center><b>Mode<td align=center><b>Flags"
$   Call    QueueInfo$ PUN_PUN_ Yes
$   Wo1	"</table>"
$!
$!__display real queues using F$GETQUI
$ Queues$_10:
$!
$   Wo  ""
$   Wo  "  --- Generic Queues ---"
$   Wo  ""
$   Wo	"           Name                  Description          Targets"
$   Wo	"----------------------------------------------------------------------------------------"
$   Wo1	"<a name=""Queue-Generic""></a>"
$   Wo1	"<h2>Generic Queues</h2>"
$   Wo1 "<table border=""2"">"
$   Wo1	"''TR_Head'<td align=center><b>Name<td align=center><b>Description<td align=center><b>Targets"
$   Call    GETQUI_GENERIC$
$   Wo1	"</table>"
$!
$   Wo  ""
$   Wo  "  --- Batchqueues ---"
$   Wo  ""
$   Wo	"               Name              Description              Autostart           Jobs  Prio          CPUdef          CPUmax"
$   Wo	"-----------------------------------------------------------------------------------------------------------------------------"
$   Wo1	"<a name=""Queue-Batch""></a>"
$   Wo1	"<h2>Batchqueues</h2>"
$   Wo1 "<table border=""2"">"
$   Wo1	"''TR_Head'<td align=center><b>Name<td align=center><b>Description<td align=center><b>Autostart<td align=center><b>Jobs<td align=center><b>Prio<td align=center><b>CPUdefault<td align=center><b>CPUmax"
$   Call    GETQUI_BATCH$
$   Wo1	"</table>"
$!
$   Wo  ""
$   Wo  "  --- Symbiontqueues ---"
$   Wo  ""
$   Wo1	"<a name=""Queue-Symbiont""></a>"
$   Wo1	"<h2>Symbiontqueues</h2>"
$   Wo1 "<table border=""2"">"
$   Call    GETQUI_SMB$
$   Wo1	"</table>"
$!
$   Return
$!
$!  ===============================================
$!__L A T
$!  Gets infos on LAT
$!  ===============================================
$!
$ Lat$:
$!
$   Call Message$   LATINFO I "Getting LAT infos"
$   Call PutHeader$ "LAT Information" "LAT-Information"
$!
$   Wo	F$Fao("  System      Status     Identification")
$   Wo	F$Fao("--------------------------------------------------------")
$   Wo1	"<table border=2>"
$   Wo1	"''TR_Head'<td align=center><b>System<td align=center><b>Status<td align=center><b>Identification"
$!
$   Ic	= 0
$ Lat$_Loop1:
$   Ic	= Ic + 1
$   If (Ic.le.Node_Num)
$   Then
$	Cpu_Nam = Node_'Ic'
$!
$!______create tmpfile
$	Call Cleantmp$
$	Open/Write/Error=Execution_Error 'TmpLun' 'TmpFile'
$	Write/Error=Execution_Error 'TmpLun' "$ Set Noon"
$	Write/Error=Execution_Error 'TmpLun' "$ Assign/NoLog/User_Mode NL: Sysmanini"
$	Write/Error=Execution_Error 'TmpLun' "$ Mcr Sysman"
$	Write/Error=Execution_Error 'TmpLun' "Set Environment/Node=''Cpu_Nam'"
$	Write/Error=Execution_Error 'TmpLun' "Do Pipe Mcr Latcp Show Node /Brief  > ''TmpFile1'"
$	Write/Error=Execution_Error 'TmpLun' "Do Pipe Mcr Latcp Show Node  > ''TmpFile2'"
$	Write/Error=Execution_Error 'TmpLun' "Do Pipe Mcr Latcp Show Node /Status > ''TmpFile3'"
$	Write/Error=Execution_Error 'TmpLun' "Do Pipe Mcr Latcp Show Ports > ''TmpFile4'"
$	Close/NoLog 'TmpLun'
$	Set Noon
$	@'TmpFile'/Output=NL:
$	Set On
$	Close/NoLog 'Tmplun1'
$	Open/Read/Error=LAT$_Loop1 'Tmplun1' 'Tmpfile1'
$ LAT$1:
$	Read/End=LAT$_Loop1 /Error=LAT$_Loop1  'TmpLun1' Record
$	If (F$Edit(Record,"Collapse,Trim").eqs."")  Then $ Goto LAT$1
$	If (F$Extract(0,5,Record).nes."-----")	Then $ Goto LAT$1	! next line is data line
$!
$	Read/End=LAT$_Loop1 /Error=LAT$_Loop1  'TmpLun1' Record
$	Close/NoLog 'Tmplun1'
$!
$	TmpNode	= F$Edit(F$Extract( 0,15,Record),"TRIM,UPCASE,COLLAPSE")
$	TmpStat	= F$Edit(F$Extract(21,10,Record),"TRIM,UPCASE,COLLAPSE")
$	TmpIdent= F$Extract(36,40,Record)
$	Wo  F$Fao("!15AS !10AS !40AS", TmpNode, TmpStat, TmpIdent)
$!
$	If (TmpStat.eqs."ON")	! if ON add port... infos
$	Then
$	    AppNum  = Appnum + 1
$	    Wo1 "''TR_Line'<td align=right><b>"
$	    Wo1 "<a title=""More information"" href=""''Cluname'_CONFIGURATION_ADDINFO.HTML#APP_''AppNum'"">''TmpNode'</a>"
$	    Wo1 "<td align=right>''TmpStat'<td align=right>''TmpIdent'"
$	    AppTxt_'AppNum' = "''Tmpnode' $ MCR LATCP SHOW NODE | SHOW NODE /STATUS | SHOW PORTS"
$	    Copy 'Tmpfile2'+'Tmpfile3'+'Tmpfile4' 'Appfile''Appnum'
$	Else
$	    Wo1 "''TR_Line'<td align=right><b>''TmpNode'<td align=right>''TmpStat'<td align=right>''TmpIdent'"
$	Endif
$	Goto lat$_Loop1
$   Endif
$!
$   Wo  ""
$   Wo1 "</Table>"
$   Return
$!
$!  ===============================================
$!__G E T Q U I _ G E N E R I C
$!  Get queueinfo on generic queues
$!  ===============================================
$!
$ Getqui_Generic$: Subroutine
$   Tmp	= F$Getqui("Cancel_Operation")	! no leftovers
$!
$ Getqui_Generic$1:
$   Queue   = F$GetQui("Display_Queue","Queue_Name","*","GENERIC,WILDCARD")
$   If (Queue.nes."")
$   Then
$	Targets	= F$GetQui("Display_Queue", "Generic_Target",   "*", "WILDCARD,FREEZE_CONTEXT")
$	Desc	= F$GetQui("Display_Queue", "Queue_Description","*", "WILDCARD,FREEZE_CONTEXT")
$	Wo  F$Fao("!32AS !20AS !AS", Queue, Desc, Targets)
$	Wo1 "''TR_Line'<td align=right><b>''Queue'<td>&nbsp;''Desc'<td>''Targets'"
$	Goto Getqui_Generic$1
$   Endif
$!
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__G E T Q U I _ B A T C H
$!  Get queueinfo on batchqueues
$!  ===============================================
$!
$ Getqui_Batch$: Subroutine
$   Tmp	= F$Getqui("Cancel_Operation")	! no leftovers
$!
$ Getqui_Batch$1:
$   Queue   = F$GetQui("Display_Queue","Queue_Name","*","BATCH,WILDCARD")
$   If (Queue.nes."")
$   Then
$	Autostart   = F$GetQui("Display_Queue", "Autostart_On",      "*", "WILDCARD,FREEZE_CONTEXT")-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"-"::"
$	Prio	    = F$GetQui("Display_Queue", "Base_Priority",     "*", "WILDCARD,FREEZE_CONTEXT")
$	Joblimit    = F$GetQui("Display_Queue", "JOB_Limit",         "*", "WILDCARD,FREEZE_CONTEXT")
$	CPUdef	    = F$GetQui("Display_Queue", "CPU_Default",       "*", "WILDCARD,FREEZE_CONTEXT")
$	CPUmax	    = F$GetQui("Display_Queue", "CPU_Limit",         "*", "WILDCARD,FREEZE_CONTEXT")
$	Desc	    = F$GetQui("Display_Queue", "Queue_Description", "*", "WILDCARD,FREEZE_CONTEXT")
$	Wo  F$Fao("!32AS !25AS !20AS !3AS !6AS !16AS !16AS", Queue, Desc, Autostart, "''Joblimit'", "''Prio'", "''CPUdef'", "''CPUmax'")
$	Wo1 "''TR_Line'<td align=right><b>''Queue'<td>&nbsp;''Desc'<td>&nbsp;''Autostart'<td align=right>&nbsp;''Joblimit'<td align=right>&nbsp;''Prio'<td>&nbsp;''CPUdef'<td>&nbsp;''CPUmax'"
$!
$	Goto Getqui_Batch$1
$   Endif
$!
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__G E T Q U I _ S M B
$!  Get queueinfo on symbiont queues
$!  ===============================================
$!
$ Getqui_SMB$: Subroutine
$   Tmp	= F$Getqui("Cancel_Operation")	! no leftovers
$!
$ Getqui_SMB$1:
$   Queue   = F$GetQui("Display_Queue","Queue_Name","*","SYMBIONT,WILDCARD")
$   If (Queue.nes."")
$   Then
$	Autostart   = F$GetQui("Display_Queue","Autostart_On",          "*", "WILDCARD,FREEZE_CONTEXT")-""""-""""-""""-""""-""""-""""-""""
$	Desc	    = F$GetQui("Display_Queue","Queue_Description",     "*", "WILDCARD,FREEZE_CONTEXT")
$	Proc	    = F$GetQui("Display_Queue","Processor",             "*", "WILDCARD,FREEZE_CONTEXT")
$	Dev 	    = F$GetQui("Display_Queue","Device_Name",           "*", "WILDCARD,FREEZE_CONTEXT")-""""-""""-""""-""""-""""-""""-""""
$	DefForm	    = F$GetQui("Display_Queue","Default_Form_Name",     "*", "WILDCARD,FREEZE_CONTEXT")
$	Lib	    = F$GetQui("Display_Queue","Library_Specification", "*", "WILDCARD,FREEZE_CONTEXT")
$!
$!______check for DCPS$ and try to translate
$	If (Dev.eqs."DCPS$")
$	Then
$	    Tmp	= "DCPS$''QUEUE'_DEVICE_NAME"
$	    Tmp	= F$Trnlnm("''Tmp'")
$	    If (Tmp.nes."")  
$	    Then 
$		Dev = Tmp
$	    Endif
$	Endif
$!
$	Wo  F$Fao("!/!32AS", Queue)
$	Wo  "--------------------------------------------------------------------"
$	Wo  F$Fao("        Description: !32AS      Processor: !20AS", Desc, Proc)
$	Wo  F$Fao("            Library: !32AS           Form: !20AS", Lib, DefForm)
$	Wo  F$Fao("          Autostart: !32AS         Device: !20AS", Autostart, dev)
$!
$	Wo1 "''TR_Head'<td align=left colspan=6><b>''Queue'"
$	Wo1 "''TR_Line'<td align=right><b>Description<td>&nbsp;''Desc'<td align=right><b>Processor<td>&nbsp;''Proc'<td align=right><b>Library<td>&nbsp;''Lib'"
$	Wo1 "''TR_Line'<td align=right><b>Autostart<td>&nbsp;''Autostart'<td align=right><b>Device<td>&nbsp;''Dev'<td align=right><b>Form<td>&nbsp;''DefForm'"
$!
$	Goto Getqui_SMB$1
$   Endif
$!
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!__Q U E U E I N F O
$!  Get queueinfo on spec. queuetype
$!  P1: queuelogical, e.g. BAT_BAT_
$!  P2: NO: no device info, YES: device info
$!  ===============================================
$!
$ QueueInfo$: Subroutine
$!
$   If (P1.eqs."")  Then $ Exit
$!
$!__loop over all logicals until no more found
$   Ix	= 0	! index to logical list
$ QueueInfo$1:   
$   Ix	= Ix + 1
$   Nx	= "''P1'''Ix'"	! name of next logical
$   Tx	= F$Trnlnm("''Nx'","Lnm$System",0,"Executive")	! get content
$   If (Tx.eqs."")  
$   Then 
$	If (Ix.eq.1)
$	Then 
$	    Wo	"No queues defined!"
$	    Tmp	= "6"
$	    If (P2) Then $ Tmp = "7"
$	    Wo1	"''TR_Line'<td colspan=''Tmp'><b>No Queues defined!"
$	Endif
$	Exit	! no more found, holes are not allowed!
$   Endif
$!
$   Tmp_Des = F$Element(0,"\",Tx)
$   Tmp_Dev = F$Element(1,"\",Tx)
$   Tmp_Nod = F$Element(3,"\",Tx)
$   Tmp_Sta = F$Element(4,"\",Tx)
$   Tmp_Mod = F$Element(5,"\",Tx)
$   Tmp_Flg = F$Element(6,"\",Tx)
$!
$   If (P2)
$   Then
$	Wo  F$Fao("!3SL   !31AS !7AS !16AS !2AS    !2AS   !6AS", Ix, Tmp_Des, Tmp_Dev, Tmp_Nod, Tmp_Sta, Tmp_Mod, Tmp_Flg)
$	Wo1 "''TR_Line'<td align=right><b>''Ix'<td>''Tmp_Des'<td>''Tmp_Dev'<td>''Tmp_Nod'<td>''Tmp_Sta'<td>''Tmp_Mod'<td>''Tmp_Flg'"
$   Else
$	Wo  F$Fao("!3SL   !31AS !22AS !2AS    !2AS   !6AS", Ix, Tmp_Des, Tmp_Nod, Tmp_Sta, Tmp_Mod, Tmp_Flg)
$	Wo1 "''TR_Line'<td align=right><b>''Ix'<td>''Tmp_Des'<td>''Tmp_Nod'<td>''Tmp_Sta'<td>''Tmp_Mod'<td>''Tmp_Flg'"
$   Endif
$!
$   Goto QueueInfo$1
$!
$   EndSubroutine 
$!
$!  ===============================================
$!__S O F T W A R E
$!  Gets software infos
$!  ===============================================
$!
$ Software$:
$!
$   Call Message$   SWINFO I "Getting SW infos"
$   Call PutHeader$ "Software Information"
$!
$   ThisYear	= F$Integer(F$Cvtime(,,"YEAR")) - 1
$   If (F$Type(Software_History_Since).eqs."INTEGER")	Then $ ThisYear = Software_History_Since
$!
$   Ic	= 0
$   TreatedDisks    = ","    ! store systemdisks treated to avoid duplicates
$!
$ Software$_10:
$   Ic	= Ic + 1
$   If (Ic.le.Node_Num)
$   Then
$	Cpu_Nam	= Node_'Ic'
$!
$!______check if disk has been treated already
$	if (F$Type(Node_Sysdisk_'Cpu_Nam').eqs."STRING")
$	Then
$	    Sysdisk	= Node_Sysdisk_'Cpu_Nam'
$	Else
$	    Sysdisk	= "UNKNOWN"
$	Endif
$!
$	If (F$Locate(",''Sysdisk',",TreatedDisks).eq.F$Length(TreatedDisks))
$	Then
$	    TreatedDisks    = TreatedDisks + "''Sysdisk',"
$	Else
$	    Goto Software$_10
$	Endif
$!
$	Wo1 "<a name=""Software-Information-''Cpu_Nam'""></a>"
$	Wo  ""
$	Wo  "  == ''Cpu_Nam' =="
$	Wo  ""
$	Wo1 "<h1>''Cpu_Nam'</h1>"
$	Wo_Left	"<tr><td align=center bgcolor=blanchedalmond><b>''CPU_Nam'"
$	Wo_Left	"<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Software-Information-''CPU_Nam'"">PRODUCT</a>"
$	Wo_Left	"<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Software-Information0-''CPU_Nam'"">PRODUCT-History</a>"
$	Wo_Left	"<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Software-Information1-''CPU_Nam'"">SW-Versions</a>"
$	Wo_Left	"<tr><td bgcolor=lightgrey align=center><a target=right href=""''Cluname'_CONFIGURATION_RIGHT.HTML#Software-Information2-''CPU_Nam'"">VMSINSTAL</a>"
$!
$!______create tmpfile
$	Call Cleantmp$
$	Open/Write/Error=Execution_Error 'TmpLun' 'TmpFile'
$	Write/Error=Execution_Error 'TmpLun' "$ Set Noon"
$	Write/Error=Execution_Error 'TmpLun' "$ Assign/NoLog/User_Mode NL: Sysmanini"
$	Write/Error=Execution_Error 'TmpLun' "$ Mcr Sysman"
$	Write/Error=Execution_Error 'TmpLun' "Set Environment/Node=''Cpu_Nam'"
$	Write/Error=Execution_Error 'TmpLun' "Do Pipe Product Show Product /Full > ''TmpFile1'"
$	Write/Error=Execution_Error 'TmpLun' "Do Pipe Product Show History/Since=1-JAN-''ThisYear' > ''TmpFile2'"
$	Write/Error=Execution_Error 'TmpLun' "Do @''MySelf' """" """" CALLBACK=GETVER"
$	Write/Error=Execution_Error 'TmpLun' "Do Search SYS$UPDATE:VMSINSTAL.HISTORY ''ThisYear' /Remaining/Out=''TmpFile3'"
$	Close/NoLog 'TmpLun'
$	Set Noon
$	@'TmpFile'/Output=NL:
$	Set On
$!
$	Wo  "  PRODUCT Show Product"
$	Wo  ""
$	Wo1 "<h2>PRODUCT Show Product</h2>"
$       Close/NoLog 'Tmplun2'
$       Open/Read/Error=Software$_45 'Tmplun1' 'Tmpfile1' 
$       Wo	F$Fao("!_!36AS | !10AS | !10AS | !36AS | !36AS", "Product", "Type" , "State", "Maintenance", "Referenced By")
$	Wo	"-------------------------------------------------------------------------------------------"
$       Wo1 "<table border=2 colspacing=2>''TR_Head'<td align=center colspan=6><b>''CPU_Nam'"
$       Wo1 "''TR_Head'<td align=center><b>Product<td align=center><b>Type<td align=center><b>State<td align=center><b>Maintenance<td align=center><b>Referenced By"
$       read/End=Software$_45/Error=Software$_35 'Tmplun1' Record
$       read/End=Software$_45/Error=Software$_35 'Tmplun1' Record
$       read/End=Software$_45/Error=Software$_35 'Tmplun1' Record
$!
$ Software$_43:
$       read/End=Software$_45/Error=Software$_45 'Tmplun1' Record
$	If (F$Extract(0,10,Record).eqs."----------") Then $ Goto Software$_45
$!
$       Prod    = F$Extract(0, 36,Record)
$       PTyp    = F$Extract(36,11,Record)
$       Stat    = F$Extract(48,11,Record)
$       Main    = F$Extract(61,36,Record)
$       Refb    = F$Extract(97,36,Record)
$!
$       Wo	F$Fao("!_!36AS | !10AS | !10AS | !36AS | !36AS", Prod, PTyp, Stat, Main, Refb)
$       Wo1 "''TR_Line'<td align=right><b>''Prod'<td>''PTyp'<td>''Stat'<td>''Main'<td>''Refb'"
$       Goto Software$_43
$!
$ Software$_45:
$	Close/NoLog 'Tmplun1'
$	Wo1 "</table>"
$!
$	Wo	""
$	Wo	"  PRODUCT Show History (since ''ThisYear')"
$	Wo	""
$	Wo1 "<a name=""Software-Information0-''Cpu_Nam'""></a>"
$	Wo1 "<h2>PRODUCT Show History (since ''ThisYear')</h2>"
$       Close/NoLog 'Tmplun2'
$       Open/Read/Error=Software$_35 'Tmplun2' 'Tmpfile2' 
$       Wo	F$Fao("!_!36AS | !12AS | !12AS | !22AS ", "Product", "Type" , "Operation", "Date")
$	Wo	"------------------------------------------------------------------------------"
$       Wo1 "<table border=2 colspacing=2>''TR_Head'<td align=center colspan=4><b>''CPU_Nam'"
$       Wo1 "''TR_Head'<td align=center><b>Product<td align=center><b>Type<td align=center><b>Operation<td align=center><b>Date"
$       read/End=Software$_35/Error=Software$_35 'Tmplun2' Record
$       read/End=Software$_35/Error=Software$_35 'Tmplun2' Record
$       read/End=Software$_35/Error=Software$_35 'Tmplun2' Record
$!
$ Software$_33:
$       read/End=Software$_35/Error=Software$_35 'Tmplun2' Record
$	If (F$Extract(0,10,Record).eqs."----------") Then $ Goto Software$_35
$!
$       Prod    = F$Extract(0, 36,Record)
$       PTyp    = F$Extract(36,11,Record)
$       Oper    = F$Extract(48,11,Record)
$       Date    = F$Extract(60,22,Record)
$!
$       Wo	F$Fao("!_!36AS | !12AS | !12AS | !22AS ", Prod, Ptyp, Oper, Date)
$       Wo1 "''TR_Line'<td align=right><b>''Prod'<td>''PTyp'<td>''Oper'<td align=right>''Date'"
$       Goto Software$_33
$!
$ Software$_35:
$	Close/NoLog 'Tmplun2'
$	Wo1 "</table>"
$!
$	Wo	""
$	Wo	"  SW Versions"
$	Wo	""
$	Wo1 "<a name=""Software-Information1-''Cpu_Nam'""></a> <h2>SW Versions</h2>"
$	TmpSWFile   = SW_File + "_''CPU_Nam'.TXT"
$	If (F$Search("''TmpSWFile'").nes."")
$	Then
$	    Close/NoLog 'Tmplun1'
$	    Open/Read/Error=Software$_20 'Tmplun1' 'TmpSWFile'
$	    Wo	F$Fao("!_!16AS | !8AS | !16AS | !8AS | !16AS | !8AS", "Product", "Version" , "Product", "Version", "Product", "Version")
$	    Wo	"-----------------------------------------------------------------------------------------------------------------------"
$	    Wo1 "<table border=2 colspacing=2>''TR_Head'<td align=center colspan=6><b>''CPU_Nam'"
$	    Wo1 "''TR_Head'<td align=center><b>Produkt<td align=center><b>Version<td align=center><b>Produkt<td align=center><b>Version<td align=center><b>Produkt<td align=center><b>Version"
$!
$!__________store all installed software packages
$	    ICnt   = 0	! count packages
$ Software$_13:
$	    read/End=Software$_14/Error=Software$_14 'Tmplun1' Record
$	    Record  = F$Edit(Record,"Trim,Upcase,Compress,UnComment")
$	    Prod    = F$Edit(F$Element(0," ",Record),"Collapse")
$	    Vers    = F$Edit(Record-Prod,"Collapse")
$	    If (Vers.eqs."N/A")	Then $ Goto Software$_13    ! skip software not installed
$	    ICnt    = ICnt + 1
$	    Prod'ICnt'    = Prod
$	    Vers'ICnt'    = Vers
$	    Goto Software$_13
$!
$!__________output packages, sorted vertically
$ Software$_14:
$	    Close/NoLog 'Tmplun1'
$	    IMax    = ICnt	    ! number of packages installed
$	    IRow    = IMax / 3 + 1  ! number od rows
$	    ICnt    = 0		    ! reset counter, now counts rows
$!
$ Software$_15:
$	    ICnt    = Icnt + 1
$	    If (Icnt.le.IRow)
$	    Then
$		Ix  = 0
$ Software$_16:
$		Ix  = Ix + 1
$		If (Ix.le.3)		! we have 3 columns at the moment
$		Then
$		    Ixx	= Icnt + (Ix-1) * IRow	! get offset in prod/vers-arrays
$		    If (F$Type(Prod'Ixx').eqs."STRING") .and. (Ixx.le.IMax) ! row may be incomplete
$		    Then
$			TmpProd'Ix'    = Prod'Ixx'
$			TmpVers'Ix'    = Vers'Ixx'
$		    Else
$			TmpProd'Ix'    = ""
$			TmpVers'Ix'    = ""
$		    Endif		    
$		    Goto Software$_16
$		Endif
$!
$		Wo	F$Fao("!_!16AS | !8AS | !16AS | !8AS | !16AS | !8AS", "''TmpProd1'", "''TmpVers1'", "''TmpProd2'", "''TmpVers2'", "''TmpProd3'", "''TmpVers3'")
$		Wo1 "''TR_Line'<td align=right><b>&nbsp;''TmpProd1'<td>&nbsp;''TmpVers1'<td align=right><b>&nbsp;''TmpProd2'<td>&nbsp;''TmpVers2'<td align=right><b>&nbsp;''TmpProd3'<td>&nbsp;''TmpVers3'"
$		Goto Software$_15
$	    Endif
$!
$	Else
$	    Wo1	"<b>''TmpSWFile' not available!</b><br>"
$	    Wo 	"  ''TmpSWFile' not available!"
$	Endif
$!
$ Software$_20:
$	Close/NoLog 'Tmplun1'
$	Wo1 "</table>"
$!
$	Wo1	"<a name=""Software-Information2-''Cpu_Nam'""></a> <h2>VMSINSTAL History (since ''ThisYear')</h2>"
$	Wo	""
$	Wo	"  VMSINSTAL History (since ''ThisYear')"
$	Wo	""
$!
$       Close/NoLog 'Tmplun1'
$       Open/Read/Error=Software$_25 'Tmplun3' 'Tmpfile3' 
$       Wo	F$Fao("!_!16AS | !8AS | !12AS | !5AS | !3AS | !15AS", "Product", "Version" , "Date", "State", "IVP", "Installer")
$	Wo	"------------------------------------------------------------------------------"
$       Wo1 "<table border=2 colspacing=2>''TR_Head'<td align=center colspan=6><b>''CPU_Nam'"
$       Wo1 "''TR_Head'<td align=center><b>Product<td align=center><b>Version<td align=center><b>Date<td align=center><b>State<td align=center><b>IVP<td align=center><b>Installer"
$!
$ Software$_23:
$       read/End=Software$_25/Error=Software$_25 'Tmplun3' Record
$       Record  = F$Edit(Record,"Trim,Upcase,Compress,UnComment")
$       Prod    = F$Element(1,"|",Record)
$       Vers    = F$Element(2,"|",Record)
$       Date    = F$Element(3,"|",Record)
$       Stat    = F$Element(4,"|",Record)
$       IVP     = F$Element(5,"|",Record)
$       Inst    = F$Element(7,"|",Record)
$!
$       Wo	F$Fao("!_!16AS | !8AS | !12AS | !2AS | !2AS | !15AS", Prod, Vers, Date, Stat, IVP, Inst)
$       Wo1 "''TR_Line'<td align=right><b>''Prod'<td>''Vers'<td align=right>''Date'<td>''Stat'<td>''IVP'<td>''Inst'"
$       Goto Software$_23
$!
$ Software$_25:
$	Close/NoLog 'Tmplun3'
$	Wo1 "</table>"
$!
$	Goto Software$_10
$   Endif
$!
$   Return
$!
$!  ===============================================
$!__C R A S H
$!  Gets cash infos
$!  ===============================================
$!
$ Crash$:
$!
$   If F$Search("CLUE$History").eqs.""	Then $ Return
$!
$   Call Message$   CRASHINFO I "Getting crash infos"
$   Call PutHeader$ "Crash Information" "Crash-Information"
$!
$   Wo1 "''Pre_Start'"
$   Call    Transfer$ CLUE$HISTORY
$   Wo1 "</pre>"
$!
$   Return
$!
$!  ===============================================
$!__S A M
$!  Gets SAM accounts
$!  ===============================================
$!
$ Sam$:
$!
$   Call Message$   SAMINFO I "Getting ADMIN accounts"
$   Call PutHeader$ "ADMIN Accounts" "ADMIN-Information"
$!
$   Wo	""
$   Wo	"  =================================================================="
$   Wo	"  === ADMIN Accounts ==============================================="
$   Wo	"  =================================================================="
$   Wo	""
$   Wo1	"<a name=""ADMIN-Information""></a> <h1>ADMIN Information</h1>"
$!
$   If ("''SAM_List'".eqs."")	Then $ SAM_List = "1,BO,3,4,5,6,7,SAM,SAMB,SAS,SASB"  ! provide some default
$   Ic	= -1
$!
$ Sam$_1:
$   Ic	= Ic + 1
$   Nx	= F$ELement(Ic,",",SAM_List)
$   If ((Nx.nes."") .and. (Nx.nes.","))
$   Then
$	On Warning  Then $ Goto Sam$_1
$	Assign/User/NoLog 'TmpFile' Sys$Output
$	Assign/User/NoLog 'Tmpfile' Sys$Error
$	MCR Authorize Show /Brief ['Nx',*]
$	If (F$FILE_ATTRIBUTES("''Tmpfile'","ALQ").gt.0)
$	Then
$	    Wo  F$Fao("!/''Nx'-User!/")
$	    wo1 "<h3>''Nx'-User</h3>''Pre_Start'"
$	    Call Transfer$ 'TmpFile'
$	    wo1 "</pre>"
$	Endif
$	Goto SAM$_1
$   Endif
$!
$   On Warning	Then $ Continue
$!
$   Return
$!
$!  ===============================================
$!  G E T _ N O D E S
$!  - gets list of nodes to work on
$!    on single systems, it is just the current node
$!    on clusters, it is all nodes with VOTES>0 or a logical SYSTEM_REPORT_START_ON_node exists
$!  Output:
$!  NODE_n    - name of node N
$!  NODE_NUM  - number of nodes to treat
$!  NODE_LIST - comma-separated list
$!  ===============================================
$!
$ Get_Nodes$:
$   Call Message$   GETNODES I "Getting nodenames"
$   CSID_Context    = ""    ! context for F$CSID
$   Node_Num	    = 0	    ! ocunt nodes
$   Node_List	    = ""
$!
$   If (.not.F$Getsyi("Cluster_Member"))
$   Then
$	Node_Num    = 1
$	Node_1	    = F$edit(F$Getsyi("SCSNODE"),"Trim,Upcase,Collapse")
$	Node_List   = Node_1
$	Call Message$   NODESFOUND I "Nodes found: ''Node_List'"
$	Return
$   Endif
$!
$!__1st: get nodes with votes (bootnodes)
$ Get_Nodes$_10:
$   Next    = F$CSID(CSID_Context)
$   If Next .nes. ""
$   Then
$	Cpu_Nam	= F$Edit(F$Getsyi("NODENAME",,Next),"Trim,Upcase,Collapse")
$	If (F$Getsyi("Votes","''Cpu_Nam'").le.0)    Then $ Goto Get_Nodes$_10
$	Node_Num	= Node_Num + 1
$	Node_'Node_Num' = Cpu_Nam
$	Node_List	= Node_List + ",''Cpu_Nam'"
$	Goto Get_Nodes$_10
$   Endif
$!
$!__2nd: now get the satellites, where logical name SYSTEM_REPORT_START_ON_'node'
$   CSID_Context    = ""
$ Get_Nodes$_20:
$   Next    = F$CSID(CSID_Context)
$   If Next .nes. ""
$   Then
$	Cpu_Nam	= F$Edit(F$Getsyi("NODENAME",,Next),"Trim,Upcase,Collapse")
$	If (F$Getsyi("Votes","''Cpu_Nam'").gt.0) Then $ Goto Get_Nodes$_20  ! had it already
$	If (F$Trnlnm("SYSTEM_REPORT_START_ON_''Cpu_Nam'").eqs."") Then $ Goto Get_Nodes$_20
$	Node_Num	= Node_Num + 1
$	Node_'Node_Num' = Cpu_Nam
$	Node_List	= Node_List + ",''Cpu_Nam'"
$	Goto Get_Nodes$_20
$   Endif
$!
$   Node_List	= Node_List - ","
$   Call Message$   NODESFOUND I "Nodes found: ''Node_List'"
$!
$   Return
$!
$!  ===============================================
$!  G E T _ D I S K I N F O
$!  - gets info about a disk, logicals are translated
$!  Input:
$!  DISKSPEC	    - this disk
$!  Output:
$!  DISKNAME	    - real diskname
$!  SHADOWMEMBERS   - list of shadowset members
$!  SHADOWMEMBERS_PLUS	    - list of shadowset members + type info (mem:type,...)
$!  SHADOWMEMBERS_PLUS_HTML - list of shadowset members + type info (mem:type,...) with HTML controls
$!  ===============================================
$!
$ GET_DiskInfo:
$   Diskname	    = ""
$   Shadowmembers   = ""
$   Shadowmembers_Plus	    = ""
$   Shadowmembers_Plus_Html = ""
$   VolName	    = ""
$!
$   If ("''DiskSpec'".eqs."")	Then $ Goto GET_DiskInfo$End
$!
$   MyDisk  = DiskSpec
$!
$ GET_DiskInfo$10:
$   MyDisk  = F$Parse("''MyDisk'",,,"DEVICE")
$   Tmp1    = MyDisk-":"
$   If (F$Extract(0,1,Tmp1).eqs."_")	Then $ Tmp1 = F$Extract(1,999,Tmp1)
$!
$   Tmp	    = F$Trnlnm("''Tmp1'")
$   If (Tmp.nes."")
$   Then
$	MyDisk	= Tmp
$	Goto Get_DiskInfo$10
$   Endif
$!
$   If (F$Extract(0,1,MyDisk).eqs."_")	Then $ MyDisk = F$Extract(1,999,MyDisk)
$   DiskName	= MyDisk-":"
$   VolName	= F$Getdvi("''DiskName'","VOLNAM")
$!
$   If (F$extract(0,3,MyDisk).nes."DSA")    Then $ Goto GET_DiskInfo$End
$   Tmp	    = ""
$   Tmp1    = ""
$   Tmp2    = ""
$   Nx	    = MyDisk
$ GET_DiskInfo$20:
$   Nx	= F$GetDvi("''Nx'","SHDW_NEXT_MBR_NAME")
$   If (Nx.nes."")
$   Then
$	Nx   = Nx - "_" - ":"
$	Tmp  = Tmp + ",''Nx'"
$	Tmp1 = Tmp1 + ",''Nx'[''F$Getdvi(Nx,"DEVICE_TYPE_NAME")']" 
$	Tmp2 = Tmp2 + ",<b>''Nx'</b>[''F$Getdvi(Nx,"DEVICE_TYPE_NAME")']" 
$	Goto GET_DiskInfo$20
$   Endif
$   Shadowmembers	    = Tmp  - ","
$   Shadowmembers_Plus	    = Tmp1 - ","
$   Shadowmembers_Plus_Html = Tmp2 - ","
$!
$ GET_DiskInfo$End:
$   Return
$!
$!  ===============================================
$!  P R E S E T 
$!  - presets all DO_xxx vaiables
$!  If P1 is defined, this overrides POSSFUNC
$!  If P2 is defined, this overrides FDEFAULT
$!
$!  Input:
$!  POSSFUNC	- list of functions (comma separated list)
$!  FDEFAULT	- preset value (T/F)
$!
$!  Output:
$!  DO_xxx symbols
$!  SELFUNC	- list of selected functions
$!  ===============================================
$!
$ Preset$:
$   If ("''PossFunc'".eqs."")	Then $ Return
$   If ("''FDefault'".eqs."")	Then $ Return
$!
$!__If P1 is defined, PS is defaultet to INCLUDED
$   If (P1.nes."")
$   Then
$	If (P2.eqs."")	Then $ P2 = "INCLUDE"
$   Else
$	P2  = "EXCLUDE"
$   Endif
$!
$   If (P2.eqs."INCLUDE")
$   Then
$	FDefault    = "F"
$   Else
$	If (P2.nes."EXCLUDE")
$	Then
$	    Ws	"?''Facility'-E-, illegal parameter P2 \''P2'\, see @''Facility' ? for help."
$	    Goto Exit
$	Endif
$   Endif
$!
$!__now preset with default
$   Ix	= -1
$ Preset$1:
$   Ix	= Ix + 1
$   Nx	= F$Element(Ix,",",Possfunc)
$   If (Nx.nes."") .and. (Nx.nes.",")
$   Then
$	DO_'NX'	= FDefault
$	Goto Preset$1
$   Endif
$!
$!__If P1 defined, modify function list
$   If (P1.eqs."")  Then $ Return
$!
$   Tmp	= "T"
$   If (FDefault.eqs."T")   Then $ Tmp = "F"
$!
$   Ix	= -1
$ Preset$2:
$   Ix	= Ix + 1
$   Nx	= F$Element(Ix,",",P1)
$   If (Nx.nes."") .and. (Nx.nes.",")
$   Then
$	If (F$Locate(",''Nx',",",''Possfunc',").eq.F$Length(",''Possfunc',"))
$	Then
$	    Ws	"?''Facility'-E-, unknown function \''Nx'\, see @''Facility' ? for help."
$	    Goto Exit
$	Endif
$	DO_'Nx'	= Tmp
$	Goto Preset$2
$   Endif
$!
$   Return
$!
$!  ===============================================
$!  F L I S T
$!  - create a functon list
$!
$!  Input:
$!  DO_xxx  - function variables
$!
$!  Output:
$!  SELFUNC	- list of selected functions
$!  ===============================================
$!
$ Flist$:
$!__create SELFUNC variable
$   SelFunc = ""
$   Ix	= -1
$ Flist$1:
$   Ix	= Ix + 1
$   Nx	= F$Element(Ix,",",PossFunc)
$   If (Nx.nes."") .and. (Nx.nes.",")
$   Then
$	If (DO_'Nx')	Then $ SelFunc	= SelFunc + ",''Nx'"
$	Goto Flist$1
$   Endif
$   SelFunc = SelFunc - ","
$!
$   Return
$!
$!  ========================================================================
$!  F I X 1 0 0 0
$!  - adds 1000er points to number display
$!  Input:
$!  P1: number to treat
$!  P2: length of textfield (filled with spaces)
$!  P3: name of result string
$!  Output:
$!  'P3': store display string
$!  ========================================================================
$ Fix1000: Subroutine
$   Spaces  = F$Fao("!64* ")
$   In  = "''P1'"
$   Ix  = F$Length(In)
$   Out = ""
$   Ic  = -1
$!
$ Fix1000_1:
$   Ix  = Ix - 1
$   If Ix .ge. 0
$   Then
$	Nx	= F$Extract(Ix,1,In)
$	If Nx .nes. " "
$	Then
$	    Ic	= Ic + 1
$	    If (Ic/3*3 .eq. Ic) .and. Ic .ne. 0
$	    Then
$		Out = Out + "." + Nx
$		Ic  = 0
$	    Else
$		Out = Out + Nx
$	    Endif
$	Else
$	    Out = Out + Nx
$	Endif
$	Goto Fix1000_1
$   Endif
$!
$   Ix  = F$Length(Out)
$   In  = ""
$ Fix1000_2:
$   Ix  = Ix -1
$   If Ix .ge. 0
$   Then
$	Nx	= F$Extract(Ix,1,Out)
$	In	= In + Nx
$	Goto Fix1000_2
$   Endif
$!
$   If F$Integer(P2) .gt. 0
$   Then
$	If F$Length(In) .lt. P2	Then $ In = F$Extract(0,P2-F$Length(In),Spaces) + In
$   Endif
$   'P3'  == In
$!
$   Exit
$   EndSubroutine
$!
$!  ===============================================
$!  G E T V E R
$!  - checks a list of images and tries to determine version
$!  Output:
$!  creates a file 'TARGET_DIR''CLUNAME'_CONFIGURATION_SW_VERSIONS_'NODENAME'.TXT
$!  ===============================================
$!
$ GETVER$:  Subroutine
$   Set Noon
$!
$   Close/Nolog	'TmplunC1'
$   Close/Nolog	'TmplunC2'
$   Close/Nolog	'TmplunC3'
$   Close/Nolog	'TmplunC4'
$   TmpSWFile	= "''SW_File'_''Nodename'.TXT"
$   Open/Write/Error=GETVER$_END    'TmplunC1'	'TmpSWFile'
$   Wc1	= "Write/Error=GETVER$_END ''TmplunC1'"   
$!
$!___________________________________
$!__get SW installed via PRODUCT 1st
$   Assign/NoLog/User_Mode 'TmpfileC2'	Sys$Output
$   Product SHOW PRODUCT
$!
$   Open/Read/Error=GETVER$_End	'TmplunC2' 'TmpfileC2'
$   Read/End=GETVER$_End/Error=GETVER$_End  'TmplunC2' Record	! skip 3 header lines
$   Read/End=GETVER$_End/Error=GETVER$_End  'TmplunC2' Record
$   Read/End=GETVER$_End/Error=GETVER$_End  'TmplunC2' Record
$ GETVER$1:
$   Read/End=GETVER$_End/Error=GETVER$_End  'TmplunC2' Record
$   Record  = F$Edit(Record,"Trim,Upcase,Compress,UnComment")
$   If (F$Extract(0,4,Record).nes."----")
$   Then
$	Prod	= F$Element(2, " ", Record)
$	Vers	= F$Element(3, " ", Record)
$	Wc1 F$Fao ("!32AS !AS", Prod, Vers)
$	Goto GETVER$1
$   Endif
$!___________________________________
$!__now open definition files
$   DefFile = "''GETVER_File'"
$   GoSub GETVER$_Sub
$   DefFile = "''GETVER_Site_Conf'"
$   GoSub GETVER$_Sub
$!
$!___________________________________
$!__now sort the output file 
$   Close/Nolog	'TmplunC1'
$   Close/Nolog	'TmplunC2'
$   Close/Nolog	'TmplunC3'
$   Close/Nolog	'TmplunC4'
$   Sort/NoDuplicates 'TmpSWFile' 'TmpSWFile'
$   Purge/Keep=2 'TmpSWFile'
$!
$!___________________________________
$ GETVER$_End:
$   If (F$Search("''TmpfileC'*").nes."")	Then $ Delete 'TmpfileC'*;*
$!
$   Exit
$!
$!  ===============================================
$!  G E T V E R $ _ S u b
$!  - reads a definitions file and gets versions
$!  ===============================================
$!
$ GETVER$_Sub:
$   Close/NoLog 'TmpLunC4'
$   If (F$Search("''DefFile'").eqs."")	Then $ Return
$!
$   Open/Error=GETVER$_Sub_End/Read	'TmplunC4' 'DefFile'
$   Vers_Last	= ""	! to skip double versions
$   Prod_Last	= ""
$!
$ GETVER$2:
$   Read/End=GETVER$_Sub_End/Error=GETVER$_Sub_End 'TmplunC4' Record 
$   Record  = F$Edit(Record,"Trim,Compress,UnComment")
$   If (Record.eqs."")	Then $ Goto GETVER$2
$!
$   Nx  = Record
$   Prod= F$Edit(F$Element(0,"|",Nx),"Trim,Collapse,Upcase")
$   TmpM= F$Edit(F$Element(1,"|",Nx),"Trim,Collapse,Upcase")
$   TmpF= F$Edit(F$Element(2,"|",Nx),"Trim")
$   Tmp1= F$Edit(F$Element(3,"|",Nx),"Trim")
$   Tmp2= F$Edit(F$Element(4,"|",Nx),"Trim")
$   Tmp3= F$Edit(F$Element(5,"|",Nx),"Trim")
$!
$   If (Prod.eqs."").or.(TmpM.eqs."").or.(TmpF.eqs."")  Then Goto GETVER$2
$!
$   If (TmpM.eqs."LNM")
$   Then
$	Vers	= F$Edit(F$Trnlnm("''Tmpf'","LNM$SYSTEM",0),"Trim,Upcase,Collapse")
$	Vers	= Vers - Prod - "''Tmp1'"
$	If (Vers.eqs."")
$	Then
$	    Wc1 F$Fao ("!32AS !AS", Prod, "n/a")
$	Else
$	    If (F$Locate(F$Extract(0,1,Vers),"0123456789").ne.10) Then $ Vers = "V''Vers'"
$	    Wc1 F$Fao ("!32AS !AS", Prod, Vers)
$	Endif
$	Goto GETVER$2
$   Endif
$!
$   If (TmpM.eqs."DCL")
$   Then
$	Set NoOn
$	Messold = F$Environment("MESSAGE")
$	Set Message /NoText/NoSeverity/NoFacility/NoIdent
$	Assign/Nolog/User_Mode 'TmpfileC2'	Sys$Output
$	Assign/Nolog/User_Mode 'TmpfileC3'	Sys$Error
$	'Tmpf'
$	Search 'TmpfileC2';-1 /Output='TmpfileC2' 'Tmp1' /Match=And
$	If ($Severity.nes."1")
$	Then
$	    Search 'TmpfileC3';-1 /Output='TmpfileC3' 'Tmp1' /Match=And
$	    If ($Severity.nes."1")
$	    Then
$		Wc1 F$Fao ("!32AS !AS", Prod, "n/a")
$		Goto GETVER$2
$	    Else
$		Lun = TmplunC3
$		Fil = TmpfileC3
$	    Endif
$	Else
$	    Lun = TmplunC2
$	    Fil = Tmpfilec2
$	Endif
$!
$	Set Message 'Messold'
$	Close/NoLog 'Lun'
$	Open/Read/Error=GETVER$2	'Lun' 'Fil'
$	Read/Error=GETVER$2/End=GETVER$2 'Lun' Record
$	Close/NoLog 'Lun'
$	TmpNum  = F$Element(0,"/",Tmp2)
$	TmpDel	= F$Element(1,"/",Tmp2)
$	If (Tmpdel.eqs."").or.(TmpDel.eqs."/")	Then $ TmpDel	= " "
$	Vers	= F$Element(Tmpnum,Tmpdel,Record)
$	Vers	= F$Edit(Vers,"Trim,Upcase,Compress,UnComment")
$	If (Tmp3.nes."") .and. (Tmp3.nes."|")	Then Vers = Vers - Tmp3
$!
$	If (Vers.eqs."")    
$	Then 
$	    Vers = "n/a"
$	Else
$	    If (F$Locate(F$Extract(0,1,Vers),"0123456789").ne.10) Then $ Vers = "V''Vers'"
$	Endif
$	If (Vers.nes.Vers_Last) .or. (Prod.nes.Prod_Last)
$	Then
$	    Wc1 F$Fao ("!32AS !AS", Prod, Vers)
$	    Vers_Last   = Vers
$	    Prod_Last   = Prod
$	Endif
$	Set On
$	Goto GETVER$2
$   Endif	    
$!
$   If (TmpM.eqs."ANALYZE")
$   Then
$	TmpF    = F$Parse("''TmpF'","SYS$SYSTEM:*.EXE")
$	If (F$Search(TmpF).eqs."")
$	Then
$	    Wc1 F$Fao ("!32AS !AS", Prod, "n/a")
$	    Goto GETVER$2
$	Endif
$ GETVER$20:
$	TmpFF	= F$Search(TmpF,1212)
$	If (Tmpff.eqs."")   Then $ Goto GETVER$2
$! 
$	Pipe Analyze/Image/Select=Ident 'TmpFF' | ( Read Sys$Pipe Rec ; Read SYS$Pipe Rec ; -
	    Define/Job/NoLog GETVER_DATA &Rec)
$	Vers	= F$Edit(F$Trnlnm("GETVER_DATA"),"Trim,Upcase,Compress,UnComment")-Prod-"''Tmp1'"
$	Vers	= F$Edit(Vers,"Trim,Upcase,Compress,UnComment")
$	If (Vers.eqs."")    
$	Then 
$	    Vers = "n/a"
$	Else
$	    If (F$Locate(F$Extract(0,1,Vers),"0123456789").ne.10) Then $ Vers = "V''Vers'"
$	Endif
$	If (Vers.nes.Vers_Last) .or. (Prod.nes.Prod_Last)  
$	Then
$	    Wc1 F$Fao ("!32AS !AS", Prod, Vers)
$	    Vers_Last   = Vers
$	    Prod_Last   = Prod
$	Endif
$	If (F$Locate("*",Tmpf).ne.F$Length(Tmpf)) .or. (F$Locate("%",Tmpf).ne.F$Length(Tmpf)) Then $ Goto GETVER$20 ! wildcards?
$   Endif
$!
$   Goto GETVER$2
$!
$ Getver$_Sub_End:
$   Close/NoLog 'TmpLunC4'
$   Return
$!
$   EndSubroutine
$!
$!  ===============================================
$!  A D D A P P
$!  ===============================================
$!
$ Addapp$: Subroutine
$!
$!__check for appendices
$   AppMax  = AppNum
$   AppNum  = 0
$!
$   Wai	= "Write /Error=Execution_Error ''Outlun_AI'"  
$   Wai1= "Write /Error=Execution_Error ''Outlun1_AI'"  
$! 
$   If (AppMax.le.0)	Then $ Exit
$!
$   Call Message$   CREATE_ADDINFO I "Creating ADD_INFO files"
$!
$   Open/Error=Execution_Error/Write 'Outlun_AI'  'Outfile_AI'  ! open text report
$   Open/Error=Execution_Error/Write 'Outlun1_AI' 'Outfile1_AI' ! open html report
$   Wai	" "
$   Wai	" -------------------------------------------------------"
$   Wai	" ''CLUNAME': A d d i t i o n a l   I n f o r m a t i o n"
$   Wai	" -------------------------------------------------------"
$   Wai	" "
$   Wai1 "<h1>''CluName': Additional Information</h1>"
$!
$ App_Loop:
$   AppNum  = AppNum + 1
$   If (Appnum.gt.Appmax)   Then $ Exit
$!
$   Appf    = "''Appfile'''AppNum'"
$   If (F$search("''Appf'").eqs."") Then $ Goto App_Loop
$!
$   If (F$Type(AppTxt_'AppNum').nes."STRING")	Then $ AppTxt_'AppNum' = " "
$   Wai	    " "
$   Wai	    " == " + AppTxt_'AppNum' + " == "
$   Wai1    "<a name=""APP_''AppNum'""></a><h2>"+AppTxt_'AppNum'+"</h2>''Pre_start'"
$   Close/NoLog 'TmpLun'
$   Open/Read/Error=App_Loop 'Tmplun' 'Appf'
$ App_Loop1:
$   Read/Error=App_Loop/End=App_Loop2 'TmpLun' Rec
$   Wai  Rec
$   Wai1 Rec
$   Goto App_Loop1
$!
$ App_Loop2:
$   Wai1 "</pre>"
$   Close/NoLog 'TmpLun'
$   Goto App_Loop
$!
$   EndSubroutine
$!
$!  ===============================================
$!  P u t H e a d e r
$!  Writes the header to the text and html report
$!  (Assumes symbol WO (text) and WO1 (html) to write  to the correct luns)
$!  Input:
$!  P1: header info
$!  P2: anchor text (optional)
$!  ===============================================
$!
$ PutHeader$: Subroutine
$   Wo	F$Fao("")
$   Wo	F$Fao("!60*=")
$   Wo  F$Fao("=== !AS ", P1) + F$Extract(0,60-F$Length(P1)-4,F$Fao("!60*="))
$   Wo	F$Fao("!60*=")
$   Wo	F$Fao("")
$!
$   If (P2.nes."")  Then $ Wo1 "<a name=""''P2'""></a>"
$   Wo1	"<h1>''P1'</h1>"
$!
$   Exit
$   EndSubroutine
