Skip to main content

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

If pip command is not found on your system then use the following commands to install pip.

$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py

If python command is also not found then please look for python3 command. Otherwise install python3.

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:
  --help  Show this message and exit.

Commands:
  install-build
  reload
  set-controller
  set-test-interface

Installing an agent build on multiple agents

[PROMPT]:~$ cyperf-agent-manager install-build --help
Usage: cyperf-agent-manager install-build [OPTIONS]

Options:
  --agent-ips NETWORK ADDRESS LIST
                                  One or more agent names (IP addresses or
                                  hostnames). Use quotation marks (`'` or `"`)
                                  for whitespace (` `) separated values. Other
                                  valid separators are `,`, `;` and `:`.
                                  [required]
  --username TEXT                 A common username for all the agents.
                                  [default: cyperf]
  --override-password             This along with --password option should be
                                  used for non default password.
  --password TEXT                 A common password for all the agents.
  --key-file FILE                 A common key file for opening ssh
                                  connections to all the agents.
  --debian-file-path FILE         Path to the .deb file to be installed.
                                  [required]
  --help                          Show this message and exit.

Example:
========

[PROMPT]:~$ cyperf-agent-manager install-build --agent-ips '10.36.75.69 10.36.75.70' --debian-file-path ./tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb
>> Connectiong to agent 10.36.75.69
>> Tranferring file ./tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb to ~/tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb
>> Connectiong to agent 10.36.75.70
>> Tranferring file ./tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb to ~/tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb
>> Connectiong to agent 10.36.75.69
>> Executing command sudo -S -p '' apt install -y ~/tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/62.0 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /home/cyperf/tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575 all 1.0.3.575 [62.0 MB]
Selecting previously unselected package tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575.
(Reading database ... 69919 files and directories currently installed.)
Preparing to unpack .../tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb ...
Unpacking tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575 (1.0.3.575) ...
Setting up tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575 (1.0.3.575) ...
Creating symbolic links
Installing portmanager
  Stopping existing portmanager service.
  Creating symbolic links
  Removing the existing cyperfagentcli auto-completion script
  Ensuring /etc/bash_completion.d/ directory is present in the system

Reusing following configurations from existing configuration
  Broker URL:                  nats://10.36.75.126:30422
  Management Interface:        ens160
  Test Interface:       [auto]
  Hooks:
    pre_diagnostic_collection: /opt/keysight/tiger/active/bin/utilities/01_ipsec_concatenate_key_logs
  Tags:       []

  Removing portmanager database
  Installing portmanager service
  Installing agent-update service
  Starting portmanager service
  Setting stack type ixstack-raw

Parsing config JSON file
schemaFileUri = file:///opt/keysight/tiger/active/bin/portmanager/portmanager-config.json.schema.json configFileUri = file:///etc/portmanager/portmanager-config.json
Restarting portmanager
Stack type set to: ixstack-raw

Portmanager service restarted.

  Starting portmanager service
Installing QAT Engine

	****Installing QAT Engine****>





	***QAT Engine Installation Complete***>





	***installer operation status is Success***>


/

Hook pre_diagnostic_collection is set to /opt/keysight/tiger/active/bin/utilities/01_ipsec_concatenate_key_logs.


Portmanager service restarted.


>> Connectiong to agent 10.36.75.70
>> Executing command sudo -S -p '' apt install -y ~/tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/62.0 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /home/cyperf/tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575 all 1.0.3.575 [62.0 MB]
Selecting previously unselected package tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575.
(Reading database ... 72923 files and directories currently installed.)
Preparing to unpack .../tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb ...
Unpacking tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575 (1.0.3.575) ...
Setting up tiger-x86-64-ixos-8.50-ixstack-raw-release-1.0.3.575 (1.0.3.575) ...
Creating symbolic links
Installing portmanager
  Stopping existing portmanager service.
  Creating symbolic links
  Removing the existing cyperfagentcli auto-completion script
  Ensuring /etc/bash_completion.d/ directory is present in the system

Reusing following configurations from existing configuration
  Broker URL:                  nats://10.36.75.126:30422
  Management Interface:        ens160
  Test Interface:       [auto]
  Hooks:
    pre_diagnostic_collection: /opt/keysight/tiger/active/bin/utilities/01_ipsec_concatenate_key_logs
  Tags:       []

  Removing portmanager database
  Installing portmanager service
  Installing agent-update service
  Starting portmanager service
  Setting stack type ixstack-raw

Parsing config JSON file
schemaFileUri = file:///opt/keysight/tiger/active/bin/portmanager/portmanager-config.json.schema.json configFileUri = file:///etc/portmanager/portmanager-config.json
Restarting portmanager
Stack type set to: ixstack-raw

Portmanager service restarted.

  Starting portmanager service
Installing QAT Engine

	****Installing QAT Engine****>





	***QAT Engine Installation Complete***>





	***installer operation status is Success***>


/

Hook pre_diagnostic_collection is set to /opt/keysight/tiger/active/bin/utilities/01_ipsec_concatenate_key_logs.


