Skip to main content

Starlyng Server Metrics

This project gathers metrics for local or hosted servers that can be run on a server used to post data to Grafana and Prometheus.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed Python 3.x.
  • You have a basic understanding of Python and virtual environments.

Setting Up Your Development Environment

To set up your development environment and run the project, follow these steps:

Supported Nvidia Driver 570

Clone the Repository

First, clone the repository to your local machine:

git https://github.com/starlyngapp/server-metrics.git
cd server-metrics

Create and Activate Virtual Environment

For macOS and Linux:

python -m venv venv
source venv/bin/activate

For Windows:

python -m venv venv
venv\Scripts\activate

Setup Environment for VSCode

  • Open the Command Palette (Ctrl+Shift+P)
  • Search for the Python: Create Environment command, and select it
  • Select Venv
  • Select Python interpreter
  • Select dependencies to install

Install Required Packages

Install all dependencies listed in the dev-requirements.txt file:

pip install -r dev-requirements.txt

Installation

To install only the package (without dev dependencies):

pip install starlyng_server_metrics

To install development dependencies (useful for contributing to the project):

pip install starlyng_server_metrics[dev]

Alternatively, you can install the development dependencies using:

pip install -r dev-requirements.txt

Environment Configuration

To configure the server metrics collection, you need to set up environment variables. This can be done by creating a .env file in the root of the project.

An example .env file is provided as .env.example. You can copy this file and update the values as needed.

Steps to Configure Environment Variables

  1. Copy the example environment file:
cp .env.example .env
  1. Open the .env file and update the values:
# .env
# List of server IPs and ports in the format ip:port, separated by commas
SERVERS=192.168.1.1:22,192.168.1.2:22

# Path to the SSH private key
KEY_PATH=/path/to/your/.ssh/id_rsa

# SSH username
USERNAME=your_username
  1. Save the .env file.

The SERVERS variable should be a comma-separated list of server IP addresses and ports. The KEY_PATH should point to the SSH private key file you will use for authentication, and USERNAME should be the SSH username.

Usage

To run the main function:

server_metrics

PyPI

starlyng-server-metrics

Command-line Arguments

You can also override configuration using command-line arguments:

server_metrics --servers "192.168.1.1:22,192.168.1.2:22" --key_path "/path/to/your/.ssh/id_rsa" --username "your_username"

Or locally:

python main.py --servers "192.168.1.1:22,192.168.1.2:22" --key_path "/path/to/your/.ssh/id_rsa" --username "your_username"

Building and Uploading Your Package

  1. Build the package:
python setup.py sdist bdist_wheel
  1. Upload to PyPI:
twine upload dist/*

Upload using specific project name referenced in .pypirc

twine upload dist/* --repository starlyng-server-metrics

Running Tests

To run tests, execute the following command in your terminal:

pytest

This command will run all tests and report the results. You can also run specific tests by providing the path and filename of the test file.

Contributing to the Project

Contributions to this project are welcome. Here's how you can contribute:

  1. Fork the project.
  2. Create your feature branch (git checkout -b feature/YourFeature).
  3. Commit your changes (git commit -am 'Add some YourFeature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a pull request.

Contact

If you have any questions, please contact us at:

Metadata

Release files for starlyng-server-metrics 0.9.11

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

Source distribution (sdist)

Source distribution for starlyng-server-metrics 0.9.11
File Size Uploaded Provenance Actions
starlyng_server_metrics-0.9.11.tar.gz 52.6 kB Without provenance Details for starlyng_server_metrics-0.9.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for starlyng-server-metrics 0.9.11
File Interpreter ABI Platform Actions
starlyng_server_metrics-0.9.11-py3-none-any.whl Python 3 none any Details for starlyng_server_metrics-0.9.11-py3-none-any.whl

Total release size: 112.6 kB

Release files / starlyng_server_metrics-0.9.11.tar.gz

Download URL starlyng_server_metrics-0.9.11.tar.gz
Size 52.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2e8e86ea9c026a8487dfe386aedc07ef2367cc1f36806442334a1ea357afd0c7
BLAKE2b-256 checksum
How to use checksums
a41fe1063be552ec1fd816459db51f3178c7adbd850d85eb0ba5881cc1ca7b94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / starlyng_server_metrics-0.9.11-py3-none-any.whl

Download URL starlyng_server_metrics-0.9.11-py3-none-any.whl
Size 60.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9010b8ab5b21ea6f00e9be1399592db0abbdb32f5af5fed8090f130e9d2266ad
BLAKE2b-256 checksum
How to use checksums
a6687a5a189fd0235767b4ec18053a27b9928559ef1cbfcbf18d5d502c83f487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for starlyng-server-metrics 0.9.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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