../_images/preview.png

External Integrations

Infoblox Integration

Definition and Scope

SCOPE_SCALR SCOPE_ACC SCOPE_ENV SCOPE_ROLE SCOPE_F_ROLE

Scalr provides a Webhook integration with Infoblox allowing you manage your IP addresses and hostnames directly in Infoblox for private clouds. Find out more about Infoblox here: Infoblox Website NEWWIN

Installation & Setup

Note

This document is written for Debian distributions. Adapt as necessary for other distributions. Prerequisite: You will need to create a server to host your Webhook, find out more about Webhooks here: Webhooks and Endpoints.

First, you will need to create a server to host your Webhook, find out more about Webhooks here: Webhooks and Endpoints . Once you have the server, please follow these directions:

On the server that will be hosting the Webhook, create the directory and pull down the Webhook code from Git:

apt update
apt install python-pip -y
pip install docker-compose

curl -fsSL https://get.docker.com/ | sh
service docker start || systemctl start docker

git clone https://github.com/scalr-tutorials/scalr-infoblox-webhook.git /opt/infoblox-webhook

Before creating a Webhook, an Endpoint is needed for the Webhook to contact. The Endpoint is the URL of the application that is running the Webhook. To create an Endpoint at the Account or Scalr scopes, click on the Scalr icon on the top left MENU_ACC and then click on Integration Hub > Endpoints.

../_images/new_endpoint.png
Field Description
Name The name of the endpoint.
URL The URL the endpoint can be reached at.
Status A radio button to turn make the endpoint active/ inactive within Scalr.
Shared Determines if the endpoint can be used at a lower level. This is only seen at the Account and Scalr scopes.

