📜 ⬆️ ⬇️

How to make an automatic snapshot of your site when it fell


What does the site look like when I don’t look at it? A question from the category “Does the world exist when I close my eyes?”, Only in this case a deep philosophical meaning is fraught with real consequences. This is if suddenly it looks bad or does not work at all. HostTracker offers a tool for spying on sites - a snapshot function. Practical meaning is revealed below.

What happens to my site?


The use of various services and applications to support the site often leads to the identification of various problems. There are often situations where, for example, YandexMetrica writes about the error and the recovery, but what exactly happened is incomprehensible. You need to dig into the logs, slow down the hosting support and perform many other tedious (and not the fact that it is not useless) actions. There are more interesting cases - the site may not open from a particular country, or it may not be uploaded to the end. Such problems can live for months, even years, until you accidentally discover them. There is another aspect - for certain purposes, you can use the verification of site content, such as here . This check will regularly notify the admin site if the expected content for some reason disappeared from it - for example, it cannot load from the database. But to see what the site itself looks like at the time of this error can be difficult, since at this point in time the admin will, of course, sleep / take a shower / drink beer or perform some other useful actions.
To solve this problem, HostTracker offers a new feature - snapshot. It is very easy to use and does not require any additional settings at all. Just every time an error is fixed, the service makes a snapshot of the page you need and keeps it available for viewing in two forms: the page code and the view itself as if from a browser. Thus, you can easily check what exactly did not load and go straight to fixing the problem, bypassing the diagnostic point, which saves time for the admin, developers and other involved persons.

How it works


With regular checks, checking servers at certain intervals try to load the page being checked. At the same time, additional functions can be used - for example, parsing the page and searching for certain keywords, which helps to be sure that this is the right page, and not, for example, the error page being substituted for it, or some sort of redirection.
If no error is detected, great. If it is present, a log is written, a message is sent about the site being unavailable (by all selected methods), and a snapshot is made and saved so that you can determine exactly what happened and how the site looked at that moment.

Also, it is possible to view the audit logs, in which snapshots will be saved for the corresponding errors:

However, there are a number of comments. First, with snapshot, as with regular checks, javascript is not executed. Secondly, the error must be one that can be fixed. That is, the checking server should receive at least something. In cases when the connection is not established or falls off by timeout - unfortunately, the snapshot will not be able to help, and only an error record will be found in the logs.

')

Source: https://habr.com/ru/post/279569/


All Articles