/* REXX */
/*                                       */
/* AUTHOR: Charles Fenton                */
/*                                       */
/*trace r*/
Address ISPEXEC
PGMNAME = 'VMSINFO  03/22/11'
/*********************************************************************/
/* DISPLAY SYSTEM INFORMATION ON TERMINAL                            */
/*********************************************************************/
/* EXECUTION SYNTAX:                                                 */
/*                                                                   */
/* ISPEXEC SELECT CMD(VMSINFO)                                       */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/
/* Change summary:                                                   */
/* 03/21/07 - CS - Changed SRRRELS and PGMNAME date.                 */
/* 05/31/07 - CS - Changed SRRRELS and PGMNAME date.                 */
/* 09/10/07 - CLF - added test of hostname error to obain hostname   */
/*                using a different version of the command.          */
/* 11/14/07 - CS - Changed SRRRELS and PGMNAME date.                 */
/* 01/31/08 - CF , chgs in collecting ACF2 ACPVERS.                  */
/* 03/24/08 - CS - Changed SRRRELS and PGMNAME date.                 */
/* 07/14/08 - CS - Changed SRRRELS and PGMNAME date.                 */
/* 11/18/08 - CF - Changed SRRRELS and PGMNAME date.                 */
/* 12/16/09 - CF - Changed SRRRELS and PGMNAME date.  Added use      */
/*            and contact info clauses.                              */
/* 03/22/11 - CF - Changed process to collect variables from         */
/*                 CACC1000.                                         */
/* 11/26/12 - CF , chgd fso_spt@disa.mil to                          */
/*   disa.letterkenny.FSO.mbx.stig-customer-support-mailbox@mail.mil.*/
/*                                                                   */
/*                                                                   */
/*********************************************************************/
LASTUPD = '11/26/2012'                       /* date of last update  */
/*********************************************************************/
Numeric digits 10                           /* dflt of 9 not enough  */
Parse source opsys . exec_name . exdsn . . ispf .
if ispf <> 'ISPF' then do
  if exdsn <> '?' then do
    address tso "ALTLIB ACT APPL(CLIST) DATASET('"exdsn"')"
    end
  Address TSO 'ISPSTART CMD(%VMSINFO)'
  exit
  end
x = sysvar('SYSPROC')
if "?" <> exdsn then,
  Address TSO "ex '"exdsn"(CACC1000)' 'HOST'"
else,
  Address ISPEXEC 'ISPEXEC SELECT CMD(CACC1000 HOST)'
Address ISPEXEC "VGET (ACPNAME ACPVERS OPSNAME OPSVERS SRRVERS SRRRELS",
  "HOSTNAME HOSTADDR SERNR MODEL MANUF) ASIS"
LPAR      = MVSVAR('SYSNAME')
PLEX      = MVSVAR('SYSPLEX')
Call Process
If sysvar('SYSPROC')<>"INIT" then call BROWSE_ISPF /* ISPF active?   */
Else do queued()                             /* ISPF is not active   */
  Parse pull line                            /* pull queued lines    */
  say line                                   /* say lines            */
End /* else do  */
/*********************************************************************/
/* Done looking at all control blocks                                */
/*********************************************************************/
Exit 0                                       /* End VMSINFO - RC 0   */
/*********************************************************************/
/*  End of main VMSINFO code                                         */
/*********************************************************************/
/*  Start of sub-routines                                            */
/*********************************************************************/
Process:
ln1 = "+======================================================================+"
ln2 = "|======================================================================|"
Queue ln1
Queue "|===============>> This software is for DoD use only. <<===============|"
Queue ln2
Queue "| Contact information: If there are issues with scripts please contact |"
Queue "| disa.letterkenny.FSO.mbx.stig-customer-support-mailbox@mail.mil.     |"
Queue ln1
Queue ' '
Queue "Security Readiness Review Self-Auditing Version",
  SRRVERS "Released" SRRRELS
Queue " " OPSNAME "Version" substr(OPSVERS,2,4),
  "is running on this system."
if ACPVERS = "" then ,
  Queue " " ACPNAME "is running on this system, unable",
    "to determine version."
else,
  Queue " " ACPNAME "Version" ACPVERS ,
    "is running on this system."
Queue ' '
Queue "The VMS asset will be defined with the following key fields:"
Queue ' '
Queue '  General tab'
Queue "    Host Name:" HOSTNAME
Queue '  Asset Identification tab'
Queue "    OS390 Sys ID:" LPAR
Queue '  Asset Posture tab'
Queue '    Operating System'
Queue '      MVS'
Queue '        MVS' OPSNAME
Queue '    Application'
Queue '      ACPs'
Queue '        ACPs' ACPNAME
Queue ' '
Queue 'The following values are obtained from the system as follows:'
Queue ' '
Queue "   " HOSTNAME "is obtained from UNIX 'hostname' command.  The UNIX"
Queue "    command obtains the information from the combination of the"
Queue "    HOSTNAME and DOMAINORIGIN identified in the TCPIP.DATA"
Queue "    configuration data set."
Queue ' '
Queue "   " LPAR "is obtained from the TSO/E SYSNAME variable.  This variable"
Queue "    is specified in SYS1.PARMLIB member IEASYSxx on the SYSNAME"
Queue "    statement."
Queue ' '
Queue "The following fields can be filled in on the VMS asset:"
Queue ' '
Queue '  Asset Identification tab'
do x = 1 to words(HOSTADDR)
  Queue "    IP Addresses:" word(HOSTADDR,x)
