Subject: FLEXlm Summary with SCRIPT

From: Laura Walsh <[email-masked]>
Date: Tue, 21 Feb 1995 09:00:27 -0600 (CST)

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
[email-masked]                       (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