HomeGuidesAPI ReferenceGuidesMRT APIConfiguration API
GitHubAirheads Developer Community
Guides

Client Disconnection

📘

Source Code

You can find the full source code and documentation for this workflow on GitHub: Client Disconnection

This workflow automates the process of disconnecting a client device from a network managed by HPE Aruba Networking Central.
The user provides a client MAC address, and the workflow:

  1. Identifies which site the client belongs to,
  2. Determines the device the client is connected to
  3. Sends a disconnect request to that device
Client Disconnect Workflow Overview

Client Disconnect Workflow Overview

Prerequisites

The following conditions must be met before running this workflow:

  • API credentials must have sufficient permissions for client management operations
  • Client devices must be currently connected to the network managed by Central
  • Client MAC addresses must be known and valid

Installation

Set up a Python virtual environment, activate it, and install dependencies from requirements.txt.

  1. Clone the repository and navigate to this workflow folder
git clone -b "v2(pre-release)" https://github.com/aruba/central-python-workflows.git
cd central-python-workflows/pycentral-workflows-beta/client-disconnection
  1. Create and activate a virtual environment, then install dependencies
  • On macOS/Linux: source venv/bin/activate
  • On Windows (PowerShell): venv\Scripts\Activate.ps1
python3 -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate
pip install -r requirements.txt

This workflow is tested on the pycentral SDK (version: 2.0a9). Please check compatibility before executing on older/newer versions as there may be changes


Configuration

Credentials Configuration (account_credentials.yaml)

For API operations in HPE Aruba Networking Central:

new_central:
    cluster_name: <cluster-name>  # or base_url: <central-api-base-url>
    client_id: <new-central-client-id>
    client_secret: <new-central-client-secret>

Sample Input: See account_credentials.yaml in this repository for an example credential file.

📘

Important Links

Workflow Input Data (workflow_variables.yaml)

client_macs:
  - aa:bb:cc:dd:ee:ff
  - 11:22:33:44:55:66
ParameterTypeRequiredDescription
client_macslist of stringsYesList of client MAC addresses to disconnect

Sample Input: See workflow_variables.yaml in this repository for an example input file structure.


Execution

When you run the script, it processes each client listed in the input file sequentially and performs the following operations:

  1. Client Location Discovery: Identifies the site and device to which each provided client MAC address is currently connected.
  2. Disconnection Request: Sends a disconnection command to the corresponding device managing that client.
  3. Results Export: Generates a comprehensive report summarizing the disconnection request status and related details for all processed clients.
python client_disconnect.py -vars workflow_variables.yaml -c account_credentials.yaml

Command Line Options

Describe the expected inputs, their formats, and any validation rules.

NameTypeDescriptionRequired
-c, --credentialsstringPath to YAML/JSON file with Central credentialsYes
-vars, --variables_filestringPath to YAML/JSON file containing client MAC addressesYes

Output

The workflow produces detailed results both in terminal output and CSV export:

Terminal Output

  • Real-time progress updates for each client
  • Tabulated summary showing disconnection results
  • Error messages and troubleshooting information
  • Colored Rows indicating status of client disconnection.
    • Green indicates that the client disconnection was initiated successfully.
    • Yellow indicates that the client disconnection was skipped. The reason for skipping (for example, client not currently connected) is shown in the Errors column.
    • Red indicates that the client disconnection failed. The detailed error or failure reason is displayed in the Errors column.

Sample Output: See below for a sample terminal output of the script.

Sample Terminal output

Sample Terminal output

CSV Export

A timestamped CSV file (client_disconnect_results_YYYYMMDD_HHMMSS.csv) containing:

ColumnDescription
Client MACMAC address of the client
Client NameName of the client
Connected SiteSite where the client was connected
Connected DeviceDevice (AP/Gateway) the client was connected to
Disconnect StatusSUCCESS/FAILED/SKIPPED for disconnection attempt
ErrorsError messages if any step failed
Overall StatusSUCCESS/FAILED overall workflow result

Sample Output: See client_disconnect_results_sample.csv in this repository for an example output file.

Verification of Disconnection

📘

Note

The disconnection attempt is initiated by the workflow but not guaranteed to complete automatically. The workflow sends a disconnect command to the device managing the client, but depending on network conditions, device response, and client type, the action may not always take effect immediately.

To confirm a successful disconnection, verify the client’s status in the Central UI. See the screenshot below for an example of how a successful disconnection event appears in the Client's Event tab in Central UI.
To confirm that the disconnection request was successful, follow these steps:

  1. Navigate to the site where the client was associated.
  2. Go to the Clients section and check the client’s current connection status.
    • If the client is disconnected, the action succeeded.
    • In some cases, the client may still appear as connected in the list due to network delays or UI refresh intervals.
  3. Regardless of the connection state, you can confirm the action by navigating to the Event tab of the client in Central. A successful disconnection event will be recorded here, as shown in the example below.
Successful Client Disconnect Event

Successful Client Disconnect Event


Output / Outcome (Please select a title based on your workflow)

Describe the outputs produced by the workflow. Provide any relevant screenshots/GIFs of the workflow execution and results.

NameTypeDescription
output_filestringPath to output file
.........

Troubleshooting

List common issues and solutions.

Support