end
Queue '  Additional Details tab'
Queue "    Serial Number:" SERNR
Queue "    Model:" MODEL
Queue "    Manufacturer:" MANUF
Queue ' '
 
Return
 
BROWSE_ISPF:         /* Browse output if ISPF is active              */
Address ISPEXEC "CONTROL ERRORS RETURN"
Address TSO
prefix = sysvar('SYSPREF')        /* tso profile prefix            */
uid    = sysvar('SYSUID')         /* tso userid                    */
If prefix = '' then prefix = uid  /* use uid if null prefix        */
If prefix <> '' & prefix <> uid then /* different prefix than uid  */
   prefix = prefix || '.' || uid /* use  prefix.uid                */
ddnm1 = 'DD'||random(1,99999)   /* choose random ddname            */
ddnm2 = 'DD'||random(1,99999)   /* choose random ddname            */
junk = msg(off)
"ALLOC FILE("||ddnm1||") UNIT(SYSALLDA) NEW TRACKS SPACE(2,1) DELETE",
      " REUSE LRECL(80) RECFM(F B) BLKSIZE(3120)"
"ALLOC FILE("||ddnm2||") UNIT(SYSALLDA) NEW TRACKS SPACE(1,1) DELETE",
      " REUSE LRECL(80) RECFM(F B) BLKSIZE(3120) DIR(1)",
      " DA('"||prefix||".VMSINFO." ||ddnm2|| ".ISPPLIB')"
junk = msg(on)
Newstack
/*************************/
/* VMSINFOP Panel source */
/*************************/
If Substr(ZENVIR,6,1) >= 4 then
  Queue ")PANEL KEYLIST(ISRSPBC,ISR)"
Queue ")ATTR"
Queue "  _ TYPE(INPUT)   INTENS(HIGH) COLOR(TURQ) CAPS(OFF)" ,
      "FORMAT(&MIXED)"
Queue "  | AREA(DYNAMIC) EXTEND(ON)   SCROLL(ON)"
Queue "  + TYPE(TEXT)    INTENS(LOW)  COLOR(BLUE)"
Queue "  @ TYPE(TEXT)    INTENS(LOW)  COLOR(TURQ)"
Queue "  % TYPE(TEXT)    INTENS(HIGH) COLOR(GREEN)"
Queue "  ! TYPE(OUTPUT)  INTENS(HIGH) COLOR(TURQ) PAD(-)"
Queue " 01 TYPE(DATAOUT) INTENS(LOW)"
Queue " 02 TYPE(DATAOUT) INTENS(HIGH)"
Queue " 0B TYPE(DATAOUT) INTENS(HIGH) FORMAT(DBCS)"
Queue " 0C TYPE(DATAOUT) INTENS(HIGH) FORMAT(EBCDIC)"
Queue " 0D TYPE(DATAOUT) INTENS(HIGH) FORMAT(&MIXED)"
Queue " 10 TYPE(DATAOUT) INTENS(LOW)  FORMAT(DBCS)"
Queue " 11 TYPE(DATAOUT) INTENS(LOW)  FORMAT(EBCDIC)"
Queue " 12 TYPE(DATAOUT) INTENS(LOW)  FORMAT(&MIXED)"
Queue ")BODY EXPAND(//)"
Queue "%BROWSE  / / @&ZTITLE  / /  %Line!ZLINES  %Col!ZCOLUMS+"
Queue "%Command ===>_ZCMD / /           %Scroll ===>_Z   +"
Queue "|ZDATA ---------------/ /-------------------------|"
Queue "|                     / /                         |"
Queue "| --------------------/-/-------------------------|"
Queue ")INIT"
Queue "  .ZVARS = 'ZSCBR'"
Queue "  &ZTITLE = 'VMS Infomation - VMSINFO'"
Queue "  &MIXED = MIX"
Queue "  IF (&ZPDMIX = N)"
Queue "   &MIXED = EBCDIC"
Queue "  VGET (ZSCBR) PROFILE"
Queue "  IF (&ZSCBR = ' ')"
Queue "   &ZSCBR = 'CSR'"
Queue ")REINIT"
Queue "  REFRESH(ZCMD,ZSCBR,ZDATA,ZLINES,ZCOLUMS)"
Queue ")PROC"
Queue "  &ZCURSOR = .CURSOR"
Queue "  &ZCSROFF = .CSRPOS"
Queue "  &ZLVLINE = LVLINE(ZDATA)"
Queue "  VPUT (ZSCBR) PROFILE"
Queue ")END"
/*                                    */
"ALLOC FILE(VMSINFOP) SHR REUSE",
      " DA('"||prefix||".VMSINFO." ||ddnm2|| ".ISPPLIB(VMSINFOP)')"
"EXECIO" Queued() "DISKW VMSINFOP (FINIS"
/* "FREE FI(VMSINFOP)" */
Delstack
"EXECIO" Queued() "DISKW" ddnm1 "(FINIS"
address ISPEXEC "LIBDEF ISPPLIB LIBRARY ID("||ddnm2||") STACK"
/*address ISPEXEC "SETMSG MSG(ISRZ002)"*/
address ISPEXEC "LMINIT DATAID(TEMP) DDNAME("||ddnm1||")"
address ISPEXEC "BROWSE DATAID("||temp") PANEL(VMSINFOP)"
address ISPEXEC "LMFREE DATAID("||temp")"
address ISPEXEC "LIBDEF ISPPLIB"
junk = msg(off)
"FREE FI(VMSINFOP)"
"FREE FI("||ddnm1||")"
"FREE FI("||ddnm2||")"
Return
 
