{"id":27770529,"url":"https://github.com/jgomezve/aci-chatbot","last_synced_at":"2025-04-29T21:08:02.719Z","repository":{"id":40475664,"uuid":"444097745","full_name":"jgomezve/aci-chatbot","owner":"jgomezve","description":"Webex Chatbot to interact with the APIC","archived":false,"fork":false,"pushed_at":"2023-03-16T01:01:58.000Z","size":559,"stargazers_count":2,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-29T21:07:59.247Z","etag":null,"topics":["aci","apic","cisco","go","golang","webex"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgomezve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-03T14:51:24.000Z","updated_at":"2024-05-24T15:25:16.000Z","dependencies_parsed_at":"2023-02-16T13:00:42.307Z","dependency_job_id":null,"html_url":"https://github.com/jgomezve/aci-chatbot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgomezve%2Faci-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgomezve%2Faci-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgomezve%2Faci-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgomezve%2Faci-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgomezve","download_url":"https://codeload.github.com/jgomezve/aci-chatbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251582940,"owners_count":21612745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aci","apic","cisco","go","golang","webex"],"created_at":"2025-04-29T21:08:02.198Z","updated_at":"2025-04-29T21:08:02.695Z","avatar_url":"https://github.com/jgomezve.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monitor an ACI Fabric from your favorite Webex Room - ChatOps\n\n[![Tests](https://github.com/jgomezve/aci-chatbot/actions/workflows/test.yml/badge.svg)](https://github.com/jgomezve/aci-chatbot/actions/workflows/test.yml) [![published](https://static.production.devnetcloud.com/codeexchange/assets/images/devnet-published.svg)](https://developer.cisco.com/codeexchange/github/repo/jgomezve/aci-chatbot)\n\n\nA lightweight bot application to interact with the APIC from a Webex chat room\n\n## Use Case description\n\nMonitor your Data Center with an user-friendly bot. This repository contains a [Go](https://go.dev/)-based web server, which listens to [Webex](https://www.webex.com/) [webhooks](https://developer.webex.com/docs/api/guides/webhooks) notifications and interacts with the [APIC](https://www.cisco.com/c/en/us/products/cloud-systems-management/application-policy-infrastructure-controller-apic/index.html) REST API to retrieve information about the operational status of your [ACI](https://www.cisco.com/c/en/us/solutions/data-center-virtualization/application-centric-infrastructure/index.html) Fabric.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/images/aci-chatbot.png\" border=\"0\" alt=\"aci-chatbot\"\u003e\n\u003cbr/\u003e\n\nThis application allows you to retrieve operational, topology, event/fault and endpoint information from the ACI Fabric by simply typing short and human-readable commands in a Webex room. These is the list of the currently supported commands by the aci-chatbot:\n\n```\n•\t/cpu\t-\u003e\tGet APIC CPU Information 💾\n•\t/ep\t-\u003e\tGet APIC Endpoint Information 💻. Usage /ep [ep_mac] \n•\t/events\t-\u003e\tGet Fabric latest events ❎.   Usage /events [user:opt] [count(1-10):opt] \n•\t/faults\t-\u003e\tGet Fabric latest faults ⚠️. Usage /faults [count(1-10):opt] \n•\t/help\t-\u003e\tChatbot Help ❔\n•\t/info\t-\u003e\tGet Fabric Information ℹ️\n•\t/neigh\t-\u003e\tGet Fabric Topology Information 🔢. Usage /neigh [node_id] \n•\t/websocket\t-\u003e\tSubscribe to Fabric events 📩\n```\n\nThe bot takes advantage of the [APIC REST API](https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/2-x/rest_cfg/2_1_x/b_Cisco_APIC_REST_API_Configuration_Guide/b_Cisco_APIC_REST_API_Configuration_Guide_chapter_01.html#d54e540a1635) to query and filter information from the APIC Management Information Tree (MIT). Additionally, the `/websocket` command leverages the [APIC WebSocket](https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/2-x/rest_cfg/2_1_x/b_Cisco_APIC_REST_API_Configuration_Guide/b_Cisco_APIC_REST_API_Configuration_Guide_chapter_01.html#concept_71EBE2E241C3442BA326273AF1A9B617) functionality, to get instant notifications once any instance of a defined MO/Class is created, modified or deleted.\n\n\n## Prerequisites\n\n* Make sure to have Go 1.15+ or Docker installed on your computer/server\n\n    * [Install Go](https://go.dev/doc/install)\n    * [Install Docker](https://docs.docker.com/get-docker/)\n\n* Login to your Webex account and create your own bot. [Create Bot](https://developer.webex.com/docs/bots)\n\n    1. Give your bot details\n\n        ![add-app](docs/images/bot_details.png \"Create Bot\") \n    \n    2. The generated token is your `WEBEX_TOKEN`\n\n        ![add-app](docs/images/bot_token.png \"Bot Token\")\n\n## Installation\n\n### Execute ngrok (Optional)\n\nThe bot application must be hosted in a server reachable via the public internet because the webhooks are delivered from **webex.com** . For development and testing pursposes you could use [ngrok](https://ngrok.com/) to expose your server to the public internet. Ngrok will expose your application (Server IP \u0026 Port) over a secure tunnel.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/images/aci-chatbot_ngrok.png\" border=\"0\" alt=\"aci-chatbot_ngrok\"\u003e\n\u003cbr/\u003e\n\n\n* [Install ngrok](https://ngrok.com/download)\n\nFollow these instructions after installing ngrok:\n\n* Start the ngrok service stating the port the bot server listens to. By default the application listens to the port **7001**, however if you are using the docker container you must state here Docker host port.\n\n        ./ngrok http \u003cbot_port\u003e --region=eu\n\n```\nngrok by @inconshreveable    \n\nSession Status                online\nSession Expires               1 hour, 59 minutes\nVersion                       2.3.40\nRegion                        Europe (eu)\nWeb Interface                 http://127.0.0.1:7001\nForwarding                    http://2d6e-89-246-96-47.eu.ngrok.io -\u003e http://localhost:7001\nForwarding                    https://2d6e-89-246-96-47.eu.ngrok.io -\u003e http://localhost:7001\n\nConnections                   ttl     opn     rt1     rt5     p50     p90\n                              0       0       0.00    0.00    0.00    0.00\n```\n\n*  The generated HTTP url is your `BOT_URL`\n\n\u003e **_NOTE:_**:  The trial version of ngrok creates the secure tunnel only for 2 hours\n\n### Option 1: Build the code from source\n\n* Set and source the environmental variables in `env.sh`\n\n```\nexport WEBEX_TOKEN=YOUR-WEBEX-TOKEN-GOES-HERE\nexport BOT_URL=http://2258-173-38-220-34.eu.ngrok.io\nexport APIC_URL=https://sandboxapicdc.cisco.com/\nexport APIC_USERNAME=admin\nexport APIC_PASSWORD=admin\n```\n        source env.sh\n\n* Execute the application\n\n        go run main.go\n\n\u003e **_NOTE:_**:  The Go application listens to port `7001`\n\n### Option 2: Execute the service as a Container\n\n* Set the environmental variables in `.env`:\n\n```\nWEBEX_TOKEN=YOUR-WEBEX-TOKEN-GOES-HERE\nBOT_URL=http://2258-173-38-220-34.eu.ngrok.io\nAPIC_URL=https://sandboxapicdc.cisco.com/\nAPIC_USERNAME=admin\nAPIC_PASSWORD=admin\n```\n\n*  Run the application in a Docker container\n\n            docker run --env-file .env -it -p \u003cbot_port\u003e:7001 jgomezve/aci-chatbot:latest\n\n\u003e **_NOTE:_** In case you are using ngrok, \u003cbot_port\u003e is the same port used to start ngrok.\n\n## Usage\n\nEither send a message directly to your bot or add it to a Webex Group\n\n![add-app](docs/images/webex_message.png \"Bot Message\")\n\n\u003e **_NOTE:_** Some commands do not work if the target APIC is a simulator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgomezve%2Faci-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgomezve%2Faci-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgomezve%2Faci-chatbot/lists"}