The URL above will point to the server you are hosting the Infoblox Webhook on (http://<webhook server IP or hostname>:5020/infoblox/). Make sure to copy down the Signing Key that is generated as it will be used later on.

Next, you will want to setup an IP Pool. To create a IP Pool at the Scalr or Account scope, click on the Scalr icon on the top left MENU_ACC and then click on IP Pools. After you click on New IP Pool the following page will show up:

../_images/new_ip_pool.png

In this screen you must enter the following information:

  • Both IPAM TYPE and IP ALLOCATION are External.
  • Select the Integration Endpoint that was created earlier.
  • Enter the Subnet Mask for the network you will be pulling information for.
  • Enter the Default Gateway for the network you will be pulling information for.
  • In the Allocate IP User Data field, enter the subnet range that should be used.

Next, log into the server that is hosting the Webhook and go to the /opt/infoblox-webhook directory. Copy the uwsgi.ini file:

cd /opt/infoblox-webhook
cp uwsgi.ini.example uwsgi.ini
vi uwsgi.ini

Edit uwsgi.ini to set the configuration variables:

  • SCALR_SIGNING_KEY: Signing key that was generated after creating the Webhook Endpoint.
  • BACKEND_USER: The user accessing Infoblox
  • BACKEND_PASS: The password for accessing Infoblox
  • BACKEND_VERIFY: Set to true/false if you want the Infoblox certificate to be checked (if invalid, the webhook will refuse to communicate with Infoblox)

Next, run the webhook with Docker:

./relaunch.sh

You’re Infoblox Webhook should now be running, you can check the logs by using the following command:

docker logs -f infoblox-webhook

Configure Farm Roles to Use Infoblox

When creating a Farm Role you will be prompted for Network information, at that point you should select the Infoblox Endpoint as your IP Source:

../_images/ip_source.png

Furthermore, you can set up a Policy to enforce the IP Pool Source, see more here: Policy Engine

ServiceNow Integration

Overview

SCOPE_SCALR SCOPE_ACC SCOPE_ENV

Scalr provides out-of-the-box integration with ServiceNow to enable mutual customers to leverage ServiceNow for ITSM workflows including problem management, incident management, change management, asset management, and others. The Scalr ServiceNow integration allows users to maintain a single source of truth for all on premise and cloud-based infrastructure resources and services, and leverage existing workflows, while taking advantage of Scalr for cloud infrastructure management.

CMDB Integration

Scalr integrates with the ServiceNow CMDB to record cloud-based assets, resources and configurations in ServiceNow, and maintain a single source of truth across the customer’s entire IT ecosystem.

CMDB Integration Setup

Note

You will need to create a server to host your Webhook, this can be a small Linux server as the load should be minimal. Find out more about Webhooks here: Webhooks and Endpoints.

First, you will need to create a table in ServiceNow if it doesn’t already exist. Please follow these instructions to do so: ServiceNow Table Creation NEWWIN

Next, on the server that will be hosting the Webhook, pull down the Webhook code from Git:

apt update
apt install python-pip -y

pip install docker-compose

curl -fsSL https://get.docker.com/ | sh
service docker start || systemctl start docker

git clone https://github.com/scalr-tutorials/scalr-servicenow-webhook.git /opt/snow-webhook

Before creating a Webhook, an Endpoint is needed for the Webhook to contact. The Endpoint is the URL of the application that is running the Webhook. To create an Endpoint at the Account or Scalr scopes, click on the Scalr icon on the top left MENU_ACC and then click on Integration Hub > Endpoints.

../_images/new_endpoint.png
Field Description
Name The name of the endpoint.
URL The URL the endpoint can be reached at.
Status A radio button to turn make the endpoint active/ inactive within Scalr.
Shared Determines if the endpoint can be used at a lower level. This is only seen at the Account and Scalr scopes.

The URL above will point to the server you are hosting the ServiceNow Webhook on (http://<webhook server IP or hostname>:5018/servicenow/). Make sure to copy down the Signing Key that is generated as it will be used later on.

Note

To use an Endpoint for Farm Approvals you DO NOT need to configure a Webhook. Approvals are set up when configuring an Environment and they use the Endpoint directly. Please see Approvals for more details.

The next step is to configure the Webhook, to do this at the Account or Scalr scope, click on the Scalr icon on the top left MENU_ACC and then click on Integration Hub > Webhooks.

../_images/new_webhook.png
Field Description
Name Name of the webhook
Endpoints The endpoint URL which should be used for this webhook.
Events The event at which the webhook call should be triggered. This can be Server or Farm lifecycle event such as BeforeInstanceLaunch and FarmLaunched. See Event Descriptions.
Farms Which farm(s) the webhook should trigger on. If left blank it will be trigger on all farms within the scope that the webhook is set.
Advanced Settings - Timeout The length of time in which Scalr should get a response back from the webhook before timing out.
Advance Settings - Max. Delivery Attempts How many times Scalr should attempt to send a payload if it initially fails to send.
Do not expose private GlobalVariables in webhook payload If a Global Variable is marked as hidden and this is checked then the Global Variable will not be passed in the payload
User Data Webhook user data can be used to add extra information to Webhook Notifications. Webhook User Data is passed as-is in the userData field of the Webhook Notification’s payload so if you configure it in a specific format (i.e. JSON) you will need to manually decode it in your webhook handler.

The Endpoint in the screenshot above will be the Endpoint that you created in the previous step. In terms of the Events, you can select as many Events as you wish, every time this event is triggered a payload will be sent to ServiceNow. By Default, the Webhook will trigger on the following events:

  • BeforeInstanceLaunch
  • HostInit
  • BeforeHostUp
  • HostUp
  • BeforeHostTerminate
  • HostDown
  • IPAddressChanged
  • ResumeComplete
  • HostInitFailed

This is configurable, by updating the following line in webhook.py which is located in /opt/snow-webhook :

https://github.com/scalr-tutorials/scalr-servicenow-webhook/blob/master/webhook.py#L48

Next, log into the server that is hosting the Webhook and go to the /opt/snow-webhook directory. Copy the uwsgi.ini file:

cd /opt/snow-webhook
vi uwsgi.in

Next, edit the uwsgi.ini file to set the configuration variables:

  • env = SCALR_SIGNING_KEY=Signing key that was generated after creating the Webhook Endpoint.
  • env = SNOW_URL=The ServiceNow URL
  • env = SNOW_USER=The user accessing ServiceNow
  • env = SNOW_PASS=The password for accessing ServiceNow
  • env = SCALR_TABLE=The table name that should receive data from the Webhook

Next, run the Webhook with Docker:

./relaunch.sh

You’re ServiceNow Webhook should now be running, you can check the logs by using the following command:

docker logs -f snow-webhook

To test, build and launch a Farm, once the server reaches the Event specified in the Webhook section above, the payload will be sent to the Webhook and forwarded to ServiceNow.