πŸ’ 
ServiceNow
StackState core integration

Overview

The ServiceNow StackPack allows near real time synchronization between ServiceNow and StackState. When the ServiceNow Agent integration is enabled, configuration items (CIs) and their dependencies from the ServiceNow CMDB will be added to the StackState topology as components and relations. ServiceNow change request events are also retrieved.
Data flow
  • Agent V2 connects to the configured ServiceNow API.
  • CIs and dependencies for the configured CI types are retrieved from the ServiceNow CMDB (default all). Change request events are retrieved in the same run.
  • Agent V2 pushes retrieved data to StackState:
    • CIs and dependencies are translated into topology components and relations.
    • ​Tags defined in ServiceNow are added to components and relations in StackState. Any defined StackState tags are used by StackState when the topology is retrieved.
    • Change requests are attached to the associated elements as events and listed in the StackState Events Perspective.

Setup

Prerequisites

To set up the StackState ServiceNow integration, you need to have:

Install

Install the ServiceNow StackPack from the StackState UI StackPacks > Integrations screen. You will need to provide the following parameters:
  • ServiceNow Instance URL: The ServiceNow instance URL from which topology data will be collected.
  • ServiceNow Instance Name: the user-defined name of the ServiceNow account shown in configurations such as views.

Configure

To enable the ServiceNow check and begin collecting data from ServiceNow, add the following configuration to StackState Agent V2:
  1. 1.
    Edit the Agent integration configuration file /etc/stackstate-agent/conf.d/servicenow.d/conf.yaml to include details of your ServiceNow instance:
    • url - The REST API URL, uses HTTPS protocol for communication.
    • user - A ServiceNow user with access to the required ServiceNow API endpoints​
    • password - Use secrets management to store passwords outside of the configuration file.
      1
      init_config:
      2
      # Any global configurable parameters should be added here
      3
      default_timeout: 10
      4
      min_collection_interval: 5
      5
      ​
      6
      instances:
      7
      - url: "https://<instance_ID>.service-now.com"
      8
      user: <instance_username>
      9
      password: <instance_password>
      10
      # batch_size: 1000
      11
      # change_request_bootstrap_days: 10
      12
      # change_request_process_limit: 1000
      13
      # timeout: 20
      14
      # verify_https: true
      15
      # cert: /path/to/cert.pem
      16
      # keyfile: /path/to/key.pem
      Copied!
  2. 2.
    You can also add optional configuration and filters:
    • batch_size - The maximum number of records to be returned (default 2500, max 10000).
    • change_request_bootstrap_days - On first start, all change requests that have been updated in last N days will be retrieved (default 100).
    • change_request_process_limit - The maximum number of change requests that should be processed (default 1000).
    • timeout - Timeout for requests to the ServiceNow API in seconds (default 20).
    • verify_https - Verify the certificate when using https (default true).
    • cert - Path to the certificate file for https verification.
    • keyfile - Path to the public key of certificate for https verification.
    • Use queries to filter change requests retrieved from ServiceNow (default all).
    • Use queries to filter the CI types retrieved (default all).
    • ​Specify the CI types that should be retrieved (default all).
  3. 3.
    ​Restart the StackState Agent(s) to apply the configuration changes.
  4. 4.
    Once the Agent has restarted, wait for the Agent to collect data from ServiceNow and send it to StackState.

Use ServiceNow queries to filter retrieved events and CI types

  1. 1.
    In ServiceNow, create and copy a filter for CI types or change requests. See the ServiceNow documentation for details on filtering with sysparm_query parameters (servicenow.com)​
  2. 2.
    Edit the Agent integration configuration file /etc/stackstate-agent/conf.d/servicenow.d/conf.yaml.
  3. 3.
    Uncomment the CI type or event that you would like to add a filter to:
    • cmdb_ci_sysparm_query - ServiceNow CMDB Configuration Items query.
    • cmdb_rel_ci_sysparm_query - ServiceNow CMDB Configuration Items Relations query.
    • change_request_sysparm_query - ServiceNow Change Request query.
    • custom_cmdb_ci_field - ServiceNow CMDB Configuration Item custom field mapping.
  4. 4.
    Add the filter you copied from ServiceNow. For example
    1
    ...
    2
    instances:
    3
    - url: "https://<instance_ID>.service-now.com"
    4
    user: <instance_username>
    5
    password: <instance_password>
    6
    ​
    7
    # ServiceNow CMDB Configuration Items query. There is no default value.
    8
    # cmdb_ci_sysparm_query: company.nameSTARTSWITHstackstate
    9
    ​
    10
    # ServiceNow CMDB Configuration Items Relations query. There is no default value.
    11
    # cmdb_rel_ci_sysparm_query: parent.company.nameSTARTSWITHstackstate^ORchild.company.nameSTARTSWITHstackstate
    12
    ​
    13
    # ServiceNow Change Request query. There is no default value.
    14
    # change_request_sysparm_query: company.nameSTARTSWITHstackstate
    15
    ​
    16
    # ServiceNow CMDB Configuration Item custom field mapping. The default value is cmdb_ci.
    17
    # custom_cmdb_ci_field: u_configuration_item
    18
    ...
    Copied!
  5. 5.
    ​Restart the StackState Agent(s) to apply the configuration changes.

