Skip to content

Latest commit

 

History

History
105 lines (94 loc) · 3.81 KB

File metadata and controls

105 lines (94 loc) · 3.81 KB

Hermes - Astra Database Connectivity Tester

Hermes is a Python tool designed to test connectivity to Astra databases. It performs several tests including DNS resolution, port connectivity, latency, and authentication. The results of these tests are stored in a report which can be printed or saved to a file.

Prerequisites

  • Python 3.10 or higher
  • pip

Setup

  1. Clone this repository to your local machine.
    • git clone ...
  2. Navigate to the directory containing the hermes.py script.
  3. Install the required Python packages by running the following command in your terminal:
    • pip install -r requirements.txt

Usage

Before running the tool, you need to set the ASTRA_DB_SECURE_BUNDLE_PATH and ASTRA_DB_APPLICATION_TOKEN environment variables. These variables should point to the path of your secure connect bundle and the application token respectively. The application token can be found in the token.json file.

The script also accepts several flags:

  • -h or --help: Show help and examples
  • -s or --save: Saves the output to a file.
  • -f or --force: Force-save file.
  • -d or --debug: Enables collecting additional information
  • -l or --live: Output to STDOUT instead of printing a report at the end of the tests
  • -c or --show-config: Show the SCB's config.json.
  • -cs or --show-config-sensitive: Show the SCB's config.json without redacting JKS passwords.

Use -d (--debug) to increase the information generated by each test.

Here's an example of how to invoke the script:

export ASTRA_DB_SECURE_BUNDLE_PATH=/path/to/secure-connect-bundle.zip
export ASTRA_DB_APPLICATION_TOKEN="AstraCS:..."
python hermes.py --debug

Sample output:

2024-06-02 00:08:19 UTC Tests Start
2024-06-02 00:08:22 UTC Printing report:
==========
DNS Test:
Resolved 9 IP addresses for a264w2b3-a70b-55ou-91nn-cy07p8b1fdb1-us-west-2.db.astra.datastax.com
====
35.166.202.200
35.161.87.148
52.88.122.199
52.11.79.207
35.81.201.30
44.237.250.38
44.226.38.103
44.231.196.220
44.230.66.97
====
No PrivateLink detected
==========
Port Connectivity Test:
====
Connection to 35.166.202.200 on port 29080 successful
Connection to 35.166.202.200 on port 29042 successful
Connection to 35.161.87.148 on port 29080 successful
Connection to 35.161.87.148 on port 29042 successful
Connection to 44.237.250.38 on port 29080 successful
Connection to 44.237.250.38 on port 29042 successful
Connection to 52.11.79.207 on port 29042 successful
Connection to 52.11.79.207 on port 29080 successful
Connection to 52.88.122.199 on port 29080 successful
Connection to 52.88.122.199 on port 29042 successful
Connection to 44.226.38.103 on port 29042 successful
Connection to 44.226.38.103 on port 29080 successful
Connection to 35.81.201.30 on port 29080 successful
Connection to 35.81.201.30 on port 29042 successful
Connection to 44.231.196.220 on port 29080 successful
Connection to 44.231.196.220 on port 29042 successful
Connection to 44.230.66.97 on port 29080 successful
Connection to 44.230.66.97 on port 29042 successful
====
All connections successful
==========
Latency Test:
====
Latency to 52.88.122.199 is 32.41 ms
Latency to 35.161.87.148 is 34.97 ms
Latency to 52.11.79.207 is 34.65 ms
Latency to 44.237.250.38 is 34.28 ms
Latency to 44.231.196.220 is 33.61 ms
Latency to 44.230.66.97 is 33.75 ms
Latency to 35.81.201.30 is 35.13 ms
Latency to 35.166.202.200 is 36.21 ms
Latency to 44.226.38.103 is 1106.2 ms
====
Average latency to contact points is 153.47 ms
==========
Testing authentication
Request read latency: 0.64 ms
Authentication successful
==========

FAQ

  • Why Hermes?
    • Well, if I have to explain the joke: since organizations related to the Cassandra Project like using Greek mythos names like Cassandra, Medusa etc, I wanted to keep the name in theme. This tool tests to see if messages can reach Astra.
    • Also, I'm playing Hades 2.