It is also unavoidable for users to have programs shut down, stop flow, crash, etc. In this case, users may not know whether the service is running properly in time. In this case, a monitoring program is required to verify whether the program crashes regularly and then send an email to the administrator.

So with that requirement, we started testing. Take EasyDSS as an example, first create a configuration file, enable parameter is global switch, email and email_PWd are sender email and authorization code, dSS_server is the detection configuration of EasyDSS service, check_time unit is second, Web_addr &kernel_addr is used to request web service and kernel service. If the return status is 200, the service is normal. Otherwise, an email is sent to send_email.

Use the Gocron package to do scheduled tasks:

The specific detection logic is used to determine whether the status code returned by the interface request is 200. The reference code is as follows:

The development and on-line of the timing detection function facilitates the operation and maintenance of users to a certain extent