Features supported in IHub Lite

Following features are supported in IHub Lite:

 

Channel with json mapping and default destinationChannel with json mapping and default destination

By default, the destination of ihub lite channel - which can be a queue, http, email or api scanner - will be always iHub main’s inbound queue. The main inbound queues will be specified as environment variables in lite’s docker stack file. 
When a channel is configured at lite with json mapping without specifying the destination the incoming json will be converted based on the json mapping given in the channel configuration and it will be redirected to iHub main’s inbound queue using TLS tunneling.
So, a queue listener should be created at iHub main end to take this message and push the message to SmartOps inbound queue.
A sample json for creating a queue channel with json mapping and no destination details is given below.

{
 "channelName":"QueueChannel", // Name for Channel
   "projectId":1205, //Project Id
   "sourcePredicates":[ //Source predicate which helps to 
identify the source and json mapping for conversion.
 Should be unique per channel
      {
         "key":"source",
         "value":"solarwinds"
      }
   ],
   "jsonMappings":{ //Json mapping used for converting input to output.
      "jsonSpecs":[
         {
            "mappings":{
               "alertDescription":"senseParams.alertMessage",
               "severity":"senseParams.alertType",
             "hostname":"senseParams.host",
               "ipaddress":"senseParams.ip",
               "port":"senseParams.port",
               "system":"senseParams.system"
          },
            "operation":"shift"
         },
         {
            "mappings":{
               "senseParams/source ":"solarwinds"
            },
          "operation":"default"
         }
      ]
   }
}


Once a json message with source = solarwinds comes in the above ihub lite channel it will be converted to smartops formatted json and will be placed in IHub main’s inbound queue.


So at iHub main side a queue listener should be configured which should map an automation story to the above request. Since the conversion is already happening at iHub lite side the iHub main queue listener should be configured in such a way to map the input json as output with additional automationStoryName field.


IHub main queue channel configured for routing message from the above lite channel is given below.

 

Channel without json mapping and default destinationChannel without json mapping and default destination

By default, the destination of ihub lite channel - which can be a queue, http, email or api scanner - will be always iHub main’s inbound queue. The main inbound queues will be specified as environment variables in lite’s docker stack file. 
When a channel is configured at lite without json mapping and without specifying the destination the incoming json will be pushed as such to ihub main’s inbound using TLS tunneling.
So, a queue listener should be created at iHub main end to take this message, convert that to Smartops json and push the message to SmartOps inbound queue.
A sample json for creating a queue channel without json mapping and no destination details is given below.

{
 "channelName":"QueueChannel", // Name for Channel
   "projectId":1205, //Project Id
   "sourcePredicates":[ //Source predicate which helps to 
identify the source and json mapping for conversion.
 Should be unique per channel
      {
         "key":"source",
         "value":"solarwinds"
      }
   ]
}


So whenever a request json with source = solarwinds comes through this queue channel it will be routed to iHub main’s inbound queue. So a queue listener should be configured at ihub main end to convert that message to SmartOps json and place the converted message to smartops queue. The queue listener configured at iHub main end is given below.


 

Channel with destination details and separate mapping for each destinationChannel with destination details and separate mapping for each destination

Lite channel creation apis have provision to specify the destination details in channel configuration itself. When a destination is specified rather than sending the messages to default destination (which is ihub inbound queue) iHub lite will send the message to defined destination(s).

Currently two types of destinations are supported in iHub lite. 

Queue

When we define queue as a destination ihub lite will convert the incoming message according to the mapping defined in this destination and will place it in that specified queue. The queue, exchange and its binding should be present in the destination rabbitmq instance for this.
While configuring queue as destination user needs to provide the following details related to that destination.

   

  "destinationType": "QUEUE",
      "jsonMappings": {  -// Before routing to this configured queue 
the incoming message will be            
  converted based on this mapping
        "jsonSpecs": [
          {
            "mappings": {},
            "operation": "string"
          }
        ]
      },
      "queueExchangeName": "string", //Destination queue exchange name
      "queueHost": "string", //Destination queue host name
      "queueName": "string", // Destination queue name
      "queuePassword": "string", //Queue password
      "queuePort": 0, //Port 
      "queueRoutingKey": "string", //secret key used while binding
      "queueUsername": "string", //Username to push messages
    "queueVhost": "string" //Queue Vhost



API

When we define API as a destination ihub will convert the incoming message according to the mapping defined in this destination and will push the message to the configured API. 
While configuring API as destination user needs to provide the following details related to that destination.

   "apiAuthType": "BASIC", //If the API has basic authentication
 the value should be “BASIC” if no authentication 
