https://github.com/lucthienphong1120/uptime-api
Uptime Kuma RestAPI management script
https://github.com/lucthienphong1120/uptime-api
python3 rest-api uptime-kuma uptime-kuma-api uptime-monitor uptime-sla
Last synced: 4 months ago
JSON representation
Uptime Kuma RestAPI management script
- Host: GitHub
- URL: https://github.com/lucthienphong1120/uptime-api
- Owner: lucthienphong1120
- License: mit
- Created: 2025-03-03T09:05:34.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-03-21T09:44:40.000Z (7 months ago)
- Last Synced: 2025-06-19T02:44:43.844Z (4 months ago)
- Topics: python3, rest-api, uptime-kuma, uptime-kuma-api, uptime-monitor, uptime-sla
- Language: Python
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Uptime-API
Ref: [lucasheld/uptime-kuma-api:latest](https://uptime-kuma-api.readthedocs.io/en/latest/index.html)
## Install
```sh
pip3 install -r requirements.txt
```## Getting Started
Sample example about the configuration file from `server1` and import to `server2`
```sh
# first login to get token file
python3 api.py -u 192.168.0.100 -a auth_server1.txt
python3 api.py -u 192.168.0.200 -a auth_server2.txt
``````sh
# export notify, tags and monitor files
python3 api.py -u 192.168.0.100 -eA
``````sh
# import notify, tags and monitor files
python3 api.py -u 192.168.0.200 -iA
```## Usage
```sh
# python3 api.py --help
usage: api.py [-h] -u HOST [-p PORT] [-a AUTH] [-t TOKEN] [-eA] [-iA] [-eM EXPORT_MONITOR] [-iM IMPORT_MONITOR]
[-eT EXPORT_TAGS] [-iT IMPORT_TAGS] [-eN EXPORT_NOTIFY] [-iN IMPORT_NOTIFY] [-l] [-d] [-k]Script IaC Cấu hình Uptime Kuma sử dụng RestAPI
optional arguments:
-h, --help show this help message and exit
-u HOST, --host HOST IP của Host Uptime Kuma (VD: 127.0.0.1)
-p PORT, --port PORT Chỉ định Port của Uptime Kuma (Default: 3001)
-a AUTH, --auth AUTH Đường dẫn đến file xác thực username:password (Default: auth.txt)
-t TOKEN, --token TOKEN
Chỉ định file chứa token (Default: token_ip.txt)
-eA, --export-all Xuất toàn bộ Monitor/Notify/Tags ra filename mặc định
-iA, --import-all Nhập toàn bộ Monitor/Notify/Tags từ filename mặc định
-eM EXPORT_MONITOR, --export-monitor EXPORT_MONITOR
Xuất danh sách Monitor ra file JSON (VD: monitors.json)
-iM IMPORT_MONITOR, --import-monitor IMPORT_MONITOR
Nhập danh sách Monitor từ file JSON (VD: monitors.json)
-eT EXPORT_TAGS, --export-tags EXPORT_TAGS
Xuất danh sách Tags ra file JSON (VD: tags.json)
-iT IMPORT_TAGS, --import-tags IMPORT_TAGS
Nhập danh sách Tags từ file JSON (VD: tags.json)
-eN EXPORT_NOTIFY, --export-notify EXPORT_NOTIFY
Xuất danh sách Notify ra file JSON (VD: notify.json)
-iN IMPORT_NOTIFY, --import-notify IMPORT_NOTIFY
Nhập danh sách Notify từ file JSON (VD: notify.json)
-l, --list Liệt kê danh sách Monitor
-d, --delete Xóa tất cả các Monitor
-k, --clean-up Dọn dẹp dữ liệu (events, heartbeats, stats)
```