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 or -splunk parameter, which provides the output in a comma separated value format for use in spreadsheets, or splunk compatible output 
for use in Splunk.  If you want to change the output names, edit the log4j.properties file and change the appropriate system or output log file names.

java -jar ARUserCount.jar -x ServerName[:2020] -u Demo [-a 1 -csv -d -df "yyyy-MM-dd HH:mm:ss" -p password -sa "BMC:Asset Mgmt" -sg -splunk -v]
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 - October 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 accountings 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
- Made the jar executable so that it wasn't necessary to specify the classpath for the java line
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 of the tool