User licence - capacity planning

Chris.Sharman@ccagroup.co.uk Chris.Sharman@ccagroup.co.uk
Mon, 26 Jan 1998 14:11:08 GMT


Arthur Kogan wrote:
>the powerhouse license daemon (cognosda on alpha) does report licenses
>requested and returned. On Unix this output goes to turned off by
>default (ie sent to /dev/null), but you can redirect it to the log file.
>I am not sure on VMS, but I think there it does go to the log file by
>default. 

Yes, COGNOS$LICENSE:COGNOSDA.LOG
As a bonus, I'd already got nearly a year's history. Wonderful. Thanks.

Below is the .COM I used to summarise the peaks (as well as modify the old logs
to contain running totals), if anyone's interested. More work could be done on
this, but this was adequate for me at the moment: next step would be to
separate different licences ($ SEARCH) and plot usage over time (pull the
running total calculated into Excel or something), or maybe study who's
actually using it.

______________________________________________________________________
Chris Sharman			Chris.Sharman@CCAgroup.co.uk
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
-----------------
$ if p1.eqs."" then $ p1 := cognos$license:cognosda.log;-0
$ sum := cognos$license:cognosda.summary
$ file := 'f$search(p1)'
$ licences := \
$ on warning then goto $ fclose
$ control = f$env("control")
$ if f$locate("Y",control) then-
	$ set nocontrol=y   ! stop in here & the file's half done
$ ver = f$verify(0)
$ priv = f$setprv("sysprv")
$ licencebegin = f$file(file,"cdt")
$ open/read/write/error=quit log 'file'
$ rename 'file' .track;
$skip: read/end=fcloseok log line
$ if (f$locate(" (cognosd) ",line).ne.14) then $ goto skip
$ suf = f$ext(25,99,line)
$ opt = f$el(0," ",suf)
$ if (opt.nes."IN:") .and. (opt.nes."OUT:") then $ goto skip
$ licname = f$el(1," ",suf)
$ licx = f$locate("\"+licname+"\",licences)
$ if licx.eq.f$length(licences)
$ then	licences = licences + licname + "\"
$	licx = licx - 1
$	licencename'licx' = licname
$	licenceusers'licx' = 0
$	licencetotal'licx' = 0
$	licencemax'licx' = 0
$ endif
$ if opt.eqs."IN:"
$ then	licenceusers'licx' = licenceusers'licx' - 1
$ else	licenceusers'licx' = licenceusers'licx' + 1
$	licencetotal'licx' = licencetotal'licx' + 1
$	if (licenceusers'licx'.gt.licencemax'licx') then-
		$ licencemax'licx' = licenceusers'licx'
$ endif
$ usrs = f$fao("Now!4UL",licenceusers'licx')
$ line[16,7] := "''usrs'"
$ write/update log line
$ goto skip
$fcloseok:
$fclose: close log
$ x = f$verify(ver)
$ on warning then $ goto sumclose
$ licenceend = f$ext(0,14,"''line'")
$ if f$search(sum).eqs."" then $ copy nl: 'sum'
$ open/append sum 'sum'
$ write sum ""
$ write sum "Log File ",file
$ write sum "Started ",licencebegin,", last entry ",licenceend
$ write sum "Peak Accesses Name"
$ licx = 0
$licloop: if f$type(licencename'licx').eqs."" then $ goto sumclose
$ write sum f$fao("!4UL!9UL !AS",licencemax'licx',licencetotal'licx',-
		    licencename'licx')
$ licences[licx,1] :=
$ licx = f$locate("\",licences)
$ goto licloop
$sumclose: close sum
$ submit/notif/noprint 'f$env("procedure")'/par='p1'
$quit: x = f$setprv(priv)
$ if f$locate("Y",control) then $ set control=y
$ exit