FLEXlm Template and script set

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

Moderators: Developers, Moderators

shoe
Posts: 7
Joined: Wed Apr 18, 2007 4:24 pm

frustrated

Post by shoe »

I'm a bit frustrated trying to get this to work.

I've tried both 0.0.2 and 0.0.1 per instructions and get the same result, no data.

I get 0 returned rows and the following debug:

Code: Select all

+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/lmgrd.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /var/www/html/cacti/scripts/lmgrd-query.pl <FQDN> 25734 index'
+ Executing script query 'perl /var/www/html/cacti/scripts/lmgrd-query.pl <FQDN> 25734 query appname'
+ Executing script query 'perl /var/www/html/cacti/scripts/lmgrd-query.pl <FQDN> 25734 query package'
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/lmgrd.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/lmgrd.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/lmgrd.xml'
Running

Code: Select all

# perl ./lmgrd-query.pl test
Yields

Code: Select all

Dumping hash...
$VAR1 = '<FQDN>';
$VAR2 = {
          'solidworks' => {
                            'inuse' => '6',
                            'port' => '25734',
                            'total' => '9',
                            'package' => 'Solidworks'
                          },
          'dwgeditor' => {
                           'inuse' => '0',
                           'port' => '25734',
                           'total' => '27',
                           'package' => 'Solidworks'
                         },
          'swofficepro' => {
                             'inuse' => '4',
                             'port' => '25734',
                             'total' => '9',
                             'package' => 'Solidworks'
                           }
        };
As you can see I'm using Solidworks.

Testing the following command:

Code: Select all

perl /var/www/html/cacti/scripts/lmgrd-query.pl <FQDN> 25734 index

yields a nice list of the three packages.

What am I doing wrong? agghh!

-shoe
shoe
Posts: 7
Joined: Wed Apr 18, 2007 4:24 pm

Post by shoe »

I also found this in my apache error log

Code: Select all

Could not create new IPC::ShareLite object: Permission denied at /var/www/html/cacti/scripts/lmgrd-query.pl line 8
Where do I set/change this permission?
pvenezia
Posts: 20
Joined: Mon Mar 13, 2006 12:39 pm

Re: frustrated

Post by pvenezia »

shoe wrote:I'm a bit frustrated trying to get this to work.

I've tried both 0.0.2 and 0.0.1 per instructions and get the same result, no data.

Testing the following command:

Code: Select all

perl /var/www/html/cacti/scripts/lmgrd-query.pl <FQDN> 25734 index

yields a nice list of the three packages.

What am I doing wrong? agghh!

-shoe
It would seem that the script called from Cacti isn't matching on the FQDN. Make sure they match, case sensitive.
pvenezia
Posts: 20
Joined: Mon Mar 13, 2006 12:39 pm

Post by pvenezia »

shoe wrote:I also found this in my apache error log

Code: Select all

Could not create new IPC::ShareLite object: Permission denied at /var/www/html/cacti/scripts/lmgrd-query.pl line 8
Where do I set/change this permission?
You don't. lmgrd-query.pl shouldn't be creating the object, just reading it. The IPC code is specifically called read-only from the query script. Is the poller running? Can you run the test and get valid data?
shoe
Posts: 7
Joined: Wed Apr 18, 2007 4:24 pm

Re: frustrated

Post by shoe »

pvenezia wrote: It would seem that the script called from Cacti isn't matching on the FQDN. Make sure they match, case sensitive.
This is what's frustrating me I think. They ARE exact, no mismatches anywhere.
shoe
Posts: 7
Joined: Wed Apr 18, 2007 4:24 pm

Post by shoe »

pvenezia wrote: You don't. lmgrd-query.pl shouldn't be creating the object, just reading it. The IPC code is specifically called read-only from the query script. Is the poller running? Can you run the test and get valid data?
Yes the poller is running

Code: Select all

# ps aux | grep lm
root      7337  0.0  0.5   7068  2656 ?        S    Apr18   0:01 lmgrd-poller.pl: Sleeping...
root     16316  0.0  0.1   3884   660 pts/1    R+   07:25   0:00 grep lm
If by "test" you mean

Code: Select all

# perl ./lmgrd-query.pl test 
Then, yes I get valid data from the test see my first post above. I'm thinking the error in my apache error log are pointing to the problem...I'm just not sure what it is...


BTW Thanks for your hard work in developing this script and answering questions, I'm really excited to try to get it working.
shoe
Posts: 7
Joined: Wed Apr 18, 2007 4:24 pm

Post by shoe »

I'm looking at your perl and following along.

I see where you've setup a switch on argument 2, the function. In the cacti debug it lists using both "query" and "index" as function arguments but never "get" which seem to be the heart of the script. Where is the script called with this argument?
Brenner
Posts: 29
Joined: Thu Apr 19, 2007 9:58 am

Post by Brenner »

Hello, first sorry for my poor english!

I have the problem that my Output on "perl ./lmgrd-query.pl test" is this:
[root@vr08 scripts]# perl ./lmgrd-query.pl test
Dumping hash...
$VAR1 = '127.0.0.1';
$VAR2 = {};
$VAR3 = 'vr08.vr';
$VAR4 = {};
$VAR5 = 'localhost';
$VAR6 = {};