Specify CI types to retrieve

By default, all available ServiceNow CI types will be sent to StackState. If you prefer to work with a specific set of resource types, you can configure the Agent integration to filter the CI types it retrieves:
  1. 1.
    Edit the Agent integration configuration file /etc/stackstate-agent/conf.d/servicenow.d/conf.yaml.
    • A subset of the available CI types is listed and commented out.
  2. 2.
    Uncomment the line include_resource_types and the CI types you would like to send to StackState. You can add any valid ServiceNow CI type to the include_resource_types list, however, components from resource types that you have added will appear on the Uncategorized layer of a StackState view.
    1
    instances:
    2
    - url: "https://<instance_ID>.service-now.com"
    3
    user: <instance_username>
    4
    password: <instance_password>
    5
    batch_size: 100
    6
    # include_resource_types: # optional and by default includes all resource types(sys Class Names)
    7
    # - cmdb_ci_netgear
    8
    # - cmdb_ci_ip_router
    9
    # - cmdb_ci_aix_server
    10
    # - cmdb_ci_storage_switch
    11
    # - cmdb_ci_win_cluster
    12
    # - cmdb_ci_email_server
    13
    # - cmdb_ci_web_server
    14
    # - cmdb_ci_app_server
    15
    # - cmdb_ci_printer
    16
    # - cmdb_ci_cluster
    17
    # - cmdb_ci_cluster_node
    18
    # - cmdb_ci_computer
    19
    # - cmdb_ci_msd
    20
    # - cmdb_ci
    21
    # - cmdb_ci_unix_server
    22
    # - cmdb_ci_win_cluster_node
    23
    # - cmdb_ci_datacenter
    24
    # - cmdb_ci_linux_server
    25
    # - cmdb_ci_db_ora_catalog
    26
    # - cmdb_ci_win_server
    27
    # - cmdb_ci_zone
    28
    # - cmdb_ci_appl
    29
    # - cmdb_ci_computer_room
    30
    # - cmdb_ci_ip_switch
    31
    # - service_offering
    32
    # - cmdb_ci_disk
    33
    # - cmdb_ci_peripheral
    34
    # - cmdb_ci_service_group
    35
    # - cmdb_ci_db_mysql_catalog
    36
    # - cmdb_ci_ups
    37
    # - cmdb_ci_service
    38
    # - cmdb_ci_app_server_java
    39
    # - cmdb_ci_spkg
    40
    # - cmdb_ci_database
    41
    # - cmdb_ci_rack
    42
    # - cmdb_ci_server
    43
    # - cmdb_ci_network_adapter
    Copied!
  3. 3.
    ​Restart the StackState Agent(s) to apply the configuration changes.

Status

To check the status of the ServiceNow integration, run the status subcommand and look for ServiceNow under Running Checks:
1
sudo stackstate-agent status
Copied!

Upgrade

When a new version of the ServiceNow StackPack is available in your instance of StackState, you will be prompted to upgrade in the StackState UI on the page StackPacks > Integrations > ServiceNow. For a quick overview of recent StackPack updates, check the StackPack versions shipped with each StackState release.
For considerations and instructions on upgrading a StackPack, see how to upgrade a StackPack.

Integration details

Data retrieved

Events

The ServiceNow check retrieves the following events data from ServiceNow:
Data
Description
Change requests
The change requests retrieved can be filtered using ServiceNow queries and will be visible in the StackState Events Perspective.

Metrics

