User Count

This program will connect to one to many Remedy servers and collect summary license statistics regarding Fixed/Floating (Write)/Floating (Read)/Read licenses of those logged in. If used against multiple servers, it will give you a total of each server, and then a count of unique users across all servers that it connected to. If you want to use this in a script, you can provide the optional -csv parameter, which provides the output in a comma separated value format for use in spreadsheets.

java -jar APLUserCount.jar -x <server>:<port> -u <user> [-p <password> -sg -a <active hours> -csv -splunk -v -d -df “yyyy-MM-dd HH:mm:ss” -sa “BMC:Asset Mgmt”]

Required
-x: This is the server to connect to, if connecting to multiple servers, use multiple of this option, or specify multiple separated by ,’s. Optionally specify server:port
-u: User used to connect to the servers

Optional
-a: Number of hours to count someone as Active within, defaults to 1 if not specified
-csv: Provides alternate display for use in scripting With csv output, you can specify which Application you want to provide output for (i.e. -sa “BMC:Change Mgmt”, if not specified, it defaults to “AR Server”); Column headers are Date/Time, [Total for each node specified to connect to], [If multiple, number of Unique users,] Active, Fixed, Float(W), Float(R), Read You can just put these headings at the the top of your output log
-d Provides debug output as collected from the servers for Users and license details
-df Allows you to specify the output format of the date, it defaults to yyyy-MM-dd HH:mm:ss
-p: Password of the user being used to connect
-sa: If you want details on a specific application, specify that app here and the stats will be produced for it, otherwise the report will be for AR System
-sg: If specified, it uses the server specified in -x and gets a list of the servers in the group from there and gets the stats for all servers in the group
-splunk Provides parameter=value type output for all of the results which is very compatible with splunk log reading
-v Verbose, this provides details of all users and their licenses instead of just counts

Examples:
Connect to multiple servers using port mapper using multiple -x commands
java -jar APLUserCount.jar -u Demo -p password -x server1 -x server2
Connect to multiple servers on specific ports using a single comma separated list of servers
java -jar APLUserCount.jar -u Demo -p password -x server1:1234,server2:1234
Connect to a single server on a specific port, but use the server group information to collect the rest of the servers
java -jar APLUserCount.jar -u Demo -p password -x server1:1234 -sg
Connect to a single server on a specific port, but collect Incident Management data instead of AR Server
java -jar APLUserCount.jar -u Demo -p password -x server1:1234 -sa “BMC:Incident Mgmt”
Connect to a server group and provide output in csv but change the output date format from 24 hours to 12 hours with am/pm
java -jar APLUserCount.jar -u Demo -p password -x server1:1234 -sg -csv -df “yyyy-MM-dd hh:mm:ss a”


Version History

5.1 – March 30th 2022

  • Added support for Bundled Licenses

5.0 – October 15th 2020

  • Completely changed how output from this program works. I’m now using logging instead of system out, which means the batch file changes. There are now two different output files one of which is the system activity, the other is the output, this allows for logging of system events (login errors, servers in the run, etc) all without concern for the output of the program, which is put in a separate file, both file names are controlled in the log4j.properties file
  • Added the ability to control the date/time output format with the new -df parameter

4.5 – October 14th 2020

  • Cleaned up the output so that it’s appropriate for -csv and -splunk outputs

4.4 – February 19 2020

  • Removed -t parameter, opting instead to use server:port nomenclature
  • Added -sg parameter, allowing you to use it against a server group and only specify a single server
  • Modified -x parameter to accept multiple , separated server names/ports

4.3 – March 28 2019

  • Updated the debug output to include which server the record is coming out of to more easily identify duplicates

4.2 – May 9th 2018

  • Added support for floating license pools for applications
  • Fixed a bug where Float Read was being listed as being in the pool

4.1 – January 26th 2018

  • A code fix for some issues that came up regarding floating license pools

4.0 – October 6th 2017

  • A virtual re-write of most of the internal code to take advantage of better understanding of Java and underlying principals

3.6 – September 4th 2017

  • Updated program so that it no longer terminates on error, allowing it to still function in server group situations where one or more servers are down

