Robin,
The following command file, when placed within a system wide logon UDC,
will limit most users to a single session (I say most since it excludes MPE
users of 'MANAGER', 'MGR' , and those who start with 'PROG' since they are
from the IT staff and can be 'trusted'). This assumes that each user has a
unique logon (jobname,username.accountname).
It also can be configured, with the assistance of an ASCII file, to provide
better granularity. (See example within the file).
Regards
Paul Christidis
(310) 952-4666
--------------------->> Start Cut *+1
#--
#--- Don't check for jobs and some 'selected' users.
#--
if hpJobType = "J" OR LFT(hpUser,4) = "PROG" &
OR POS("!hpUser#","MANAGER#,MGR#") <> 0 then
RETURN
endif
#--
#--- Set initial / default values to some variables
#--
setvar _lg_DEFAULT_LIMIT 1
#--
setvar _lg_Limits_File "JOBLIMIT.PUB.SYS"
setvar _lg_Limit_By_IP FALSE
setvar _lg_This_Limit _lg_DEFAULT_LIMIT
setvar _lg_Select "!hpJobName,!hpUser.!hpAccount"
# Next flag indicates whether the 'jobname' portion of the logon
# should be used by 'JOBCNT' when 'limit' is set at the 'account'
# or the 'account_user' level.
setvar _lg_Use_JobName TRUE
#--
#--- Determine if a 'special' limit is configured for this user.
#--
if FINFO(_lg_Limits_File,"exists") then
purge $oldpass > $null
continue
fcopy from=!_lg_Limits_File &
;to=$newpass;new;subset="![hpAccount]_",8 > $null
#
if FINFO("$OLDPASS", "exists") AND &
FINFO("$OLDPASS", "eof" ) > 0 then
xeq $oldpass
if BOUND(![hpAccount]_![hpUser]_![hpJobName]_limit) then
setvar _lg_This_Limit ![hpAccount]_![hpUser]_![hpJobName]_limit
else
if NOT _lg_Use_Jobname then
# Remove 'jobname' from 'selection' specification
setvar _lg_Select _lg_Select - "!hpJobName,"
endif
if BOUND(![hpAccount]_![hpUser]_limit) then
setvar _lg_This_Limit ![hpAccount]_![hpUser]_limit
elseif BOUND(![hpAccount]_limit) then
setvar _lg_This_Limit ![hpAccount]_limit
endif
endif
endif
endif
#---
#--- Find all sessions logged on as "you" (current user)
#---
setvar _lg_NumJobs JOBCNT("@S:!_lg_Select",_lg_Ses_List)
if _lg_NumJobs > 1 then
# there is at least 1 other session logged on as "you"
if NOT _lg_Limit_By_IP then
setvar _lg_IpCnt _lg_NumJobs
else
setvar _lg_IpCnt 0
setvar _lg_I 0
while setvar(_lg_I,_lg_I+1) <= _lg_NumJobs do
if JINFO(word(_lg_Ses_List,,_lg_I),"ipaddr") = HPREMIPADDR then
setvar _lg_IpCnt _lg_IpCnt+1
endif
endwhile
endif
#---
if _lg_IpCnt > _lg_This_Limit then
echo ![chr(7)]
echo ** Exceeded # of sessions allowed to 'logon' as: "!_lg_Select" **
if _lg_Limit_By_IP then
echo ** from the same IP address (!HPREMIPADDR).
endif
echo ![chr(7)]
bye
endif
endif
#---
#--- Debug / Clean Up
#---
if BOUND(traceon) then
showvar _lg_@, !hpAccount@_limit
else
deletevar _lg_@, !hpAccount@_limit >$null
endif
RETURN
# <---------------------------------------------------->
# Author: Paul Christidis e-mail: [log in to unmask]
# Version: 2001.06.27 Date: 06/27/2001
#
# This is an enhancement of the command file posted by Jeff Vance on
# the HP3000-L list. It allows a site to 'configure' the number of
# sessions allowed to logon to an account using account_user_jobname,
# account_user, or account limits. It also allows the 'limit' to
# be applied to sessions originating on the same IP address.
#
# Configuration information is stored in a flat file "joblimit" as a
# series of 'setvar' commands, for each MPE account, MPE user or Session
# name. It should adhere to the following format:
# (Using the SYS account as an example):
# SETVAR SYS_MANAGER_XTIDIS_limit 3
# SETVAR SYS_MANAGER_limit 2
# SETVAR SYS_limit 1
#
# NOTE: Suffix of '_limit' is required AND use UPPER case as shown.
# <---------------------------------------------------->
----------------->> End Cut *-1
Hi. Really appreciate reading the postings here. I am new to MPE and
it is a great resource. Maybe someone out there has a simple answer for
my question... is there a way, as manager.sys or an account manager to
limit the number of concurrent sessions a specific user can have open?
all users? We have 100 MPE licenses and 80 users, which should be
enough, except I have some users who insist on having six or more
sessions open. I am also looking into Bouncer to alleviate the
problem....
Thanks in advance,
Robin Warbey
Fresh Kist Produce
[log in to unmask]
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|