Standalone Health Dashboard deployment using WAR file

Introduction

How many Health Dashboards do I need?

CAST highly recommends that you install one Health Dashboard to display snapshot data from all your Applications whether they are stored in one or multiple Dashboard schemas. When configuring the Health Dashboard, you should therefore:

  • Configure a connection to one single Measurement Service schema
  • Consolidate data from all your Dashboard schemas in this single Measurement schema

Standalone or combined WAR file?

Click here to expand…

CAST provides the Health Dashboard in a WAR file that must be deployed to a compatible Application Server. However, CAST provides two WAR files that contain the Health Dashboard, as follows:

WAR file nameDescription
com.castsoftware.aip.dashboard.health..warTraditional “standalone” WAR file containing only the Health Dashboard. This document describes the installation using this WAR file.
com.castsoftware.aip.dashboard..warCombined” WAR file containing both the Health Dashboard and the Engineering Dashboard.

You are free to use whichever WAR file you prefer to deploy the Health Dashboard (the requirements and prerequisites are identical for both WAR files), however if you are using both the CAST Health and Engineering Dashboard, to fulfil (for example) a “risk and quality” use case, then it would make sense to take advantage of the combined com.castsoftware.aip.dashboard..war file and deploy both dashboards from the same WAR file. If you do so, please note the following about using the “combined” WAR file:

  • There is no need to specifically configure a URL for your Engineering Dashboard drilldown (via the “microscope” icon) - when using the combined “WAR” file, access to the Engineering Dashboard from the Health Dashboard is pre-configured.
  • Security access and authentication is common to both Dashboards. Therefore, if you setup Active Directory authentication, then this must be used to access both Dashboards - you cannot use “Default Authentication” for one Dashboard and “Active Directory” for the other.
  • Role configuration is common to both Dashboards. Therefore “UserA” that has been granted the “admin” role, will have the “admin” role in both Dashboards.
  • Data authorization is common to both Dashboards. Therefore if you authorize “UserA” to view Application “B” only via the authorizations.xml file, then this is true for both Dashboards. Note that authorizations based only on Tags and Categories created for the Health Dashboard (Tags and Categories are a feature that is not available in the Engineering Dashboard) WILL be applied in the Engineering Dashboard when using the combined war file.
  • Group configuration is common to both Dashboards, regardless of the authentication mode in use. Therefore if you authorize “GroupD”  to view Application “E” only, then this is true for both Dashboards.
  • On login, the user will be presented with a choice of Dashboard as shown below (Image 1) in a “Welcome” page. Clicking Access will take the user to the custom login screen for the chosen Dashboard where a “Return to welcome page” URL is available if the user wishes to login to the other Dashboard (Image 2):

Image 1 - Welcome page

Image 2 - Return to welcome page URL

Requirements

See Standalone dashboard - installation requirements.

Pre-installation check list

Before beginning the installation process, please ensure that you have carried out all of the following tasks and that the following requirements have been met:

Ensure that your web application server is up and running.
Ensure you have read all Release Notes accompanying CAST products for any last-minute information.
Decide where the Health Dashboard will be installed.
Ensure that your user login on the target machine has sufficient user privileges to install applications.
Make sure you have the required .WAR file ready for deployment

Installation procedure

The installation process is divided into various steps:

Step 1Rename and deploy the .WAR file on your application server
Step 2Configure your deployed .WAR file
Step 3Restart Tomcat and test connection
Step 4Configure user authentication
Step 5First login and become admin - ≥ 2.1 only
Step 6Configure roles
Step 7Upload snapshot data for display in Health Dashboard
Step 8Configure data authorization
Step 9Configure access to the Engineering Dashboard and from the Health Dashboard

Step 1 - Rename and deploy the .WAR file on your application server

Click here to expand…

Rename WAR file

The name of the .WAR file will be included in the URL used to access the dashboard in a browser, as listed below. Therefore, before you deploy the .WAR file, you may wish to rename it to your own chosen name:

  • ≥ 1.11.0 - the deployed folder will be named com.castsoftware.aip.dashboard.health. (standalone .WAR) or com.castsoftware.aip.dashboard. (combined .WAR)
  • ≤ 1.10.0 - the deployed folder will be named CAST-Health (standalone .WAR) or CAST-Health-Engineering (combined .WAR)