Portmanager service restarted.


Setting controller IP for multiple agents

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

Options:
  --agent-ips NETWORK ADDRESS LIST
                                  One or more agent names (IP addresses or
                                  hostnames). Use quotation marks (`'` or `"`)
                                  for whitespace (` `) separated values. Other
                                  valid separators are `,`, `;` and `:`.
                                  [required]
  --username TEXT                 A common username for all the agents.
                                  [default: cyperf]
  --override-password             This along with --password option should be
                                  used for non default password.
  --password TEXT                 A common password for all the agents.
  --key-file FILE                 A common key file for opening ssh
                                  connections to all the agents.
  --controller-ip NETWORK ADDRESS
                                  The IP/Hostname of the CyPerf controller.
                                  [required]
  --help                          Show this message and exit.

Example:
========

[PROMPT]:~$ cyperf-agent-manager set-controller --controller-ip 10.36.75.126 --agent-ips '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]

Options:
  --agent-ips NETWORK ADDRESS LIST
                                  One or more agent names (IP addresses or
                                  hostnames). Use quotation marks (`'` or `"`)
                                  for whitespace (` `) separated values. Other
                                  valid separators are `,`, `;` and `:`.
                                  [required]
  --username TEXT                 A common username for all the agents.
                                  [default: cyperf]
  --override-password             This along with --password option should be
                                  used for non default password.
  --password TEXT                 A common password for all the agents.
  --key-file FILE                 A common key file for opening ssh
                                  connections to all the agents.
  --help                          Show this message and exit.

Example:
========

[PROMPT]:~$ cyperf-agent-manager reload --agent-ips '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]

Options:
  --agent-ips NETWORK ADDRESS LIST
                                  One or more agent names (IP addresses or
                                  hostnames). Use quotation marks (`'` or `"`)
                                  for whitespace (` `) separated values. Other
                                  valid separators are `,`, `;` and `:`.
                                  [required]
  --username TEXT                 A common username for all the agents.
                                  [default: cyperf]
  --override-password             This along with --password option should be
                                  used for non default password.
  --password TEXT                 A common password for all the agents.
  --key-file FILE                 A common key file for opening ssh
                                  connections to all the agents.
  --test-interface TEXT           The name of the interface on the agents
                                  which will be used for test traffic.
                                  [required]
  --help                          Show this message and exit.

Example:
========

[PROMPT]:~$ cyperf-agent-manager set-test-interface --agent-ips '10.36.75.69 10.36.75.70' --test-interface auto
>> 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.


Password Override

Even though CyPerf agents are deployed from official machice images provided CyPerf team, CyPerf can also installed on arbitrary machines. All CyPerf machine images come with a default password. cyperf-agent-manager by default tries to connect with that default password. Obviously the default password won't work for arbitrary machines. In those cases the password has to be overriden. The options --override-password and --password are there for that purpose only but using --password directly in CLI is unsafe. In that case the actual password will be visible in plain text. A better option is to use only the --override-password option in CLI and then a password prompt will come up. The user will be able to type the password in an invisible way. Please see the example below. If a key file is provided using --key-file option then cyperf-agent-manager will try to open a connection with each agent using the key file first. If authentication fails with the key file then it will try the password.

Example

[PROMPT]:$ cyperf-agent-manager reload --agent-ips '10.36.75.69 10.36.75.70' --override-password
Password [cyperf]:
Repeat for confirmation:
>> 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:       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.

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:       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.

Connecting....Connected


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.agent_manager as caMgr

agentIPs     = [ '192.168.0.1', '192.168.0.2' ]
controllerIP = '192.168.100.1'
testIface    = 'ens192'
debFile      = './tiger_x86_64_ixos-8.50_ixstack-raw_release_1.0.3.575.deb'

agentMgr     = caMgr.CyPerfAgentManager(agentIPs)

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

Release files for cyperf-agent-manager 0.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cyperf-agent-manager 0.0.13
File Size Uploaded
cyperf_agent_manager-0.0.13.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cyperf-agent-manager 0.0.13
File Interpreter ABI Platform
cyperf_agent_manager-0.0.13-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / cyperf_agent_manager-0.0.13.tar.gz

Download URL cyperf_agent_manager-0.0.13.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e5c7859c25e1a23dee733ae88933ffdcdb8b1032d1b9ae68fadf11190347d58a
BLAKE2b-256 checksum
How to use checksums
b98db1e592fea8af0e02722348333bfbb51113caa7ddcc4f887e844cf387ca1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.25.0

Release files / cyperf_agent_manager-0.0.13-py3-none-any.whl

Download URL cyperf_agent_manager-0.0.13-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9f8d2b186d17623895c084283714b0169f41d0f714c75d7197621df9c35da7a
BLAKE2b-256 checksum
How to use checksums
0341d3eecc15a606f1d09fe53793bc30fc6f729e620c3b23ea43b77134fb7e51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.25.0

Release history Release notifications | RSS feed

This release

0.0.13 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page