License Management

FlexLM

Description:

Check flexlm license server and return total license and license in use (Also use Performance data).

Current Version

Last Release Date

June 22, 2009

Compatible With


Project Files
Project Notes
Another flexlm check plugin. based on Joshua Parsell script. now the script return in performance Data: license in use and percent of license in use, this value is viewable in graph with pnp4nagios Also added a new switch to check single feature -f switch and a switch to set percent warning level, (%warning is limit of percent license in use above of it the plugin return warning)
Reviews (4) Add a Review
Works but ....
by leap77, March 31, 2017
plugin works, but you have to include the bug on the code. It's working for me on Nagios 4.2 with perl installed, lmutil and a yum -y install redhat-lsb to solve error from /lib64/ld-lsb-x86-64.so.3: bad ELF interpreter: No such file or directory when you run lmutil from the bash.

Thanks for the plugin
Helpful? Yes  No 
Patch to specify vendor, including previous patches as well
by viet.nguyen, August 31, 2013
I ran into an issue where if one vendor was down, any feature even with a different vendor would fail. So I added an argument to take in the vendor name as well:

86c86
Luca.sassone@omega-sistemi.it
93c93
Usage: perl check_flexlm_perf_data.plx -H hostname [-p port] [-f feature] [-S vendor] [-w %warning]
99c99
6)||(@ARGV eq "0"))
---
> if ((@ARGV > 10)||(@ARGV eq "0"))
113a114
> my $feature = 0;
120c121
if (($_ ne "-p")&&($_ ne "-H")&&($_ ne "-f")&&($_ ne "-w")&&($_ ne "-S"))
127c128,129
$feature = $arg_hash{"-f"} if ($_ eq "-f");
> $vendor = $arg_hash{"-S"} if ($_ eq "-S");
140,141c142,143
$lmstat_output = `$path_to_lmutil lmstat -f $feature -S $vendor -c $port@$server`; # Get output of lmstat for $vendor_daemon only
180a183
> my $seen_feature = 0;
191a195
> $seen_feature++;
207a212,214
> } elsif ($vendor && ($seen_feature == 0)) {
> # We're looking for a feature and it's not there
> $output = "FLEXlm CRITICAL: License Server for $vendor not available.n";
Helpful? Yes  No 
patch for alerting on missing feature
by Paul.Haldane, April 30, 2013
If used, for example, like this ...

/tmp/check_flexlm_perf_data -H assdlic01 -p 1055 -f aa_r_cfdd -w 80

and the specified feature doesn't exist the plugin returns OK (0% of 0 licences used). The patch below treats a missing feature as a critical error.

Index: production/apps/nagios/libexec/ncl/check_flexlm_perf_data
===================================================================
--- production/apps/nagios/libexec/ncl/check_flexlm_perf_data (revision 2161)
+++ production/apps/nagios/libexec/ncl/check_flexlm_perf_data (working copy)
@@ -148,12 +148,14 @@
my $current_use = 0;
my $tot_lic = 0;
my $perc_in_use = 0;
+ my $seen_feature = 0;
for (@lmstat_lines) {
if ($features eq 0) {
$red_flag ++ if ((/[Cc]annot/)||(/[Uu]nable/)||(/refused/)||(/down/)||(/[Ww]in[sS]ock/));
} else {
if (/Users of (.*): .* of ([0-9]+) .* issued; .* of ([0-9]+) .* use/) {
my $available_licenses = $2 - $3;
+ $seen_feature++;
$current_use = $3;
$tot_lic = $2;
$perc_in_use = ($current_use/$tot_lic)*100;
@@ -168,6 +170,9 @@
}
if ($red_flag > 0) {
$output = "FLEXlm CRITICAL: License Server Down or Unreachable.n";
+ } elsif ($vendor && ($seen_feature == 0)) {
+ # We're looking for a feature and it's not there
+ $output = "FLEXlm CRITICAL: License Server for $vendor not available.n";
} elsif ($yellow_flag > 0) {
$output = "FLEXlm WARNING: Reach Usage Warning for Features: ";
for my $feat (@$yellow_feats) {
@@ -190,7 +195,6 @@
$output .=int($perc_in_use);
$output .="% in use| user=";
$output .= $current_use;
-
$output .="n";
}
return ($output);
Helpful? Yes  No 
Bug Fix for unintended interpolation of @omega
by Meyer, May 31, 2012
You might get an error like:
check_flexlm_perf_data.plx: Possible unintended interpolation of @omega in string at ./check_flexlm_perf_data.plx line 61.
To fix this change line 86 from:
Luca.sassone@omega-sistemi.it
to
Luca.sassone@omega-sistemi.it



There is another bug in the script
99c99
6)||(@ARGV eq "0"))
---
> if ((@ARGV > 8)||(@ARGV eq "0"))

ARGV has to be 8 instead of 6 if you use all parameters, like:
-H HOST -p PORT -f LIC -w WARN


Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.4 (5)
Favorites
0
Views
111,045