Deploy the WAR file

Locate the .WAR file and move it to the web application installation location. By default on Apache Tomcat this is set to:

CATALINA_HOME\webapps

If the Apache Tomcat server is running, the .WAR file will then be unpacked and deployed in a folder matching the name of the .WAR file. If the Apache Tomcat server is not running, start it up and the WAR file will be automatically deployed.

Step 2 - Configure your deployed .WAR file

For CAST Dashboards 1.x

Click here to expand…

context.xml file configuration

After deploying, you need to configure the context.xml file to tell the web application where the Measurement schema is stored. This file is located here:

CATALINA_HOME\webapps\CAST-Health\META-INF\context.xml

Instructions for Tomcat 8 / 8.5 / 9

Open the context.xml file (as detailed above) with an editor. By default, the file will contain an uncommented template as follows - this is tailored for connections to Measurement schemas located on a PostgreSQL instance running with port 2280 using Tomcat 8 / 8.5 / 9:

<Resource name="jdbc/domains/AAD" url="jdbc:postgresql://localhost:2280/postgres"
		  connectionInitSqls="SET search_path TO [Measure Schema];"
		  username="operator" password="CastAIP"

		  auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
		  validationQuery="select 1"
		  initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
  • Set the URL parameter to the server on which the Measurement schema is located:
    • change the “localhost” to the name of the server on which the host CSS is located
    • change the port from 2280 if necessary
  • Change**[Measure Schema]** to the name of the Measurement schemayou are using.
  • Ensure the usernameand password parameters are correct (note that if you need to encrypt the username and password to avoid entering names in clear text, please see: Encrypt login and password for database and LDAP)
  • You should end up with a section something like this:
<Resource name="jdbc/domains/AAD" url="jdbc:postgresql://my_server:2282/postgres"
			connectionInitSqls="SET search_path TO general_measure;"
			username="operator" password="CastAIP"
 
			auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
			validationQuery="select 1"
			initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>

Following any changes you make, save the context.xml file and then restart your application server so that the changes are taken into account.

Instructions for Tomcat 7

Open the context.xml file (as detailed above) with an editor. By default, the file will contain an uncommented template as follows - this is tailored for connections to Measurement schemas located on a PostgreSQL instance running with port 2280 using Tomcat 8 / 8.5 / 9:

<Resource name="jdbc/domains/AAD" url="jdbc:postgresql://localhost:2280/postgres"
		  connectionInitSqls="SET search_path TO [Measure Schema];"
		  username="operator" password="CastAIP"

		  auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
		  validationQuery="select 1"
		  initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>

You need to comment this template by adding**** around the section:

<!-- <Resource name="jdbc/domains/AAD" url="jdbc:postgresql://localhost:2280/postgres"
		  connectionInitSqls="SET search_path TO [Measure Schema];"
		  username="operator" password="CastAIP"

		  auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
		  validationQuery="select 1"
		  initialSize="5" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
-->

Now locate the Tomcat 7 template - this is located here:

<!--  Tomcat 7 Documentation : http://ci.apache.org/projects/tomcat/tomcat7/docs/jndi-resources-howto.html -->
<!-- These connections examples on Tomcat 7 are provided for CSS connections especially useful for REST API on central database.

template for resources on CSS:
    <Resource name="jdbc/domains/${domainName}"
            url="jdbc:postgresql://${host}:${port}/postgres"
            username="${user}" password="${password}"
            initConnectionSqls="SET search_path TO ${schema};"
            auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
            validationQuery="select 1" initialSize="5" maxActive="20" maxIdle="10" maxWait="-1"/>
-->

Copy the template for resources on CSS template into uncommented white space:

<Resource name="jdbc/domains/${domainName}" 
        url="jdbc:postgresql://${host}:${port}/postgres"
		username="${user}" password="${password}"
		initConnectionSqls="SET search_path TO ${schema};"
        auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
        validationQuery="select 1" initialSize="5" maxActive="20" maxIdle="10" maxWait="-1"/>
  • Set the ${domainName} value to AAD
  • Set the URL parameter to the server on which the Measurement schemais located:
    • change the ${host} to the name of the server on which the host PostgreSQL instance is located
    • change the ${port} values to the required port (e.g.: 2280, 2282, 2284 or a custom port depending on the PostgreSQL instance you are running).
  • Ensure the ${user}and ${password} parameters are correct - use the operator and CastAIP username/password combination if you have not changed these defaults (note that if you need to encrypt the username and password to avoid entering names in clear text, please see: Encrypt login and password for database and LDAP)
  • Change ${schema} to the name of the Measurement schema
  • You should end up with a section something like this:
