From lwalsh@aries.scs.uiuc.edu  Tue Feb 21 10:57:35 1995
Received: from argus.cso.uiuc.edu  for lwalsh@aries.scs.uiuc.edu
	by www.ccl.net (8.6.9/930601.1506) id KAA17329; Tue, 21 Feb 1995 10:00:28 -0500
Received: from aries.scs.uiuc.edu (aries.scs.uiuc.edu [128.174.90.55]) by argus.cso.uiuc.edu (8.6.9/8.6.9) with SMTP id JAA75801 for <@argus.cso.uiuc.edu:chemistry@ccl.net>; Tue, 21 Feb 1995 09:00:28 -0600
Received: by aries.scs.uiuc.edu (931110.SGI/930416.SGI)
	for @argus.cso.uiuc.edu:chemistry@ccl.net id AA02216; Tue, 21 Feb 95 09:00:27 -0600
Date: Tue, 21 Feb 1995 09:00:27 -0600 (CST)
From: Laura Walsh <lwalsh@aries.scs.uiuc.edu>
Subject: FLEXlm Summary with SCRIPT
To: Computational Chemistry List Server <chemistry@ccl.net>
Message-Id: <Pine.3.89.9502210852.A2163-0100000@aries.scs.uiuc.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


Once more a summary, this time a bit more helpful.  Here is
a simple script that will count the number of simultaneous
usages of a program managed by FLEXlm -- in this case SoftPC,
but it works for Quanta/CHARMm and Cerius2 as well.

Thanks VERY MUCH to the person who sent me this, whose name 
I unfortunately deleted when I edited the script for my 
purposes.  Sometimes a starting point can really help and
this did for me.

Again, THANKS.

Laura

Laura Lynn Walsh, School of Chemical Sciences Computer Center, 
Box 66-1, 152 Noyes Lab, 505 South Mathews Ave., 
University of Illinois, Urbana, IL  61801-3364
lwalsh@aries.scs.uiuc.edu                       (217) 244-0560
________________________________________________________________

#!/bin/sh

##
## Script to check the maximum # of SoftPC licenses checked
## out at any single time.  Useful for estimating # of floating
## licenses that are needed.
##
## It can take an argument that is the log file to process.
## If no argument is given, the log-file is
##
## 	/usr/lib/SoftPC/FLEXlm/log-file
##
## by default.
##

# Set default LOGFILE
LOGFILE=/usr/lib/SoftPC/FLEXlm/log-file

# See if they specified a different LOGFILE
if [   $# = 1 ]; then
	LOGFILE=$1
fi

# See if LOGFILE really exists
if [ ! -f $LOGFILE ];then
	echo "No log file to check on this machine!"
	exit 1
fi

MAXCOUNT=0		## Max Number of licenses checked out at one time
TMP=0			## Temporary holder for number of licenses checked out

BEG_DATE=`head -1 $LOGFILE | awk '{print $1}'`
END_DATE=`tail -1 $LOGFILE | awk '{print $1}'`

echo ""
echo "\tReport for time period $BEG_DATE to $END_DATE"
echo "\t-------------------------------------"
echo ""
echo ""

for tran in `cat $LOGFILE | grep SoftPC_SGI | awk '{print $4}'`
do
	if [ $tran = "OUT:" ]; then
		#echo $tran
		TMP=`expr $TMP + 1`
		if [ $TMP -gt $MAXCOUNT ]; then
			MAXCOUNT=$TMP
		fi
	elif [ $tran = "IN:" ]; then
		#echo $tran
		TMP=`expr $TMP - 1`
	fi
done

echo "Maximum number of concurrent SoftPC_SGI checkouts is " $MAXCOUNT