3.5 – November 8th 2016

  • Enhanced error messages
  • Updated example batch file to better capture errors

3.4 – August 1st 2016

  • Found bug in Remedy server group that sometimes has the same user as Floating Read on one server and Floating Write on another, in that scenario, this tool will always report as Floating Write if it’s found that way on at least one server

3.3 – August 1st 2016

  • Fixed nullPointerException when using csv output

3.2 – July 29th 2016

  • Fixed bug introduced with 3.1 related to not capturing the other applications

3.1 – July 28th 2016

  • Fixed bug that caused inaccurate accounting of Read licenses
  • Extended the -sa command line to only show that application for all outputs, in 3.0 it was only relevant to the -csv output

3.0 – July 27th 2016

  • Added the ability to capture more than just AR Server licenses, now captures all license details
  • Added new -sa (Specified Application) to the -csv output. because of the limited control of information in the CSV format, if you want that output to specify something  other than AR Server you can specify which application you want, but csv will only report on a single application at a time, verbose, splunk, and un-altered will report  license info for all applications if wanting to get multiple applications for csv format, run it multiple times with different output redirection files, one for each application

2.0.4 – February 4th 2016

  • Added the Max count to Floating License Pool data, so when it shows you the count of how many users are using what float pool, it’ll tell you out of how many

2.0.3 – January 11th 2015

  • Fixed problem connecting to servers that don’t use Port Mapper

2.0.2 – November 24th 2014

  • Reconfigured some of the error handling to capture the error and report it cleanly

2.0.1 – November 24th 2014

  • Recompiled using Java 1.6 for better backwards compatibility

2.0 – August 8th 2014

  • Changed -cl command line to -csv, -cl still works, but it won’t be documented anywhere any more 🙂
  • Added a -splunk command line parameter, this provides output that is friendly to splunk for use with that tool (http://www.splunk.com/)
  • Added a -v (verbose) command line parameter, that instead of giving you counts, provides you details of the users and their licenses
  • Added ‘Floating License Pool’ information. This output is available in all modes except -csv, as I couldn’t find a good way to present the data

1.0 – June 7th 2014

  • Initial public release

13 thoughts on “User Count

  1. Hi LJ,

    Would you mind sharing (or PM) your source code? I would like to run this on Linux and I would need to adapt it since it’s not working as is.

    Hope you don’t mind.
    Best regards
    Jean-Francois

  2. This would be extremely useful for us since we have 12 ARS instances on 4 different physical servers spread out on two geo-redundant locations.

    Thank you again
    JF

  3. Hi LJ,

    We would like to extend this tool to also include the Write license pool from which a floating user would be consuming a license from…

    Thanks

  4. HI LJ

    I am getting this error

    C:\com\apl>java -cp .\lib\APLUserCount.jar;.\libarapi81_build001.jar;.\lib\log4j
    -1.2.14.jar com.apl.APLUserCount -u XXXX -p XXXX -x Server1 > output1.log
    Exception in thread “main” java.lang.UnsupportedClassVersionError: com/apl/APLUs
    erCount : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: com.apl.APLUserCount. Program will exit.

    Is this something to do with Java vesion .

    C:\com\apl>java -version
    java version “1.6.0_45”
    Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

    Can you help us in running this properly..

    Jyothi

    1. Hi LJ

      Based on your respnse ..

      I would appreciate if you could recompile the Jar for our java version (1.6.0_45) . I would have to get the special approval for installing the new java.

      Jyothi

  5. When I run this in Task scheduler, every time it is run (with csv output) I get the following two lines plus a blank line before the actual output. Is there anyway to omit this information on each run so I can track license count over say 24 hours?
    A Programming Legacy – http://remedylegacy.com
    APLUserCount v4.3

    (Blank line above)

    1. Ron,
      I checked the 4.4 and it wasn’t putting that stuff in there, but with the changes I made in 4.4, it was putting OTHER things in the output that you wouldn’t have wanted. I’ve updated the code in 4.5 so that -csv and -splunk outputs provide nothing other than the stuff you are going to be appending to your csv file 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

twenty + 19 =