예제 #1
0
options = {
    'verbosity'     : opt.verbosity,
    'command'       : command,
    'log_name'      : opt.log_name,
    'server_vals'   : server_values,
    'rlogin'        : opt.rlogin,
    'file_stats'    : opt.file_stats,
    'show_options'  : opt.show_options,
    'copy_location' : opt.copy_location,
    'value'         : opt.value,
}

try:
    # Open a connection to the audit log manager and run the audit
    # log commands as specified by the options.
    log = AuditLog(options)

    # Make sure server supports the audit log else fail
    if command != "COPY" and not opt.file_stats:
        log_error = log.check_audit_log()
        if log_error:
            parser.error(log_error)

    # Show audit log options before command
    if opt.show_options:
        # if some other command has run
        if len(args):
            print("#\n# Showing options before command.")
        log.show_options()

    # Execute the command specified
예제 #2
0
    'format': opt.format,
    'users': users,
    'start_date': start_date,
    'end_date': end_date,
    'pattern': pattern,
    'use_regexp': opt.use_regexp,
    'query_type': query_types,
    'event_type': event_types,
}

try:
    if not exist_search_criteria() and not (opt.format or opt.stats):
        print "#\n# No search criteria defined.\n#"
    else:
        # Create and init the AuditLog obj with the provided options
        log = AuditLog(options)

        # Open the audit log file
        log.open_log()

        # Parse the audit log file and apply filters
        log.parse_log()

        # Close the audit log
        log.close_log()

        if opt.stats:
            # Show audit log stats
            log.show_statistics()
        else:
            # Print the resulting data (to the sdtout) in the specified format
예제 #3
0
        'users': users,
        'start_date': start_date,
        'end_date': end_date,
        'pattern': pattern,
        'use_regexp': opt.use_regexp,
        'query_type': query_types,
        'event_type': event_types,
        'status': status_list,
    }

    try:
        if not exist_search_criteria() and not (opt.format or opt.stats):
            print("#\n# No search criteria defined.\n#")
        else:
            # Create and init the AuditLog obj with the provided options
            log = AuditLog(options)

            # Open the audit log file
            log.open_log()

            # Parse the audit log file and apply filters
            log.parse_log()

            # Close the audit log
            log.close_log()

            if opt.stats:
                # Show audit log stats
                log.show_statistics()
            else:
                # Print the resulting data (to the sdtout) in the specified
예제 #4
0
    options = {
        'verbosity': opt.verbosity,
        'command': command,
        'log_name': opt.log_name,
        'server_vals': server_values,
        'rlogin': opt.rlogin,
        'file_stats': opt.file_stats,
        'show_options': opt.show_options,
        'copy_location': opt.copy_location,
        'value': opt.value,
    }

    try:
        # Open a connection to the audit log manager and run the audit
        # log commands as specified by the options.
        log = AuditLog(options)

        # Make sure server supports the audit log else fail
        if command != "COPY" and not opt.file_stats:
            log_error = log.check_audit_log()
            if log_error:
                parser.error(log_error)

        # Show audit log options before command
        if opt.show_options:
            # if some other command has run
            if len(args):
                print("#\n# Showing options before command.")
            log.show_options()

        # Execute the command specified