A FastAPI application to expose UPS data via NUT (Network UPS Tools)
Project description
WatchMyUPS
A FastAPI application to expose data from UPS devices via NUT (Network UPS Tools).
Table of Contents
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.
Getting Started
Prerequisites
- Install and configure NUT (Network UPS Tools) (AYou can also check this for a more detailed NUT installation guide.)
- Install Docker (This step is optional. You can follow it if you want to run WatchMyUPS on a container.)
Installation
Pip
- Clone the repo
git clone https://github.com/murratefe/watchmyups.git
- Install the requirements
cd watchmyups pip install .
Docker
- Clone the repo
cd watchmyups git clone https://github.com/murratefe/watchmyups.git
- Docker up
docker-compose up
Usage
- 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
- 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.
Changelog
See the CHANGELOG for a detailed list of changes and updates.
Contributing
See the CONTRIBUTING file for contribution guidelines.
License
This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for details.
Contact
Donation
If you find this project useful and would like to support its development, consider buying me a coffee!
You can also buy me a coffee via 0xba2ea63a519ed0eb4342f410b0a91990244c4308
You can also support the project by starring the repository and sharing it with others.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6bcad18cb2916238c54fbeaa9efd7071054092a90ea7989eb69adc716d92e3b
|
|
| MD5 |
ffc5ce4264fa3341f79f3121472fc73a
|
|
| BLAKE2b-256 |
4951e55f0b21dc2cd4b96b5395b74d43a236532d2dee75fc524a5458f0a2e007
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f1ae57ed5ff714d93075857af9d7fd5ee6c39a92da8dcae12d81c54f0d41e28
|
|
| MD5 |
e7787cf3c1f8ee47c680adfaa3ecac6e
|
|
| BLAKE2b-256 |
f24a121828d095f18a53cb1697561ef37c0719e974b3bf77ce6e0eeca29a2efb
|