Skip to main content

A simple utility for executing various commands on multiple cyperf agents.

Project description

cyperf-agent-manager

A simple python script that can ssh into multiple cyperf agents and run some pre-defined commands

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install cyperf-agent-manager

License

cyperf-agent-manager is distributed under the terms of the MIT license.

CLI

This package installs a command called cyperf-agent-manager that is a very thin wrapper over cyperf_agent_manager package. This top level commands has many subcommands that can be used to execute different operations on multiple agents at simultaneously.

The command details can be found by running the script with --help option, as shown in the following blocks.

[PROMPT]:~$ cyperf-agent-manager --help
Usage: cyperf-agent-manager [OPTIONS] COMMAND [ARGS]...

Options:
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.
  --help                          Show this message and exit.

Commands:
  reload
  set-controller
  set-test-interface

Setting controller IP for multiple agents

[PROMPT]:~$ cyperf-agent-manager set-controller --help
Usage: cyperf-agent-manager set-controller [OPTIONS] AGENT_IPS...

Arguments:
  AGENT_IPS...  [required]

Options:
  --controller-ip TEXT  [required]
  --help                Show this message and exit.

Example:
========

[PROMPT]:~$ cyperf-agent-manager set-controller --controller-ip 10.36.75.126 10.36.75.69 10.36.75.70
>> Connectiong to agent 10.36.75.69
>> Executing command cyperfagent controller set 10.36.75.126

Controller is set successfully.

Current Configurations
  Controller:           10.36.75.126:30422
  Management Interface: ens160
  Test Interface:       ens192

Please make sure that the URL and interfaces are set correctly for the tests to run.

Portmanager service restarted.

Connecting....Connected


>> Connectiong to agent 10.36.75.70
>> Executing command cyperfagent controller set 10.36.75.126

Controller is set successfully.

Current Configurations
  Controller:           10.36.75.126:30422
  Management Interface: ens160
  Test Interface:       ens192

Please make sure that the URL and interfaces are set correctly for the tests to run.

Portmanager service restarted.

Connecting....Connected

Reloading configuration for multiple agents

[PROMPT]:~$ cyperf-agent-manager reload --help
Usage: cyperf-agent-manager reload [OPTIONS] AGENT_IPS...

Arguments:
  AGENT_IPS...  [required]

Options:
  --help  Show this message and exit.

Example:
========

[PROMPT]:~$ cyperf-agent-manager reload 10.36.75.69 10.36.75.70
>> Connectiong to agent 10.36.75.69
>> Executing command cyperfagent configuration reload

Current Configurations
  Controller:           10.36.75.126:30422
  Management Interface: ens160
  Test Interface:       ens192

Please make sure that the URL and interfaces are set correctly for the tests to run.

Portmanager service restarted.

Connecting.....Connected


>> Connectiong to agent 10.36.75.70
>> Executing command cyperfagent configuration reload

Current Configurations
  Controller:           10.36.75.126:30422
  Management Interface: ens160
  Test Interface:       ens192

Please make sure that the URL and interfaces are set correctly for the tests to run.

Portmanager service restarted.

Connecting....Connected


Setting test interface for multiple agents

[PROMPT]:~$ cyperf-agent-manager set-test-interface --help
Usage: cyperf-agent-manager set-test-interface [OPTIONS] AGENT_IPS...

Arguments:
  AGENT_IPS...  [required]

Options:
  --test-interface TEXT  [required]
  --help                 Show this message and exit.

Example:
========

[PROMPT]:~$ cyperf-agent-manager set-test-interface --test-interface auto 10.36.75.69 10.36.75.70
>> Connectiong to agent 10.36.75.69
>> Executing command cyperfagent interface test set auto

Test Interface is set successfully.

Current Configurations
  Controller:           10.36.75.126:30422
  Management Interface: ens160
  Test Interface:       auto (Auto-detected interface is ens192)

Please make sure that the URL and interfaces are set correctly for the tests to run.
Use the following commands to explicitly set the Management and Test interfaces:
  cyperfagent interface management set <Management interface name>
  cyperfagent interface test set <Test interface name>

Portmanager service restarted.


>> Connectiong to agent 10.36.75.70
>> Executing command cyperfagent interface test set auto

Test Interface is set successfully.

Current Configurations
  Controller:           10.36.75.126:30422
  Management Interface: ens160
  Test Interface:       auto (Auto-detected interface is ens192)

Please make sure that the URL and interfaces are set correctly for the tests to run.
Use the following commands to explicitly set the Management and Test interfaces:
  cyperfagent interface management set <Management interface name>
  cyperfagent interface test set <Test interface name>

Portmanager service restarted.


Module

The python module installed by this package in cyperf_agent_manager. This can be used from a custom python script. Here is a smaple code that uses the cyperf_agent_manager module.

import cyperf_agent_manager as caMgr

agentIPs     = [ '192.168.0.1', '192.168.0.2' ]
controllerIP = '192.168.100.1'
testIface    = 'ens192'

agentMgr     = caMgr.CyPerfAgentManager(agentIPs)

agentMgr.ControllerSet (controllerIP)
agentMgr.Reload ()
agentMgr.SetTestInterface (testIface)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cyperf_agent_manager-0.0.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

cyperf_agent_manager-0.0.5-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file cyperf_agent_manager-0.0.5.tar.gz.

File metadata

File hashes

Hashes for cyperf_agent_manager-0.0.5.tar.gz
Algorithm Hash digest
SHA256 452f5badecf0552f3bf296dc722e89fe54ebcb7a8ae3d77999c63b3d8bb1cad1
MD5 b72edf4bb538416f0bcce5e8f7c2e20d
BLAKE2b-256 31b33d798b7240c57d7a04c044b6f9d38fc72ed933f3613e4c4013f3533423aa

See more details on using hashes here.

File details

Details for the file cyperf_agent_manager-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for cyperf_agent_manager-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 149f70d92365b236f340ee37ac663a95fe4bd49a3aac6414e26a5d524d6c2872
MD5 2f3877d8f42c20200e13c9cb42826ea6
BLAKE2b-256 05ce2819fa23a7b6c6b8bb6b96e5d5b6b8ce397703ccbf70fdf615677e91afbd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page