Conversion to 710G2 on OVMS 6.2 from 620E

Chris Sharman Chris.Sharman@ccagroup.co.uk
Fri, 30 Jul 1999 15:25:05 +0100


Here's my flexlm log analyser.
It modifies the log file to replace "(cognosd)" with the running total of
licences (of various types), and renames it to .track, so it doesn't do it
again. It mails a summary to @sys$manager:managers.dis
Use it at your own peril, of course - no warranties.

Chris

$ if p1.eqs."" then $ p1 := cognos$license:cognosda.log;-0
$! @sys$manager:periodical ! resubmit regularly
$ sum := cognos$license:cognosda.summary
$ priv = f$setprv("sysprv")
$ control = f$env("control")
$ domail := n
$nextver: file := 'f$search(p1)'
$ licences := \
$ on warning then goto $ fclose
$ if f$locate("Y",control) then-
	$ set nocontrol=y   ! stop in here & the file's half done
$ ver = f$verify(0)
$ 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
$ licenceend = f$ext(0,14,line)
$ 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
$ 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] :=
$ del/sym licencename'licx'
$ licx = f$locate("\",licences)
$ goto licloop
$sumclose: close sum
$ domail := y
$ goto nextver
$!
$quit: if domail then-
	$ mail 'sum' /noself "@sys$manager:managers"-
		/subj="Cognos Licence Usage ''sum'"
$ x = f$setprv(priv)
$ if f$locate("Y",control) then $ set control=y
$ exit
_______________________________________________________________________
Chris.Sharman@CCAgroup.co.uk		http://www.ccastat.demon.co.uk/
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.