Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

FlexLM

Rating
5 votes
Favoured:
0
Hits
111046
Files:
FileDescription
check_flexlm_perf_data.plxUnknown Tag: 'FileDesc1'
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Check flexlm license server and return total license and license in use (Also use Performance data).
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)
byleap77, March 6, 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
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";
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);
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
< if ((@ARGV > 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