Upptime is an opensource tool that can be used to monitor uptime and status of your website using GitHub Actions and GitHub pages. You don’t need to do any server configuration to set it up. You also don’t need to setup any agent on your website.
It is normally very important to know the status of your website and also to note what time it went down. This helps in troubleshooting and also saves money if your website is for business purposes.
This guide will discuss how to configure Upptime actions and pages to monitor status of your website.
With Upptime, you can get the following:
- Website monitoring at an interval of 5 minutes,
- Downtime notifications/alerts to your email or chat channels such as slack using webhooks.
- Status notifications if the website response code is anything different from 200.
- Custom status page that is sharable to a team for monitoring.
How to configure Upptime for monitoring
Let’s walk though how to configure Upptime. Follow the steps below:
Step 1 – Replicate Upptime repository
You have to replicate/fork Upptime official repository, which is a template repository. On Upptime’s Github repository, click on the “Use this template” button.
Give the repository a name and check the “Include all braches” option. In my case, I have named the repository as “web-uptime”
Step 2 – Configure Monitoring
There are a number of configurations that needs to be done on the cloned repository.
- Add GH_PAT
Upptime needs to access this repository so that it can be able to check the status of the website every 5 minutes. Depending on the result, Upptime either opens an issue, sends an alert or commits the relevant information e.g status and response time.
We therefore need to provide access to this repository by providing a personal access token.
Go to your account settings then choose “Developer settings”
In developer options, click on “Personal access tokens” then on “Generate new token”.
You will be asked to provide your GitHub credentials.
Give the token a name under “Note“
In the “Select scopes” area, check “repo” and “workflow”. Then click “Generate token”
Copy the generated token to a safe place. Be notified that this key is only available once for copying.
We’ll then be required to add the generated token as a repository secret.
Head over to your cloned repository’s “Settings” then choose “Secrets”
Click on “New repository secret” to add the secret we created in the step above.
Name the new secret as GH_PAT and paste the copied token in the “Value” section. Then click “Add secret”
You should now see a repository secret added.
- Configure the websites to monitor
The next step is to configure the website that Upptime will monitor using GitHub actions. The main configuration file is located in the root of the main branch. The file is
.upptimerc.yml. We need to modify this file to have the details of the websites we intend to monitor.
.upptimerc.yml in the following manner:
- Change value of
ownerto your GitHub username
- change the
repovalue to the custom name of the repo you created. In my case, it is
- Add your websites under
sitesaray. Remember to remove the existing ones that come with the template.
- Add the
cnameof your website if you have it, otherwise remove the line.
- Uncomment the baseUrl line and change the value to your GitHub repository.
Then commit changes to master.
Wait for a few minutes for the actions to complete. You can check the progress in the Actions menu.
Upon completion, your website status should be visible at the “Live status”.
You will also be notified on email in case an issue has been raised by GitHub actions.
You can also view the graphs on the Upptime status page by clicking on the link under “About“
That’s all you need to monitor your website with Upptime. Cheers!!
Check out these other interesting articles: