mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00:00
faster reporting expecially if many features are requested
This commit is contained in:
parent
4323adbf08
commit
d3c0b24204
1 changed files with 15 additions and 13 deletions
|
@ -35,10 +35,11 @@
|
||||||
# - LMFEATURES: The individual features of each vendor daemon to graph
|
# - LMFEATURES: The individual features of each vendor daemon to graph
|
||||||
# - LMDISPLAYNAME: use the LMDISPLAYNAME instead of the daemon name when
|
# - LMDISPLAYNAME: use the LMDISPLAYNAME instead of the daemon name when
|
||||||
# generating graph names
|
# generating graph names
|
||||||
# - LMGRAPHISSUED: Generate a graph of the number of licenses issued for
|
# - LMGRAPHISSUED: If set generate a graph of the number of licenses issued for
|
||||||
# each feature .
|
# each feature.
|
||||||
# - LMSTAT: The path to the lmstat binary
|
# - LMSTAT: The path to the lmstat binary
|
||||||
# - LMLICFILE: The path to the FlexLM License File
|
# - LMLICFILE: The path to the FlexLM License File
|
||||||
|
# - LMLOGARITHMIC If set then graph use a logarithmic scale
|
||||||
#
|
#
|
||||||
# $Log$
|
# $Log$
|
||||||
# Revision 1.00 20090807 nassarmu
|
# Revision 1.00 20090807 nassarmu
|
||||||
|
@ -71,7 +72,6 @@ if ( ! $ENV{'LMFEATURES'} ) {
|
||||||
our $lmstat;
|
our $lmstat;
|
||||||
our $lmlicfile;
|
our $lmlicfile;
|
||||||
our $lmdisplayname;
|
our $lmdisplayname;
|
||||||
our $lmgraphissued;
|
|
||||||
if ( $ENV{'LMSTAT'} ) {
|
if ( $ENV{'LMSTAT'} ) {
|
||||||
$lmstat = $ENV{'LMSTAT'};
|
$lmstat = $ENV{'LMSTAT'};
|
||||||
} else {
|
} else {
|
||||||
|
@ -87,11 +87,6 @@ if ( $ENV{'LMDISPLAYNAME'} ) {
|
||||||
} else {
|
} else {
|
||||||
$lmdisplayname = $daemon;
|
$lmdisplayname = $daemon;
|
||||||
}
|
}
|
||||||
if ( $ENV{'LMGRAPHISSUED'} ) {
|
|
||||||
$lmgraphissued = "1";
|
|
||||||
} else {
|
|
||||||
$lmgraphissued = "0";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Parse LMFEATURES
|
# Parse LMFEATURES
|
||||||
my @features = split(/\s+/, $ENV{'LMFEATURES'});
|
my @features = split(/\s+/, $ENV{'LMFEATURES'});
|
||||||
|
@ -111,15 +106,20 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
|
||||||
# print out a config screen when asked.
|
# print out a config screen when asked.
|
||||||
if ( $ARGV[0] and $ARGV[0] eq "config" ) {
|
if ( $ARGV[0] and $ARGV[0] eq "config" ) {
|
||||||
print "graph_title FlexLM License usage for $lmdisplayname\n";
|
print "graph_title FlexLM License usage for $lmdisplayname\n";
|
||||||
print "graph_args --base 1000 --vertical-label licenses -l 0\n";
|
if ( $ENV{'LMLOGARITHMIC'} ) {
|
||||||
|
print "graph_args --base 1000 --vertical-label licenses --lower-limit 0.01 --logarithmic\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print "graph_args --base 1000 --vertical-label licenses -l 0\n";
|
||||||
|
}
|
||||||
print "graph_category licensing\n";
|
print "graph_category licensing\n";
|
||||||
print "graph_period minute\n";
|
print "graph_period minute\n";
|
||||||
foreach my $feature (@features) {
|
foreach my $feature (@features) {
|
||||||
my $clean_feature = clean_fieldname($feature);
|
my $clean_feature = clean_fieldname($feature);
|
||||||
print "$clean_feature".".label $feature actual\n";
|
print "$clean_feature".".label $feature\n";
|
||||||
print "$clean_feature".".draw LINE2\n";
|
print "$clean_feature".".draw LINE2\n";
|
||||||
print "$clean_feature".".info The number of $feature licenses checked out\n";
|
print "$clean_feature".".info The number of $feature licenses checked out\n";
|
||||||
if ( $lmgraphissued ) {
|
if ( $ENV{'LMGRAPHISSUED'} ) {
|
||||||
print "$clean_feature"."max.label $feature max\n";
|
print "$clean_feature"."max.label $feature max\n";
|
||||||
print "$clean_feature"."max.draw LINE3\n";
|
print "$clean_feature"."max.draw LINE3\n";
|
||||||
print "$clean_feature"."max.info The total number of $feature licenses available\n";
|
print "$clean_feature"."max.info The total number of $feature licenses available\n";
|
||||||
|
@ -128,9 +128,11 @@ if ( $ARGV[0] and $ARGV[0] eq "config" ) {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my @results = `$lmstat -c $lmlicfile -S $daemon`;
|
||||||
|
|
||||||
# pull the info from lmstat and print the results
|
# pull the info from lmstat and print the results
|
||||||
foreach my $feature (@features) {
|
foreach my $feature (@features) {
|
||||||
my @results = `$lmstat -c $lmlicfile -S $daemon -f $feature`;
|
my @results = grep(/Users of $feature/, @results);
|
||||||
|
|
||||||
foreach my $result (@results) {
|
foreach my $result (@results) {
|
||||||
if ($result =~ m/Users of $feature\:/ ) {
|
if ($result =~ m/Users of $feature\:/ ) {
|
||||||
|
@ -139,7 +141,7 @@ foreach my $feature (@features) {
|
||||||
|
|
||||||
my $clean_feature = clean_fieldname($feature);
|
my $clean_feature = clean_fieldname($feature);
|
||||||
print "$clean_feature".".value $fields[10]\n";
|
print "$clean_feature".".value $fields[10]\n";
|
||||||
if ( $lmgraphissued ) {
|
if ( $ENV{'LMGRAPHISSUED'} ) {
|
||||||
print "$clean_feature"."max.value $fields[5]\n";
|
print "$clean_feature"."max.value $fields[5]\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue