Building a Webex Chatbot for Testbed Environment Monitoring 🤖
🚀 Build an Intelligent Testbed Monitoring Bot
Automate testbed management with WebSocket-powered real-time monitoring
📋 Table of Contents
Overview
The Testbed Monitor Bot is a sophisticated Webex-integrated chatbot that revolutionizes how teams manage and track test environment resources. Built with Python and leveraging WebSocket technology, it eliminates the need for webhooks and public IP addresses.
Real-time Monitoring
Track testbed availability and usage with instant updates
Smart Broadcasting
Notify teams across multiple Webex rooms automatically
Easy Registration
Book testbeds with interactive Adaptive Cards UI
WebSocket Security
No public IP needed - secure behind firewalls
🎯 Key Features
🔌Why WebSocket?
Unlike traditional webhook-based bots that require:
- ✗ Public IP address
- ✗ SSL certificates
- ✗ Firewall configurations
- ✗ ngrok tunnels
This bot uses WebSocket connections:
- ✓ Works behind corporate firewalls
- ✓ No complex network setup
- ✓ Real-time bidirectional communication
- ✓ Automatic reconnection on failure
Core Capabilities
- 📊 Monitoring
- ✍️ Registration
- 📢 Broadcasting
Real-time Testbed Status
- View all testbeds at a glance
- See who's using what resource
- Track usage duration and expected release time
- Color-coded availability indicators
# Bot automatically tracks:
{
"testbed_name": "Testbed-1",
"status": "in_use",
"user_email": "engineer@company.com",
"registered_time": "2025-10-01T10:30:00Z",
"expected_release_time": "2025-10-01T18:00:00Z"
}
Interactive Registration System
- Adaptive Cards UI - No typing required
- Auto-populated user info - Pulls from Webex profile
- Dropdown selection - Choose from available testbeds
- Time tracking - Set expected release time
- Purpose logging - Document usage reason
Example workflow:
- User sends
testbedcommand - Bot displays menu card
- User clicks "Register Testbed"
- Bot shows registration form
- User fills form and submits
- Bot updates database and confirms
Multi-room Notifications
Broadcast testbed status to multiple Webex rooms:
{
"broadcast_rooms": [
{
"name": "QA Team",
"room_id": "Y2lzY29zcGFyazovL...",
"description": "Quality assurance team channel"
},
{
"name": "Development Team",
"room_id": "Y2lzY29zcGFyazovL...",
"description": "Dev team coordination"
}
]
}
Features:
- Select specific rooms for broadcasting
- Rich card notifications with full details
- Automatic room discovery
- Permission-based access
🏗️ System Architecture
🏗️ Interactive System Architecture
Technology Stack
📸 Bot Interface Gallery
🚀 Getting Started
Prerequisites
✅Requirements Checklist
Before starting, ensure you have:
- Python 3.10+ installed and configured
- Webex Teams account with bot creation privileges
- Network access to Webex APIs (or proxy configuration)
- Basic knowledge of Python and REST APIs
Optional but recommended:
- Git for version control
- Virtual environment (venv/conda)
- Docker for containerized deployment
Step 1: Create Your Webex Bot
- 🌐 Web Portal
- 🔧 API Method
Register via Webex Developer Portal:
-
Visit developer.webex.com
-
Sign in with your Webex credentials
-
Navigate to My Apps → Create a New App
-
Select Create a Bot
-
Fill in bot details:
Bot Name: Testbed Monitor Bot
Bot Username: testbed-monitor@webex.bot
Bot Icon: [Upload custom icon]
Description: Intelligent bot for tracking and managing testbed usage
- Click Add Bot and copy the Bot Access Token
⚠️🔒 Security Warning
Never commit your bot token to version control!
The bot access token is like a password. If exposed:
- Anyone can impersonate your bot
- Unauthorized access to conversations
- Potential data breaches
Always store it in:
- Environment variables
.envfiles (add to.gitignore)- Secret management systems (AWS Secrets Manager, Azure Key Vault)
Create Bot via REST API:
curl -X POST https://webexapis.com/v1/bots \
-H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Testbed Monitor Bot",
"username": "testbed-monitor",
"avatar": "https://your-domain.com/bot-icon.png"
}'
Response:
{
"id": "Y2lzY29zcGFyazovL...",
"name": "Testbed Monitor Bot",
"created": "2025-10-01T10:00:00.000Z",
"email": "testbed-monitor@webex.bot",
"token": "YOUR_BOT_ACCESS_TOKEN"
}








