Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save selmanj/fd25da94b0f8d6f65415409e98659bf2 to your computer and use it in GitHub Desktop.
Save selmanj/fd25da94b0f8d6f65415409e98659bf2 to your computer and use it in GitHub Desktop.

Setting up events for Google Provider in ManageIQ

(Note: much of this was taken from this public document: https://cloud.google.com/logging/docs/export/configure_export)

Summary

Events can be setup on a per-project basis by using Google Stackdriver Logging combined with Google Pub/Sub. Stackdriver logging is a service that aggregates and exposes log events from various other Google services and applications. This document describes how to export activity log entries for a Google project to Google Pub/Sub, a messaging service.

Prerequisites

  1. You must have owner permission on the project you are exporting
  2. You must have enabled the Google Cloud Pub/Sub API for your project. You can enable the API via the following steps:
  3. Visit the API Library
  4. Search for "Pub/Sub" and click on the Google Cloud Pub/Sub API
  5. Click the Enable API button at the top of the screen
  6. The Stackdriver logging service must have permission to publish to your project’s Pub/Sub service. You can add permissions via the following steps:
  7. Navigate to the Permissions page in the Cloud Platform Console. If prompted, select your project.
  8. If account cloud-logs@system.gserviceaccount.com is already listed, then change its permission from Can view to Can edit.
  9. If the account is not listed, then select Add Member: 1. Enter cloud-logs@system.gserviceaccount.com in the Email box 2. Select Can Edit under Permission 3. Select Add

Instructions

You can setup exporting events for your Google project via the following steps:

  1. Go to the Logs Viewer and select a project
  2. Select the Exports tab at the left of the Logs Viewer screen. You should see something like this on the panel: Before changes
  3. In the Select service dropdown, select Compute Engine.
  4. In the Export these sources section, select Add item. Make sure compute.googleapis.com/activity_log is selected.
  5. In the Select export destinations section, select the Publish to Cloud Pub/Sub topic dropdown and choose Add new topic...
  6. When prompted for a topic name, enter the name manageiq-activity-log
  7. Confirm your panel looks like the panel pictured below: After changes
  8. Click Save.

You’re finished! Now whenever changes occur to Compute Engine instances, ManageIQ will be notified and update its model appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment