How does Grafana work with CASM Reporting APIs
search cancel

How does Grafana work with CASM Reporting APIs

book

Article ID: 412208

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Management - Service Desk Manager

Issue/Introduction

This Knowledge Base article provides a comprehensive guide on configuring Grafana for report creation, specifically focusing on integrating with CASM Reporting API. It outlines the necessary steps to leverage Grafana's powerful data visualization capabilities to build dashboards using SDM OOTB reports.

Environment

Service Desk Manager 17.4 RU4 and later

Grafana OSS

Resolution

Grafana Installation and Authentication

1. Download and install Grafana OSS

 

Note: User Authentication in Grafana. There are 2 options.

Manual Creation: Grafana administrator manually adds users

LDAP Integration: The Grafana Administrator can configure LDAP to create users at first login automatically. Link to configure LDAP.

The Default Administrator username/password is admin/admin | Default URL is http://<GrafanaServerHostname>:3000

 

Setup Datasource

2. Log in to Grafana as an administrator

3. Go to Administration | Plugins and Data | Plugins: Search for "Infinity" and install it.

4. Go to Connections | Data Sources | Click on "Add new data source" | Search for: "Infinity" | Click on it | Set a new name. Example: SDMDatasource

Go to "Authentication" and set the Authentication type to Basic | Enter User Name and Password under the "Auth details" section. 

Note: The user must exist in Grafana and Service Desk Manager.

Go to "URL, Headers & Params" | Click on "Add Custom HTTP Header" set:

Key: X-ImpersonateID

Value:  ${__user.login}

Note: This custom header ensures that dashboards honor individual user permissions (Each user sees only their allowed data). Ensure that the allowApiImpersonation flag is set to true under SDM | Administration | xFlow Interface | General Configuration.

Go to "Security" and enter the URL to the CASM Reporting API. Example: http://<SDMServerHostname>:<TomcatPort> under "Allowed Hosts"

Click on "Save & Test"

 

Creating Dashboard on Grafana

This example will use the "Incident_Details_View" out-of-the-box List report, which has an "Incidents_Incident_Details_View" code.

5. Log into Grafana as an administrator | Dashboards | New | New Dashboard | Click on "Add Visualization" | Click on the Datasource created in step 4.

6. Set the following for the new Dashboard:

Title (at the left pane under "Panel Options"): Set a Title

Set the Visualization type (in the left pane above "Panel Options"): Table

Under the "Queries" tab

Method: GET

URL: http://<SDMServerHostname>:<TomcatPort>/CASMReports/reports/v1/getReport

Under "Header, Request params" | Add Header

Key: X-Report-Code

Value: Incidents_Incident_Details_View

Under Parsing options & Results fields

Rows/Root: results

Click on Add Columns

Selector: id as ID | format as String

Selector: assignee.combo_name as Assignee | format as String

Selector: priority.sym as Priority | format as String

Note: In this example, we are adding only 3 columns. You can add several columns, based on your requirements.

7. Click on the Refresh Icon to load the data. You should see a table above the Queries tab.

8. Click on the "Save Dashboard" button located in the top right corner

 

Visualizing the Dashboard

9. Go to Dashboard in the left pane | Click on the new Dashboard | The Table list should be loaded.

Example:

 

Additional Information