FLEXlm Template and script set

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

bodoe
Posts: 6
Joined: Tue Jun 05, 2007 8:40 am

Post by bodoe »

Hi all


I have a small problem with displaying graphs. I have two license servers, and can only display graphs for one of them. The error message is

"ERROR: openinf 'XXX/file.rrd': No such file or directory"

The query works fine, verbose query shows correct output. Status for the device is "down", all other devices for the other server have status "up". The device that doesn't work is set up exactly like the other devices that do work.

If I runt the query_lmgrd.pl script with "get" data is displayed correctly, the same goes for "index", "test" and "query".

If this thread isn't dead already, perhaps someone can give me a hint? Would be much appriciated.
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

Maybe u can try to remove/delete all that FlexLM systems u want to monitor and recreate again.

SH
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

Oh! 2 things about this script you have to aware....
1. Remember to modify the Data Source Template's MAXIMUM value. It is default to LIMIT to 100 license. If your license servers has more than 100 license, it will show u "nan" and it will not get plotted.

2. I not sure about the rest but I change all the data in the Graph Template to use EXACT value instead...because u either check out/in 1 license or not...not point something license.

SH
Taiphun
Posts: 21
Joined: Mon Jan 08, 2007 11:44 am

Post by Taiphun »

Hi,
I'm using v0.0.2. I've got everything configured, but when I do 'perl lmgrd-query.pl test' I get nothing.

I can however, run the command from the script manually:

Code: Select all

$ lmutil lmstat -c 17021@server.network -S MLM
lmutil - Copyright (c) 1989-2004 by Macrovision Corporation. All rights reserved.
Flexible License Manager status on Wed 7/18/2007 13:25

DAEMONs in configuration file: MLM 
Users of features served by MLM:
Users of TMW_Archive:  (Uncounted, node-locked)
Users of MATLAB:  (Total of 8 licenses issued;  Total of 0 licenses in use)
Users of SIMULINK:  (Total of 6 licenses issued;  Total of 0 licenses in use)
Users of Curve_Fitting_Toolbox:  (Total of 1 license issued;  Total of 0 licenses in use)
Users of Control_Toolbox:  (Total of 5 licenses issued;  Total of 0 licenses in use)
Users of Signal_Blocks:  (Total of 1 license issued;  Total of 0 licenses in use)
Users of Excel_Link:  (Total of 4 licenses issued;  Total of 0 licenses in use)
Users of Identification_Toolbox:  (Total of 4 licenses issued;  Total of 0  licenses in use)
Users of MPC_Toolbox:  (Total of 2 licenses issued;  Total of 0 licenses in use)
Users of NCD_Toolbox:  (Total of 1 license issued;  Total of 0 licenses in use)
Users of Neural_Network_Toolbox:  (Total of 1 license issued;  Total of 0 licenses in use)
...
Here's my lmgrd-poller.pl lines:

Code: Select all

# Servers to poll, daemon name, and TCP port
my %licservers = (
        'server.network'     => {
                '17021'           => {
                        'MLM'     => 'Matlab',
                },
        },
);
What am I missing?

TIA,
Taiphun
Posts: 21
Joined: Mon Jan 08, 2007 11:44 am

Post by Taiphun »

Okay, got that all working.. I wasn't running the lmgrd poller.

Now the rra's aren't being created.
Laffer
Posts: 14
Joined: Fri Aug 24, 2007 8:47 am

Same names in different Daemons?

Post by Laffer »

Is it possible if Modules have the same name on different Vendor Daemons, that lmgrd does not properly handle them?

Example:

First I configured only one Licence Daemon and Cacti reported around 80 licence modules (apps).
Then I configured a second one, because we run another daemon for a new version of the same application (UGS NX3 and NX5). Now from the first one I have only 24 records as data query result as opposed to 80 before...
Laffer
Posts: 14
Joined: Fri Aug 24, 2007 8:47 am

Post by Laffer »

I fixed it:


Change the lines in lmgrd-poller.pl


