Fetches data from Uptime.com and outputs to a .csv file.
This script requires you to supply primary keys of the checks you would like to retrieve data for. In order to view primary keys:
- Go to one of the Uptime status pages (prod, or non-prod), select a check, and copy the primary key from the end of the URL.
- From the Uptime dashboard, select a check, and copy primary key from end of the URL.
Info You can supply multiple primary keys by separating keys by a comma. Eg:
-pk 13896,16934
To view available options, run:
python3 script.py -hYou must first save an Uptime API token as an environment variable:
export TOK="" # Uptime API TokenThen run:
# Get check data from today's date, going back in time by the default amount
python3 script.py -t $TOK -pk 1389736# Get check data for check starting on 2023-07-23 (note: this check may fail if running in the future.)
python3 script.py -t $TOK -pk 1389736 -d "2023-07-23"
# Get check data from today's date, fetching data from 10 days back:
python3 script.py -t $TOK -pk 1389736 -n 10
# Get check data from multiple checks:
python3 script.py -t $TOK -pk 1389736,1662934
# Output a csv for alert data only:
python3 script.py -t $TOK -pk 1389736 -o alerts