In the lmgrd-poller.pl I have change to this, not more
my $lmutil = '/opt/flexlm/lmutil';

# Servers to poll, daemon name, and TCP port
my %licservers = (
'FQDN' => {
'27002' => {
'lizenz_humansolutions' => 'HumanSolution',
'lizenz_maya' => 'Maya',
'lizenz_vircinity' => 'Vircinity',
'lizenz_vrcom' => 'VRCom',
},
},
);
shoe
Posts: 7
Joined: Wed Apr 18, 2007 4:24 pm

Post by shoe »

shoe wrote:I'm looking at your perl and following along.

I see where you've setup a switch on argument 2, the function. In the cacti debug it lists using both "query" and "index" as function arguments but never "get" which seem to be the heart of the script. Where is the script called with this argument?
n/m found it in the xml template, you'll have to forgive me as I'm new to cacti.

I still get 0 rows of data however. What's interesting is I can run the exact perl command(s) that are listed in cacti's debug and they all work perfectly. :x
shoe
Posts: 7
Joined: Wed Apr 18, 2007 4:24 pm

Post by shoe »

Okay I finally got it figured out. The errors in my apache error log were pointing me in the right direction. It turns out the SELinux was not allowing apache/php to run lmutil. Once I disabled that it all worked fine. I haven't played with linux in a while so I was unaware that SELinux is enabled on Fedora 6 by default. Since this is a dev machine I don't really need it. Thanks for all the help and work on the scripts.

I sitting back and watching my pretty graphs grow
:D
Brenner
Posts: 29
Joined: Thu Apr 19, 2007 9:58 am

Post by Brenner »

Brenner wrote:Hello, first sorry for my poor english!

I have the problem that my Output on "perl ./lmgrd-query.pl test" is this:
[root@vr08 scripts]# perl ./lmgrd-query.pl test
Dumping hash...
$VAR1 = '127.0.0.1';
$VAR2 = {};
$VAR3 = 'vr08.vr';
$VAR4 = {};
$VAR5 = 'localhost';
$VAR6 = {};

In the lmgrd-poller.pl I have change to this, not more
my $lmutil = '/opt/flexlm/lmutil';

# Servers to poll, daemon name, and TCP port
my %licservers = (
'FQDN' => {
'27002' => {
'lizenz_humansolutions' => 'HumanSolution',
'lizenz_maya' => 'Maya',
'lizenz_vircinity' => 'Vircinity',
'lizenz_vrcom' => 'VRCom',
},
},
);

Nobody? Should I open a new thread?

Today I tried all the time, read perl script manuals and so on but nothing is better.

Can somebody give me a real lmgrd-query.pl with fake data. I can
quorks987
Posts: 1
Joined: Wed Apr 25, 2007 8:42 am

Post by quorks987 »

[edited] ...


After spending a lot of time with this, I have no idea, how to get it work. The perl-Script returns right values... Data query debug returns:

Code: Select all

+ Running data query [13].
+ Found type = '4 '[script query].
+ Found data query XML file at '<cactiPath>/cacti/resource/script_queries/lmgrd.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl <cactiPath>/cacti/scripts/lmgrd-query.pl FQDN xxx index'
+ Executing script query 'perl <cactiPath>/cacti/scripts/lmgrd-query.pl FQDN xxx query appname'
+ Executing script query 'perl <cactiPath>/cacti/scripts/lmgrd-query.pl FQDN xxx query package'
+ Found data query XML file at '<cactiPath>/cacti/resource/script_queries/lmgrd.xml'
+ Found data query XML file at '<cactiPath>/cacti/resource/script_queries/lmgrd.xml'
+ Found data query XML file at '<cactiPath>/cacti/resource/script_queries/lmgrd.xml'
...but it says "This data query returned 0 rows, perhaps there was a problem executing this data query" ... I'm not able to figure out whats going wrong... executing "perl lmgrd_query.pl FQDN xxx index" returns nice list :-)
pvenezia
Posts: 20
Joined: Mon Mar 13, 2006 12:39 pm

Post by pvenezia »

quorks987 wrote: ...but it says "This data query returned 0 rows, perhaps there was a problem executing this data query" ... I'm not able to figure out whats going wrong... executing "perl lmgrd_query.pl FQDN xxx index" returns nice list :-)
Check to see if SELinux is enabled. This will block script execution if not properly configured. Also, ensure that the FQDN matches exactly.
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

Hi all

I manage to install and use this script. Cool! I think my boss like it.
Thanks pvenezia and nick@seakr.com! Any new updates?

I not sure whether is it a script bug or cacti bug but here is the thing:
On Application/Vendor that has a lot of features (like more than 50 features), if I select all feature and create the graph, it does not disable the feature that it already created the graph. That mean, I can keep on selecting the same feature(s) again and again and the end results is that I will have alot of same graphs of the same features.

For Applications/Vendor that has leser feature, it does not have that problem because those feature that already selected to generate graph will be disabled.

SH
Bucket10284
Posts: 1
Joined: Wed Jun 06, 2007 10:43 am

Post by Bucket10284 »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest