74 Replies Latest reply: Jul 10, 2013 4:15 AM by Amelia D RSS

Where to read license usage from?

dragonauta

Hi,

 

I want to create an application for license usage analysis, but I don't know where to read that info from, and I've given up on making the QMS API work. Any help will be appreciated, thanks.

  • Where to read license usage from?
    Leonard Short

    I suspect this may be what you are looking for?

     

    http://community.qlik.com/qlikviews/1029

  • Where to read license usage from?
    David VASSEUR

    I have just started playing with QMS API and I have created a small application to retrieve CAL definitions (Named CAL/Doc CALs, documents authorizations if using DMS). These informations are stored in xml files which can be loaded in a QVW.

     

    Some remarks:

    • NET 3.5 required (same as Qlikview Server)
    • You have to be in the "Qlikview Administrators" and "Qlikview Management API" groups
    • QVS and DSC have to be on the same server
    • I have just loaded to files in the QVW, there is no design yet (feel free to contribute ;-)
    • This is just a beta/proof of concept application, use at your own risk !

     

    You can download the file here: http://dl.excelcio.com/QVSCALManager_beta.zip

     

    Next step: do the same in a WebService so that info can be retrieved within Qlikview with a "load from http://xxx"

     

    PS. for those interested in developping their own applications, check this file C:\Program Files\QlikView\Management Service\QMSAPIDocumentation.chm (should have be stored in the SDK folder IMO...)

    • Where to read license usage from?
      dragonauta

      Hi David,

       

      I'm trying to download but it seems dl.excelcio.com is not available. thanks,

      • Re: Where to read license usage from?
        David VASSEUR

        Hummm, strange... see the attached file

        • Re: Where to read license usage from?
          dragonauta

          Hi David,

           

          I've added myself to the Qlikview Management API but I'm getting a "Service Key has expired" error. Please see attached image.

           

          Thanks!

          • Re: Where to read license usage from?
            David VASSEUR

            Humm, strange ! Service key is valid for 1 min I think, do you have a lot of cals/documents on your server ? Or maybe AD groups resolution is taking some time...

             

            Anyway, here is an updated version with some more calls to retrieve a service key, quick and dirty but should be enough for now !

            • Re: Where to read license usage from?
              dragonauta

              It works now and it's exactly what I needed, thanks a lot!

               

              One question, is it possible to run the exe file in batch mode? I'd like run it everyday as part of my publisher tasks.

              • Re: Where to read license usage from?
                David VASSEUR

                Great !

                 

                Right now, it cannot be run in batch mode. I could rewrite it that way but I may prefer to implement it as a web application. That way you could directly extract data into a qlikview application, for example:

                 

                CALS:

                load * from [http://<server>/qvscalmanager/get_cals];

                 

                Docs_info:

                load * from [http://<server>/qvscalmanager/get_docsinfo];

                 

                ...

                 

                The only drawback is that it would require IIS support, hummm... Or could it be integrated into QVWebServer ? Or maybe I could write it as a plugin for QVSource (hi Chris ;-))...

                 

                Well, as I said, it just a beta/poc right now, I'll be happy to have your feedback on this ! So 'batch exe file' or 'integrated into IIS/webserver' ?

            • Re: Where to read license usage from?
              Diederik van Hemert

              David, great example!

              At our site there is a need to run this in batch mode, could you possibly make the Server configurable (app.config) & the Retrieve command execute on run perhaps? That would be great. If you lack the time I could do this if you send me the source code. Thanks, Diederik

            • Re: Where to read license usage from?
              DanieleC

              Hello David, I'm really keen to use your exe but it's not working for me. I'm usign QV server v11 and probably your application was designed for v9 or v10.

              When I try to execute it I receive the message: "Connecting to QMS server 'localhost'.. failed".

              I checked your config: you use a function called BasicHttpBinding_IQMSBackend.

              I opened http://localhost:4799/QMS/Service in my server and that function doesn't exist, I wonder if maybe it was used in the v9/10 and not anymore in the v11. Any clues?

              Also, do I need to execute the exe from a specific folder in the server?

               

              Regards,

              Daniele

              • Re: Where to read license usage from?
                David VASSEUR

                Hello Daniele,

                 

                Indeed QlikTech broke (ok, improved ;-)) a few things. I've quickly patched the existing application to make it work on QV 11 but have not really tested it so use at your own risks ! There is also a command line version available, if you find the application to be useful just tell me and I'll also upgrade it.

                 

                You don't have to execute it in a specific folder.

                 

                Regards,

                David

                 

                Update:

                see here for latest version: http://community.qlik.com/message/221814#221814

                • Re: Where to read license usage from?
                  DanieleC

                  Hello David,

                       excellent work! I have tried the exe and it works on v11. I will play with it and give you my feedback, meantime thank you!

                   

                  Regards,

                  Daniele

                  • Re: Where to read license usage from?
                    DanieleC

                    Hello David,

                       I have worked with your application. My goal is to have an analysis like this:

                     

                    Document CALs allocated to this document: 20

                    Document CALs assigned to users: 10

                    Number of Users Authorisations: 30

                     

                    The first info is on the "Document.xml" file created by your application.

                     

                    The second one is missing, can you add it in the same document as a new tag? (I hope is possible, you already have the tag <DocumentCALsEmbedded>)

                     

                    The third one is on the "documentName.qvw.Meta" file. The issues are: 1 this is not a structured file so is difficult to extract the info. 2 There a different file for every doc so you need to update manually the loader if you create a new doc or create a kind of cursor to check all your docs every time. Any clues? Do you have a different approach? Do you think you can add those info in your application?

                     

                     

                    Thank you again for the support!

                     

                    Regards,

                    Daniele

                    • Re: Where to read license usage from?
                      David VASSEUR

                      Hello Daniele,

                       

                      Please find attached an updated application and a Qlikview document using the generated XML files (put the qvw in the same folder and reload). This is still in beta but you should have the information you want.

                       

                      Regards,

                      David

                       

                      *** For QV v11 only (not tested with SR1) ***

                       

                      UPDATE:

                      See here for latest version: http://community.qlik.com/message/221814#221814

                      • Where to read license usage from?
                        kmiles83

                        Hi David,

                         

                        This application is just what we have been looking for but at present it relies on someone having to manually run the applictaion to update the xml files, is there anyway to do this via a bach or integrate it into QlikView loads?

                         

                        Many thanks again for this, as even as it is it's a massive help.

                         

                        Regards,

                         

                        K

                        • Re: Where to read license usage from?
                          David VASSEUR

                          Hi K,

                           

                          here is the command line version. You can use parameters to define which info you want to retrieve but basically, the following should be enough:

                          QVSCALManager.exe -SERVER localhost -LICENSE_CALS -DOCUMENTS -CALS -DOCUMENTS_AUTHORISATIONS

                           

                          This will generate xml files in the current folder.

                           

                          You can execute the program within QV script with the "execute" keyword.

                           

                          I also have a IIS plugin version which can be called with a "load * from http://xxx" in the QV script but:

                          • it requires IIS
                          • it's a bit more complicated to configure

                           

                          Are you using the associated QVW application or only the program to generate XML files ? If so it would be nice to have your feedback on it !

                           

                          Regards,

                          David

                           

                          *** For QV v11 only (not tested with SR1) ***

                           

                          UPDATE:

                          See here for latest version:
                          http://community.qlik.com/message/221814#221814

                          • Where to read license usage from?
                            kmiles83

                            Hi David,

                             

                            Unfortunately I am not having any luck with the command line version, it says "Error connecting to QMS server 'localhost', I am using QV10, would that make a difference?

                             

                            I have been using the basic QVW application you posted initially and it has been great to help tidy up and document licenses. I plan to try and integrate this into a cutdown and slightly customised version of the QlikView Monitor to give our power users better visibility of the licenses as currently there is no way to keep them updated other than sending out spreadsheets!

                             

                            Many thanks,

                             

                            K

                            • Re: Where to read license usage from?
                              David VASSEUR

                              Hi K,

                               

                              Sorry, I thought you were referencing the previous message from Daniele and so QV 11. If you are using QV 10 please use this version.

                               

                              There is an updated QVW (see above my last answer to Daniele), it's v10 and v11 compatible.

                               

                              Regards,

                              David

                               

                              *** For QV 10 (SR1+) only ***

                               

                              UPDATE:

                              See here for latest version:
                              http://community.qlik.com/message/221814#221814

                              • Where to read license usage from?
                                martha.hernandez

                                Hi David,

                                 

                                We were using the GUI version of your code and it worked perfectly, but since we updated our server to the latest build of SR4 we've been having the following error:

                                 

                                QlikView CAL Manager (QV10) - v1.0 BETA © Excelcio 2012

                                -------------------------------------------------------

                                 

                                 

                                WARNING: Server authorization is set to 'NTFS', documents authorizations won't b

                                e retrieved!

                                Retrieving allocated CALs...

                                Whoops! Please contact the developers with the following information:

                                 

                                 

                                Message:

                                System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

                                Parameter name: documentPreloadMode

                                 

                                Exception:

                                System.ServiceModel.FaultException

                                 

                                 

                                Stack Trace:

                                 

                                Server stack trace:

                                   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRunt

                                ime operation, ProxyRpc& rpc)

                                   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on

                                eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim

                                eout)

                                   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall

                                Message methodCall, ProxyOperationRuntime operation)

                                   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

                                 

                                 

                                Exception rethrown at [0]:

                                   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req

                                Msg, IMessage retMsg)

                                   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa

                                ta, Int32 type)

                                   at QMSManager.QMSAPI.IQMSBackend.GetDocumentMetaData(DocumentNode userDocumen

                                t, DocumentMetaDataScope scope)

                                   at QMSManager.QMSAPI.QMSBackendClient.GetDocumentMetaData(DocumentNode userDo

                                cument, DocumentMetaDataScope scope)

                                   at ☻.♥(QMSBackendClient ☻, Guid ♥)

                                   at.☻(Guid ☻, Boolean ♥)

                                   at.♥(String[] ☻)

                                   at.☻(String[] ☻)

                                 

                                If we use -LICENSE_CALS it doesn´t throw the exception but, it doesn't generate the xml file although it says it does.

                                 

                                What can we do?

                                 

                                Thanks,

                                 

                                Martha

                • Re: Where to read license usage from?
                  satish47.venkat

                  Hi David,

                   

                  I downloaded your QVSCALManager_v11_GUI.zip file and while running the QVSCALManager.exe it is genarating an error attached below.

                   

                  Please suggest how to overcome this error.

                   

                  I'm using Qlikview11 Desktop app and QlikView11 Server app.

                   

                  error.JPG

                   

                  Thanks in advance.

    • Where to read license usage from?
      Rob Wunderlich

      Great tool David! Thanks for posting it.

       

      -Rob

    • Where to read license usage from?
      AndreBer

      Hello,

       

      I have just downloaded your program. Unfortunately I just get the message »Connecting to QMS server 'localhost'...failed!«.

       

      Any idea why I can't connect to the server even though I'm executing the program directly on the server.

       

      Thanks & regards

    • Re: Where to read license usage from?
      ben.jenkins

      Is there a workaround for this to work with .NET4.0? I'm receiving the following error:

       

       

      3_5_0_0 error.JPG

       

      Thanks, Ben

  • Re: Where to read license usage from?
    Stevens Bonnand

    Hi,

     

    I read this topic with some interest. Do we have an update or documentation ?

     

    I found a lot of .zip but I tried unsuccessfully

  • Re: Where to read license usage from?
    Stevens Bonnand

    Hi David,

     

    After a successfull test with v11, I tried on v10 then I get this error :

     

    Message:

    The maximum message size quota for incoming messages (65536) has been exceeded.

    To increase the quota, use the MaxReceivedMessageSize property on the appropriat

    e binding element.

     

     

    Exception:

    System.ServiceModel.CommunicationException

     

     

    Stack Trace:

     

     

    Server stack trace:

       at System.ServiceModel.Channels.HttpInput.ThrowMaxReceivedMessageSizeExceeded

    ()

       at System.ServiceModel.Channels.HttpInput.GetMessageBuffer()

       at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStr

    eam)

       at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception& req

    uestException)

       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha

    nnelRequest.WaitForReply(TimeSpan timeout)

       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeS

    pan timeout)

       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag

    e, TimeSpan timeout)

       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on

    eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim

    eout)

       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall

    Message methodCall, ProxyOperationRuntime operation)

       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

     

     

    Exception rethrown at [0]:

       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req

    Msg, IMessage retMsg)

       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa

    ta, Int32 type)

       at QMSManager.QMSAPI.IQMSBackend.GetUserDocuments(Guid qvsID)

       at QMSManager.QMSAPI.QMSBackendClient.GetUserDocuments(Guid qvsID)

       at.♣(QMSBackendClient ☻, Guid ♥)

       at ♣.☻(Guid ☻, Boolean ♥)

       at ♣.♥(String[] ☻)

       at ♣.☻(String[] ☻)

     

    I use the commandeline version, and I also tried the debug version with the same result.

     

    Could you help me on this please ?

    • Re: Where to read license usage from?
      David VASSEUR

      Hi Stevens,

       

      It's probably because you have a lot of users/documents, try ths:

      Edit QVSCALManager.exe.config (it's a text file so use Notepad for example)

      At line 14 replace:

      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

      with

      maxBufferSize="2147483647" maxBufferPoolSize="0" maxReceivedMessageSize="2147483647"

      Save and try again, it should work !

       

      By the way, this application won't be updated, I'm currently working on a new version which will be integrated within Qlikview (easier to reload and much better for results analysis )

       

      Regards,

      • Re: Where to read license usage from?
        Stevens Bonnand

        Awersome !! thanks for your rapidity.

         

        It's work. I didnt think about edit the .config file.

         

        You're work is really interresting.

         

        Just to understand, how work you're .exe ? Where do you extract license informations ? (in some word, not in details of course).

         

        Thanks again, have a nice day.

  • Re: Where to read license usage from?
    Stevens Bonnand

    Hi, again

     

    I got a new problems.

     

    In a manuel case, I can reload my application (my account is granted about document/user propertie) and I'm in the required windows group.

     

    But when I tried to reload thanks to amdinistration consol, I got an error. XML aren't loaded !

     

    I guess the Execute command crash but why ? I miss something ?

     

    I know that task is lunched with another account (sysbatch in my case). He have the same right as myself. And manually, its work too.