OneUptime Automation
oneuptime-automation provides a set of scripts for automating uptime monitoring tasks using the OneUptime platform. It includes scripts for adding monitors, updating status pages, and fetching monitor data etc.
Project Structure 📂
.
├── .env                     # Environment variables file
├── .envGroupname            # Environment variables file for group-specific settings
├── add-monitor.csv          # Example CSV file for monitor data
├── add-monitor.js           # Puppeteer Script for adding monitors
├── add-to-statuspage.sh     # Script for adding monitors to the status pages
├── create-groups.sh         # Script for creating groups to status page
├── create-status-pages.sh   # Script for creating status pages
├── created-groups.csv       # CSV file to store created group IDs
├── get-monitors.sh          # Script for fetching monitor name and ID
├── groups.csv               # CSV file for specifying group names to be created
├── package.json             # Package information
└── status-pages.csv         # CSV file to store status page IDs
Usage 🛠️
- 
Setup Environment Variables:
- Edit 
.envfile and set the required environment variables likeAPI_KEY,PROJECT_ID, andDOMAIN. 
 - Edit 
 - 
Adding Monitors:
- Use the 
add-monitor.jsscript to add monitors. Provide monitor data in CSV format and run the script. 
 - Use the 
 - 
Fetching Monitor Data:
- Use the 
get-monitors.shscript to fetch monitor data. The data will be saved in CSV format. 
 - Use the 
 - 
Creating Status Pages:
- Run 
create-status-pages.shto create status pages based on the data instatus-pages.csv. 
 - Run 
 - 
Creating Status Page Groups:
- Run 
create-groups.shto create status page groups based on the data ingroups.csv. This script will return the group IDs which are necessary to add the monitors to the specified status page. - Edit 
.envGroupnamefile for group-specific settings. 
 - Run 
 - 
Updating Status Pages:
- Use the 
add-to-statuspage.shscript to add groups to the specified status page. 
 - Use the 
 
Dependencies 🛠️
curl: Command-line tool for transferring data with URLs.jq: Command-line JSON processor for parsing JSON responses.csv-parser: Node.js library for parsing CSV files 📊puppeteer: Node.js library for controlling headless Chrome or Chromium browsers 🖥 ️dotenv: Node.js library to use .env variables.