lmstat reliability?

L

lynto

Guest
Greetings:

We are seeing some strange behavior with "lmstat". It's the same on
Solaris and Linux. What happens is that it's not reporting the users
properly. I've written a perl script to count the number of licenses
in use and report. This does: "lmutil lmstat -a -c $lfile" where
"$lfile" is $CDS_LIC_FILE. I can see jobs running in LSF, however they
don't show up on the "lmstat" command. Any one else seen this
behavior? Any idea how to fix it? I've included the script at the
bottom of this message.

Thanks
Tom


#!/usr/local/bin/perl -w
#
#$Id: lcnt,v 1.3 2003/07/29 12:44:56 lynch Exp $
#
# Counts the number of licenses in use.
# by: Tom L.
#
use Getopt::Std;
#
# Check Command Line
#
if ($ARGV[0] eq "") {
print "ERROR: No Input!\n";
&usage;
}
#
# Get the command line options.
#
getopts("l:") || die &usage;
#
if ($opt_l) {
@license_file = split(/:/,$opt_l);
}
#
# Got through the lmstat routine and make a count and user list.
#
foreach $lfile (@license_file) {
print "\n+++ Checking $lfile +++\n\n";
@license_list = `lmutil lmstat -a -c $lfile`;
$hit = 0;
$count = 0;
LINE:
foreach $line (@license_list) {
$_ = $line;
@x = $_;
@x = split;
if ((/Users of/) && ($hit == 0)) {
$name = $x[2];
$total = $x[5];
$count = 0;
$hit = 1;
next LINE;
}
elsif ((/Users of/) && ($hit == 1)) {
&printusage;
undef %users;
$name = $x[2];
$total = $x[5];
$count = 0;
next LINE;
}
elsif (/start/) {
$count++;
$users{$x[0]}++;
}
}
}
&printusage;
print "\n";
exit (0);
#
# Usage
#
sub usage {
print "Usage: $0 -l \$LM_LICENSE_FILE\n";
exit (1);
}
#
# Print out the License usage information, including user name and
total for user and total for license.
#
sub printusage {
printf "Feature %-35s Current Licenses In Use: %3s, Total:
%3s\n",$name, $count, $total;
if ($count == $total) {
$name =~ s/://;
print "*** Warning: All Licenses In Use For \"$name\"!
***\n";
}
while (($key,$value) = each %users) {
printf "\t User: %-12s has %3s
license.\n",$key,$value;
}
}
 
Which version of lmstat/lmgrd are you using? There were some problems in 6.1 and
7.1 (I think) which lead us to update the versions used in IC446 and IC50 to
8.somethingorother (if my memory is correct). That's assuming you're talking
about Cadence tools - but either way the version of the FlexLM tools is
possibly the reason.

Andrew.

On 30 Jul 2003 05:25:22 -0700, lynch@agere.com (lynto) wrote:

Greetings:

We are seeing some strange behavior with "lmstat". It's the same on
Solaris and Linux. What happens is that it's not reporting the users
properly. I've written a perl script to count the number of licenses
in use and report. This does: "lmutil lmstat -a -c $lfile" where
"$lfile" is $CDS_LIC_FILE. I can see jobs running in LSF, however they
don't show up on the "lmstat" command. Any one else seen this
behavior? Any idea how to fix it? I've included the script at the
bottom of this message.

Thanks
Tom


#!/usr/local/bin/perl -w
#
#$Id: lcnt,v 1.3 2003/07/29 12:44:56 lynch Exp $
#
# Counts the number of licenses in use.
# by: Tom L.
#
use Getopt::Std;
#
# Check Command Line
#
if ($ARGV[0] eq "") {
print "ERROR: No Input!\n";
&usage;
}
#
# Get the command line options.
#
getopts("l:") || die &usage;
#
if ($opt_l) {
@license_file = split(/:/,$opt_l);
}
#
# Got through the lmstat routine and make a count and user list.
#
foreach $lfile (@license_file) {
print "\n+++ Checking $lfile +++\n\n";
@license_list = `lmutil lmstat -a -c $lfile`;
$hit = 0;
$count = 0;
LINE:
foreach $line (@license_list) {
$_ = $line;
@x = $_;
@x = split;
if ((/Users of/) && ($hit == 0)) {
$name = $x[2];
$total = $x[5];
$count = 0;
$hit = 1;
next LINE;
}
elsif ((/Users of/) && ($hit == 1)) {
&printusage;
undef %users;
$name = $x[2];
$total = $x[5];
$count = 0;
next LINE;
}
elsif (/start/) {
$count++;
$users{$x[0]}++;
}
}
}
&printusage;
print "\n";
exit (0);
#
# Usage
#
sub usage {
print "Usage: $0 -l \$LM_LICENSE_FILE\n";
exit (1);
}
#
# Print out the License usage information, including user name and
total for user and total for license.
#
sub printusage {
printf "Feature %-35s Current Licenses In Use: %3s, Total:
%3s\n",$name, $count, $total;
if ($count == $total) {
$name =~ s/://;
print "*** Warning: All Licenses In Use For \"$name\"!
***\n";
}
while (($key,$value) = each %users) {
printf "\t User: %-12s has %3s
license.\n",$key,$value;
}
}
--
Andrew Beckett
Senior Technical Leader
Custom IC Solutions
Cadence Design Systems Ltd
 

Welcome to EDABoard.com

Sponsor

Back
Top