Verifying audit record packages using the default Java tool

Verify audit record packages by using the default Java tools that are provided with Cloud Pak System.

Before you begin

Download the command line tool from the Welcome page in the console. See the Related tasks section below for more information.

You must be assigned the Auditing role with permission to View all auditing reports (Read-only) to perform these steps.

Procedure

  1. Locate the following two files in the file system:
    • The AuditManagementTool.jar file in the lib directory
    • The JSON4J.jar file in the lib/1.1.0.X-[build_number] directory, where [build_number] is the product version number
  2. Copy the two files that you located in the previous step into a new directory.
  3. Create a Java class to run the audit verification process. For an example, refer to the sample PureAppAuditVerificationTest.java class.
  4. Compile and run the class with the two JAR files in the classpath, for example:
    Note: Replace the [user_name] and [password] variables with your system administrator credentials.
    Compile the class
    	# javac -cp AuditManagementTool.jar:JSON4J.jar PureAppAuditVerificationTest.java
    Run the class
    	# java -cp AuditManagementTool.jar:JSON4J.jar:./ PureAppAuditVerificationTest [user_name] [password] [hostname or IP address of your Cloud Pak System server] /path/to/auditpackagefile/puresystems-audit-[from date]-[to date]-version-XXX.zip
    output of the above command should be JSON format
    	{"verificationResultAuditPackage":true,"newpackagefilename":"\/path\/to\/auditpackagefile\/puresystems-audit-[from date]-[to date]-version-XXX.zip"}
    
    Sample Java class (PureAppAuditVerificationTest.java)
    >>>
    import com.ibm.workloaddeployer.auditmanagement.sample.ManagePureASAuditRecords;
    
    public class PureAppAuditVerificationTest {
    	public static void main(String[] args) throws Exception {
    		// args[0]:username, args[1]:password, args[2]:Cloud Pak System server
    		ManagePureASAuditRecords mpar = new ManagePureASAuditRecords(args[0], args[1], args[2], true);
    		// args[3]:Absolute path to an audit package file (NOT directory)
    		System.out.println(mpar.auditVerify(args[3], true));
    	}
    }