Counting FilePro licenses
Brian K. White
brian at aljex.com
Fri Mar 11 12:21:52 PST 2011
On 3/10/2011 9:57 PM, Flavius Moldovan wrote:
> Richard,
>
> Sorry, I forgot to mention that the FilePro is running on linux RedHat 4.4.
>
> Following your advice, I will use the following to count the processes. Is this enough?
>
> ps -ef|grep -E "dclerk|dreport"|grep -v grep|awk '{print $6}'|sort|uniq|wc -l
OK first thing, won't buy more licenses? My answer to that would be a
simple "Ok well I guess you don't really care if it works or not
then..." it automatically becomes not your problem at that point as far
as I'm concerned. Basic respect. They'll happily waste hours of your
time to save a few hundred bucks? Your time is worth more than that.
Just don't use the word "seats" when talking to customers and the number
of required licenses becomes less of an issue. It's "instances", and
they need however many they need, if it's average 5 instances per user
plus 10 more for server-side reporting or web site activity then so be
it. All depends on usage.
But my real purpose was a fine, perhaps nitpicky point but if you're
going to use awk anyways, you don't need ANY of the other processes in
that pipe. Just the single awk can do the entire job in one process.
Although it's admittedly a little arcane in the scrunched up minimal
form I'm going to use for posting.
This will tell you the total number of rclerk/dclerk/rreport/dreport
running at the moment.
ps -eopid,comm |awk '/(r|d)(clerk|report)/{n++}END{print n}'
That simple rule is correct for 5.0.13 and below.
But that doesn't account for the fact that in 5.6, processes spawned by
other processes don't count extra. I'm not sure how true that is or if
the real rule used inside fp is more complicated or if it's possibly
configurable or even variable.
I don't use 5.6 for several reasons so I can't test how accurately this
matches fp's own counting rules, but here is a version of above that
doesn't count a clerk/report process if it was started by any other
clerk or report process:
ps -eopid,ppid,comm |awk '/(r|d)(clerk|report)/{p[$1]=$2;t++}END{for(x
in p)for(y in p)if(p[x]==y){delete p[x];t--};print t
}'
This one just adds a little verbosity to show all the potential
processes under consideration followed by the discards. Pipe that into
less to verify the PID/PPID relationship of the discards yourself before
trusting the non-verbose one.
ps -eopid,ppid,comm |awk '/(r|d)(clerk|report)/{p[$1]=$2;t++;print
$0}END{print "----";print "total",t;for(x in p)for(y in
p)if(p[x]==y){print "discarding",x;delete p[x];t--};print "remander",t}'
|less
Each of these are a single long line.
--
bkw
More information about the Filepro-list
mailing list