Ad Widget

Collapse

Item to monitor license usage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mortuletti
    Member
    • May 2016
    • 76

    #16
    Hi!
    Strange. Looks like a bug.
    Please, connect mysql and run command;
    select key_, value_type from items where key_ = 'arnold.status';

    So, we will check value type registered in the database for this item.
    Expected result:
    0 - numeric, float
    3 - numeric, unsigned

    Br, Alexander

    Comment

    • limbooface
      Member
      • Jun 2016
      • 77

      #17
      mysql> select key_, value_type from items where key_='arnod.status';
      Empty set (0.01 sec)


      I did notice yesterday that when I ran in a terminal on the server:
      rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | cut -c 40-41

      11
      0,

      I get 2 values because we have 2 license files but expiring different times. I expect it does not like the "," I think also it maybe because its thinking the value that should be in the graph is "110,"

      I am getting a red "x" in the item type as Not Supported.
      saying "Received value[110,]is not suitable for value type [Numeric (unsigned)] and data type [Decimal]. I think this is the root cause as data is being sent.

      Do you know how i separate the 2 values?

      i am getting the data from a in house license check utility in order to run cut.
      ### Arnold ###

      arnold v20160712
      count: 13, # reservations: 0, inuse: 11, exp: 12-jul-2016
      obsolete: 0, min_remove: 120, transactions: 13807
      arnold v20170218
      count: 11, # reservations: 0, inuse: 0, exp: permanent
      obsolete: 0, min_remove: 120, transactions: 29876

      Also in the command if i select cut -c 40|41 when eventually the license usage becomes single figure from 11 to say 5 it will think the value is "5,", which will be invalid.

      Comment

      • mortuletti
        Member
        • May 2016
        • 76

        #18
        Hi!
        Ok. Clear.
        Yes, "5," can be saved to database as "log" or "text". This fields will do not have graph and not so simple to create Triggers and so on.

        Try to use:

        rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | awk -F'[^0-9]*' '{print $6}'

        Change $6 to value, what will give expected (license count) result.

        Br, Alexander

        Comment

        • mortuletti
          Member
          • May 2016
          • 76

          #19
          And in regards of monitoring 2 license types, just create 2 Items.
          For v20160712:
          rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | awk -F'[^0-9]*' '{print $2}'

          For v20170218:
          rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | awk -F'[^0-9]*' '{print $11}'

          Something like this.
          Br, Alexander

          Comment

          • limbooface
            Member
            • Jun 2016
            • 77

            #20
            ok I understand what your saying, but the 2 values will be dynamic as it will show current number of licenses "in use" so the command to add {print $2} etc will not make it dynamic but static and produce a static graph with only 1 value the value will not change as more licenses get used or released.

            How do I make it so that the value changes dynamically as and when the license count starts to get used or released?

            Comment

            • limbooface
              Member
              • Jun 2016
              • 77

              #21
              ok so i ran the command

              rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | awk -F'[^0-9]*' '{print $4}'

              which give me the inuse value however when I run this command i still get 2 values:
              5
              0
              displayed exactly as above in 2 separate lines.

              as you can see from the license

              count: rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count
              count: 13, # reservations: 0, inuse: 5, exp: 12-jul-2016
              count: 11, # reservations: 0, inuse: 0, exp: permanent

              Comment

              • limbooface
                Member
                • Jun 2016
                • 77

                #22
                50690:20160705:144447.035 error reason for "server:arnold.status" changed: Received value [60] is not suitable for value type [Numeric (unsigned) ] and data type [Decimal]


                above is showing the 2 licenses
                6
                0

                as 60.

                Comment

                • mortuletti
                  Member
                  • May 2016
                  • 76

                  #23
                  Script should return just one value.
                  I have tested with, of cours, differen example but script returns just number and just one. (depending from $X ) X - is number of value we need to get.

                  So, if script without awk command get:
                  count: rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count
                  count: 13, # reservations: 0, inuse: 5, exp: 12-jul-2016
                  count: 11, # reservations: 0, inuse: 0, exp: permanent

                  To get 1st issued license count should be:
                  rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | awk -F'[^0-9]*' '{print $3}'

                  for second:
                  rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | awk -F'[^0-9]*' '{print $8}'

                  Zabbix will run command with configured interval and it will not be dynamic.
                  Br, Alexander

                  P.S. of course can create 2 more Items to collect license count and then make calculated Graphs and Triggers, but this depends from requirements.

                  Comment

                  • limbooface
                    Member
                    • Jun 2016
                    • 77

                    #24
                    This is correct

                    rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count
                    count: 13, # reservations: 0, inuse: 5, exp: 12-jul-2016
                    count: 11, # reservations: 0, inuse: 0, exp: permanent

                    However if I run
                    rlmutil rlmstat -a -c 5055@server | sed -n '/arnold/,$p'|grep count | awk -F'[^0-9]*' '{print $4}'
                    That will give the value for column with the inuse numbers so what it shows me is:
                    5
                    0
                    This is correct.

                    But because it shows me both the license inuse numbers at print $4 I cannot enter the exact same UserParameter in zabbix-agent.conf for both licenses as it says already used.

                    If i use a different "print $3 etc" I get no value the correct one is print $4 for both licenses.

                    In the server logs it seems to add the values together to make a whole number so it becomes 50 and not just 5 or just 0.

                    Thanks for your help and being patient.

                    Comment

                    • limbooface
                      Member
                      • Jun 2016
                      • 77

                      #25
                      changed to float to see what happens and server logs says
                      50689:20160705:150401.827 error reason for "server.unionvfx.local:arnold.status" changed: Received value [60] is not suitable for value type [Numeric (float)]
                      50691:20160705:151150.385 error reason for "server.unionvfx.local:arnold.status" changed: Received value [50] is not suitable for value type [Numeric (float)]
                      50690:20160705:151200.395 error reason for "server.unionvfx.local:arnold.status" changed: Received value [60] is not suitable for value type [Numeric (float)]
                      50692:20160705:151210.407 error reason for "server.unionvfx.local:arnold.status" changed: Received value [50] is not suitable for value type [Numeric (float)]
                      50689:20160705:151220.419 error reason for "server.unionvfx.local:arnold.status" changed: Received value [60] is not suitable for value type [Numeric (float)]
                      50689:20160705:151230.434 error reason for "server.unionvfx.local:arnold.status" changed: Received value [50] is not suitable for value type [Numeric (float)]
                      50692:20160705:151320.495 error reason for "server.unionvfx.local:arnold.status" changed: Received value [60] is not suitable for value type [Numeric (float)]
                      50689:20160705:151341.520 error reason for "server.unionvfx.local:arnold.status" changed: Received value [50] is not suitable for value type [Numeric (float)]

                      Comment

                      • mortuletti
                        Member
                        • May 2016
                        • 76

                        #26
                        Ahh, sorry, now clear why 2 numbers returned.
                        2 rows - 2 numbers
                        Somehow we need to reduce command result to one row at a time.
                        Br, Alexander

                        Comment

                        • mortuletti
                          Member
                          • May 2016
                          • 76

                          #27
                          Can we get license count using different commands?
                          I have found:
                          rlmutil rlmstat -c 5055@server -avail
                          Can you run it and paste here result?
                          Br, Alexander

                          Comment

                          • limbooface
                            Member
                            • Jun 2016
                            • 77

                            #28
                            this gives:
                            rlmutil rlmstat -c 5055@server -avail
                            Setting license file path to 5055@server
                            rlmutil v9.4
                            Copyright (C) 2006-2012, Reprise Software, Inc. All rights reserved.

                            License availability for all products from all ISVs

                            ISV: solidangle
                            server host: server (port 5055)
                            arnold v20160712 available: 9
                            arnold v20170218 available: 11

                            Comment

                            • limbooface
                              Member
                              • Jun 2016
                              • 77

                              #29
                              rlmutil rlmstat -c 5055@server -p arnold v20160712

                              show all the licenses for product v20160712 maybe we can somehow incorporate that command option with the command

                              rlmutil rlmstat -a -c 5055@server |grep count | awk -F'[^0-9]*' '{print $4}'

                              Comment

                              • mortuletti
                                Member
                                • May 2016
                                • 76

                                #30
                                Hi!
                                Yes, we need to get value per license, so you can create 2 separate Items in Zabbix.
                                So, please run these commands and show me result:
                                1.
                                rlmutil rlmstat -a -c 5055@server | grep v20160712 | awk -F'[^0-9]*' '{print $4}'
                                2.
                                rlmutil rlmstat -a -c 5055@server | grep v20170218 | awk -F'[^0-9]*' '{print $4}'
                                3.
                                rlmutil rlmstat -c 5055@server -avail | grep v20160712 | awk -F'[^0-9]*' '{print $3}'
                                4.
                                rlmutil rlmstat -c 5055@server -avail | grep v20170218 | awk -F'[^0-9]*' '{print $3}'

                                Using command awk -F'[^0-9]*' '{print $3}' does not means we will get number 3, we will get 3rd number from command output.
                                Please change number after $ sign to get exactly number of licenses.
                                Br, Alexander

                                Comment

                                Working...