🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

gitlab.com/ribtoks/healthcheck-timer

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlab.com/ribtoks/healthcheck-timer

v0.0.1-beta
Source
Go
Version published
Created
Source

HealthCheck Timer

HealthCheck Timer is pretty much a HealthChecks.io/Cronitor, but for one-time jobs.

HealthCheck Timer is a simple monitoring tool, built out of AWS services. It's purpose is to send you a notification when a certain condition is not met.

How to use it

  • Generate a unique ping URL for your job
  • Update your job to send HTTP request to the ping URL
  • If (2) did not happen before the configured timeout, you will receive an email

Deployment

  • install npm and run npm install inside this repository (needs to be done only once)
  • cp secrets.example.yml secrets.your-stage.yml and edit it's self-documented contents to your liking
  • run STAGE=your-stage make deploy

Endpoints

Here are the endpoints:

EndpointTypeDescription
/healthcheckPOSTCreate new monitor
/ping/{id}GETMark monitor as healthy

Arguments for creating a health monitor

These are the "form fields" that can be sent with the request.

ArgumentRequiredTypeDescription
idYesString (<= 64 chars)User ID of this monitor
descriptionYesString (<= 200 chars)Name of this monitor
secondsYesIntegerTTL of this monitor
linkNoString (<= 100 chars)Call to action link for alert emails

Usage

Create a monitor by sending an HTML form with arguments (see Endpoints section)

curl -X POST \
  -H "X-Api-Key: your-api-key-here" \
  -F "id=custom-id" \
  -F "description=description-of-the-monitor" \
  -F "seconds=ttl-seconds" \
  -F "link=cta-link" \
  https://some-id-here.execute-api.eu-west-1.amazonaws.com/your-stage/healthcheck

This will return you a unique ID, that you can ping using

NOTE: if ping api key is empty in secrets.yml, you don't need to specify it with the request

curl -H "X-Api-Key: ping-api-key" https://some-id-here.execute-api.eu-west-1.amazonaws.com/your-stage/ping/{unique-id}

Customization

If you wish to receive SMS or push notifications instead of the email, you need to update Subscription part of the creation of SNS topic. Check official AWS docs.

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts