yunsii / cf-worker-status-page-pro

Monitor your websites, showcase status including daily history, and get notification whenever your website status changes. Using Cloudflare Workers, CRON Triggers, and KV storage.
https://cf-worker-status-page-pro-production.yunsii.workers.dev/
16 stars 3 forks source link

Pushing status of non HTTP services #5

Open JoyceBabu opened 2 months ago

JoyceBabu commented 2 months ago

Is it possible to push the status to the worker, for non HTTP services?

For example, I have MariaDB replication configured on a slave server, and would like to monitor it by pushing the status every few minutes.

yunsii commented 2 months ago

It means you want to push the status to database directly? Maybe it can be works with MariaDB client JS SDK to push data though I'm not familier with MariaDB.

JoyceBabu commented 2 months ago

I want to write a bash script to check the replication status, and make a HTTP request to the status page with the service status. In other words I want to push the service status to the status page, instead of the monitors retrieving it.

JoyceBabu commented 2 months ago

I am interested in support for non HTTP services, which will be updated directly. Currently the monitors fetch the URL for checking the service health, and log the request time. For non-http services behind a firewall, it is not possible for the status page cron job to poll the service to check its health. So, an agent on the server, running the service, should be able to update the status by calling a status page api end point.

The metric to be measured might be different for non-HTTP service. For example, for the replication service I would like to monitor the replication delay.

yunsii commented 2 months ago

It means you want to push a status record directly by API request. I think the best solution is creating a HTTP service to detect your DB service status?

JoyceBabu commented 2 months ago

It means you want to push a status record directly by API request.

That is right.

I think the best solution is creating a HTTP service to detect your DB service status?

The server is behind firewall. I cannot open a port to receive incoming connections.

yunsii commented 1 month ago

It occurred to me that kv namespace can be controled by RESTful API, you can directly write data with it 👌

JoyceBabu commented 1 month ago

That solves the issue partially.

The service monitor can only update the status when it is up, if the server is down it may not be able to do that. So if no status is received in a pre-configured period, then the service should be considered as down.

yunsii commented 1 month ago

If so, the related changes seems not easy. I will gradually make it happen, Also PR is welcome.