# Well, this is stupid.
my %tmpstat = %licstatus;
$tmpstat{$lserver}{$app."_".$1}{total} = $2;
$tmpstat{$lserver}{$app."_".$1}{package} = $licservers{$lserver}{$lport}{$app};
$tmpstat{$lserver}{$app."_".$1}{inuse} = $3;
$tmpstat{$lserver}{$app."_".$1}{port} = $lport;
%licstatus = %tmpstat;
# print Dumper %licstatus;
mpelikan
Posts: 2
Joined: Thu Sep 13, 2007 6:03 am

lmgrd - stale licenses

Post by mpelikan »

Hi,

the lmgrd-poller is really good stuff; I installed the lmgrd-poller-0.0.2 version;
Only one thing isn't very nice;

the lmgrd-poller.pl is running and collecting the flexlm stats of my LICENSE1.
The is picked up from cacti, the graphs are available, everything works very nice :

BUT : I STOP the lmgrd-poller.pl ; but the data from my flexlm LICENSE1 are still
in the TIE::SHARELITE memory cache for hours ...

How long do stale data live?
Is it possible, to clean the cache ; maybe once a day ?

Regards,
Martin
Taiphun
Posts: 21
Joined: Mon Jan 08, 2007 11:44 am

Post by Taiphun »

I'm revisiting this again, same problems as first time around - my graphs are all NaN's.

:(
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

The data stay in the memory forever till u reboot.

I write an script where I use "destroy" command to release those memory instead.

I recently found a limitation/bug/or whatever u want to call it.

In the poller, each time when it start to do polling, it actually "lock" the IPC first and when finish polling, it "Unlock" it.

I think this is good if that share memory is going to be write by many applications because when the memory is lock, others cannot read or write onto it. Other application have to wait till the share memory is unlock before it can be read or write. But for this lmgrd-poller, there is only one application/script that is doing the writing....which is the poller. Thus I notice that during the time the poller is doing "Polling", the lmgrd-query (use by the cacti) will have to wait till the poller to complete. In this situation, the runtime increases.

I tried to comment out the lock and unlock on the lmgrd-poller and lmgrd-query, and it works!

SH
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

Taiphun wrote:I'm revisiting this again, same problems as first time around - my graphs are all NaN's.

:(
Is your license more than 100? If yes, u have to modify it to allow more than 100. See my previous post.

SH
mpelikan
Posts: 2
Joined: Thu Sep 13, 2007 6:03 am

Post by mpelikan »

Hi super-hornet,

please send me the script to "release" the shared memory;
I want to run it onca a day by cron, so that stale licenses do not live until
the next reboot.

Thanks!

Regards,
Martin
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

Script to "destroy" the share memory
---------------------------------------------------------------------------
#!/usr/bin/perl

#use strict;
#no strict 'subs';
use lib "/usr/lib/perl5/site_perl/5.6.1";
use Data::Dumper;
use Tie::ShareLite qw( :lock );
### my $log = '/var/log/lmgrd-poller.log';
my $hostinfo_file = "/usr/share/cacti/scripts/hostinfo.inc";

my %licstatus;
# Use below for the default key
$ipc = tie %licstatus, 'Tie::ShareLite', -key => 2030405,
-mode => 0666,
-create => 'no',
-destroy => 'yes'
or die("Could not tie to shared memory: $!");

---------------------------------------------------------------------------
jacobskp
Posts: 13
Joined: Mon Aug 09, 2004 8:51 am

Post by jacobskp »

Bucket10284 wrote:This app is exactly what I'm looking for, but my problem is that I'm running all of this on Windows and the Perl scripts (including Tie::Sharelite) are built for a UNIX/Linux environment. Can anyone point me in the right direction on where I could go to solve this problem? Thanks.
I rewrote this to use Cache::FastMmap::WithWin32 for a windows environment last night. It seems to be working and wasn't too difficult as it is mostly just replacing the ShareLite code and turning off the daemonizing since FastMmap doesn't support threads. I turned the poller into a Windows service with srvany.

I saw a few hiccups this morning and it has only been running since 10PM last night, so I'm not going to post any code yet since I'm not entirely sure that I've done this correctly.
Gabro
Posts: 1
Joined: Wed Jun 04, 2008 10:32 am

Post by Gabro »

Hello

i have problem with flexlm. Everything seems to be ok, but when i look at the graph, it show statistic only for two days ago. The problem is only with flexlm server template.

thx
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests