[go: up one dir, main page]

Skip to content
/ uptime Public

Extremely simple, static, server-free uptime monitoring.

Notifications You must be signed in to change notification settings

18F/uptime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uptime

Extremely simple, static, server-free uptime monitoring. No procurement or ATO needed*.

*Statements about ATO not yet verified.

View the demo site.

What problem does this solve?

This monitors the uptime/downtime status of a single website, without:

  • needing an ATO
  • procuring and setting up a commercial monitoring solution
  • hosting a server
  • running a database

How can I use this?

  • Clone this repository to your own GitHub account / organization. (Forking it appears to break GitHub Actions.)
  • Delete the contents of log.txt and readlog.txt, but leave the empty files in place.
  • Find and replace 18f.gsa.gov everywhere in the repo with your own URL. As of this writing, it's only in:
    • The header in index.html
    • The curl line in .github/workflows/ping.yaml
  • Make sure GitHub Pages is enabled to deploy your main branch at /.

The page will update a little while after every status check, which by default runs every 15 minutes.

To run the server check manually, to make sure it's working or to force the first deploy:

  • Go to the Actions tab.
  • In the left sidebar, select "Check server status".
  • In the light blue bar, there will be a "Run workflow" dropdown.
  • Click it, make sure the branch is "main", and click "Run workflow".

Contributing and setup

Contributions are welcome!

Running the server

To run this locally, first clone the repository, cd into the folder, then run:

python3 -m http.server

This will run a simple server to serve the static page. Visit localhost:8000 to see the page.

Adding log data

If you need log data, just run this command like 50 times, sometimes changing up to dn to simulate downtime:

echo "$(TZ=US/Eastern date -Iseconds) up" > log.txt

Then run:

tail -n 65 log.txt > readlog.txt

How does it work?

This monitors a single site and records the uptime/downtime in a log. It displays the last 65 events, showing the uptime/downtime in a simple chart.

Process:

  • Every fifteen minutes, a scheduled GitHub Action checks the status of the website.
  • It records the status in a log, log.txt. The log is append-only, so we can track uptime over all time.
  • It copies the last 65 events to a separate log, readlog.txt. Instead of reading a log with potentially thousands of entries, we only load the smaller set of entries in readlog.txt for display.
  • The scheduled GitHub action commits these changes, saving the data, using these files as the data source.
  • Each commit, GitHub redeploys the GitHub Pages page with the new data.

The next few tasks

  • Check for accessibility / 508 compliance
  • Multi-site monitoring
  • Settings file for monitored domains, cadence, etc.

About

Extremely simple, static, server-free uptime monitoring.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages