This installation guide will help you setup the following components of Auto Resolution
- EventHandler Bot
- Services - 1. Neo4jDBHandler 2. Recommendation Engine (Static - Json Based)
Prerequisites:
- Neo4j (Recommended versions: 3.3.3,3.4.0)
- node js (Recommended version: v6.11.3)
Getting Started:
Panel |
---|
borderColor | green |
---|
titleColor | green |
---|
title | EventHandler bot setup |
---|
|
EventHandler bot can be set up manually by following the steps described below: cd myhubot yo hubot - Copy the scripts from the cloned repository(first step) from the bot folder event-handler-bot into myhubot/scripts folder
- Copy the package.json file into the myhubot directory
Now set the required environment variables (As mentioned below in Environment Variables section) |
Panel |
---|
borderColor | green |
---|
titleColor | black |
---|
title | Environment Variables |
---|
|
Variable | Purpose |
---|
EXPRESS_PORT | Port number where the hubot will run | HUBOT_SLACK_TOKEN | Bot User OAuth Access Token of EventHandler bot | NEO4JHANDLER_IP | "IP:port" where the Neo4jDBHandler service is running | RECOMMENDATION_ENGINE_IP | "IP:port" where the RecommendationEngine service is running |
|
Panel |
---|
borderColor | green |
---|
titleColor | black |
---|
title | Configuration |
---|
|
Config file | Location | Description |
---|
tokenizer.json | EventHandler/scripts/ | Specifies the fields in notification and resolution and the regex to match the same. The regex is to be specified in the order of decreasing number of groups (i.e.) the regex that matches the maximum number of fields should be at top followed by the regex that matches fewer number of fields and so on. | problemconfig.json | EventHandler/scripts/ | The metadata for every problem is to be specified in this file. | resolutionconfig.json | EventHandler/scripts/ | The metadata for every action is to be specified in this file. | getrecommendation.json | EventHandler/scripts/ | The primary key field to be used and the field to be retrived for recommendation (command field) needs to be specified in this file. | filter.json | EventHandler/scripts/ | The condition under which recommendations should be fetched is specified in this file. |
Note: Click the filenames to download the example config file. |
Run EventHandler Bot
- Change the working directory to myhubot folder
- Run: npm install
Finally, start the bot as a background process (logs will be redirected to hubot.log file): nohup ./bin/hubot -a slack > hubot.log &
Note |
---|
At any time the bot running in background can be stopped by this command: ps aux | grep -ie <botname> | awk '{print $2}' | xargs kill -9 The <botname> can be fetched from the following line of the bin/hubot file: exec node_modules/.bin/hubot --name "botname" "$@" |
Setting up Services : Neo4jDBHandler and Recommendation Engine
Panel |
---|
borderColor | green |
---|
titleColor | green |
---|
title | Neo4jServices setup |
---|
|
Node services (Neo4jDBHandler and RecommendationEngine) can be set up manually by following the steps described below: - Clone our OnBot repository from github (git clone https://github.com/CognizantOneDevOps/OnBot.git)
- Change the working directory to reco-engine folder
- Now set the required environment variables (As mentioned below in Environment Variables section)
|
Panel |
---|
borderColor | green |
---|
titleColor | black |
---|
borderStyle | solid |
---|
title | Environment Variables |
---|
|
Expand |
---|
|
Variable | Purpose |
---|
NEO4J_PROTOCOL | "bolt" | NEO4J_HOST | IP address where neo4j is running | NEO4J_PORT | port where the neo4j bolt protocol is running | NEO4J_USERNAME | neo4j login username | NEO4J_PASSWORD | neo4j login password |
|
Expand |
---|
title | RecommendationEngine |
---|
|
Variable | Purpose |
---|
NEO4JHANDLER_IP | "IP:port" where the Neo4jDBHandler service is running | EVENTHANDLER_IP | "IP:port" where the EventHandler bot is running | SLACK_LEGACY_TOKEN | Legacy token of the slack workspace | EVENTHANDLER_USER_TOKEN | Bot User OAuth Access Token of EventHandler bot |
|
|
Panel |
---|
borderColor | green |
---|
titleColor | black |
---|
borderStyle | solid |
---|
title | Configuration |
---|
|
Config file | Location | Description |
---|
notification.js, action.js, problem.js | Neo4jServices/models/ | The properties and relationships of these node labels needs to be defined in the respective js files. Refer: https://github.com/adam-cowley/neode/blob/master/example/Person.js | <<notificationTool>>.json | Neo4jServices/resources/eventlifecyclemapping/ | The list of files that maps the events to the suggested actions are to be placed here. The file name should be the name of the notification tool (Monitoring tool). For example, if CFBot is used for monitoring, then name the file as "cfbot.json". | <<platform>>.json | Neo4jServices/resources/lifecyclecmdmapping/ | The list of files that maps the actions to commands of the remediation tool used in the platform are to be placed here. The file name should be the name of the platform where the apps are hosted. For example, if bluemix platform is used, then name the file as "bluemix.json". |
Note: Click the filenames to download the example config file. |
Panel |
---|
borderColor | green |
---|
titleColor | black |
---|
title | Slack configuration for interactive messages |
---|
|
- Logging into api.slack.com navigating to the My Apps section at slack.com/apps
- Click the Interactive Components link in the menu
Image Added - Click Enable Interactive Messages, enter Request URL (http://<RecommendationEngine IP:port>/hubot/ai-callback) and click Enable Interactive Messages
The Request URL must be publicly accessible and secure. Image Added
|
Note |
---|
"Request URL" is the Recommendation Engine service endpoint. Ensure Reco Engine service(RecommendationEngine) is publicly accessible for the slack to connect by the way of making load balancer URL or proper port opening in the firewall. |
Run Neo4jServices:
- Change the working directory to reco-engine folder
- Run: npm install
- Finally, start the node services as :
- node RecommendationEngine.js
- node Neo4jDBHandler.js