PARM group=@.!hpaccount, entry=main # # This script reports the following: # o the user volume set mappings defined in the ACCTUVOL file # o all volume sets on the system # o all groups (in your logon account, by default) and what volume set the # group is homed to. # # Syntax: chkgrp [grp.acct] # where: grp.acct are the groups you are interested in validating wrt # being homed to user volumesets. # # To see all groups on the system enter :chkgrp @.@ if '!entry' = 'main' then echo !hpfile !hptimef Version A.01 echo errclear # Extract the group and account names if pos('.','!group') = 0 then setvar _chkgrp_group ups('!group') setvar _chkgrp_acct hpaccount else setvar _chkgrp_group ups(word('!group','.')) setvar _chkgrp_acct ups(word('!group','.',-1)) endif # report contents of the ACCTUVOL config file echo if bound(_USERVOL_FILE) then setvar _chkgrp_file _uservol_file echo Using config file defined by the _USERVOL_FILE variable else setvar _chkgrp_file 'ACCTUVOL.PUB.SYS' endif if not finfo(_chkgrp_file,'exists') then echo "!_chkgrp_file" config file does not exist! else echo echo Contents of "!_chkgrp_file" User Volume Set Config File follows: echo (only entries matching "!_chkgrp_group.!_chkgrp_acct" are shown) continue xeq !hpfile !_chkgrp_group.!_chkgrp_acct entry=alt_config chkgrpds if cierror = 0 then echo echo Volume Sets on !hpsysname: echo xeq !hpfile !group entry=alt_dstat chkgrplf if cierror = 0 then setvar _chkgrp_sys 0 setvar _chkgrp_uv 0 echo echo Groups on System Volume Groups on User Volumes (volset) echo ----------------------- ------------------------------- xeq !hpfile !group entry=alt_lf = 0 do # read volset name which is the 2nd to last word in input record if word(setvar(_chkgrp_name,input()),,2) = 'MASTER' then echo ![word(word(_chkgrp_name,,-2),'-')] endif endwhile return elseif '!entry' = 'alt_config' then # expect input redirected from acctuvol config file # "group" parm is passed as upshifted 'group.acct' # read redirected input and write to $stdlist # only echo entries that match the user supplied group name setvar _chkgrp_cnt 0 echo [Group.]Account ----!> User Volume Set echo --------------- --------------- setvar _chkgrp_eof finfo(hpstdin,'eof') while setvar(_chkgrp_eof,_chkgrp_eof-1) >= 0 do if lft(setvar(_chkgrp_name,rtrim(ltrim(input()))),1) <> '#' then setvar _chkgrp_lhs ups(word(_chkgrp_name)) setvar _chkgrp_acctonly (pos('.',_chkgrp_lhs) = 0) # use 2 pmatch calls to handle cases where both the acctuvol grp.acct # name and the user supplied "group" names are wildcarded. # Also deal with acct-only entries by omitting group name in match. if (_chkgrp_acctonly and (pmatch(_chkgrp_acct,_chkgrp_lhs) or & pmatch(_chkgrp_lhs,_chkgrp_acct))) or & ((not _chkgrp_acctonly) and (pmatch('!group',_chkgrp_lhs) or & pmatch(_chkgrp_lhs,'!group'))) then # entry matches, echo it setvar _chkgrp_cnt _chkgrp_cnt+1 echo !_chkgrp_lhs ![rpt(' ',21-len(_chkgrp_lhs))] & ![word(_chkgrp_name,,-1)] endif endif endwhile echo !_chkgrp_cnt matches. return elseif '!entry' = 'alt_lf' then # expect input redirected from listfile,6 file setvar _chkgrp_eof finfo(hpstdin,'eof') while setvar(_chkgrp_eof,_chkgrp_eof-1) >= 0 do if setvar(_chkgrp_vs,finfo(setvar(_chkgrp_name,input()),& 'volume set name')) = "MPEXL_SYSTEM_VOLUME_SET" then setvar _chkgrp_sys _chkgrp_sys+1 echo !_chkgrp_name else setvar _chkgrp_uv _chkgrp_uv+1 echo !_chkgrp_name (!_chkgrp_vs) endif endwhile return endif