# Project Mapping

# Introduction

Open iT uses the openit_setid application to register a user to specific projects.

The following sections will guide you on setting up the necessary configuration to list project options and set a user project so that the user and UID classifications in your reports includes the user project ID.

From this: Application Usage Count per User Before Project Mapping

Application Usage Count per User Before Project Mapping

To this: Application Usage Count per User After Project Mapping

Application Usage Count per User After Project Mapping

This configuration affects the following data types:

# Requirements

# Listing Project Options

List the projects a user can select and set. A user won't be able to set a random string as a project; only those available in this file.

  1. Open the projectmap.oconf file in the Configuration directory, which is by default in C:\Program Files\OpeniT\Core\Configuration.

  2. Locate and set the value of root.setid.gui.title to configure the title of the interface.

    projectmap.oconf
    7|	title
    8|	{
    9|	    type=string
    10|		value="Select Project"
  3. Locate root.setid.projects.

    projectmap.oconf
    18|	projects
    19|	{
    20|	    description=Explicit projects for explicit users
    21|		sample
    22|     {
    23|         description=Sample project. List users separating them with the separator or with newline.
    24|         type=list
    25|         separator=;
    26|         nobody;none
    27|     }
  4. Add nodes based on the sample node under the projects node and configure it as needed.

    Each project object can have four (4) sub-objects:

    • description
    • type
    • separator
    • usernames

    You can list a user name under multiple projects. You can specify multiple users in a project separated by your specified separator (e.g., ;) or new lines.

    You can attach the following flags in the project or user names within parentheses:

    • global - you can use this flag for projects only. It means the project is available for everyone.

      Example
      21|		project1(global)
      22|     {
      23|         description=Sample project. List users separating them with the separator or with newline.
      24|         type=list
      25|         separator=;
      26|     }
    • default - you can use this flag for project and user names. If this is set to a project, the project will be used if the user does not select a project.

      Example
      21|		project2(global,default)
      22|     {
      23|         description=Sample project. List users separating them with the separator or with newline.
      24|         type=list
      25|         separator=;
      26|     }

      If this is set for a user, the project under which you listed the user is the default.

      Example
      21|		project3
      22|     {
      23|         description=Sample project. List users separating them with the separator or with newline.
      24|         type=list
      25|         separator=;
      26|         jdoe;jdelacruz
      27|         tmax(default)
      28|     }
  5. Save the changes.

# Setting a Project

There are two ways to set a project for specific users:

  • Setting a project manually through the command line
  • Setting a project manually through a user interface

# Setting a Project Manually through the Command Line

These are the required steps to set a project through the command line.

  1. Open a command prompt with Administrator level privileges.

  2. Go to the bin directory, which is by default in C:\Program Files\OpeniT\Core\bin, run the command:

    Command Syntax
     cd $BIN_DIR
    Example
     cd C:\Program Files\OpeniT\Core\bin
  3. Once in the directory, set your project. Run the command:

    Command Syntax
     openit_setid --set <project_name>

    where <project_name> is the name of the project you want to set.

    Command Syntax
     openit_setid --set project1
    Parameter Description
    -q, --query Use this to launch the user interface, allowing you to select a project from a list of projects.
    Note: If you don't belong to a project and you use this parameter, N/A is defined.
    -l <exe-path>, --launch <exe-path> Use this to launch an application after saving a project. You can use this with --set or --query.

    Examples:
    openit_setid --set project1 --launch C:\Windows\system32\notepad.exe
    Running this sets project1 as project and launches the Notepad application.

    openit_setid --query --launch C:\Windows\system32\notepad.exe
    Running this launches the user interface for selecting a project. After you choose a project, the Notepad application will launch.
    -v, --verbose Use this to output detailed information about what openit_setid is doing.
    Optional Parameters

    Make sure no errors are encountered.

# Setting a Project Manually through a User Interface

# Creating an openit_setid Shortcut

You can manually set a project through a user interface. First, you must create a desktop shortcut for openit_setid.exe. These are the required steps to create the shortcut.

  1. Right-click on your desktop, click New, and then click Shortcut.

    Create openit_setid.exe Shortcut

    Create openit_setid.exe Shortcut

    A window will appear.

  2. Type in or browse for the absolute path to openit_setid.exe, which is by default C:\Program Files\OpeniT\Core\bin\openit_setid.exe, then click Next.

    Specify openit_setid.exe Path

    Specify openit_setid.exe Path

  3. Type in the name for the shortcut, then click Finish.

    Specify Shortcut Name

    Specify Shortcut Name

  4. Right-click the shortcut you created, then click Properties.

    Shortcut Properties

    Shortcut Properties

  5. Replace the value of target with the following:

    Target Value
     <openit_set_id_path> --query

    where <openit_set_id_path> is the absolute path to openit_setid.exe, which is by default C:\Program Files\OpeniT\Core\bin\openit_setid.exe,

    Example
     "C:\Program Files\OpeniT\Core\bin\openit_setid.exe" --query

    Then click Apply, then click OK.

    Apply Shortcut Properties

    Apply Shortcut Properties

# Setting a Project

  1. Double-click the shortcut you created. A user interface will appear.

  2. Select your project, then click OK.

    Select Project

    Select Project

# Verifying a Set Project

Verify that you successfully set the project.

  1. Go to the temp directory, which is by default in C:\ProgramData\OpeniT\Data\temp.

  2. Verify that there is a generated project_id-<username>*.idval file (e.g., project_id-jdoe-1.idval).

  3. Open said file and verify that it contains the timestamp and name for the set project.

    Example
    1   time=3953089194133
    2   project=project1

# Creating Project and Username Classifications

These are the required steps to create a virtual classification from the UID classification to separate it into username and project to allow project chargeback implementation.

From this: Application Usage Count per User After Project Mapping

Reporting with the UID Classification

To this: Application Usage Count per User After Project Mapping

Reporting with the User and Project Classifications

  1. Go to the mappings directory, which is by default in C:\Program Files\OpeniT\Core\Configuration\mappings.

  2. In the default report, the project id is appended to the username in the format <username>|projectid=<project_name>. With this configuration, we will use the separator | and fields[0] for the username and the separator = and fields[1] for the project id.

    Create a file named u-id with the following contents:

    u-id
    [SUB-MAPPINGS]:
    sub {
        my( $value ) = @_;
        my $sep = '|';
        my @fields = split( /\Q$sep/, $value );
        $sep = '\\\\';
        @fields = split( $sep, $fields[0] );
        return pop @fields;
    }

    Save the file.

    Create a file named project-id with the following contents:

    project-id
    [SUB-MAPPINGS]:
    sub {
        my( $value ) = @_;
        my $sep = '|';
        my @fields = split( /\Q$sep/, $value );
        $sep = '=';
        @fields = split( /\Q$sep/, $fields[1] );
        return pop @fields;
    }

    Save the file.

  3. Open the acc_types file in the Configuration directory, which is by default in C:\Program Files\OpeniT\Core\Configuration.

  4. Locate (Process^Accounting, and add the following lines before Domain,:

    acc_types
    (Project,Project^Names,
     ((UID,project-id))),
    (Username,User^ID,
     ((UID,u-id))),

    That is,

    acc_types
    1304|   Exit^status,
    1305|   (Program^class,Mapping^from_command^to^classes,
    1306|    ((Command,sample_mapping))),
    1307|   (Project,Project^Names,
    1308|    ((UID,project-id))),
    1309|   (Username,User^ID,
    1310|    ((UID,u-id))),
    1311|   Domain,
  5. Save the changes.

  6. Open the classvar_mapping_config file in the Configuration directory, which is by default in C:\Program Files\OpeniT\Core\Configuration.

  7. Locate (Process^Accounting, and add Project and Username after Program^class.

    acc_types
    284|    (Process^Accounting,
    285|    (Command, Exit^status, Prime^time, Application, GID, UID, Program^class, Project, Username),
    286|    ((OS, Host), (Architecture, Host), (Domain, Host))),
  8. Save the changes

# Next Steps?

Proceed through the following documentation pages sequentially:

   Generating Classification Variable Mapping  

   Updating Database  

   Creating Reports using the Complete Selection Tab