Skip to main content

A FastAPI application to expose UPS data via NUT (Network UPS Tools)

Project description

Contributors Forks Stargazers Issues GPL License Python Version Buy Me A Coffee LinkedIn

WatchMyUPS

A FastAPI application to expose data from UPS devices via NUT (Network UPS Tools).

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Changelog
  5. Contributing
  6. License
  7. Contact
  8. Donation

About The Project

WatchMyUPS is a FastAPI-based application that utilizes NUT (Network UPS Tools) to collect and expose data from UPS devices. It can be easily integrated with monitoring systems, enables the creation of secure shutdown protocols using data obtained via its API, and can be reliably used in applications that automatically take checkpoints during power outages.

(back to top)

Getting Started

Prerequisites

  1. Install and configure NUT (Network UPS Tools) (AYou can also check this for a more detailed NUT installation guide.)
  2. Install Docker (This step is optional. You can follow it if you want to run WatchMyUPS on a container.)

(back to top)

Installation

Pip

  1. Clone the repo
    git clone https://github.com/murratefe/watchmyups.git
    
  2. Install the requirements
    cd watchmyups
    pip install .
    

Docker

  1. Clone the repo
    cd watchmyups
    git clone https://github.com/murratefe/watchmyups.git
    
  2. Docker up
    docker-compose up
    

(back to top)

Usage

  1. Run the application
    python watchmyups.py --nut-host 127.0.0.1 --nut-port 3493 --nut-login admin --nut-password password --export-host 127.0.0.1 --export-port 9999
    
  2. You can access the data at http://<EXPORTER_BIND_ADDRESS>:<EXPORTER_PORT>/

Args

  • --nut-host: IP address of the NUT server. (default: 127.0.0.1)
  • --nut-port: Port of the NUT server (default: 3493).
  • --nut-login: Username for NUT authentication. (default: None)
  • --nut-password: Password for NUT authentication. (default: None)
  • --nut-debug: Enable debug mode (default: False).
  • --nut-timeout: Timeout for NUT operations in seconds (default: 5).
  • --export-host: Bind address for the exporter (default: 0.0.0.0).
  • --export-port: Port for the exporter service (default: 9999).
  • --docker-mode: Run the application in Docker mode (default: False). If set to True, it will read environment variables instead of command-line arguments.
  • --version: Show the version and exit.
  • --license: Show license information and exit.

(back to top)

Changelog

See the CHANGELOG for a detailed list of changes and updates.

(back to top)

Contributing

See the CONTRIBUTING file for contribution guidelines.

(back to top)

License

This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for details.

(back to top)

Contact

Murat EFE

linkedin-shield
github-shield
kaggle-shield
reddit-shield

(back to top)

Donation

If you find this project useful and would like to support its development, consider buying me a coffee!

Buy Me A Coffee
You can also buy me a coffee via usdt-shield 0xba2ea63a519ed0eb4342f410b0a91990244c4308

You can also support the project by starring the repository and sharing it with others.

(back to top)

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

watchmyups-1.0.0.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

watchmyups-1.0.0-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file watchmyups-1.0.0.tar.gz.

File metadata

  • Download URL: watchmyups-1.0.0.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for watchmyups-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d6bcad18cb2916238c54fbeaa9efd7071054092a90ea7989eb69adc716d92e3b
MD5 ffc5ce4264fa3341f79f3121472fc73a
BLAKE2b-256 4951e55f0b21dc2cd4b96b5395b74d43a236532d2dee75fc524a5458f0a2e007

See more details on using hashes here.

File details

Details for the file watchmyups-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: watchmyups-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for watchmyups-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f1ae57ed5ff714d93075857af9d7fd5ee6c39a92da8dcae12d81c54f0d41e28
MD5 e7787cf3c1f8ee47c680adfaa3ecac6e
BLAKE2b-256 f24a121828d095f18a53cb1697561ef37c0719e974b3bf77ce6e0eeca29a2efb

See more details on using hashes here.

Supported by

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