<Resource name="jdbc/domains/AAD"
			url="jdbc:postgresql://my_server:2282/postgres"
			username="operator" password="CastAIP"
			initConnectionSqls="SET search_path TO general_measure;"
			auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
			validationQuery="select 1" initialSize="5" maxActive="20" maxIdle="10" maxWait="-1"/>

Following any changes you make, save the context.xml file and then restart your application server so that the changes are taken into account.

For CAST Dashboards 2.x

Click here to expand…

Modify application.properties to define connection to CSS/PostgreSQL for AIP schemas

When the .WAR has been deployed you now need to configure the application.properties file to tell the web application on which PostgreSQL instance the Measure schema is stored. This file is located here:

CATALINA_HOME\webapps\<deployed_war>\WEB-INF\classes\application.properties

Locate the following section in the file:

## DATASOURCE
# Resource1 is the datasource name used in domains.properties
# Adapt server name (localhost) and port (2282) if required
# You can add multiple datasources if you want to connect to multiple CSS Servers. Datasource name must be unique
# You have to configure your domains names and relative schema names in domains.properties
restapi.datasource[0].url=jdbc:postgresql://localhost:2282/postgres
restapi.datasource[0].username=operator
restapi.datasource[0].password=CastAIP
restapi.datasource[0].poolname=Resource1
restapi.datasource[0].minimumIdle=10
restapi.datasource[0].maximumPoolSize=20

Modify the url, username and password entries to match your target PostgreSQL where the Measure schema is located, for example:

## DATASOURCE
# Resource1 is the datasource name used in domains.properties
# Adapt server name (localhost) and port (2282) if required
# You can add multiple datasources if you want to connect to multiple CSS Servers. Datasource name must be unique
# You have to configure your domains names and relative schema names in domains.properties
restapi.datasource[0].url=jdbc:postgresql://192.168.200.104:2282/postgres
restapi.datasource[0].username=operator
restapi.datasource[0].password=CastAIP
restapi.datasource[0].poolname=Resource1
restapi.datasource[0].minimumIdle=10
restapi.datasource[0].maximumPoolSize=20

Save the file before proceeding.

Modify domains.properties

You now need to configure the domains.properties file which provides a link between the PostgreSQL instances defined in the application.properties file and the Measure schema containing the relevant snapshot data. This file is located here:

CATALINA_HOME\webapps\<deployed_war>\WEB-INF\classes\domains.properties

This file is delivered empty as shown below:

# Domains for HD
# empty lines in this file lead to connection error, remove all empty lines
# - AAD domain is mandatory for the portal
# - You can only connect one measure schema and domain must be "AAD"
# - You have to align [Resource1] with the resource name configured in application.properties
# - You have to replace [Measure Schema] by your measure schema name you want to connect
# AAD=Resource1,[Measure Schema]

Add one line to the file ensuring that there are no empty lines:

AADThis is known as the “domain” and this must be unique in the domains.properties file. For a Measure schema, this must ALWAYS be AAD. There can only be one AAD entry in domains.properties.
Resource1This entry refers to the PostgreSQL instance as defined in the application.properties file.
[Measure Schema1]This entry refers to the Measure schema containing the relevant Application data.

For example, for a Measure schema called “GENERAL_MEASURE” stored in the PostgreSQL instance defined in Resource1 in the application.properties file, add the following:

# Domains for HD
# empty lines in this file lead to connection error, remove all empty lines
# - AAD domain is mandatory for the portal
# - You can only connect one measure schema and domain must be "AAD"
# - You have to align [Resource1] with the resource name configured in application.properties
# - You have to replace [Measure Schema] by your measure schema name you want to connect
# AAD=Resource1,[Measure Schema]
AAD=Resource1,GENERAL_MEASURE

Save the file before proceeding.

Modify application.properties to define connection to CSS/PostgreSQL for the roles/permissions schema - ≥ 2.1 only

