Harneet Sital
Mega Sage
Mega Sage

Overview

You can activate the Google Stackdriver Logging service to auto-update CMDB CI data whenever Google Cloud Connector or your Google account makes a life-cycle state or configuration change to a Google Cloud Platform resource. As a result, the CI data in the CMDB is updated without having to wait for Discovery to run.

More details about Cloud Operations Suite - https://cloud.google.com/products/operations


Overview of how it works

  • Setup prerequisites for ServiceNow and GCP Cloud Operations Suite (former StackDriver)
  • By default, a scheduled job on your instance (GCP-Events-job) polls the Google Cloud Operations (former Stackdriver) Logging service for updates every 5 minutes.
  • This scheduled job runs periodically to check for an event in the GCP platform. ServiceNow will receive the event details as a response and will create them in the Cloud Events table. These events are stored in ‘sn_cmp_cloud_event` table
  • Once an event is created in ServiceNow, the event payload is passed to the Identification and Reconciliation Engine (IRE). The IRE then takes the necessary actions to modify the state of the resources based on the event in ServiceNow CMDB

ServiceNow activities to set up the connectivity

  • Activate Discovery and Service mapping patterns
  • Make sure discovery has successfully discovered logical datacenters of the Google project
  • MID server is required to communicate with GCP and ServiceNow
  • Ensure that you select the should pull events check box on the Google Service Account page, before you execute datacenter discovery

find_real_file.png

GCP Activities

Google Cloud Platform administrator needs to perform the following configuration steps in the GCP console - 

Add logging role to the Google Cloud Platform (GCP) integration user (Service account) that would allow OAuth scopes for the following APIs-

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/logging.read

Procedure to setup StackDriver console -

Log in to the Google Cloud Platform account. For your project, navigate to APIs & Services > Library

find_real_file.png

Enable both the Stackdriver API and Cloud Logging API.

  1. In the library, search for Stackdriver.
  2. Click the Stackdriver API card.
  3. On the Stackdriver API page, click Enable

find_real_file.png

Repeat the previous step for the Cloud Logging API.


ServiceNow Scheduled job details

Scheduled Job  - /sysauto_script.do?sys_id=5b7b8152db4533002b0e363ffe961944

 find_real_file.png

Outcome

  • Once the Google Cloud Platform generates an event and Cloud Provisioning and Governance receives the event information, the 'GCP-Events-job' scheduled jobs execute in the background. These events are stored in 'sn_cmp_cloud_event'
  • The scheduled job passes the event payload to the Identification and Reconciliation Engine (IRE). The IRE then takes the necessary actions to modify the state of the resources based on the event.

Architecture

 find_real_file.png

Helpful Links -

https://docs.servicenow.com/bundle/rome-it-operations-management/page/product/it-operations-manageme...

https://cloud.google.com/monitoring/alerts/

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0786361

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0749555

API used by ServiceNow - https://logging.googleapis.com/v2/entries:list

 

If the article has helped you, please bookmark it or mark the answer as helpful. Also please share your feedback in the comments. 

Thank you
Harneet

Version history
Last update:
‎04-22-2022 08:35 AM
Updated by: