This is a simple script that can check the current status of your services and create an incident on the status page if necessary. All this works via Python scripts and the website pipedream.com.
Note
This is not an advertisement!
With pipedream.com you have the possibility to run scripts on an external server. This is necessary, for example, if your home server is not available or you have problems with your network connection.
Important
In the free version of Pipedream.com, it is only possible to run the check script a maximum of 10 times a day. This means that it can only be executed every 2.5 hours.
Because you want to know when your services are offline. So this is a must for anyone who has a few services to maintain.
Watch this tutorial on YouTube (german) or read the following guide.
- Create an account here
- Login and First Setup
- Go to
Projects
=>New project
- Set name and click
Create Project
- Click
New
=>Workflow
- Set name and click
Create Workflow
- Click
Add Trigger
- Click
Custom Interval
- Set
Every 150 Minutes
- Click
Generate Test Event
- Click
Save and Continue
- Click on
+
- Search after
Python
=> selectRun Python code
- Paste this Code into the Code section
- Adjust all variables
Quantity | Variable | Explanation | Example |
---|---|---|---|
1 | <service_url> | URL of your Websites | https://example.com |
1 | <component_id> | Component_id to your Websites | a1b2c3d4e5f6 |
1 | <discord_webhook> | Discord Webhook URL | https://discord.com/api/webhooks/12345678910/ABCdEFG_hIJKlMNOp_QRsTUVw_XYz/ |
2 | <statuspage_url> | URL of your statuspage | https://atlassian.statuspage.io/ |
1 | <page_id> | PageID of your statuspage | 12ab34cd56ef |
1 | <api_key> | API_Key from statuspage | 123abc456def789ghi1011jkl1213mno |
- Click
Test
- Click
+
and selectContinue execution if a condition is met
(Actions -> Control Flow) - Set
Initial Value
to{{steps.code.continue_workflow}}
- Set
Condition
toText Matches exactly (TEXT_EQUALS)
- Set
Second value
totrue
- By
Case sensitive
click onCLEAR
- Click
Test
- Click
+
, clickHTTP / Webhook
and selectSend POST Request
- Set
Request URL
tohttps://api.statuspage.io/v1/pages/<your_page_id>/incidents/
(INSERT YOUR PAGE ID!!) - Set
Authorization Type
toBearer Token
and insert your API Key from Statuspage - Click on
Body
, selectapplication/json
forContent-Type
- Click in
Edit raw JSON
and insert this JSON code - Click on
Deploy
(Do not click `Test' because all your services are currently working, so your variables are empty. You would get errors! And of course, this workflow will stop before that).
The workflow should now be executed automatically every 150 minutes to check the status of your specified services to create an incident on the Statuspage if necessary.
Fortschrittsanzeige icon by Icons8