In ≥ 2.1 only, an interface exists to manage User roles - 2.x and above and Data authorization - 2.x and above - this interface stores all its records in a dedicated schema on a PostgreSQL instance. This instance does not need to be the same as used for your AIP schemas (Dashboard/Measure schemas), however, the required schema is small and therefore CAST recommends using an existing PostgreSQL instance to host it. The schema is created automatically when you start up your Dashboard deployment if it does not already exist.

The application.properties file contains a section dedicated to this schema - this file is located here:

CATALINA_HOME\webapps\<deployed_war>\WEB-INF\classes\application.properties

Locate the following section in the file:

#datasource configuration for user management
spring.datasource.url=jdbc:postgresql://localhost:2282/postgres?ApplicationName=DASHBOARDS&currentSchema=cast_dashboards
spring.datasource.platform=postgres
spring.datasource.username=operator
spring.datasource.password=CastAIP
spring.datasource.initialization-mode=always
spring.datasource.driver-class-name=org.postgresql.Driver
spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.xml
spring.liquibase.default-schema=cast_dashboards
spring.liquibase.enabled=true

Change the line spring.datasource.url to match the PostgreSQL instance you intend to use for the roles/permissions schema, for example:

#datasource configuration for user management
spring.datasource.url=jdbc:postgresql://192.168.200.104:2282/postgres?ApplicationName=DASHBOARDScurrentSchema=cast_dashboards
spring.datasource.platform=postgres
spring.datasource.username=operator
spring.datasource.password=CastAIP
spring.datasource.initialization-mode=always
spring.datasource.driver-class-name=org.postgresql.Driver
spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.xml
spring.liquibase.default-schema=cast_dashboards
spring.liquibase.enabled=true

Save the file before proceeding. This will ensure that a schema called “cast_dashboards” is created on the target PostgreSQL instance when you start the web application.

Step 3 - Restart Tomcat and test connection

Restart Tomcat

Before proceeding, ensure you restart your application server so that the configuration changes you made are taken into account.

Test access to the Health Dashboard

You can now access the Health Dashboard using the URL:

http://<server_name>:[<port_number>]/<name-of_deployed_war>

You should see the login page as follows - this indicates that the initial setup was successful:

Step 4 - Configure user authentication

This step involves configuring how your users will authenticate with the CAST Health Dashboard. Most organizations opt for LDAP/Active Directory integration so that users can use their corporate username/password to access the resources they need. The Health Dashboard also has a built in username/password authentication mechanism which is enabled “out of the box”. See User authentication.

Step 5 - First login and become admin - ≥ 2.1 only

By default, the CAST Dashboard requires that at least one user is granted the ADMIN role following the first login after the **User authentication**configuration. This ensures that one user can access all data and cofiguration settings. See First login and become admin. This step is not required when using Dashboards 1.x and can be skipped.

Step 6 - Configure roles

This step involves configuring roles for users and groups that are accessing the CAST Health Dashboard. See User roles.

Step 7 - Upload snapshot data for display in Health Dashboard

Click here to expand…

Before your users can view any data in the Health Dashboard, you need to upload your snapshot data to the Measurement schema once it has been generated. The snapshot upload is achieved using AIP Console.

When using AIP Console, the Measurement schema is automatically activated for all your Application analyses on all AIP Nodes (only one Measurement schema can be managed per AIP Console instance). When you run an analysis or snapshot, you can choose to upload the results immediately to the Measurement schema:

You can also manually upload snapshots using the Application - Snapshots interface:

Step 8 - Configure data authorization

An Authorization defines permission to access and “consume the data” in a specific Applicationor group of Applications via the CAST Health Dashboard. If permission is not granted, or a “restriction” is used, then any information related to this Application will be not accessible: application properties such as name, technologies or grades and measures, etc. Therefore, an Authorization must be defined before a user/group of users can access a specific application. See Data authorization.

Step 9 - Configure access to the Engineering Dashboard and from the Health Dashboard

Click here to expand…

The Health Dashboard enables users (via the “microscope” icon) to access directly the underlying data in the Dashboard schema via the Engineering Dashboard. The Engineering Dashboard provides detailed information about the top level data displayed in the Health Dashboard. This configuration is license dependent.

Access to the underlying data is provided via a URL (pointing to the required dashboard) that is stored in the Measurement schema.

Combined WAR file