The ServiceNow check does not retrieve any metrics data.

Tags

All tags defined in ServiceNow will be retrieved and added to the associated components and relations in StackState.
The ServiceNow integration also understands StackState common tags. These StackState tags can be assigned to elements in ServiceNow to influence the way that the resulting topology is built in StackState. For example, by placing a component in a specific layer or domain.

Topology

The ServiceNow check retrieves the following topology data from the ServiceNow CMDB:
Data
Description
Components
CI types retrieved from the ServiceNow CMDB, see filter retrieved CI types.
Relations
Relations retrieved from the cmdb_rel_ci table.
The ServiceNow integration understands StackState common tags. These StackState tags can be assigned to elements in ServiceNow to influence the way that the resulting topology is built in StackState. For example, by placing a component in a specific layer or domain.

Traces

The ServiceNow check does not retrieve any traces data.

REST API endpoints

The ServiceNow user configured in StackState Agent V2 must have access to read the ServiceNow TABLE API. The specific table names and endpoints used in the StackState integration are described below. All named REST API endpoints use the HTTPS protocol for communication.
Table Name
REST API Endpoint
change_request
/api/now/table/change_request
cmdb_ci
/api/now/table/cmdb_ci
cmdb_rel_type
/api/now/table/cmdb_rel_type
cmdb_rel_ci
/api/now/table/cmdb_rel_ci
Refer to the ServiceNow product documentation for details on how to configure a ServiceNow user and assign roles.

ServiceNow views in StackState

When the ServiceNow integration is enabled, the following ServiceNow specific views are available in StackState:
  • ServiceNow Applications
  • ServiceNow Business Processes
  • ServiceNow Discovered
  • ServiceNow Infrastructure & Network
  • ServiceNow Machines & Load balancers

Open source

The code for the StackState ServiceNow check is open source and available on GitHub at: https://github.com/StackVista/stackstate-agent-integrations/tree/master/servicenow​

Troubleshooting

Troubleshooting steps for any known issues can be found in the StackState support knowledge base.

Uninstall

To uninstall the ServiceNow StackPack and disable the ServiceNow check:
  1. 1.
    Go to the StackState UI StackPacks > Integrations > ServiceNow screen and click UNINSTALL.
    • All ServiceNow specific configuration will be removed from StackState.
  2. 2.
    Remove or rename the Agent integration configuration file, for example:
    1
    mv servicenow.d/conf.yaml servicenow.d/conf.yaml.bak
    Copied!
  3. 3.
    ​Restart the StackState Agent(s) to apply the configuration changes.

Release notes

ServiceNow StackPack v5.3.1 (2021-04-12)
Improvement
  • Common bumped from 2.5.0 to 2.5.1
ServiceNow StackPack v5.3.0 (2021-04-02)
Improvement
  • Common bumped from 2.2.3 to 2.5.0
  • StackState min version bumped to 4.3.0
ServiceNow StackPack v5.2.0 (2021-03-23)
  • Improvement: Set tags, domain, layer and environment coming from ServiceNow integration.
  • Improvement: Enable auto grouping on generated views.
  • Improvement: Added configuration options for SSL certificate included with Agent 2.11.0 release.
ServiceNow StackPack v5.1.0 (2020-12-16)
  • Feature: Documentation update for new features of Change Requests and different filters added.
ServiceNow StackPack v5.0.0 (17-11-2020)
  • Feature: Introduce the Instance Name for easy filtering and use.
ServiceNow StackPack v4.0.1 (18-08-2020)
  • Feature: Introduced the Release notes pop up for customer.
ServiceNow StackPack v4.0.0 (04-08-2020)
  • Bugfix: Fix and make Component mapping function per instance to support multi-instance.
ServiceNow StackPack v3.1.0 (04-08-2020)
  • Improvement: Deprecated stackpack specific layers and introduced a new common layer structure.
  • Improvement: Addition of new views.
ServiceNow StackPack v3.0.0 (30-04-2020)
  • Feature: Updated the requirement docs to use AgentV2 now.
  • Feature: Updated the installation details to use the new configuration parameters.
  • Feature: Replace resolveOrCreate with getOrCreate.
  • Feature: Multi-instance support is available now.
ServiceNow StackPack v2.1.0 (10-04-2020)
  • Improvement: Updated StackPacks integration page, categories, and icons for the SaaS trial.

See also

Last modified 11d ago