Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/giannisalinetti/webcheckd

Webcheckd: a website status checker written in Go.
https://github.com/giannisalinetti/webcheckd

Last synced: 11 days ago
JSON representation

Webcheckd: a website status checker written in Go.

Awesome Lists containing this project

README

        

# Webcheckd: a website status check daemon

Webcheckd is a very simple utility to check the status of websites.
It runs in a loop and checks every 5 minutes if the monitored site are up,
expecting a **200 OK** http status in front of a simple HTTP GET request.

It can be built as a standalone utility or executed as a container in Docker,
Podman or Kubernetes.

If the check fails it sends a notification using a user defined email account
to a user defined recipients list.

### Binary build
To build the application use the **make** command along with the provided
Makefile.
```
$ make build
```

### Docker build
The make command can also be used to build, tag and push the image.
```
$ make image; make tag; make push
```

### Binary execution
This is a basic example of execution. More than one url can be checked in
parallel.
```
$ ./webcheckd \
-url https://www.example.com \
-url https://www.myapp.com \
-from [email protected] \
-password mypassword \
-to [email protected]
-to [email protected]
```

### Running as a container
This is an example of a containerized instance running in Docker. The following
example also leverages on local docker health check to restart the container
in case of internal failure. The check is executed every 10 minutes.
```
docker run -d -p 8080:8080 \
--restart always \
--name webcheckd \
--health-cmd "curl --fail http://localhost:8080/healthz || exit 1"\
--health-interval 5s \
--health-retries 3 \
quay.io/gbsalinetti/webcheckd \
-url https://www.mysite.com \
-interval 600 \
-from [email protected] \
-password 'myrandompassword' \
-to [email protected] \
-to [email protected]
```

### Running in Kubernetes
Additional files for K8S deployment are provided in the **k8s** directory.
First, create a secret holding the sender's account:
```
$ kubectl create secret generic webcheckd-secret \
--from-literal=password=mypassw0rd \
[email protected]
```

Then, create a ConfigMap to provide URLs to check and notification recipients.
You can use the example ConfigMap provided in the **k8s** directory as a
starting point.
```
$ kubectl apply -f k8s/cm.yaml
```

Then, create the deployment for the application using the deployment manifest
provided:
```
$ kubectl apply -f k8s/deployment.yaml
```

Finally, create a service to inspect the health check. Further features will
be enabled as REST API endpoints in the future.
```
$ kubectl apply -f k8s/svc.yaml
```

### Maintainer
Giovan Battista Salinetti