This dashboard displays summary information about Webex Devices across a Webex Org and both Active and Historic (CDR) Device Call information.
The focus of this dashboard is to monitor Webex Devices
and Webex Device Calls
both in realtime and historically to identify problems impacting calls.
The dashboard can also integrate with ServiceNow to display Open and Closed Tickets related to Webex Devices.
Summary information about Webex Devices includes:
Device Call Information includes:
MOS Values
section for more details)Note:
config.py
)OAuth Integrations are how you request permission to invoke the Webex REST API on behalf of another Webex Teams user. To do this in a secure way, the API supports the OAuth2 standard which allows third-party integrations to get a temporary access token for authenticating API calls instead of asking users for their password.
Note: It's important to use a Full Admin Account
as the underlying account for the integration. Several API calls within the script are 'admin-only'.
To register an integration with Webex Teams:
developer.webex.com
My Webex Apps
Create a New App
Create an Integration
to start the wizardhttp://0.0.0.0:5500/callback
(this must be exact)spark:xapi_statuses
spark:xapi_commands
spark-admin:devices_read
spark-admin:workspaces_read
spark-admin:locations_read
To read more about Webex Integrations & Authorization and to find information about the different scopes, you can find information here
This app provides a Docker
file for easy deployment. Docker
is the recommended deployment method. Install Docker
here.
If integrating with ServiceNow, gather the url
and username
/password
for a ServiceNow Admin associated with the target ServiceNow instance. A free developer instance can be created with the Developer Program
While there's many ways a ServiceNow incident table and tickets can be organized, it's recommended to set the Short Description
of a Webex Device Ticket to that of the Endpoint Name
and group device tickets in some way (category, etc.). This allows the dashboard to easily retrieve relevant incidents (based on ServiceNow filtering query) and display the Endpoint Name associated with the ticket.
This dashboard utilizes Audio and Video MOS scores to indicate the performance and user experience in Active and Historic Calls. These MOS scores are based on Packet Loss and Jitter.
To calculate the MOS values, we use the following methodology:
This methodology, penalties, and threshold can be modified in flask_app/util.py
> calculate_mos
if desired.
git clone [repository name]
. To find the repository name, click the green Code
button above the repository files. Then, the dropdown menu will show the https domain name. Click the copy button to the right of the domain name to get the value to replace [repository name] placeholder..env_sample
file to .env
. Rename config_sample.py
to config.py
(in flask_app
directory).Webex Client Key
and Client Secret
to .env
from the prerequisites section.WEBEX_CLIENT_ID="" WEBEX_CLIENT_SECRET=""
Device Type
filter to only consider specific types of devices in config.py
, and modify Maximum Call History
retained per device and/or Call History Refresh Frequency
if desired.# (optional) Filter devices by type (roomdesk, phone, accessory, webexgo, unknown) DEVICE_TYPE = "" # Max Period (in days) to keep call history, Frequency to gather call history from devices (minutes) CALL_HISTORY_MAX_PERIOD = 60 CALL_HISTORY_REFRESH_CYCLE = 10
config.py
), add ServiceNow instance variables (.env
) obtained from the prerequisites section.# config.py SERVICE_NOW_FEATURE = True
# .env SERVICENOW_INSTANCE="<replace>" SERVICENOW_USERNAME="<replace>" SERVICENOW_PASSWORD="<replace>"
Short Description
of a ServiceNow ticket to that of the corresponding Device Name
, set INCLUDE_ENDPOINT_NAME
to True (this will display the endpoint name associated with a Ticket on the dashboard).INCLUDE_ENDPOINT_NAME = True
Open/Closed Tickets
associated with Webex Devices based on Incident Table structure (ex: Tickets with a 'devices' category). The queries mimic the dashboard queries and are highly dependent on how device tickets are classified and organized.# ServiceNow Filters (controls which incidents are returned to the dashboard - by default: active tickets (open), # last 48 hours (closed) For all available filter parameters, build filter with UI, right click query string, # copy query to sysparm_query OPEN_SERVICE_NOW_INCIDENT_FILTER = {"sysparm_display_value": "true", "sysparm_query": "active=true^category=devices"} LAST_X_HOURS = 48 # Last 48 hours of closed tickets by default CLOSED_SERVICE_NOW_INCIDENT_FILTER = {"sysparm_display_value": "true", "sysparm_query": "active=false^category=devices"}
pip3 install -r requirements.txt
Webex OAuth Token
: Before launching the dashboard, generate a Webex OAuth Token
with script flask_app/webex_tokens.py
(This web app script must be run first):$ python3 flask_app/webex_tokens.py
Once the script is running, navigate to http://0.0.0.0:5500
(the same one configured in the Webex Integration). This will prompt a Webex Login page.
Sign in with the Full Admin Account
. The account provided here grants the access permissions of the account to the token (in addition to the scopes defined in the integration).
You may be prompted to grant access to the integration. Once successful, a landing page with a 'Success' message is displayed:
An 'Access Token' and a 'Refresh Token' will be written to tokens.json
. The 'Access Token' and 'Refresh Token' are valid for 14 and 90 days respectively. If the access token expires, it will automatically be refreshed if the refresh token is valid (and the refresh token's life is reset back to 90 days).
The process only needs to be completed once if the dashboard is launched within 90 days of generating the tokens. Otherwise, if both tokens are expired, the process must be repeated.
Launching the Dashboard
: To launch the dashboard, use the following commands to run with python directly:$ python3 flask_app/db.py
$ python3 flask_app/app.py
or with the docker command:
$ docker-compose up -d --build
Note:
db.py
creates a sqlite database which maintains the historic call information (it must be run first!) while app.py
represents the main flask app.flask_app/logs
Once the app is running, navigate to http://127.0.0.1:5000 to be greeted with the main landing page (overview page):
This page summarizes Webex Devices seen in the organization (Note: if a device isn't present, the device likely doesn't have xAPI permission - see logs)
The remaining pages and workflows are summarized below:
Active Calls
:
Show current active calls and their MOS values.
Historic Calls
:
See historic calls for all or a specific device based on the selected time period (up to 60 days).
Device Details
:
Clicking into a device on the landing page displays further details about a Webex Device, including peripherals, room analytics, system unit informaiton, etc.
Open Tickets
:
If integrated with ServiceNow, this page displays any open tickets (based on query) for Webex Devices.
Closed Tickets
:
If integrated with ServiceNow, this page displays closed tickets (based on query) for Webex Devices in the last 48 hours (by default). If INCLUDE_ENDPOINT_NAME is set to True, you will see an Endpoint Name otherwise that column will be blank.
Provided under Cisco Sample Code License, for details see LICENSE
Our code of conduct is available here
See our contributing guidelines here
Please note: This script is meant for demo purposes only. All tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use.
You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.
Owner
Contributors
Categories
Products
WebexProgramming Languages
JavaScriptLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community