If you have deployed the Health Dashboard and Engineering Dashboard from the combined Health/Engineering .WAR file, access to the Engineering Dashboard is implemented automatically. You do not need to do anything further.

Standalone WAR files

If you have deployed the Health Dashboard and Engineering Dashboard using the standalone Health / Engineering .WAR files, then access to the Engineering Dashboard (ED) is not implemented automatically and you will need to proceed as follows:

  • For each Dashboard schema that you want to drill down into, you must first determine the context “name” of the Dashboard schema as defined in thecontext.xml file for theEngineering Dashboard. Doing so differs for WAR files delivered in 1.x and those delivered in 2.x:
CAST Dashboards 1.x

First locate and open the following file in an editor:

%CATALINA_HOME%\webapps\<dashboard>\WEB-INF\context.xml

Then take the following example which shows three Dashboard schemas each with different context “names” (the context “name” is the value defined after the second forward slash in for example name=“jdbc/domains/APP1” (i.e. APP1)). We will use the APP1 name defined for the V80_CENTRAL_APP1 Dashboard schema:

<Resource name="jdbc/domains/APP1" url="jdbc:postgresql://NEFYN:2280/postgres"
           initConnectionSqls="SET search_path TO V80_CENTRAL_APP1;"
           username="operator" password="CastAIP" 
           auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
           validationQuery="select 1"
           initialSize="5" maxActive="20" maxIdle="10" maxWait="-1"/>

<Resource name="jdbc/domains/APP2" url="jdbc:postgresql://NEFYN:2280/postgres"
           initConnectionSqls="SET search_path TO V80_CENTRAL_APP2;"
           username="operator" password="CastAIP" 
           auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
           validationQuery="select 1"
           initialSize="5" maxActive="20" maxIdle="10" maxWait="-1"/>

<Resource name="jdbc/domains/APP3" url="jdbc:postgresql://NEFYN:2280/postgres"
           initConnectionSqls="SET search_path TO V80_CENTRAL_APP3;"
           username="operator" password="CastAIP" 
           auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
           validationQuery="select 1"
           initialSize="5" maxActive="20" maxIdle="10" maxWait="-1"/>

Open the CAST Management Studio and move to the Services view. Double click the corresponding Dashboard Service to open its editor (i.e the V80_CENTRAL_APP1 in this example):

  • Enter the URL to your Engineering Dashboard. This will take the following form http://:/CAST-Engineering/engineering/index.html# - you should tailor the and entries to your environment. The value refers the value we determined earlier, in this example APP1. So we will add the following URL: http://TOMCAT:8080/CAST-Engineering/engineering/index.html#APP1
  • Click the Add URL to Measurement Service
  • Restart your application server so that the changes are taken into account.
  • Now users can drill down into the Engineering Dashboard.
CAST Dashboards 2.x

First locate and open the following file in an editor:

CATALINA_HOME\webapps\<deployed_war>\WEB-INF\classes\domains.properties

Locate the domain name (the first entry in each row) that corresponds to the Dashboard schema you need your users to drill down into and take note of it. In this example we want users to drill down to V80_CENTRAL_APP1 which corresponds to the domain APP1:

# Domains for ED
# empty lines in this file lead to connection error, remove all empty lines
# - You have to align [Resource1] with the resource name configured in application.properties
# - You have to replace [Central Schema1] by the central schema name
# - Domains names must be unique
# AED1=Resource1,[Central Schema1]
# AED2=Resource1,[Central Schema2]
APP1=Resource1,V80_CENTRAL_APP1
APP2=Resource1,SEVRES_CENTRAL
APP3=Resource2,PARIS_CENTRAL

Open the CAST Management Studio and move to the Services view. Double click the corresponding Dashboard Service to open its editor (i.e the V80_CENTRAL_APP1 in this example):

  • Enter the URL to your Engineering Dashboard. This will take the following form http://:/CAST-Engineering/engineering/index.html# - you should tailor the and entries to your environment. The value refers the value we determined earlier, in this example APP1. So we will add the following URL: http://TOMCAT:8080/CAST-Engineering/engineering/index.html#APP1
  • Click the Add URL to Measurement Service
  • Restart your application server so that the changes are taken into account.
  • Now users can drill down into the Engineering Dashboard.

Additional information

Advanced configuration specific to the CAST Health Dashboard:

Additional advanced configuration options: