Palisade Java Collection Script Instructions
This document is Copyright © 2011-2024 by Palisade Compliance, LLC. It contains confidential and proprietary
information that may only be disclosed to individuals and entities under a Non-Disclosure Agreement (NDA).
The terms Palisade Compliance, Audit Intervention, Compliance Assurance and ULA Optimization are marks of Palisade
Compliance, LLC. All other trademarks are the property of their owners.
```
Contents
Overview ............................................................................................................................................................... 2
Introduction ...................................................................................................................................................... 2
Unix Prerequisites ............................................................................................................................................ 2
Windows Prerequisites .................................................................................................................................... 2
Important Notes ............................................................................................................................................... 3
Running the Palisade Java Collection Script for Unix ............................................................................................ 4
Installation ........................................................................................................................................................ 4
Interactive mode execution ............................................................................................................................. 4
Running the Palisade Java Collection Script for Windows .................................................................................... 7
Installation ........................................................................................................................................................ 7
Execution .......................................................................................................................................................... 7
Uploading the Collected Data ............................................................................................................................... 8
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 1
```
Palisade Java Collection Script Instructions
Overview
This document describes the technical steps to be performed by server administrator to extracting Java
related deployment configuration for analysis.
Introduction
The Java Collection Script is designed to extract all deployment configuration required for utilization
analysis from a Java environment. The script should be executed on each server where Java software is
installed. The data collected is in text format.
Unix Prerequisites
To properly run the Palisade Java Collection script, certain conditions and credentials are required.
Before proceeding with the script execution, please make sure the following conditions are met and the
required information is readily available:
1. This script can only be used on Unix/Linux or Solaris environments
2. This script can potentially be used on other Unix based environments
3. Check that the operating system user that will be used to run the tool has access to the
following OS level commands: TAR, GZIP
4. The operating system user executing the script should have read permissions to the directories
where the Java distributions are installed. In order to get the Java version information from
various user paths, and to identify the folder(s) of a running Java process, it is recommended to
execute the script with a root user or another user with root privileges.
5. Make sure the ‘collect_java.sh’ file is in Unix format (sometimes the format is switched to
Windows when editing there). There are various ways to check format, here are some checks
(dos2unix is not available in all systems):
grep -U $'\015' collect_java.sh
dos2unix < collect_java.sh | cmp -s - collect_java.sh
Windows Prerequisites
To properly run the Palisade Java Collection script, certain conditions and credentials are required. Before
proceeding with the script execution, please make sure the following conditions are met and the required
information is readily available:
1. This script can be only used on Windows operating systems.
2. The operating system user executing the script should have read permissions to the directories
locations where Java is installed.
3. At runtime, files will be automatically created by the script on the path where the script is located or
on the output path specified in the command line using -output parameter. Therefore, full access
rights are required to the folder used for output.
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 2
```
Important Notes
File Compression Utilities
o The compression formats listed below are the only acceptable formats that are to
be used when consolidating script output files.
ZIP (.zip)
GNU ZIP (.gz, .[Link])
Script Generated File Names and File Content
o Do not alter or edit the script generated file name – the script creates a unique file
name for each program instance measured under the current directory using the
host name and a timestamp.
o Do not alter or edit the content contained in the script generated file.
Duplicates
o When executing a script more than once against the same set of data only provide
the most recent script output.
Script Execution on All Environments
o Scripts are to be executed on all machines across all environments, including
Disaster Recovery, if possible.
o If a Clone and the host name is an exact duplicate of a host in another
environment, place the cloned output in a folder that describes the cloned machine
(for example, sub-folder names may be something like “test_clone_location”,
“dev_clone_location”, or “qa_clone_location”).
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 3
```
Running the Palisade Java Collection Script for Unix
This section provides instructions on running the Java Data Collection script on UNIX/Linux environments.
Installation
Copy the ‘collect_java.[Link]’ archive file into the server location where you intend to run the script
from and extract all files in a directory. Please check that the following file exists in that directory:
collect_java.sh - mandatory
collect_cpu.sh – optional (required only if the CPU information is needed)
At runtime, the output file(s) and subdirectories will be created in the collection path automatically by the
script. Therefore, full access rights are required to this subdirectory for the operating system user being used
to run the script.
Interactive mode execution
1. Start the tool by running the corresponding executable file (shell script):
On a Unix/Linux terminal type:
./collect_java.sh
The script will search by default on all filesystems excluding the Network File Systems
2. The script will ask for the Customer Name and Search Directory Location. It is recommended a
value is provided for each to control the outcome. However, default values will be set by the
script when user input is omitted. Here is a brief description for each of the user inputs, and their
corresponding default values when omitted:
Input Description Default Value
Customer Name Usually the Company Name, used to label the output palcust
files
Search Directory Top level directory location to be searched recursively /dev /home /opt /var
/usr
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 4
```
The default output directory will be the script directory. The -output command line parameter can
be used to select a different directory (directories with spaces are not permitted):
./collect_java.sh -output /path/to/output/directory
The Network File Systems or/and Common Internet File Systems will not be scanned. If Java
installations related with a specific server are deployed on NFS or CIFS please use -includeremotefs
parameter when invoking the executable file:
./collect_java.sh -includeremotefs
Please note the directory locations provided must exist and be accessible to the user executing the
script. When an invalid directory location is entered, the script will inform the user about the error:
find: `/wrongdir': No such file or directory
3. After the user input has been entered, the script will proceed to perform the Java data collection
4. Each command being used by the script is previously logged (in output file) – to be tracked with
produced output:
e.g.: checked command: java -version | head -2
5. The script can be also executed in silent mode if needed. In this mode all user input is provided in the
command line, using parameters (e.g., collect_java.sh -silent -fullscan). The default Customer
Name (palcust) will be always used in this mode. Once all parameters are valid, the script will proceed to
perform the Java data collection.
Parameter Description Dependency
-silent Enable the silent mode. If -fulscan or - scandirs parameters are not
used, then the tool will search for java on the default top level
directories: /dev /home /opt /var /usr
-fullscan The script will perform a full scan starting from root (/) -silent
-scandirs The script will recursively scan starting from the directories specified on - -silent
<comma,separated,directories> scandirs parameter. The top-level directories should be comma separated
-includeremotefs Include remote files systems (NFS, CIFS) on
searching
-output The script will collect/copy the output files in the directory specified on -
output option. Directory names with spaces are not permitted.
-restricted With this option the potential sensitive information will be excluded from
output
-noip Avoid the collection of IP addresses in the CPUQ output file
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 5
```
6. Here is a list of error messages that might be returned by the Unix script:
Error exit Error message / Error code meaning
code
0 Collection process has been completed.
121 PALJVERR: Unable to create the <dir> directory.
PALJVERR: User doesn't have the permission to write in the <dir> directory.
PALJVERR: <dir> directory does not exist.
122 PALJVERR: Please check the available storage space on <dir> directory.
123 PALJVERR: <directory to be scanned> directory does not exist or is not readable.
PALJVERR: No argument provided on -scandirs option.
124 PALJVERR: <output dir> directory does not exist or is not readable.
PALJVERR: No argument provided on -output option.
125 PALJVERR: The -fullscan parameter cannot be used together with the -scandirs parameter.
126 PALJVERR: -fullscan or -scandirs parameters can be accessed only if -silent parameter is used.
127 PALJVERR: No argument provided on -customername option.
128 Reserved error code.
129 PALJVERR: <parameter> is an invalid entry.
7. If the collect_cpu.sh file is in the same directory with collect_java.sh file, two output files will be
generated in a subdirectory created at runtime. The subdirectory will be packed into an archive file with
the following naming convention:
palcust-palpck-<machine_name>__<YYYYMMDDHH24MI>P<process_id_for_collect_java>.[Link]
8. If collect_cpu.sh is not on the same directory with collect_java.sh file, only one flat file will be created by
the script. The single file will have the following naming convention
palcust-paljv-<machine_name>_ <YYYYMMDDHH24MI> P<process_id_for_collect_java>.txt
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 6
```
Running the Palisade Java Collection Script for Windows
This section provides instructions on running the Java Data Collection script on Windows environments.
Installation
Copy the ‘collect_java.zip’ archive file into the Windows server or workstation location where you intend to
run the script from and extract all files in a directory. Please check that the following files exists in that
directory:
collect_java.cmd - mandatory
collect_java.js – mandatory
[Link] – optional (required only if the CPU information is needed)
[Link] – optional (required only if the CPU information is needed)
The output file will be created by default on the path where the script is located or on the path specified in the
command line. Full access rights are required to the folder used for output.
Execution
1. The script can be executed in interactive or silent mode. No user input is required in interactive mode. No
messages will be displayed to the terminal in silent mode. The user can control the script using the
available command line options. The script will search on all fixed drives for Java installations and will scan
the list of processes for Java processes.
collect_java.cmd -silent
collect_java.cmd -includenetwork
collect_java.cmd -includeremovable
collect_java.cmd -silent -includenetwork -includeremovable
collect_java.cmd -output “C:\Test”
collect_java.cmd -restricted
Option Description
-silent Enable the silent mode.
-includenetwork By default, the script will scan only the local fixed drives. When this option is used, the script will also scan
the mapped network drives.
-includeremovable By default, the script will scan only the local fixed drives. When this option is used, the script will also scan
the removable drives (external drives or USB memory sticks)
-output “<PATH>” By default, the output will be stored in the script folder. When this option is used, the script will check the
existence of the PATH specified by the user. If the path exists, then the output files will be created on this
path. Otherwise, the script folder will be used.
-restricted With this option the potential sensitive information will be excluded from output
-noip Avoid the collection of IP addresses in the CPUQ output file
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 7
```
2. If the [Link] and [Link] files are in the same directory with collect_java.cmd and collect_java.js files,
two output files will be generated in a subdirectory created at runtime. The subdirectory will be packed
into an archive file with the following naming convention:
palcust-palpck-<machine_name>__<YYYYMMDDHH24MISEC>P<process_id_for_collect_java>.zip
3. If the [Link] and [Link] files are not in the same directory with collect_java.cmd and collect_java.js
files, only one flat file will be created by the script. The single file will have the following naming
convention:
palcust-paljv-<machine_name>_ <YYYYMMDDHH24MISEC> P<process_id_for_collect_java>.txt
Uploading the Collected Data
Once completed successfully, all the output files from all machines will be packaged into a [Link] or zip
file and delivered back to Palisade for analysis.
Upload notes:
• The data folder paths will be searchable in the Palisade reports, so feel free to organize the data
into subfolders by business unit, environment, etc.
• Output files do not need to be uploaded individually for every machine, feel free to bundle using
.zip formatted files.
Confidential and Proprietary – © 2011-2024 Palisade Compliance, LLC. All Rights Reserved. 8