https://github.com/mdminhazulhaque/uptimerobot-cli
:wrench: UptimeRobot CLI
https://github.com/mdminhazulhaque/uptimerobot-cli
cli monitoring uptimerobot
Last synced: 4 months ago
JSON representation
:wrench: UptimeRobot CLI
- Host: GitHub
- URL: https://github.com/mdminhazulhaque/uptimerobot-cli
- Owner: mdminhazulhaque
- Created: 2020-07-23T14:31:45.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-02T21:47:55.000Z (over 3 years ago)
- Last Synced: 2025-03-24T22:35:23.527Z (over 1 year ago)
- Topics: cli, monitoring, uptimerobot
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Uptime Robot CLI
CLI that uses [UptimeRobot REST API](https://uptimerobot.com/api/)
## Install
```
pip install -r requirements.txt
```
## Usage
First, export `UPTIMEROBOT_API_KEY` with proper API key. For example,
```
export UPTIMEROBOT_API_KEY=u12345678-7d4c23d189a04051b88a565f7
```
Then use the CLI like this.
```
Usage: uptimerobot.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
delete-monitor Delete a monitor
edit-alert-contact Edit Alert contacts
edit-monitor Edit a monitor
get-alert-contacts Get Alert contacts
get-monitors Get all monitors
new-monitor Create a monitor
```
### List
```
$ uptimerobot get-monitors
| id | friendly_name | url | interval |
|-----------|------------------|----------------------------|------------|
| 785618397 | MY Frontend | https://origin.example.com | 300 |
| 785618398 | MY Backend | https://api.example.com | 300 |
| 785618399 | SG Frontend | https://origin.example.sg | 300 |
```
### Add
```
$ uptimerobot new-monitor -u https://api.example.sg -n 'SG Backend' -i 600
785618400
$ uptimerobot list
| id | friendly_name | url | interval |
|-----------|------------------|----------------------------|------------|
| 785618397 | MY Frontend | https://origin.example.com | 300 |
| 785618398 | MY Backend | https://api.example.com | 300 |
| 785618399 | SG Frontend | https://origin.example.sg | 300 |
| 785618400 | SG Backend | https://api.example.sg | 600 |
```
### Edit
```
$ uptimerobot edit-monitor -i 785618400 -n 'SG API'
$ uptimerobot list
| id | friendly_name | url | interval |
|-----------|------------------|----------------------------|------------|
| 785618397 | MY Frontend | https://origin.example.com | 300 |
| 785618398 | MY Backend | https://api.example.com | 300 |
| 785618399 | SG Frontend | https://origin.example.sg | 300 |
| 785618400 | SG API | https://api.example.sg | 600 |
```
### Delete
```
$ uptimerobot delete-monitor -i 785618397
$ uptimerobot delete-monitor -i 785618398
$ uptimerobot list
| id | friendly_name | url | interval |
|-----------|------------------|----------------------------|------------|
| 785618399 | SG Frontend | https://origin.example.sg | 300 |
| 785618400 | SG API | https://api.example.sg | 600 |
```
### Alert Contacts
```
$ uptimerobot get-alert-contacts
| id | friendly_name | value |
|---------|------------------|--------------|
| 1234567 | me@example.com | John Doe |
| 1234568 | foo@bar.buzz | Foo Bar |
```