Skip to content

lucthienphong1120/uptime-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uptime-API

Ref: lucasheld/uptime-kuma-api:latest

Install

pip3 install -r requirements.txt

Getting Started

Sample example about the configuration file from server1 and import to server2

# 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
# export notify, tags and monitor files
python3 api.py -u 192.168.0.100 -eA
# import notify, tags and monitor files
python3 api.py -u 192.168.0.200 -iA

Usage

# 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)

About

Uptime Kuma RestAPI management script

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages