# Uptime Monitoring with n8n and QuestDB

## Метаданные

- **Канал:** n8n
- **YouTube:** https://www.youtube.com/watch?v=yCazYDdIu9E
- **Дата:** 01.12.2021
- **Длительность:** 4:21
- **Просмотры:** 1,348

## Описание

At Hackmation 0.4, Tanay and Tom created an Uptime Monitoring workflow that sends an email when the website is unreachable.

Hackmation is an internal company hackathon where we use n8n to automate our tasks or build low-code products.

#automation #n8n #monitoring

## Содержание

### [0:00](https://www.youtube.com/watch?v=yCazYDdIu9E) Segment 1 (00:00 - 04:00)

so um what tony and i built was an uptime monitor i first called it downtown detector but i noticed that sounds a bit negative so actually what we want to see is um uh how our website is nice and up and um it is very simple we um did not put multiple web books in one workflow instead we um group this into five different workflows that we have um um named accordingly to the steps in the process right so once would be to serve the form if you um access this page you get served a nice html form actually not as nice as the one from our designer but you can see like you still get along right you have two fields and one where you enter the url of the website you want to monitor whatever microsoft that is pretty cool well i think i'm not saying too much if um bootstrap is a very popular framework so it's um yeah so this is how you sign up for this monitoring service when you click submit the um second workflow kicks in which stores the subscriptions it receives the weapon and it renames the field so that we can use it in our database and then writes this database and sends this wonderful thank you message that provides the user with the id the database itself is rather simple so it has essentially three tables like the monitoring table the notifications table and the subscriptions table and you send up like a new subscriptions element gets entered here so this is questb which is really nice because it comes with um this wonderful web interface which you can always look into while you're developing stuff so that was really pleasant to use like i have not used it before but i can fully recommend it and then um once the subscription is set up this uh cron job kicks in that every five minutes just calls the website and notices the response so it tries to open the website every five minutes and then um stores the result in a database and you can actually look at the data using these wonderful um website that is provided by the fourth workflow display chart one so um what this does it just then fetches the subscription id from the url up here so you can pass it along and then makes a date this query and formats the results a bit using the item lists node and then puts together like the html website and yeah and this is how it looks the response right so you can see um so zapier is uh working fine but uh let's assume the ap is not working fine um just to get an idea of how that looks like because that's the more interesting part right you want to get alerted when once that doesn't work so let's just insert a actual error in the database it's a shame and then instead of the nice check mark you will see um a slightly arranged slowpoke which i thought we found nicer than a red cross and uh it will also send you an email if you have not received an email in the last hour so which i did so i'm not getting another one right so we'll also be alerted by email which is what um workflow number five does and um yeah so sorry my zoom commands in the way but this is very simple right it just varies the um uh down times then checks oh have we sent out a notification in the last hour and then just um goes through this flow system oh if not then send a notification and uh store this in the database so we know not to send objections yes what's the threshold for it to be down like i can't like one time one failure is not enough right oh one failure um but um obviously you can adjust the data biscuits as needed right so we're happy to share this if you're looking for a low-cost alternative to services doing this professionally but yeah um yeah you get an email and you can just play this wherever you want the chart is actually an svg rendered chart which was nice so this was all learned for the day of how to build svgs using pure functions in it and that's what we did today

---
*Источник: https://ekstraktznaniy.ru/video/15760*