is required it should be NO_AUTH
      "apiHeaders": {}, //If any headers need to be provided for invoking API 
      "apiPassword": "string",
      "apiUsername": "string",// API Authentication details if authType is BASIC
      "apiRequestMethod": "POST", //The request type can be either POST or PUT
      "apiUrl": "string", // The API URL in which message to be pushed
      "destinationType": "QUEUE",
      "jsonMappings": {  -// Before routing to this configured queue 
the incoming message will be            
  converted based on this mapping
        "jsonSpecs": [
          {
            "mappings": {},
            "operation": "string"
          }



A sample json for creating ihub lite queue channel with 2 destinations – one is a queue and other is and API is given below.

{
        "channelName": "LiteQueueChannel",
        "sourcePredicates": [
            {
                "key": "source",
                "value": "solarwinds"
          }
        ],
        "projectId": 90,
        "destinations": [
            {
                "destinationType": "API",
                "queueHost": null,
              "queuePort": 0,
                "queueUsername": null,
                "queuePassword": null,
                "queueExchangeName": null,
                "queueRoutingKey": null,
                "queueName": null,
                "queueVhost": null,
                "apiRequestMethod": "POST",
                "apiUrl": "https://smartops-dev.eastus.cloudapp.azure.com/paas/monitoring/ihubcomponent/api/smartops/ihub/endpoint",
              "apiHeaders": {
                    "offline-token": "YWNjZXNzIHByb2ZpbGUifQ.59pQ-NSfkAxGHhyWxI1fs1a3afITz3mZoA7T1Q5SQiw",
                    "Organization-key": 5
              },
                "apiAuthType": "NO_AUTH",
                "apiUsername": null,
                "apiPassword": null,
                "jsonMappings": {
                  "jsonSpecs": [
                        {
                            "operation": "shift",
                            "mappings": {
                              "severity": "senseParams.alertType",
                                "ipaddress": "senseParams.ip",
                                "hostname": "senseParams.host",
                              "system": "senseParams.system",
                                "port": "senseParams.port",
                                "alertDescription": "senseParams.alertMessage"
                          }
                        },
                        {
                            "operation": "default",
                            "mappings": {
                              "automationStoryName": "PwfMonitoringRealtime",
                                "source": "ihubHttp",
                                "senseParams/source": "solarwinds"
                          }
                        }
                    ]
                }
            },
            {
                "destinationType": "QUEUE",
                "queueHost": "smartops-dev-connect.eastus.cloudapp.azure.com",
                "queuePort": 443,
                "queueUsername": "admin",
                "queuePassword": "admin",
              "queueExchangeName": "ihub.lite.exchange",
                "queueRoutingKey": "ihub-inbound",
                "queueName": "ihub.outbound.queue",
              "queueVhost": "/",
                "apiRequestMethod": null,
                "apiUrl": null,
                "apiHeaders": null,
                "apiAuthType": "NO_AUTH",
                "apiUsername": null,
                "apiPassword": null,
                "jsonMappings": {
                    "jsonSpecs": [
                      {
                            "operation": "shift",
                            "mappings": {
                                "severity": "senseParams.alertType",
                              "ipaddress": "senseParams.ip",
                                "hostname": "senseParams.host",
                                "system": "senseParams.system",
                              "port": "senseParams.port",
                                "alertDescription": "senseParams.alertMessage"
                            }
                      },
                        {
                            "operation": "default",
                            "mappings": {
                                "automationStoryName": "PwfMonitoringRealtime",
                                "source": "solarwindsQueue",
                                "senseParams/source": "solarwinds"
                          }
                        }
                    ]
                }
            }
        ]
    }


When it above configured lite queue channel receives a request with source=solarwinds it will convert the messages based on mapping provided in queue destination and place that converted message to the configured queue and also based on mapping provided in API destination and will place it in the configured API.

 

Channel with destination details and no mappingChannel with destination details and no mapping

When we define channel with destination details and with no mapping information within destination details the channel will push the incoming message as such to the defined destination.
A sample json for creating a channel with destination details without json mapping is given below.

{
        "channelName": "LiteQueueChannel",
        "sourcePredicates": [
            {
                "key": "source",
                "value": "solarwinds"
          }
        ],
        "projectId": 90,
        "destinations": [
            {
                "destinationType": "API",
                "queueHost": null,
              "queuePort": 0,
                "queueUsername": null,
                "queuePassword": null,
                "queueExchangeName": null,
                "queueRoutingKey": null,
                "queueName": null,
                "queueVhost": null,
                "apiRequestMethod": "POST",
                "apiUrl": "https://smartops-dev.eastus.cloudapp.azure.com/paas/monitoring/ihubcomponent/api/smartops/ihub/endpoint",
              "apiHeaders": {
                    "offline-token": "YWNjZXNzIHByb2ZpbGUifQ.59pQ-NSfkAxGHhyWxI1fs1a3afITz3mZoA7T1Q5SQiw",
                    "Organization-key": 5
              },
                "apiAuthType": "NO_AUTH",
                "apiUsername": null,
                "apiPassword": null
            },
            {
              "destinationType": "QUEUE",
                "queueHost": "smartops-dev-connect.eastus.cloudapp.azure.com",
                "queuePort": 443,
                "queueUsername": "admin",
                "queuePassword": "admin",
                "queueExchangeName": "ihub.lite.exchange",
                "queueRoutingKey": "ihub-inbound",
              "queueName": "ihub.outbound.queue",
                "queueVhost": "/",
                "apiRequestMethod": null,
                "apiUrl": null,
              "apiHeaders": null,
                "apiAuthType": "NO_AUTH",
                "apiUsername": null,
                "apiPassword": null
            }
      ]
    }



Note: The above mentioned four types of message processing is supported in all four types of ihub channels – ie, Queue, HTTP, Email and API Scanner.

 

 

Related Topics: 

Feedback

Copyright © 2021 UST Global. All Rights Reserved.