Skip to main content

Lightweight OS-agnostic service monitoring API

Project description

PyNinja

Lightweight OS-agnostic service monitoring API

Python

Platform Supported

Platform

Deployments

pages pypi markdown

Pypi Pypi-format Pypi-status

Kick off

Recommendations

Install PyNinja

python -m pip install pyninja

Initiate - IDE

import pyninja


if __name__ == '__main__':
    pyninja.start()

Initiate - CLI

pyninja start

Use pyninja --help for usage instructions.

Environment Variables

Sourcing environment variables from an env file

By default, PyNinja will look for a .env file in the current working directory.

  • APIKEY - API Key for authentication.
  • NINJA_HOST - Hostname for the API server.
  • NINJA_PORT - Port number for the API server.
  • REMOTE_EXECUTION - Boolean flag to enable remote execution.
  • API_SECRET - Secret access key for running commands on server remotely.
  • MONITOR_USERNAME - Username to authenticate the monitoring page.
  • MONITOR_PASSWORD - Password to authenticate the monitoring page.
  • MONITOR_SESSION - Session timeout for the monitoring page.
  • NO_AUTH - Boolean flag to host monitoring page without authentication.
  • MAX_CONNECTIONS - Maximum number of monitoring sessions allowed in parallel.
  • PROCESSES - List of process names to include in the monitor page.
  • SERVICES - List of service names to include in the monitor page.
  • GPU_LIB - GPU library filepath to use for monitoring.
  • DISK_LIB - Disk library filepath to use for monitoring.
  • SERVICE_LIB - Memory library filepath to use for monitoring.
  • PROCESSOR_LIB - Processor library filepath to use for monitoring.
  • DATABASE - FilePath to store the auth database that handles the authentication errors.
  • RATE_LIMIT - List of dictionaries with max_requests and seconds to apply as rate limit.
  • LOG_CONFIG - Logging configuration file path.

⚠️ Enabling remote execution can be extremely risky and a major security threat. So use caution and set the API_SECRET to a strong value.

Refer samples directory for examples.

Coding Standards

Docstring format: Google
Styling conventions: PEP 8 and isort

Release Notes

Requirement

python -m pip install gitverse

Usage

gitverse-release reverse -f release_notes.rst -t 'Release Notes'

Linting

pre-commit will ensure linting, run pytest, generate runbook & release notes, and validate hyperlinks in ALL markdown files (including Wiki pages)

Requirement

python -m pip install sphinx==5.1.1 pre-commit recommonmark

Usage

pre-commit run --all-files

Pypi Package

pypi-module

https://pypi.org/project/PyNinja/

Runbook

made-with-sphinx-doc

https://thevickypedia.github.io/PyNinja/

License & copyright

© Vignesh Rao

Licensed under the MIT License

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

PyNinja-0.1.4-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file PyNinja-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: PyNinja-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 58.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for PyNinja-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5c602605e65c740c5e513f889cfb6425f1fadff1064e5cc31c9b3e00efbe643d
MD5 0f5b38a8f462a2d96abddaf8841ce43d
BLAKE2b-256 85d0242ab6644e0ebb8cde33231bd56ecbf181922b612d37df8814833d29d1e1

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